Mercurial > hg > aboriginal
annotate host-tools.sh @ 682:d79f936c8f42
Fix qemu build so it can find pc-bios directory.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 31 Mar 2009 06:40:41 -0500 |
parents | 1cf41855bb85 |
children | 20ba34b54140 |
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 |
389
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
5 # Tell bash not to cache the $PATH to anything, so busybox/toybox utilities |
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
6 # get used immediately even if a different executable was found last lookup. |
254
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 |
96
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
95
diff
changeset
|
9 NO_ARCH=1 |
669 | 10 source sources/include.sh || exit 1 |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 |
485
b0438691e9e1
Move color selection into ./config. (The default colors don't look great on a white background.)
Rob Landley <rob@landley.net>
parents:
453
diff
changeset
|
12 echo -e "$HOST_COLOR" |
b0438691e9e1
Move color selection into ./config. (The default colors don't look great on a white background.)
Rob Landley <rob@landley.net>
parents:
453
diff
changeset
|
13 echo "=== Building host tools" |
b0438691e9e1
Move color selection into ./config. (The default colors don't look great on a white background.)
Rob Landley <rob@landley.net>
parents:
453
diff
changeset
|
14 |
389
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
15 export LC_ALL=C |
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
16 |
99
fd6d26721acf
Minor tweak, move toybox build to the start.
Rob Landley <rob@landley.net>
parents:
96
diff
changeset
|
17 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
|
18 |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
19 # 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
|
20 # 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
|
21 |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
22 if [ ! -z "$RECORD_COMMANDS" ] |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
23 then |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
24 if [ ! -f "$BUILD/wrapdir/wrappy" ] |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
25 then |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
26 echo setup wrapdir |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
27 |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
28 # Build the wrapper and install it into build/wrapdir/wrappy |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
29 rm -rf "$BUILD/wrapdir" |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
30 mkdir "$BUILD/wrapdir" && |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
31 $CC -Os "$SOURCES/toys/wrappy.c" -o "$BUILD/wrapdir/wrappy" || 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
|
32 |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
33 # Loop through each $PATH element and create a symlink to the wrapper with |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
34 # that name. |
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 |
657
a56fa2df4d82
Add MANIFEST file to mini-native-$ARCH/usr/src.
Rob Landley <rob@landley.net>
parents:
653
diff
changeset
|
36 for i in $(echo "$PATH" | sed 's/:/ /g') |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
37 do |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
38 for j in $(ls $i) |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
39 do |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
40 [ -f "$BUILD/wrapdir/$j" ] || ln -s wrappy "$BUILD/wrapdir/$j" |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
41 done |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
42 done |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
43 |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
44 # Adjust things to use wrapper directory |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
45 |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
46 export WRAPPY_REALPATH="$PATH" |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
47 PATH="$BUILD/wrapdir" |
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
48 fi |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
49 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
50 # 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
|
51 # 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
|
52 # 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
|
53 # 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
|
54 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
55 # 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
|
56 # |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
57 # 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
|
58 # 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
|
59 # 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
|
60 # 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
|
61 # |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
62 # 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
|
63 # 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
|
64 # 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
|
65 # |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
66 # 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
|
67 # 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
|
68 # 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
|
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 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
|
71 |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
72 # 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
|
73 # 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
|
74 # 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
|
75 # 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
|
76 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
77 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
|
78 do |
615
7523d1f3b818
Some slight paranoia against multiple host-tools.sh runs that get interrupted in the middle. (Yeah, in general that's not guaranteed to work, but still...)
Rob Landley <rob@landley.net>
parents:
609
diff
changeset
|
79 [ ! -f "${HOSTTOOLS}/$i" ] && |
7523d1f3b818
Some slight paranoia against multiple host-tools.sh runs that get interrupted in the middle. (Yeah, in general that's not guaranteed to work, but still...)
Rob Landley <rob@landley.net>
parents:
609
diff
changeset
|
80 (ln -s `PATH="$OLDPATH" which $i` "${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
|
81 done |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
82 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
83 # 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
|
84 |
514
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
85 if [ ! -f "${HOSTTOOLS}/toybox" ] |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
86 then |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
87 setupfor toybox && |
514
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
88 make defconfig && |
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
89 make || dienow |
389
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
90 if [ -z "$USE_TOYBOX" ] |
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
91 then |
514
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
92 mv toybox "$HOSTTOOLS" && |
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
93 ln -s toybox "$HOSTTOOLS"/patch && |
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
94 ln -s toybox "$HOSTTOOLS"/netcat || dienow |
389
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
95 else |
514
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
96 make install_flat PREFIX="${HOSTTOOLS}" || dienow |
389
becb1084a427
Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents:
368
diff
changeset
|
97 fi |
514
8d2b9cd1a52e
build-all-target.sh needs toybox netcat to pass data into/out of qemu, so host-tools.sh should install that too.
Rob Landley <rob@landley.net>
parents:
508
diff
changeset
|
98 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
|
99 |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
100 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
|
101 fi |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
102 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
103 # 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
|
104 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
105 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
|
106 then |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
107 setupfor busybox && |
453
61a26b8092bf
Busybox defconfig has become useless, so switch busybox to build via allyesconfig minus symbols to be disabled.
Rob Landley <rob@landley.net>
parents:
413
diff
changeset
|
108 make allyesconfig KCONFIG_ALLCONFIG="${SOURCES}/trimconfig-busybox" && |
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
|
109 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
|
110 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
|
111 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
|
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 [ $? -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
|
114 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
115 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
|
116 do |
609
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
117 [ ! -f "${HOSTTOOLS}/$i" ] && |
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
118 (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
|
119 done |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
120 cd .. |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
121 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
122 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
|
123 fi |
625
065e1a0f6697
The new distcc version notices the host has the python binary, and assumes
Rob Landley <rob@landley.net>
parents:
624
diff
changeset
|
124 |
065e1a0f6697
The new distcc version notices the host has the python binary, and assumes
Rob Landley <rob@landley.net>
parents:
624
diff
changeset
|
125 PATH="${HOSTTOOLS}" |
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
|
126 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
|
127 |
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
|
128 # 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
|
129 # 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
|
130 # 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
|
131 # 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
|
132 |
571
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
133 # Note that this one we can use off of the host, it's used on the host where |
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
134 # the system image runs. The build doesn't actually use it, we only bother |
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
135 # to build it at all here as a convenience for run-from-build.sh. |
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
136 |
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
|
137 # Build distcc (if it's not in $PATH) |
609
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
138 if [ -z "$(which distccd)" ] |
277
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
139 then |
571
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
140 setupfor distcc && |
624
7641e1038cb6
The new distcc is dumb enough to use -Werror by default. Make it stop.
Rob Landley <rob@landley.net>
parents:
615
diff
changeset
|
141 ./configure --with-included-popt --disable-Werror && |
571
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
142 make -j "$CPUS" && |
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
143 cp distcc distccd "${HOSTTOOLS}" && |
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
144 cd .. |
277
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
145 |
571
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
146 cleanup distcc |
277
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
147 fi |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
148 |
609
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
149 # Build genext2fs. We use it to build the ext2 image to boot qemu with |
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
150 # in system-image.sh. |
508
909a4921273d
Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents:
505
diff
changeset
|
151 |
571
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
152 if [ ! -f "${HOSTTOOLS}"/genext2fs ] |
508
909a4921273d
Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents:
505
diff
changeset
|
153 then |
609
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
154 setupfor genext2fs && |
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
155 ./configure && |
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
156 make -j $CPUS && |
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
157 cp genext2fs "${HOSTTOOLS}" && |
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
158 cd .. |
508
909a4921273d
Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents:
505
diff
changeset
|
159 |
609
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
160 cleanup genext2fs |
508
909a4921273d
Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents:
505
diff
changeset
|
161 fi |
909a4921273d
Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents:
505
diff
changeset
|
162 |
642
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
163 # Build e2fsprogs. |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
164 |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
165 # Busybox used to provide ext2 utilities (back around 1.2.2), but the |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
166 # implementation was horrible and got removed. Someday the new Lua |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
167 # toybox should provide these. |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
168 |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
169 # This mostly isn't used creating a system image, which uses genext2fs instead. |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
170 # If SYSIMAGE_HDA_MEGS is > 64, it'll resize2fs because genext2fs is |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
171 # unreasonably slow at creating large files. |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
172 |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
173 # The hdb.img of run-emulator.sh and run-from-build.sh uses e2fsprogs' |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
174 # fsck.ext2 and tune2fs. These are installed by default in most distros |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
175 # (which genext2fs isn't), and genext2fs doesn't have ext3 support anyway. |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
176 |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
177 if [ ! -f "${HOSTTOOLS}"/mke2fs ] |
642
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
178 then |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
179 setupfor e2fsprogs && |
653
0071f3c72d4c
Vladimir Dronnikov pointed out that building e2fsprogs under uClibc would need --disable-tls.
Rob Landley <rob@landley.net>
parents:
651
diff
changeset
|
180 ./configure --disable-tls --enable-htree && |
642
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
181 make -j "$CPUS" && |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
182 cp misc/{mke2fs,tune2fs} resize/resize2fs "${HOSTTOOLS}" && |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
183 cp e2fsck/e2fsck "$HOSTTOOLS"/fsck.ext2 && |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
184 cd .. |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
185 |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
186 cleanup e2fsprogs |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
187 fi |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
188 |
609
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
189 # Squashfs is an alternate packaging option. |
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
|
190 |
648
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
191 if [ ! -f "${HOSTTOOLS}"/mksquashfs ] |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
192 then |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
193 setupfor squashfs && |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
194 cd squashfs-tools && |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
195 make -j $CPUS && |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
196 cp mksquashfs unsquashfs "${HOSTTOOLS}" && |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
197 cd .. |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
198 |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
199 cleanup squashfs |
a72f7f70c003
Now that the 2.6.29 kernel is out with squashfs, add squashfs to host-tools.sh and system-image.sh.
Rob Landley <rob@landley.net>
parents:
642
diff
changeset
|
200 fi |
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
|
201 |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
202 # Here's some stuff that isn't used to build a cross compiler or system |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
203 # image, but is used by run-from-build.sh. By default we assume it's |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
204 # installed on the host you're running system images on (which may not be |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
205 # the one you're building them on). |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
206 |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
207 # Either build qemu from source, or symlink it. |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
208 |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
209 if [ ! -f "${HOSTTOOLS}"/qemu ] |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
210 then |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
211 if [ ! -z "$HOST_BUILD_EXTRA" ] |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
212 then |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
213 |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
214 # Build qemu. Note that this is _very_slow_. (It takes about as long as |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
215 # building a system image from scratch, including the cross compiler.) |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
216 |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
217 # It's also ugly: its wants to populate a bunch of subdirectories under |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
218 # --prefix, and we can't just install it in host-temp and copy out what |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
219 # we want because the pc-bios directory needs to exist at a hardwired |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
220 # absolute path, so we do the install by hand. |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
221 |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
222 setupfor qemu && |
650
7a4ea7f6dc3d
Revert qemu ppc openbios to the version before the --nographic bug showed up (which was svn 6658). See http://lists.gnu.org/archive/html/qemu-devel/2009-03/msg01070.html for details.
Rob Landley <rob@landley.net>
parents:
649
diff
changeset
|
223 cp "$SOURCES"/patches/openbios-ppc pc-bios/openbios-ppc && |
682
d79f936c8f42
Fix qemu build so it can find pc-bios directory.
Rob Landley <rob@landley.net>
parents:
669
diff
changeset
|
224 sed -i 's@datasuffix=".*"@datasuffix="/pc-bios"@' configure && |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
225 ./configure --disable-gfx-check --prefix="$HOSTTOOLS" && |
650
7a4ea7f6dc3d
Revert qemu ppc openbios to the version before the --nographic bug showed up (which was svn 6658). See http://lists.gnu.org/archive/html/qemu-devel/2009-03/msg01070.html for details.
Rob Landley <rob@landley.net>
parents:
649
diff
changeset
|
226 make -j $CPUS && |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
227 # Copy the executable files and ROM files |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
228 cp $(find -type f -perm +111 -name "qemu*") "$HOSTTOOLS" && |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
229 cp -r pc-bios "$HOSTTOOLS" && |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
230 cd .. |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
231 |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
232 cleanup qemu |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
233 else |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
234 # Symlink qemu out of the host, if found. Since run-from-build.sh uses |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
235 # $PATH=.../build/host if it exists, add the various qemu instances to that. |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
236 |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
237 echo "$OLDPATH" | sed 's/:/\n/g' | while read i |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
238 do |
660
3561574d8a56
The i386 version is "qemu" with no trailing dash, so symlink that too.
Rob Landley <rob@landley.net>
parents:
657
diff
changeset
|
239 for j in $(cd "$i"; ls qemu* 2>/dev/null) |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
240 do |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
241 ln -s "$i/$j" "$HOSTTOOLS/$j" |
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
242 done |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
243 done |
651
0d6c67c401e0
Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents:
650
diff
changeset
|
244 fi |
649
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
245 fi |
950ef7de1cf9
Add qemu to host-tools.sh. If HOST_BUILD_EXTRA set, compile from source, otherwise symlink it from host. (Note that ppc --nographic and sh4 --append are currently broken in host version of qemu.)
Rob Landley <rob@landley.net>
parents:
648
diff
changeset
|
246 |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
247 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
|
248 then |
604
7fc1f4695c29
Minor cosmetic cleanup (don't warn about re-linking things that are expected to already be there), and don't build distccd if it's already in $PATH. (We need to put genext2fs in host/path because system-image.sh isn't using host's $PATH, but run-from-build.sh and friends do use host $PATH.)
Rob Landley <rob@landley.net>
parents:
580
diff
changeset
|
249 # Make sure the host tools we just built are also in wrapdir |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
250 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
|
251 do |
608
ab76d4cdd392
Jean Wolter pointed out that running RECORD_COMMANDS=1 twice could create circular symlinks. Hopefully fixed now, and some related cleanups/clarifications.
Rob Landley <rob@landley.net>
parents:
604
diff
changeset
|
252 [ -e "$BUILD/wrapdir/$j" ] || ln -s wrappy "$BUILD/wrapdir/$j" |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
253 done |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
254 fi |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
255 |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
256 echo -e "\e[32mHost tools build complete.\e[0m" |