Mercurial > hg > aboriginal
annotate host-tools.sh @ 1725:c0c2e67782be draft
New squashfs config symbol, not sure why you'd ever want to switch it off...
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 25 Jan 2015 11:48:36 -0600 |
parents | b134528a9b50 |
children | b89324905ca2 |
rev | line source |
---|---|
177 | 1 #!/bin/bash |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
1128
e5f9681a8b3c
Lots of comment updates. Add a NO_HOST_TOOLS=1 config option, and a few "time" calls to stages that didn't have them. Put native-compiler.sh after root-filesystem.sh in build so it's slightly easier to document.
Rob Landley <rob@landley.net>
parents:
1101
diff
changeset
|
3 # Set up a known host environment, providing known versions of all required |
888 | 4 # prerequisites, built from source. |
5 | |
6 # This script serves a similar purpose to the temporary chroot system in | |
7 # Linux From Scratch chapter 5, isolating the new build from the host system | |
8 # so information from the host doesn't accidentally leak into the target. | |
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
|
9 |
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 # 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
|
11 # 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
|
12 # 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
|
13 # 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
|
14 # 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
|
15 |
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 # 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
|
17 # 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
|
18 # 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
|
19 # 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
|
20 |
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 # 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
|
22 # 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
|
23 # 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
|
24 # 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
|
25 # 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
|
26 |
1582
6a8114c148d1
Lots of small improvements: check for toybox instead of busybox for host-tools $PATH adjustment, better manifest generation (with toybox in list), make package_cache function to find extracted source (so root-image.sh works when packages contains linux-git snapshot), fix more/record-commands.sh path adjustment.
Rob Landley <rob@landley.net>
parents:
1552
diff
changeset
|
27 SAVEPATH="$PATH" |
669 | 28 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
|
29 |
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
|
30 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
|
31 |
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
|
32 # 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
|
33 # 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
|
34 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
35 blank_tempdir "$WORK" |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
36 mkdir -p "$STAGE_DIR" || 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
|
37 |
1645
a242ea5d6bb4
Make host-tools.sh update the record-commands wrapper so we can log the distcc, genext2fs, e2fsprogs, and mksquashfs builds.
Rob Landley <rob@landley.net>
parents:
1582
diff
changeset
|
38 # Populate a directory with host versions of all the command line utilities |
a242ea5d6bb4
Make host-tools.sh update the record-commands wrapper so we can log the distcc, genext2fs, e2fsprogs, and mksquashfs builds.
Rob Landley <rob@landley.net>
parents:
1582
diff
changeset
|
39 # we're going to install into root-filesystem. When we're done, PATH can be |
a242ea5d6bb4
Make host-tools.sh update the record-commands wrapper so we can log the distcc, genext2fs, e2fsprogs, and mksquashfs builds.
Rob Landley <rob@landley.net>
parents:
1582
diff
changeset
|
40 # set to include just this directory and nothing else. |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
41 |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
42 # 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
|
43 # |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
44 # 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
|
45 # 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
|
46 # 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
|
47 # 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
|
48 # 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
|
49 # |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
50 # 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
|
51 # 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
|
52 # 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
|
53 # |
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
54 # 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
|
55 # 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
|
56 # 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
|
57 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
58 # Use the new tools we build preferentially, as soon as they become |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
59 # available. |
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
|
60 |
1544
e2f722cc97a6
Make busybox build by default, switch override knob to BUSYBOX=1 to use defconfig busybox, always use toybox for oneit, cleanup/fix record-commands logic.
Rob Landley <rob@landley.net>
parents:
1510
diff
changeset
|
61 PATH="$(hosttools_path):$PATH" |
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 |
1093
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
63 # Sanity test for the host supporting static linking. |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
64 |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
65 if [ "$BUILD_STATIC" != none ] |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
66 then |
1676
0f4499211cfa
Move hello.c into /src in the root filesystem so the instructions in the README to try building it aren't wrong.
Rob Landley <rob@landley.net>
parents:
1674
diff
changeset
|
67 $CC "$SOURCES/root-filesystem/src/hello.c" --static -o /dev/null |
1093
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
68 |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
69 if [ $? -ne 0 ] |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
70 then |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
71 echo "Your host toolchain does not support static linking." >&2 |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
72 echo "Either install support, or export BUILD_STATIC=none" >&2 |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
73 |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
74 dienow |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
75 fi |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
76 fi |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
77 |
2de27a5561af
Test for static linking capability on the host, and complain if we need it but it isn't there.
Rob Landley <rob@landley.net>
parents:
1042
diff
changeset
|
78 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
79 # Start by building busybox. We have no idea what strange things our host |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
80 # system has (or lacks, such as "which"), so throw busybox at it first |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
81 # thing. |
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
|
82 |
910
f1671488c740
Split busybox and toybox builds, update toybox and linux package versions.
Rob Landley <rob@landley.net>
parents:
907
diff
changeset
|
83 [ ! -f "$STAGE_DIR/busybox" ] && build_section busybox |
1544
e2f722cc97a6
Make busybox build by default, switch override knob to BUSYBOX=1 to use defconfig busybox, always use toybox for oneit, cleanup/fix record-commands logic.
Rob Landley <rob@landley.net>
parents:
1510
diff
changeset
|
84 [ ! -f "$STAGE_DIR/toybox" ] && build_section toybox |
352
1782b77fae15
Add command logging. Set RECORD_COMMANDS=1 to log every command line run
Rob Landley <rob@landley.net>
parents:
340
diff
changeset
|
85 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
86 # Create symlinks to the host toolchain. We need a usable existing host |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
87 # toolchain in order to build anything else (even a new host toolchain), |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
88 # and we don't really want to have to care what the host type is, so |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
89 # just use the toolchain that's already there. |
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
|
90 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
91 # This is a little more complicated than it needs to be, because the host |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
92 # toolchain may be using ccache and/or distcc, which means we need every |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
93 # instance of these tools that occurs in the $PATH, in order, each in its |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
94 # own fallback directory. |
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
|
95 |
1723
b134528a9b50
New kernel needs objdump in the $PATH.
Rob Landley <rob@landley.net>
parents:
1713
diff
changeset
|
96 for i in ar as nm cc make ld gcc objdump $HOST_EXTRA |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
97 do |
1041
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
98 if [ ! -f "$STAGE_DIR/$i" ] |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
99 then |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
100 # Loop through each instance, populating fallback directories. |
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
|
101 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
102 X=0 |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
103 FALLBACK="$STAGE_DIR" |
1582
6a8114c148d1
Lots of small improvements: check for toybox instead of busybox for host-tools $PATH adjustment, better manifest generation (with toybox in list), make package_cache function to find extracted source (so root-image.sh works when packages contains linux-git snapshot), fix more/record-commands.sh path adjustment.
Rob Landley <rob@landley.net>
parents:
1552
diff
changeset
|
104 PATH="$SAVEPATH" "$STAGE_DIR/which" -a "$i" | while read j |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
105 do |
1510
8e98296410f3
Another attempt to make more/record-commands.sh and host-tools.sh play together.
Rob Landley <rob@landley.net>
parents:
1482
diff
changeset
|
106 if [ ! -e "$FALLBACK/$i" ] |
8e98296410f3
Another attempt to make more/record-commands.sh and host-tools.sh play together.
Rob Landley <rob@landley.net>
parents:
1482
diff
changeset
|
107 then |
8e98296410f3
Another attempt to make more/record-commands.sh and host-tools.sh play together.
Rob Landley <rob@landley.net>
parents:
1482
diff
changeset
|
108 mkdir -p "$FALLBACK" && |
8e98296410f3
Another attempt to make more/record-commands.sh and host-tools.sh play together.
Rob Landley <rob@landley.net>
parents:
1482
diff
changeset
|
109 ln -sf "$j" "$FALLBACK/$i" || dienow |
8e98296410f3
Another attempt to make more/record-commands.sh and host-tools.sh play together.
Rob Landley <rob@landley.net>
parents:
1482
diff
changeset
|
110 fi |
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
|
111 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
112 X=$[$X+1] |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
113 FALLBACK="$STAGE_DIR/fallback-$X" |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
114 done |
1041
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
115 |
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
116 if [ ! -f "$STAGE_DIR/$i" ] |
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
117 then |
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
118 echo "Toolchain component missing: $i" >&2 |
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
119 dienow |
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
120 fi |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
121 fi |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
122 done |
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
|
123 |
1041
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
124 # Workaround for a bug in Ubuntu 10.04 where gcc became a perl script calling |
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
125 # gcc.real. Systems that aren't crazy don't need this. |
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
126 |
1582
6a8114c148d1
Lots of small improvements: check for toybox instead of busybox for host-tools $PATH adjustment, better manifest generation (with toybox in list), make package_cache function to find extracted source (so root-image.sh works when packages contains linux-git snapshot), fix more/record-commands.sh path adjustment.
Rob Landley <rob@landley.net>
parents:
1552
diff
changeset
|
127 ET_TU_UBUNTU="$(PATH="$SAVEPATH" "$STAGE_DIR/which" gcc.real)" |
1510
8e98296410f3
Another attempt to make more/record-commands.sh and host-tools.sh play together.
Rob Landley <rob@landley.net>
parents:
1482
diff
changeset
|
128 [ ! -z "$ET_TU_UBUNTU" ] && ln -s "$ET_TU_UBUNTU" "$STAGE_DIR/gcc.real" 2>/dev/null |
1041
77024e0f4ccb
Ubuntu 10.04 turned gcc into a perl script wrapper that calls gcc.real, so host-tools.sh has to copy that if it exists. Add some simple error checking the the host toolchain symlinking while we're at it.
Rob Landley <rob@landley.net>
parents:
1024
diff
changeset
|
129 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
130 # We now have all the tools we need in $STAGE_DIR, so trim the $PATH to |
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
131 # remove the old ones. |
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
|
132 |
899
726cac165450
Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
133 PATH="$(hosttools_path)" |
1671
d201f0baf0b6
Don't rebuild record-commands directory if build/host didn't change.
Rob Landley <rob@landley.net>
parents:
1649
diff
changeset
|
134 if [ ! -z "$(find "$STAGE_DIR" -newer "$BUILD/record-commands" 2>/dev/null)" ] |
1645
a242ea5d6bb4
Make host-tools.sh update the record-commands wrapper so we can log the distcc, genext2fs, e2fsprogs, and mksquashfs builds.
Rob Landley <rob@landley.net>
parents:
1582
diff
changeset
|
135 then |
a242ea5d6bb4
Make host-tools.sh update the record-commands wrapper so we can log the distcc, genext2fs, e2fsprogs, and mksquashfs builds.
Rob Landley <rob@landley.net>
parents:
1582
diff
changeset
|
136 cd "$TOP" && more/record-commands.sh || dienow |
1713
8929051f09f4
When switching record-commands to host-tools after the toybox build, update path to actually log the next few packages.
Rob Landley <rob@landley.net>
parents:
1676
diff
changeset
|
137 PATH="$WRAPDIR" |
1645
a242ea5d6bb4
Make host-tools.sh update the record-commands wrapper so we can log the distcc, genext2fs, e2fsprogs, and mksquashfs builds.
Rob Landley <rob@landley.net>
parents:
1582
diff
changeset
|
138 fi |
311
a791ca629d9c
Upgrade to toybox-0.0.5 and linux-2.6.25-rc7. Remove use of perl in the kernel
Rob Landley <rob@landley.net>
parents:
301
diff
changeset
|
139 |
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
|
140 # 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
|
141 # 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
|
142 # 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
|
143 # 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
|
144 |
571
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
145 # 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
|
146 # 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
|
147 # 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
|
148 |
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
|
149 # 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
|
150 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
|
151 then |
571
f07d714321fe
Fix a couple brown paper bag bugs (oops) and general cleanups.
Rob Landley <rob@landley.net>
parents:
514
diff
changeset
|
152 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
|
153 ./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
|
154 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
|
155 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
|
156 |
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
|
157 cleanup |
277
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
158 fi |
ffef8c1fe240
Build distcc on host if it's not already installed.
Rob Landley <rob@landley.net>
parents:
276
diff
changeset
|
159 |
609
3c30ce98c273
And genext2fs could suffer the same symlink loop problem with RECORD_COMMANDS, so don't symlink. (The point of host-tools.sh is to build what we can from source anyway, linking to anything but the host toolchain defeats the purpose.)
Rob Landley <rob@landley.net>
parents:
608
diff
changeset
|
160 # 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
|
161 # 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
|
162 |
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
|
163 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
|
164 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
|
165 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
|
166 ./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
|
167 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
|
168 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
|
169 |
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
|
170 cleanup |
508
909a4921273d
Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents:
505
diff
changeset
|
171 fi |
909a4921273d
Move genext2fs build to host-tools, remove dead code, add comments.
Rob Landley <rob@landley.net>
parents:
505
diff
changeset
|
172 |
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
|
173 # 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
|
174 |
c92dc77da038
Since gene2fs can't produce large images in a reasonable amount of time, make a 64 meg image and resize it if necessary. (This means the minimum image size is 64 megs, because gene2fs won't run unless you specify a size, but it knows right away if the size you gave it wasn't big enough. I don't understand this either.)
Rob Landley <rob@landley.net>
parents:
625
diff
changeset
|
175 # 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
|
176 # 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
|
177 # (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
|
178 |
1001 | 179 # system-image.sh will also use resize2fs from this package if |
180 # SYSIMAGE_TYPE=ext2 to expand the image to SYSIMAGE_HDA_MEGS, because | |
181 # genext2fs is unreasonably slow at creating large files. (It has a -b | |
182 # option that should do this... if you want your 8-way server with 32 gigs | |
183 # of ram to sit there and drool for over 10 minutes to create a 2 gig file | |
184 # that's mostly empty. Yeah: not doing that.) | |
185 | |
1020
b9319aa31df8
Always make mke2fs, run-from-build.sh can't make hdb.img otherwise.
Rob Landley <rob@landley.net>
parents:
1001
diff
changeset
|
186 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
|
187 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
|
188 setupfor e2fsprogs && |
911
b69d7013e16e
Fix e2fsprogs on uClibc build.
Rob Landley <rob@landley.net>
parents:
910
diff
changeset
|
189 ./configure --disable-tls --disable-nls --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
|
190 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
|
191 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
|
192 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
|
193 |
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
|
194 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
|
195 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
|
196 |
1552
c3b91b70cc42
Remove USE_ALT option, I have a better idea (upcoming patch).
Rob Landley <rob@landley.net>
parents:
1544
diff
changeset
|
197 # Squashfs is the default 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
|
198 |
932
61e95d49f520
Have host-tools.sh only make e2fs or squashfs tools if we need them.
Rob Landley <rob@landley.net>
parents:
911
diff
changeset
|
199 if [ ! -f "${STAGE_DIR}"/mksquashfs ] && |
61e95d49f520
Have host-tools.sh only make e2fs or squashfs tools if we need them.
Rob Landley <rob@landley.net>
parents:
911
diff
changeset
|
200 ([ -z "$SYSIMAGE_TYPE" ] || [ "$SYSIMAGE_TYPE" == squashfs ]) |
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
|
201 then |
1024
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
202 setupfor zlib && |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
203 ./configure && |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
204 make -j $CPUS && |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
205 mv z*.h libz.a .. |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
206 |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
207 cleanup |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
208 |
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
|
209 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
|
210 cd squashfs-tools && |
1265
918501f802d1
Update squashfs and kernel to current versions.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
211 # Disable xattr support, uClibc doesn't support it and it's deeply pointless |
918501f802d1
Update squashfs and kernel to current versions.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
212 # anyway. (I left extended attributes behind with OS/2, thanks.) |
918501f802d1
Update squashfs and kernel to current versions.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
213 sed -i "/^XATTR_/d" Makefile && |
1024
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
214 CC="$CC -I ../.. -L ../.." make -j $CPUS && |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
215 cp mksquashfs unsquashfs "${STAGE_DIR}" && |
0fd90ff771dc
Build zlib for squashfs, so we don't depend on the host having it.
Rob Landley <rob@landley.net>
parents:
1020
diff
changeset
|
216 rm ../../{z*.h,libz.a} |
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
|
217 |
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
|
218 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
|
219 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
|
220 |
1671
d201f0baf0b6
Don't rebuild record-commands directory if build/host didn't change.
Rob Landley <rob@landley.net>
parents:
1649
diff
changeset
|
221 # One more update with new packages |
d201f0baf0b6
Don't rebuild record-commands directory if build/host didn't change.
Rob Landley <rob@landley.net>
parents:
1649
diff
changeset
|
222 if [ ! -z "$(find "$STAGE_DIR" -newer "$BUILD/record-commands" 2>/dev/null)" ] |
d201f0baf0b6
Don't rebuild record-commands directory if build/host didn't change.
Rob Landley <rob@landley.net>
parents:
1649
diff
changeset
|
223 then |
d201f0baf0b6
Don't rebuild record-commands directory if build/host didn't change.
Rob Landley <rob@landley.net>
parents:
1649
diff
changeset
|
224 cd "$TOP" && more/record-commands.sh || dienow |
d201f0baf0b6
Don't rebuild record-commands directory if build/host didn't change.
Rob Landley <rob@landley.net>
parents:
1649
diff
changeset
|
225 fi |
d201f0baf0b6
Don't rebuild record-commands directory if build/host didn't change.
Rob Landley <rob@landley.net>
parents:
1649
diff
changeset
|
226 |
93
153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
227 echo -e "\e[32mHost tools build complete.\e[0m" |