1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
host arch is determined at build time
prokit install [-a <arch>] [-P <plat>] <suite> <chroot>
<suite>
e.g. rs1, dev/trunk, or proteanos:dev/trunk
if <arch> != host-arch
install host-arch base packages to /inst
prokit shell <chroot>
prokit opkg <chroot> [<option> ...] <command> [<argument> ...]
prokit opkbuild <chroot> [<option> ...] <pkgdir>
gets build deps, makes and installs metapackage, opkbuilds
removes metapackage, autoremoves cruft
developer:
host$ prokit install -a core-linux-eglibc -P dev proteanos:dev/trunk chroot
host$ prokit opkbuild chroot .
buildd:
host$ prokit opkg chroot install src-expat
host$ prokit opkbuild chroot chroot/usr/src/expat_*/
TODO:
profiles, e.g. proteanos
each profile has its own tests for host arch/plat
also, how does debootstrap determine host arch on non-Debian hosts?
apparently it doesn't
(must pass --arch, then debootstrap can't detect if host != target)
configure
--with-profile=proteanos
--with-arch=core-linux-eglibc
--with-plat=dev
profiles/
+- proteanos
+- archtab
+- plattab
+- feedtab
should profiles be left to run time?
Debian/etc. packaging: proinst-proteanos? proinst with all profiles? arch:any?
m4_include profiles/profiles.m4
PI_PROFILE
configure
--with-proteanos-arch
maybe better: at run time:
look in sysconfdir for host arch value
in-place: etc/proinst_arch?
distributions can make this file in postinst
otherwise, autodetect
or just autodetect and "cache":
`prokit install` detects host arch
profile-specific config.guess-like function
`prokit shell` and `prokit opkg` look for /inst
add /inst to PATH and run /inst/bin/sh and /inst/usr/bin/opkg
`prokit build` looks for /inst
screams something about "unsupported" and "cross install"
then bails
if no /inst, opkbuild
opkbuild will find /etc/proteanos_{arch,plat} and do magics
run_cmd()
{
if $# lt cmd_$cmd_min_args
help $cmd
exit 1
if cmd_$cmd_max_args is set and $# gt cmd_$cmd_max_args
help $cmd
exit
i=0; args=
while i lt cmd_$cmd_exp_args
args="$args ''"
eval cmd_$cmd_main $@ $args
}
cmd_install_min_args=2
cmd_install_exp_args=2
cmd_install_max_args=2
opkg cmd? parses opts after <chroot>?
maybe <chroot> itself should be an option?
ask profile for arch and feed index URIs
for each feed
download feed index
control=
for each line in feed index
if line not empty
control="$control$line$LF"
else
pkg=`echo $control | sed -n 's/^Package: *//p'`
run profile callback
if $pkg should be installed
pkgs="$pkgs $pkg"
for each field in $install_dep_fields $host_dep_fields
deps=`echo $control | sed -n
"s/^$field: *//p"`
new_deps=
IFS=', '; for each dep in $deps
dep=`echo $dep | sed
's/ *|.*$//; s/ *(.*$/;'`
# or maybe `echo $dep |
cut -d ' ' -f 1`
new_deps="$new_deps $dep"
echo "$pkg$new_deps" >$field.list
all_deps=
while $new_pkgs not empty
all_deps="$all_deps $new_pkgs"
new_deps=
for each pkg in $new_pkgs
new_deps=`grep "^$pkg " *depends.list | cut -d ' ' -f 2-`
new_deps=`printf '%s\n' $new_deps | sort -u`
new_pkgs=
for each pkg in $new_deps
if $pkg not in $all_deps
new_pkgs="$new_pkgs $pkg"
for each line in feed index
if line not empty
parse control fields
else
run profile callback
if $pkg should be installed
pkgs="$pkgs $pkg"
unresolved="$deps"
while $unresolved not empty
for each line in feed index
if line not empty
parse control fields
else
if $unresolved starts with $pkg
allpkgs='base'
newpkgs='busybox linux-image opkg'
foreach pkg
if $pkg in $newpkgs
|