annotate host-tools.sh @ 815:8129df56091b

Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
author Rob Landley <rob@landley.net>
date Wed, 26 Aug 2009 02:37:57 -0500
parents e2fc10ede93f
children 5dd1a99a0737
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
796
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
3 # This script sets up a known host environment. It serves a similar purpose
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
4 # to the temporary chroot system in Linux From Scratch chapter 5, isolating
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
5 # the new build from the host system so information from the host doesn't
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
6 # accidentally leak into the target.
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
7
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
8 # This script populates a build/host directory with busybox and symlinks to
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
9 # the host's toolchain, then adds the other packages (genext2fs, e2fsprogs,
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
10 # squashfs-tools, distcc, and qemu) that might be needed to package and run
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
11 # a system image. This lets the rest of the build run with the $PATH pointing
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
12 # at the new build/host directory and nothing else.
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
13
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
14 # The tools provided by this stage are as similar as possible to the ones
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
15 # provided in the final system image. The fact the system can build under
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
16 # these tools is a good indication that it should be able to rebuild itself
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
17 # under itself.
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
18
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
19 # This script is optional. The build runs fine without it, assuming the
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
20 # host has all the necessary packages installed and doesn't have any extra
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
21 # packages (such as libtool, pkg-config, python...) that might provide
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
22 # false information to autoconf or attach themselves as dependencies to
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
23 # the newly generated programs. (In practice, this can be quite fiddly.)
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
24
669
1cf41855bb85 More error checking.
Rob Landley <rob@landley.net>
parents: 660
diff changeset
25 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
26
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
27 echo -e "$HOST_COLOR"
783
db06a8c1bfed Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents: 744
diff changeset
28 echo "=== Building $STAGE_NAME"
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
29
389
becb1084a427 Add USE_TOYBOX option (enabled by default), to use toybox commands where
Rob Landley <rob@landley.net>
parents: 368
diff changeset
30 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
31
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
32 STAGE_DIR="${HOSTTOOLS}"
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
33
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
34 # Blank $WORK but accept $STAGE_DIR if it exists. Re-running this script
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
35 # should be a NOP.
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
36
744
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 711
diff changeset
37 blank_tempdir "${WORK}"
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
38 mkdir -p "${STAGE_DIR}" || 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
39
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
40 # If we want to record the host command lines, so we know exactly what commands
744
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 711
diff changeset
41 # the build uses, set up a wrapper that does that.
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
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 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
44 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
45 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
46 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
47 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
48
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
49 # Build the wrapper and install it into build/wrapdir/wrappy
744
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 711
diff changeset
50 blank_tempdir "$BUILD/wrapdir"
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
51 $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
52
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
53 # 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
54 # 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
55
657
a56fa2df4d82 Add MANIFEST file to mini-native-$ARCH/usr/src.
Rob Landley <rob@landley.net>
parents: 653
diff changeset
56 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
57 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
58 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
59 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
60 [ -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
61 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
62 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
63
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
64 # 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
65
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
66 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
67 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
68 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
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 # 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
71 # with host versions of all the command line utilities we're going to install
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
72 # into root-filesystem. When we're done, PATH can be set to include just this
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
73 # 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
74
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
75 # 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
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 # 1) Enumerate exactly what we need to build the system, so we can make sure
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
78 # root-filesystem has everything it needs to rebuild us. If anything is
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
79 # missing from this list, the resulting root-filesystem probably won't have
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
80 # it either, so it's nice to know as early as possible that we actually
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
81 # needed it.
352
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 # 2) Quick smoke test that the versions of the tools we're using can compile
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
84 # everything from source correctly, and thus root-filesystem should be able
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
85 # to rebuild from source using those same tools.
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 #
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
87 # 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
88 # 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
89 # 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
90
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
91 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
92
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
93 # Use the new tools we build preferentially, as soon as they become
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
94 # available.
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
95
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
96 PATH="$STAGE_DIR:$PATH"
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
97
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
98 # Start by building busybox. We have no idea what strange things our host
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
99 # system has (or lacks, such as "which"), so throw busybox at it first
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
100 # thing.
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
101
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
102 if [ ! -f "${STAGE_DIR}/busybox" ]
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
103 then
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
104 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
105 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
106 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
107 make busybox.links &&
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
108 cp busybox "${STAGE_DIR}"
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
109
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
110 [ $? -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
111
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
112 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
113 do
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
114 [ ! -f "${STAGE_DIR}/$i" ] &&
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
115 (ln -sf busybox "${STAGE_DIR}/$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
116 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
117
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
118 cleanup
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 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
120
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
121 # Build toybox
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
122
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
123 if [ ! -f "${STAGE_DIR}/toybox" ]
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
124 then
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
125 setupfor toybox &&
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
126 make defconfig &&
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
127 make || dienow
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
128 if [ -z "$USE_TOYBOX" ]
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
129 then
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
130 mv toybox "$STAGE_DIR" &&
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
131 ln -sf toybox "$STAGE_DIR"/patch &&
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
132 ln -sf toybox "$STAGE_DIR"/netcat || dienow
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
133 else
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
134 make install_flat PREFIX="${STAGE_DIR}" || dienow
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
135 fi
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
136
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
137 cleanup
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
138 fi
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
139
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
140 # Create symlinks to the host toolchain. We need a usable existing host
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
141 # toolchain in order to build anything else (even a new host toolchain),
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
142 # and we don't really want to have to care what the host type is, so
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
143 # just use the toolchain that's already there.
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
144
796
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
145 # This is a little more complicated than it needs to be, because the host
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
146 # toolchain may be using ccache and/or distcc, which means we need every
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
147 # instance of these tools that occurs in the $PATH, in order, each in its
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
148 # own fallback directory.
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
149
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
150 for i in ar as nm cc make ld gcc
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
151 do
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
152 if [ ! -f "${STAGE_DIR}/$i" ]
796
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
153 then
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
154 # Loop through each instance, populating fallback directories.
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
155
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
156 X=0
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
157 FALLBACK="$STAGE_DIR"
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
158 PATH="$OLDPATH" "$STAGE_DIR/which" -a "$i" | while read j
796
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
159 do
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
160 mkdir -p "$FALLBACK" &&
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
161 ln -sf "$j" "$FALLBACK/$i" || dienow
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
162
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
163 X=$[$X+1]
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
164 FALLBACK="$STAGE_DIR/fallback-$X"
796
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
165 done
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
166 fi
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
167 done
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
168
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
169 # We now have all the tools we need in $STAGE_DIR, so trim the $PATH to
792
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
170 # remove the old ones.
b364ed2adf49 Fedora 11 hasn't got "which", so move the busybox build up and the host toolchain symlinks down to the end. Make sure toybox patch replaces busybox patch, and host toolchain ar replaces busybox ar.
Rob Landley <rob@landley.net>
parents: 783
diff changeset
171
796
5f793a1ca658 Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents: 792
diff changeset
172 PATH="$(hosttools_path)"
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
173 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
174
711
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
175 # This is optionally used by root-filesystem to accelerate native builds when
20ba34b54140 Rename mini-native.sh to root-filesystem.sh, since that's what it builds.
Rob Landley <rob@landley.net>
parents: 682
diff changeset
176 # running under qemu. It's not used to build root-filesystem, 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
177 # 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
178 # 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
179
571
f07d714321fe Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents: 514
diff changeset
180 # 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
181 # 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
182 # 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
183
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
184 # 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
185 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
186 then
571
f07d714321fe Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents: 514
diff changeset
187 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
188 ./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
189 make -j "$CPUS" &&
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
190 cp distcc distccd "${STAGE_DIR}"
277
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
191
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
192 cleanup
277
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
193 fi
ffef8c1fe240 Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents: 276
diff changeset
194
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
195 # 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
196 # 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
197
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
198 if [ ! -f "${STAGE_DIR}"/genext2fs ]
508
909a4921273d Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents: 505
diff changeset
199 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
200 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
201 ./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
202 make -j $CPUS &&
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
203 cp genext2fs "${STAGE_DIR}"
508
909a4921273d Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents: 505
diff changeset
204
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
205 cleanup
508
909a4921273d Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents: 505
diff changeset
206 fi
909a4921273d Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents: 505
diff changeset
207
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
208 # 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
209
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
210 # 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
211 # 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
212 # 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
213
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
214 # 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
215 # 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
216 # 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
217
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
218 # 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
219 # 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
220 # (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
221
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
222 if [ ! -f "${STAGE_DIR}"/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
223 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
224 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
225 ./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
226 make -j "$CPUS" &&
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
227 cp misc/{mke2fs,tune2fs} resize/resize2fs "${STAGE_DIR}" &&
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
228 cp e2fsck/e2fsck "$STAGE_DIR"/fsck.ext2
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
229
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
230 cleanup
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
231 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
232
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
233 # 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
234
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
235 if [ ! -f "${STAGE_DIR}"/mksquashfs ]
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
236 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
237 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
238 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
239 make -j $CPUS &&
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
240 cp mksquashfs unsquashfs "${STAGE_DIR}"
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
241
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
242 cleanup
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
243 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
244
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 # 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
246 # 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
247 # 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
248 # 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
249
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
250 # 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
251
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
252 if [ ! -f "${STAGE_DIR}"/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
253 then
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
254 if [ ! -z "$HOST_BUILD_EXTRA" ]
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
255 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
256
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
257 # 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
258 # 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
259
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
260 # 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
261 # --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
262 # 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
263 # 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
264
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
265 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
266 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
267 sed -i 's@datasuffix=".*"@datasuffix="/pc-bios"@' configure &&
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
268 ./configure --disable-gfx-check --prefix="$STAGE_DIR" &&
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
269 make -j $CPUS &&
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
270 # Copy the executable files and ROM files
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
271 cp $(find -type f -perm +111 -name "qemu*") "$STAGE_DIR" &&
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
272 cp -r pc-bios "$STAGE_DIR"
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
273
815
8129df56091b Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents: 813
diff changeset
274 cleanup
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
275 else
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
276 # 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
277 # $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
278
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
279 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
280 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
281 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
282 do
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
283 ln -s "$i/$j" "$STAGE_DIR/$j"
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
284 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
285 done
651
0d6c67c401e0 Fix qemu build and add sh4 -append patch.
Rob Landley <rob@landley.net>
parents: 650
diff changeset
286 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
287 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
288
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
289 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
290 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
291 # Make sure the host tools we just built are also in wrapdir
813
e2fc10ede93f Consistently use STAGE_DIR as the output directory. (root-filesystem.sh already did, host-tools.sh was using $HOSTTOOLS, cross-compiler.sh was using $CROSS, and system-image.sh was using SYSIMAGE.)
Rob Landley <rob@landley.net>
parents: 796
diff changeset
292 for j in $(ls "$STAGE_DIR")
352
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
293 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
294 [ -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
295 done
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
296 fi
1782b77fae15 Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents: 340
diff changeset
297
93
153ba1a0b427 Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff changeset
298 echo -e "\e[32mHost tools build complete.\e[0m"