annotate host-tools.sh @ 355:f6e1d29086c1

Mmove package-mini-native.sh back to using oneit, and always build toybox for that. Add a report script to show commands used by each build stage on the various architectures.
author Rob Landley <rob@landley.net>
date Fri, 04 Jul 2008 06:12:59 -0500
parents 1782b77fae15
children 9829e6cc8637
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 # These commands need to be added to toybox. The build breaks if we use
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
91 # the busybox-1.2.2 versions, where available. I'm working to remove this
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
92 # hunk...
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
93
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
94 for i in bzip2 find install od diff wget
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
95 do
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
96 [ ! -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
97 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
98
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
99 # 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
100
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
101 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
102 then
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
103 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
104 make defconfig &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
105 make install_flat PREFIX="${HOSTTOOLS}" &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
106 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
107
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
108 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
109 fi
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
110
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
111 # 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
112
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
113 # 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
114 # 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
115 # 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
116
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
117 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
118 then
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
119 setupfor busybox &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
120 cp "${SOURCES}/config-busybox" .config &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
121 yes "" | make oldconfig &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
122 make &&
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
123 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
124
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
125 [ $? -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
126
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
127 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
128 do
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
129 ln -s busybox "${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
130 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
131 cd ..
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
132
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
133 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
134 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
135 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
136
254
e005f4279b36 Tell bash not to cache paths, missing error check, commented out busybox build.
Rob Landley <rob@landley.net>
parents: 222
diff changeset
137
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 # 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
139 # 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
140 # 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
141 # 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
142
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
143 # 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
144 if [ -z "$(which distcc)" ]
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
145 then
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
146 setupfor distcc &&
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
147 ./configure --with-included-popt &&
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
148 make -j "$CPUS" &&
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
149 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
150 cd ..
277
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
151
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 cleanup distcc
277
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
153 fi
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
154
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
155 # 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
156 # 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
157
319
17ac907b99f8 Typo (mine, not Andre's).
Rob Landley <rob@landley.net>
parents: 318
diff changeset
158 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
159 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
160 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
161 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
162 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
163 CONFIG_HOSTFS=y
215
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
164 CONFIG_LBD=y
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
165 CONFIG_BLK_DEV=y
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
166 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
167 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
168 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
169 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
170 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
171 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
172 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
173 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
174 cd ..
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
175
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
176 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
177 fi
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
178
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
179 # 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
180
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
181 # 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
182 #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
183 #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
184 #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
185 #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
186 #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
187 #
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
188 #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
189
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
190 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
191 then
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
192 # 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
193 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
194 do
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
195 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
196 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
197 fi
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
198
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
199 echo -e "\e[32mHost tools build complete.\e[0m"