annotate host-tools.sh @ 215:fed22f98962e

Update UML build config to work with 2.6.23.
author Rob Landley <rob@landley.net>
date Sun, 16 Sep 2007 18:28:52 -0500
parents fc827ab6166f
children 8b0d2080707c
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
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_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
35 CONFIG_HOSTFS=y
215
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
36 CONFIG_LBD=y
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
37 CONFIG_BLK_DEV=y
fed22f98962e Update UML build config to work with 2.6.23.
Rob Landley <rob@landley.net>
parents: 182
diff changeset
38 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
39 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
40 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
41 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
42 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
43 make ARCH=um allnoconfig KCONFIG_ALLCONFIG=mini.conf &&
182
fc827ab6166f Autodetect number of processors and feed appropriate -j to make.
Rob Landley <rob@landley.net>
parents: 177
diff changeset
44 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
45 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
46 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
47 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
48
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
49 [ $? -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
50 fi
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
51
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
52 # 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
53 #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
54 #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
55 #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
56 #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
57 #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
58 #$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
59 #
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 #[ $? -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
61
134
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
62 # we can't reliably build qemu because who knows what gcc version the host
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
63 # has? so until qemu is fixed to build with an arbitrary c compiler,
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
64 # just test for its' existence and warn.
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
65
134
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
66 temp="qemu-${qemu_test}"
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
67 [ -z "$qemu_test" ] && temp=qemu
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
68
134
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
69 if [ -z "$(which $temp)" ]
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
70 then
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
71 echo "***************** warning: $temp not found. *******************"
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 fi
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
73
134
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
74 # setupfor qemu &&
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
75 # ./configure --disable-gcc-check --disable-gfx-check --prefix="${CROSS}" &&
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
76 # make &&
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
77 # make install &&
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
78 # cd .. &&
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
79 # $CLEANUP qemu-*
da91da84e7de We can't reliably build qemu because who knows what toolchains the host
Rob Landley <rob@landley.net>
parents: 120
diff changeset
80
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
81 echo -e "\e[32mHost tools build complete.\e[0m"