Mercurial > hg > aboriginal
annotate sources/native-builds/gentoo-bootstrap/make-control-image.sh @ 1251:204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 24 Sep 2010 08:36:21 -0500 |
parents | sources/native-builds/gentoo-stage1.sh@b84cf2f3ef53 |
children | ba951c11fb48 |
rev | line source |
---|---|
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # Script to extend minimal native build environment into a Gentoo stage 1. |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 # We take some liberties with this stage 1: use busybox instead of gnu tools, |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 # uClibc-based instead of glibc-based, and using our existing toolchain |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 # (with distcc acceleration). |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 |
1095
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
9 # GFS used: |
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
10 # setup-base-packages.sh |
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
11 # strace, Python, ncurses, bash, tar, patch, findutils, file, pax-utils, |
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
12 # shadow |
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
13 # setup-portage.sh |
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
14 # /etc/passwd (root and portage), /etc/group (root and portage) |
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
15 # portage |
891bb7ec58f2
Redo download logic to work with FORK=1 (spotted by Milton Miller).
Rob Landley <rob@landley.net>
parents:
1080
diff
changeset
|
16 |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 # Download all the source tarballs we haven't got up-to-date copies of. |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 # The tarballs are downloaded into the "packages" directory, which is |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 # created as needed. |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 source sources/include.sh || exit 1 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 |
1251
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
24 # Find path to our working directory. |
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
25 |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 [ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1 |
1230
50015325b804
Teach gentoo-stage1.sh that /dev/null means don't create an hdc.
Rob Landley <rob@landley.net>
parents:
1223
diff
changeset
|
27 [ "$1" != "/dev/null" ] && [ -e "$1" ] && echo "$1" exists && exit 0 |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 |
1188
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1112
diff
changeset
|
29 # We use a lot of our own directories because we may have the same packages |
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1112
diff
changeset
|
30 # as the aboriginal build, but use different versions. So keep things separate |
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1112
diff
changeset
|
31 # so they don't interfere. |
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1112
diff
changeset
|
32 |
1251
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
33 MYDIR="$(dirname "$(readlink -f "$(which "$0")")")" |
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
34 IMAGENAME="${MYDIR/*\//}" |
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
35 PATCHDIR="$MYDIR/patches" |
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
36 SRCDIR="$SRCDIR/$IMAGENAME" && mkdir -p "$SRCDIR" || dienow |
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
37 WORK="$WORK/$IMAGENAME" && blank_tempdir "$WORK" |
1188
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1112
diff
changeset
|
38 SRCTREE="$WORK" |
13c22a46b1c9
Now that extract_packages is separate from setupfor, EXTRACT_ALL=1 should be less brittle. (If not, needs to be fixed, so remove workarounds.)
Rob Landley <rob@landley.net>
parents:
1112
diff
changeset
|
39 |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
40 echo "=== Download source code." |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 |
1251
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
42 EXTRACT_ALL=1 |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
43 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
44 URL=http://zlib.net/zlib-1.2.5.tar.bz2 \ |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
45 SHA1=543fa9abff0442edca308772d6cef85557677e02 \ |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
46 maybe_fork "download || dienow" |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
47 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
48 URL=http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz \ |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 SHA1=8233ee56ed84ae05421e4e6d6db6c1fe72ee6797 \ |
1223
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
50 maybe_fork "download || dienow" |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
51 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
52 URL=http://python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2 \ |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 SHA1=24c94f5428a8c94c9d0b316e3019fee721fdb5d1 \ |
1223
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
54 maybe_fork "download || dienow" |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
55 |
1080
119367910fcd
More work on gentoo from scratch conversion.
Rob Landley <rob@landley.net>
parents:
1057
diff
changeset
|
56 URL=http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz \ |
119367910fcd
More work on gentoo from scratch conversion.
Rob Landley <rob@landley.net>
parents:
1057
diff
changeset
|
57 SHA1=fe6466c7ee98061e044dae0347ca5d1a8eab4a0d \ |
1223
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
58 maybe_fork "download || dienow" |
1202
75d179a52475
Bootstrapping gentoo portage tree. Download tarball, extract it, and emerge --sync. (Build rsync so emerge --sync works.)
Rob Landley <rob@landley.net>
parents:
1188
diff
changeset
|
59 |
75d179a52475
Bootstrapping gentoo portage tree. Download tarball, extract it, and emerge --sync. (Build rsync so emerge --sync works.)
Rob Landley <rob@landley.net>
parents:
1188
diff
changeset
|
60 URL=http://www.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz \ |
75d179a52475
Bootstrapping gentoo portage tree. Download tarball, extract it, and emerge --sync. (Build rsync so emerge --sync works.)
Rob Landley <rob@landley.net>
parents:
1188
diff
changeset
|
61 SHA1=63426a1bc71991d93159cd522521fbacdafb7a61 \ |
1223
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
62 maybe_fork "download || dienow" |
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
63 |
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
64 URL=http://ftp.gnu.org/gnu/patch/patch-2.5.9.tar.gz \ |
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
65 SHA1=9a69f7191576549255f046487da420989d2834a6 \ |
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
66 maybe_fork "download || dienow" |
1080
119367910fcd
More work on gentoo from scratch conversion.
Rob Landley <rob@landley.net>
parents:
1057
diff
changeset
|
67 |
1249
b84cf2f3ef53
Add "file" to the bootstrap packages, and add a package.provided listing stuff that's there already for portage.
Rob Landley <rob@landley.net>
parents:
1230
diff
changeset
|
68 URL=ftp://ftp.astron.com/pub/file/file-5.03.tar.gz \ |
b84cf2f3ef53
Add "file" to the bootstrap packages, and add a package.provided listing stuff that's there already for portage.
Rob Landley <rob@landley.net>
parents:
1230
diff
changeset
|
69 SHA1=f659a4e1fa96fbdc99c924ea8e2dc07319f046c1 \ |
b84cf2f3ef53
Add "file" to the bootstrap packages, and add a package.provided listing stuff that's there already for portage.
Rob Landley <rob@landley.net>
parents:
1230
diff
changeset
|
70 maybe_fork "download || dienow" |
b84cf2f3ef53
Add "file" to the bootstrap packages, and add a package.provided listing stuff that's there already for portage.
Rob Landley <rob@landley.net>
parents:
1230
diff
changeset
|
71 |
1112
25607cc50c8f
Update gentoo-stage1 build to actually build portage. (Doesn't install a tree yet.)
Rob Landley <rob@landley.net>
parents:
1095
diff
changeset
|
72 URL=http://dev.gentoo.org/~zmedico/portage/archives/portage-2.1.8.tar.bz2 \ |
25607cc50c8f
Update gentoo-stage1 build to actually build portage. (Doesn't install a tree yet.)
Rob Landley <rob@landley.net>
parents:
1095
diff
changeset
|
73 SHA1=390c97f3783af2d9e52482747ead3681655ea9c3 \ |
1223
db3b0244a49e
Break down and build separate patch package on target for gentoo stage 1.
Rob Landley <rob@landley.net>
parents:
1202
diff
changeset
|
74 maybe_fork "download || dienow" |
1112
25607cc50c8f
Update gentoo-stage1 build to actually build portage. (Doesn't install a tree yet.)
Rob Landley <rob@landley.net>
parents:
1095
diff
changeset
|
75 |
1057
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
76 echo === Got all source. |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
77 |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
78 cleanup_oldfiles |
949617f5287f
First chunk of porting Gentoo From Scratch to an hdc build. (Much more to go.)
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
79 |
1251
204238871b7c
Shuffle gentoo bootstrapping into a single directory (with files and patches subdirectories under that).
Rob Landley <rob@landley.net>
parents:
1249
diff
changeset
|
80 cp -a "$MYDIR/files/." "$WORK" || exit 1 |
1230
50015325b804
Teach gentoo-stage1.sh that /dev/null means don't create an hdc.
Rob Landley <rob@landley.net>
parents:
1223
diff
changeset
|
81 |
50015325b804
Teach gentoo-stage1.sh that /dev/null means don't create an hdc.
Rob Landley <rob@landley.net>
parents:
1223
diff
changeset
|
82 if [ "$1" != "/dev/null" ] |
50015325b804
Teach gentoo-stage1.sh that /dev/null means don't create an hdc.
Rob Landley <rob@landley.net>
parents:
1223
diff
changeset
|
83 then |
50015325b804
Teach gentoo-stage1.sh that /dev/null means don't create an hdc.
Rob Landley <rob@landley.net>
parents:
1223
diff
changeset
|
84 cd "$TOP" && |
50015325b804
Teach gentoo-stage1.sh that /dev/null means don't create an hdc.
Rob Landley <rob@landley.net>
parents:
1223
diff
changeset
|
85 mksquashfs "$WORK" "$1" -noappend -all-root || dienow |
50015325b804
Teach gentoo-stage1.sh that /dev/null means don't create an hdc.
Rob Landley <rob@landley.net>
parents:
1223
diff
changeset
|
86 fi |