annotate host-tools.sh @ 368:2c5b02b47c8e

Switch to building defconfig busybox. (Keep trimmed config anyway.)
author Rob Landley <rob@landley.net>
date Fri, 18 Jul 2008 09:00:05 -0500
parents 9829e6cc8637
children becb1084a427
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
177
6b4844b708b9 dash->bash.
Rob Landley <rob@landley.net>
parents: 134
diff changeset
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
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
17 # If we want to record the host command lines, so we know exactly what commands
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
18 # the build uses.
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
19
355
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
20 if [ ! -z "$RECORD_COMMANDS" ] && [ ! -f "$BUILD/wrapdir/wrappy" ]
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
21 then
355
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
22 # package-mini-native.sh needs oneit.
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
23
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
24 if [ ! -f "${HOSTTOOLS}/toybox" ]
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
25 then
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
26 setupfor toybox &&
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
27 make defconfig &&
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
28 make &&
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
29 mv toybox "${HOSTTOOLS}"/oneit &&
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
30 cd ..
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
31
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
32 cleanup toybox
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
33 fi
f6e1d29086c1 Mmove package-mini-native.sh back to using oneit, and always build toybox
Rob Landley <rob@landley.net>
parents: 352
diff changeset
34
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
35 echo setup wrapdir
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
36
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
37 # Build the wrapper and install it into build/wrapdir/wrappy
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
38 rm -rf "$BUILD/wrapdir"
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
39 mkdir "$BUILD/wrapdir" &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
40 $CC -Os "$SOURCES/toys/wrappy.c" -o "$BUILD/wrapdir/wrappy" || dienow
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
41
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
42 # Loop through each $PATH element and create a symlink to the wrapper with
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
43 # that name.
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
44
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
45 for i in $(echo $PATH | sed 's/:/ /g')
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
46 do
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
47 for j in $(ls $i)
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
48 do
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
49 ln -s wrappy "$BUILD/wrapdir/$j"
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
50 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
51 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
52
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
53 # Adjust things to use wrapper directory
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
54
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
55 export WRAPPY_REALPATH="$PATH"
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
56 PATH="$BUILD/wrapdir"
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
57
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
58 # If we're not recording the host command lines, then populate a directory
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
59 # with host versions of all the command line utilities we're going to install
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
60 # into mini-native. When we're done, PATH can be set to include just this
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
61 # directory and nothing else.
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
62
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
63 # This serves three purposes:
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
64 #
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
65 # 1) Enumerate exactly what we need to build the system, so we can make sure
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
66 # mini-native has everything it needs to rebuild us. If anything is missing
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
67 # from this list, the resulting mini-native probably won't have it either,
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
68 # so it's nice to know as early as possible that we actually needed it.
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
69 #
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
70 # 2) Quick smoke test that the versions of the tools we're using can compile
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
71 # everything from source correctly, and thus mini-native should be able to
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
72 # rebuild from source using those same tools.
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
73 #
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
74 # 3) Reduce variation from distro to distro. The build always uses the
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
75 # same command line utilities no matter where we're running, because we
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
76 # provide our own.
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
77
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
78 else
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
79
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
80 # Start by creating symlinks to the host toolchain, since we need to use
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
81 # that to build anything else. We build a cross compiler, and a native
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
82 # compiler for the target, but we don't build a host toolchain. We use the
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
83 # one that's already there.
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
84
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
85 for i in ar as nm cc gcc make ld
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
86 do
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
87 [ ! -f "${HOSTTOOLS}/$i" ] && (ln -s `which $i` "${HOSTTOOLS}/$i" || dienow)
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
88 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
89
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
90 # Build toybox
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
91
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
92 if [ ! -f "${HOSTTOOLS}/toybox" ]
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
93 then
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
94 setupfor toybox &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
95 make defconfig &&
358
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
96 # make install_flat PREFIX="${HOSTTOOLS}" &&
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
97 make &&
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
98 cp toybox $HOSTTOOLS &&
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
99 ln -s toybox $HOSTTOOLS/oneit &&
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
100 ln -s toybox $HOSTTOOLS/patch &&
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
101 cd ..
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
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
103 cleanup toybox
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
104 fi
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
105
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
106 # Build busybox
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
107
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
108 # Yes this is an old version of busybox. (It's the last version I released
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
109 # as busybox maintainer.) We're gradually replacing busybox with toybox, one
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
110 # command at a time.
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
111
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
112 if [ ! -f "${HOSTTOOLS}/busybox" ]
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
113 then
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
114 setupfor busybox &&
368
2c5b02b47c8e Switch to building defconfig busybox. (Keep trimmed config anyway.)
Rob Landley <rob@landley.net>
parents: 358
diff changeset
115 # make allnoconfig KCONFIG_ALLCONFIG="${SOURCES}/config-busybox" &&
2c5b02b47c8e Switch to building defconfig busybox. (Keep trimmed config anyway.)
Rob Landley <rob@landley.net>
parents: 358
diff changeset
116 make defconfig &&
358
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
117 make -j $CPUS &&
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
118 make busybox.links &&
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
119 cp busybox "${HOSTTOOLS}"
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
120
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
121 [ $? -ne 0 ] && dienow
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
122
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
123 for i in $(sed 's@.*/@@' busybox.links)
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
124 do
358
9829e6cc8637 Update busybox from 1.2.2 to 1.11.0. Toybox i still used for oneit and patch,
Rob Landley <rob@landley.net>
parents: 355
diff changeset
125 ln -s busybox "${HOSTTOOLS}"/$i # || dienow
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
126 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
127 cd ..
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
128
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
129 cleanup busybox
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
130 fi
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
131 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
132
254
e005f4279b36 Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents: 222
diff changeset
133
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
134 # 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
135 # 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
136 # 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
137 # 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
138
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
139 # 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
140 if [ -z "$(which distcc)" ]
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
141 then
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
142 setupfor distcc &&
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
143 ./configure --with-included-popt &&
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
144 make -j "$CPUS" &&
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
145 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
146 cd ..
277
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
147
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
148 cleanup distcc
277
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
149 fi
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
150
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
151 # 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
152 # 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
153
319
17ac907b99f8 Typo (mine, not Andre's).
Rob Landley <rob@landley.net>
parents: 318
diff changeset
154 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
155 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
156 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
157 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
158 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
159 CONFIG_HOSTFS=y
215
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
160 CONFIG_LBD=y
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
161 CONFIG_BLK_DEV=y
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
162 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
163 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
164 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
165 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
166 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
167 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
168 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
169 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
170 cd ..
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
171
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
172 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
173 fi
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
174
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
175 # 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
176
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
177 # 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
178 #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
179 #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
180 #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
181 #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
182 #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
183 #
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
184 #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
185
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
186 if [ ! -z "$RECORD_COMMANDS" ]
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
187 then
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
188 # Add the host tools we just built to wrapdir
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
189 for j in $(ls "$HOSTTOOLS")
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
190 do
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
191 ln -s wrappy "$BUILD/wrapdir/$j"
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
192 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
193 fi
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
194
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
195 echo -e "\e[32mHost tools build complete.\e[0m"