summaryrefslogtreecommitdiff
path: root/baserock-bootstrap
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-02-17 15:58:15 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-02-17 16:09:45 +0000
commit90ef512d020c5e2d7249d241451765f0e3f65b6a (patch)
tree7ba2779e47fe6edd893170e0478017394cdbd229 /baserock-bootstrap
parent0056dcba6d0ab2ed5e2c92b0dbaf4b0de76e0ac5 (diff)
downloadmorph-90ef512d020c5e2d7249d241451765f0e3f65b6a.tar.gz
baserock-bootstrap: cache the sources in pass 3
this is pretty much just a copy of the pass 2 thing this needs a cleanup, as there is duplicated functionality and clashing names
Diffstat (limited to 'baserock-bootstrap')
-rwxr-xr-xbaserock-bootstrap63
1 files changed, 59 insertions, 4 deletions
diff --git a/baserock-bootstrap b/baserock-bootstrap
index 090a71a1..24f79eb0 100755
--- a/baserock-bootstrap
+++ b/baserock-bootstrap
@@ -782,7 +782,7 @@ EOF
pass2_get_sources_with_morph_in_chroot()
{
- echo "Building Baserock with morph"
+ echo "Getting sources with morph"
cat <<EOF > "$LFS/baserock/build.sh"
#!/tools/bin/bash
set -e
@@ -958,15 +958,69 @@ pass3_remove_tools()
$HOST_SUDO rm -rf "$LFS/tools"
}
-pass3_build_with_morph_in_chroot()
+pass3_get_sources_with_morph_in_chroot()
{
- echo "Building Baserock with morph"
+ echo "Getting sources with morph"
+ # use pass 2 sources as a starting point
+ # but the cached chunks may be invalid, so
+ # move them away
cd "$LFS/baserock/gits/morph"
mv "$LFS/baserock/cache" "$LFS/baserock/cache.pass2"
- mkdir "$LFS/baserock/cache"
+ mkdir -p "$LFS/baserock/cache"
mv "$LFS/baserock/cache.pass2/gits" "$LFS/baserock/cache/gits"
+ cat <<EOF > "$LFS/baserock/build.sh"
+#!/bin/bash
+set -e
+set -x
+
+cd /baserock/gits/morph
+while ! python ./morph --verbose update-gits \
+ morphs master foundation.morph \
+ morphs master devel.morph \
+ morphs master linux-stratum.morph \
+ --cachedir=/baserock/cache \
+ --log=/baserock/morph.log \
+ --dump-memory-profile=none \
+ --keep-path \
+ --bundle-server="$GIT_BUNDLES" \
+ --git-base-url=git://gitorious.org/baserock-morphs/ \
+ --git-base-url=git://gitorious.org/baserock/
+do
+ echo eeekk try again
+done
+EOF
+ $HOST_CHMOD +x "$LFS/baserock/build.sh"
+ local do_chroot="$BASEDIR/do-chroot.bash"
+ if [ ! -e "$do_chroot" ]; then
+ $HOST_CAT <<EOF >"$do_chroot"
+#!/bin/bash
+trap "$HOST_SUDO umount $LFS/proc $LFS/sys" INT TERM EXIT
+set -e
+set -x
+if ! mount | grep "$LFS/proc" >/dev/null
+then
+ $HOST_SUDO mount -t proc proc "$LFS/proc"
+fi
+if ! mount | grep "$LFS/sys" >/dev/null
+then
+ $HOST_SUDO mount -t sysfs sysfs "$LFS/sys"
+fi
+$HOST_SUDO $HOST_CP -f /etc/resolv.conf "$LFS/etc/resolv.conf"
+$HOST_SUDO /usr/sbin/chroot "$LFS" \\
+ /usr/bin/env -i HOME=/baserock TERM=\$TERM \\
+ PATH="/bin:/usr/bin:/sbin:/usr/sbin" \\
+ "\${@-\$SHELL}"
+EOF
+ $HOST_CHMOD +x "$do_chroot"
+ fi
+ "$do_chroot" /baserock/build.sh
+}
+pass3_build_with_morph_in_chroot()
+{
+ echo "Building Baserock with morph"
+
cat <<EOF > "$LFS/baserock/build_pass3.sh"
#!/bin/bash
set -e
@@ -1077,6 +1131,7 @@ case "$buildwhat" in
;;
pass3)
pass3_remove_tools
+ pass3_get_sources_with_morph_in_chroot
pass3_build_with_morph_in_chroot
exit 1
;;