diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-01-06 17:15:29 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-01-06 17:15:29 +0000 |
commit | c6ea285f9e1b67923d85ccc5b52e84fad1852dcd (patch) | |
tree | 80a80625b455b68e4477c6c411b8f835c644e6d5 /baserock-bootstrap | |
parent | b605c727fef92f7ebff6b92ce0c834abbbc72f93 (diff) | |
download | morph-c6ea285f9e1b67923d85ccc5b52e84fad1852dcd.tar.gz |
build the devel system strata and then assemble a system image by hand
Building a system image breaks because we would need to put in more
tools into the devel stratum, which is too much work right now. This
is a workaround that will be taken out later.
Diffstat (limited to 'baserock-bootstrap')
-rwxr-xr-x | baserock-bootstrap | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/baserock-bootstrap b/baserock-bootstrap index 733966f9..d339c04c 100755 --- a/baserock-bootstrap +++ b/baserock-bootstrap @@ -768,7 +768,9 @@ set -x cd /baserock/gits/morph mkdir -p /baserock/cache python ./morph --verbose build \ - file:///baserock/gits/morphs/ liw/foo devel-system.morph \ + file:///baserock/gits/morphs/ liw/foo linux-stratum.morph \ + file:///baserock/gits/morphs/ liw/foo foundation.morph \ + file:///baserock/gits/morphs/ liw/foo devel.morph \ --bootstrap \ --cachedir=/baserock/cache \ --log=/baserock/morph.log \ @@ -793,6 +795,50 @@ EOF } +pass2_build_devel_system_outside_chroot() +{ + cd "$LFS/.." + img="devsys.img" + + $HOST_SUDO qemu-img create -f raw "$img" 1G + $HOST_SUDO parted -s "$img" mklabel msdos + $HOST_SUDO parted -s "$img" mkpart primary 0% 100% + $HOST_SUDO parted -s "$img" set 1 boot on + $HOST_SUDO install-mbr "$img" + part=/dev/mapper/$($HOST_SUDO kpartx -av "$img" | awk '/^add map/ { print $3 }' | head -n1) + trap "$HOST_SUDO kpartx -dv $img" EXIT + $HOST_SUDO mkfs -t ext4 "$part" + mp="$(mktemp -d)" + $HOST_SUDO mount "$part" "$mp" + + for stratum in "$LFS"/baserock/cache/*.stratum.{foundation,linux-stratum,devel} + do + $HOST_SUDO tar -C "$mp" -xf "$stratum" + done + + cat <<EOF | $HOST_SUDO tee "$mp/etc/fstab" +proc /proc proc defaults 0 0 +sysfs /sys sysfs defaults 0 0 +/dev/sda1 / ext4 errors=remount-ro 0 1 +EOF + + cat <<EOF | $HOST_SUDO tee "$mp/extlinux.conf" +default linux +timeout 1 + +label linux +kernel /vmlinuz +append root=/dev/sda1 init=/sbin/init quiet rw +EOF + + $HOST_SUDO extlinux --install "$mp" + sync + sleep 2 + + $HOST_SUDO umount "$mp" +} + + echo "Bootstrapping Baserock development environment" echo "LFS_TGT=$LFS_TGT" @@ -848,4 +894,4 @@ fi pass2_get_sources pass2_prepare_for_chroot pass2_build_with_morph_in_chroot - +pass2_build_devel_system_outside_chroot |