summaryrefslogtreecommitdiff
path: root/run-bootstrap-in-chroot
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-01-13 15:17:54 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-01-13 15:17:54 +0000
commit659d035e3f64c16deb53e95e3a308c37cc9f1479 (patch)
tree2e901a70fb1df03d98b11c6ea5115c4bdb988a63 /run-bootstrap-in-chroot
parentfb7ea35ca0ff4c75e80f7a79889a2cc6d83936aa (diff)
downloadmorph-659d035e3f64c16deb53e95e3a308c37cc9f1479.tar.gz
add script to run baserock-bootstrap in a newly created clean chroot
Diffstat (limited to 'run-bootstrap-in-chroot')
-rwxr-xr-xrun-bootstrap-in-chroot37
1 files changed, 37 insertions, 0 deletions
diff --git a/run-bootstrap-in-chroot b/run-bootstrap-in-chroot
new file mode 100755
index 00000000..1671b4c0
--- /dev/null
+++ b/run-bootstrap-in-chroot
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+set -e
+
+export LC_ALL=C
+
+dir="squeeze-chroot"
+mirror="http://192.168.1.185/debian"
+
+mkdir "$dir"
+
+debootstrap \
+--include=build-essential,\
+bc,gawk,bison,python,autoconf,autopoint,automake,gettext,libtool,\
+help2man,texinfo,sudo \
+squeeze "$dir" "$mirror"
+
+hostname > "$dir/etc/hostname"
+cat <<EOF > "$dir/etc/hosts"
+127.0.0.1 localhost
+127.0.1.1 $(hostname)
+EOF
+
+cp baserock-bootstrap "$dir/."
+sed 's,^.*/,http://192.168.1.185/lfs/,' wget-list > "$dir/wget-list"
+cp -a /home/liw/baserock/lfs-tarballs "$dir/."
+mount -t proc proc "$dir/proc"
+mount -t sysfs sysfs "$dir/sys"
+if chroot "$dir" bash -x baserock-bootstrap yes
+then
+ exit=0
+else
+ exit=$?
+fi
+umount "$dir/sys"
+umount "$dir/proc"
+exit $exit