Mercurial > hg > aboriginal
annotate host-tools.sh @ 120:c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
cases in which the ldd/readelf build breaks, and let CROSS_TARGET be set
manually by config files.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 04 Mar 2007 16:15:58 -0500 |
parents | b66d638a3844 |
children | da91da84e7de |
rev | line source |
---|---|
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/sh |
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 |
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 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
|
6 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
|
7 |
96
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
95
diff
changeset
|
8 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
|
9 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
|
10 |
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
|
11 #rm -rf "${HOSTTOOLS}" |
99
fd6d26721acf
Minor tweak, move toybox build to the start.
Rob Landley <rob@landley.net>
parents:
96
diff
changeset
|
12 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
|
13 |
99
fd6d26721acf
Minor tweak, move toybox build to the start.
Rob Landley <rob@landley.net>
parents:
96
diff
changeset
|
14 # Build toybox |
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
|
15 if [ ! -f "$(which toybox)" ] |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
16 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
|
17 echo which toybox |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
18 setupfor toybox && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
19 make defconfig && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
20 make && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
21 make instlist && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
22 make install_flat PREFIX="${HOSTTOOLS}" |
99
fd6d26721acf
Minor tweak, move toybox build to the start.
Rob Landley <rob@landley.net>
parents:
96
diff
changeset
|
23 |
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
|
24 [ $? -ne 0 ] && dienow |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
25 fi |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 |
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
|
27 # As a temporary measure, build User Mode Linux and use _that_ to package |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
28 # the ext2 image to boot qemu with. |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
29 |
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
|
30 if [ -z "$(which linux)" ] |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
31 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
|
32 setupfor linux && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
33 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
|
34 CONFIG_MODE_SKAS=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
|
35 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
|
36 CONFIG_HOSTFS=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
|
37 CONFIG_SYSCTL=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
|
38 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
|
39 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
|
40 CONFIG_BLK_DEV_LOOP=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
|
41 CONFIG_LBD=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
|
42 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
|
43 CONFIG_PROC_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
|
44 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
|
45 make ARCH=um allnoconfig KCONFIG_ALLCONFIG=mini.conf && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
46 make ARCH=um && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
47 cp linux "${HOSTTOOLS}" && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
48 cd .. && |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
49 rm -rf linux-* |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
50 |
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
|
51 [ $? -ne 0 ] && dienow |
c91ceb05bc1c
Make host-tools not rebuild stuff that's already there, fix yet more corner
Rob Landley <rob@landley.net>
parents:
108
diff
changeset
|
52 fi |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 |
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
|
54 # 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
|
55 #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
|
56 #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
|
57 #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
|
58 #cp mksquashfs unsquashfs "${HOSTTOOLS}" && |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
59 #cd .. && |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
60 #$CLEANUP 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
|
61 # |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
62 #[ $? -ne 0 ] && dienow |
b66d638a3844
Build User Mode Linux and have that do the ext2 packaging (for now, anyway).
Rob Landley <rob@landley.net>
parents:
99
diff
changeset
|
63 |
95
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
64 # Build qemu (if it's not already installed) |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
65 |
95
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
66 TEMP="qemu-${QEMU_TEST}" |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
67 [ -z "$QEMU_TEST" ] && TEMP=qemu |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
68 |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
69 if [ -z "$(which $TEMP)" ] |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
70 then |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
71 |
95
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
72 setupfor qemu && |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
73 ./configure --disable-gcc-check --disable-gfx-check --prefix="${CROSS}" && |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
74 make && |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
75 make install && |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
76 cd .. && |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
77 $CLEANUP qemu-* |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
78 |
95
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
79 [ $? -ne 0 ] && dienow |
027e15c1cfec
Only build qemu if it's not already installed. (Revisit this when 0.9.0 comes
Rob Landley <rob@landley.net>
parents:
93
diff
changeset
|
80 fi |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
81 |
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
82 echo -e "\e[32mHost tools build complete.\e[0m" |