Mercurial > hg > aboriginal
annotate host-tools.sh @ 340:595332f94fea
Add timeout to wget, and add another mirror (impactlinux.com) so there's a
place to get toybox if landley.net is down. Busybox 1.2.2 wget doesn't support
timeouts so yank that and add it to the host-tools blacklist (which doubles
as the todo list for toybox). Also, the sha1sum I was using didn't match the
toybox _release_ tarball (probably some handrolled one I did).
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 31 May 2008 19:09:43 -0500 |
parents | 65b7f7a6ddf4 |
children | 1782b77fae15 |
rev | line source |
---|---|
177 | 1 #!/bin/bash |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # Get lots of predefined environment variables and shell functions. |
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
254
e005f4279b36
Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
5 # Tell bash not to memorize the path to anything, so toybox utilities get |
e005f4279b36
Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
6 # used immediately even if a different executable was found last $PATH lookup. |
e005f4279b36
Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
7 set +h |
e005f4279b36
Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
8 |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 echo -e "\e[0m" |
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 echo "=== Building host tools" |
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 |
96
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
95
diff
changeset
|
12 NO_ARCH=1 |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 source include.sh |
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 |
99
fd6d26721acf
Minor tweak, move toybox build to the start.
Rob Landley <rob@landley.net>
parents:
96
diff
changeset
|
15 mkdir -p "${HOSTTOOLS}" || dienow |
96
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
95
diff
changeset
|
16 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
17 # Here are the utilities the build needs that this script doesn't |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
18 # build, but which me must instead use from the host system. |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
19 |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
20 # The first seven are from packages already in mini-native. |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
21 # The last six need to be added to toybox. (The build breaks if we use |
311
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
22 # the busybox-1.2.2 versions.) |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
23 |
340
595332f94fea
Add timeout to wget, and add another mirror (impactlinux.com) so there's a
Rob Landley <rob@landley.net>
parents:
320
diff
changeset
|
24 for i in ar as nm cc gcc make ld bzip2 find install od sort diff wget |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
25 do |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
26 [ ! -f "${HOSTTOOLS}/$i" ] && (ln -s `which $i` "${HOSTTOOLS}/$i" || dienow) |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
27 done |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
28 |
311
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
29 # Build toybox |
318
b3cf2e4b74f0
Patch from Andre Ruiz to fix host-tools rebuild check. (If busybox is already
Rob Landley <rob@landley.net>
parents:
311
diff
changeset
|
30 if [ ! -f "${HOSTTOOLS}/toybox" ] |
311
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
31 then |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
32 setupfor toybox && |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
33 make defconfig && |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
34 make install_flat PREFIX="${HOSTTOOLS}" && |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
35 cd .. |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
36 |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
37 cleanup toybox |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
38 fi |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
39 |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
40 # Yes this is an old version of busybox. (It's the last version I released |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
41 # as busybox maintainer.) We're gradually replacing busybox with toybox, one |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
42 # command at a time. |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
43 |
254
e005f4279b36
Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
44 # Build busybox |
318
b3cf2e4b74f0
Patch from Andre Ruiz to fix host-tools rebuild check. (If busybox is already
Rob Landley <rob@landley.net>
parents:
311
diff
changeset
|
45 if [ ! -f "${HOSTTOOLS}/busybox" ] |
259
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
46 then |
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
47 setupfor busybox && |
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
48 cp "${SOURCES}/config-busybox" .config && |
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
49 yes "" | make oldconfig && |
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
50 make && |
276
b3054103cdd7
Have busybox clean up after itself, and zap old host tool symlinks when rerun.
Rob Landley <rob@landley.net>
parents:
271
diff
changeset
|
51 cp busybox "${HOSTTOOLS}" |
b3054103cdd7
Have busybox clean up after itself, and zap old host tool symlinks when rerun.
Rob Landley <rob@landley.net>
parents:
271
diff
changeset
|
52 |
b3054103cdd7
Have busybox clean up after itself, and zap old host tool symlinks when rerun.
Rob Landley <rob@landley.net>
parents:
271
diff
changeset
|
53 [ $? -ne 0 ] && dienow |
b3054103cdd7
Have busybox clean up after itself, and zap old host tool symlinks when rerun.
Rob Landley <rob@landley.net>
parents:
271
diff
changeset
|
54 |
259
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
55 for i in $(sed 's@.*/@@' busybox.links) |
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
56 do |
276
b3054103cdd7
Have busybox clean up after itself, and zap old host tool symlinks when rerun.
Rob Landley <rob@landley.net>
parents:
271
diff
changeset
|
57 ln -s busybox "${HOSTTOOLS}"/$i || dienow |
259
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
58 done |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
59 cd .. |
276
b3054103cdd7
Have busybox clean up after itself, and zap old host tool symlinks when rerun.
Rob Landley <rob@landley.net>
parents:
271
diff
changeset
|
60 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
61 cleanup busybox |
259
754717ecf40b
Have host tools build all the busybox tools which A) the build actually
Rob Landley <rob@landley.net>
parents:
254
diff
changeset
|
62 fi |
254
e005f4279b36
Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
63 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
64 # This is optionally used by mini-native to accelerate native builds when |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
65 # running under qemu. It's not used to build mini-native, or to build |
311
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
66 # the cross compiler, but it needs to be on the host system in order to |
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
67 # use the distcc acceleration trick. |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
68 |
318
b3cf2e4b74f0
Patch from Andre Ruiz to fix host-tools rebuild check. (If busybox is already
Rob Landley <rob@landley.net>
parents:
311
diff
changeset
|
69 # Build distcc (if it's not in $PATH) |
277
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
70 if [ -z "$(which distcc)" ] |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
71 then |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
72 setupfor distcc && |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
73 ./configure --with-included-popt && |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
74 make -j "$CPUS" && |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
75 cp distcc distccd "${HOSTTOOLS}" && |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
76 cd .. |
277
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
77 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
78 cleanup distcc |
277
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
79 fi |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
80 |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
81 # As a temporary measure, build User Mode Linux and use _that_ to package |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
82 # the ext2 image to boot qemu with. (Replace this with toybox gene2fs.) |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
83 |
319 | 84 if [ ! -f "${HOSTTOOLS}/linux" ] |
120
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
85 then |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
86 setupfor linux && |
254
e005f4279b36
Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents:
222
diff
changeset
|
87 cat > mini.conf << EOF && |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
88 CONFIG_BINFMT_ELF=y |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
89 CONFIG_HOSTFS=y |
215
fed22f98962e
Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents:
182
diff
changeset
|
90 CONFIG_LBD=y |
fed22f98962e
Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents:
182
diff
changeset
|
91 CONFIG_BLK_DEV=y |
fed22f98962e
Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents:
182
diff
changeset
|
92 CONFIG_BLK_DEV_LOOP=y |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
93 CONFIG_STDERR_CONSOLE=y |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
94 CONFIG_UNIX98_PTYS=y |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
95 CONFIG_EXT2_FS=y |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
96 EOF |
120
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
97 make ARCH=um allnoconfig KCONFIG_ALLCONFIG=mini.conf && |
276
b3054103cdd7
Have busybox clean up after itself, and zap old host tool symlinks when rerun.
Rob Landley <rob@landley.net>
parents:
271
diff
changeset
|
98 make -j "$CPUS" ARCH=um && |
120
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
99 cp linux "${HOSTTOOLS}" && |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
100 cd .. |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
101 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
102 cleanup linux |
120
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
103 fi |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
104 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
105 # Everything after here is stuff we _could_ build, but currently don't. |
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
106 |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
107 # Build squashfs |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
108 #setupfor squashfs |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
109 #cd squashfs-tools && |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
110 #make && |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
111 #cp mksquashfs unsquashfs "${HOSTTOOLS}" && |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
112 #cd .. |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
113 # |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
281
diff
changeset
|
114 #cleanup squashfs |
108
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
115 |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
116 echo -e "\e[32mHost tools build complete.\e[0m" |