diff options
author | ficus <ficus@robocracy.org> | 2012-09-11 01:16:38 +0200 |
---|---|---|
committer | ficus <ficus@robocracy.org> | 2012-09-12 01:25:30 +0200 |
commit | e55744bb195f0d665332ceb48acb57b4a4e186b5 (patch) | |
tree | 70824873c9dad07bf55c9e8101a97321f78fc6f5 /freedom-maker/source/install.sh | |
parent | e109d94422d0687fc84d8aa1804c2b209785d0aa (diff) | |
download | torouter-e55744bb195f0d665332ceb48acb57b4a4e186b5.tar.gz torouter-e55744bb195f0d665332ceb48acb57b4a4e186b5.zip |
update to FBx public-0.1 freedom-maker
Snapshot commit with no torouter-specific changes re-applied.
Updated freedom-maker image to a significantly more recent version, used
by the FreedomBox project. This includes a shift from debian "stable" to
"testing" (wheezy), which has a Linux 3.2 kernel.
date Fri, 24 Aug 2012 03:50:41 +0000
repo git://anonscm.debian.org/freedombox/freedom-maker.git
commit de1f66f0651a3a7c306331eeda1db93535b1470a (public-0.1)
Diffstat (limited to 'freedom-maker/source/install.sh')
-rw-r--r-- | freedom-maker/source/install.sh | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/freedom-maker/source/install.sh b/freedom-maker/source/install.sh new file mode 100644 index 0000000..76547ba --- /dev/null +++ b/freedom-maker/source/install.sh @@ -0,0 +1,76 @@ +echo "Preconfiguring dash - else dash and bash will be left in a broken state" +/var/lib/dpkg/info/dash.preinst install + +# don't leave target image containing apt config of the build host +echo "Configuring all packages" +export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true +export LC_ALL=C LANGUAGE=C LANG=C + +# allow flash-kernel to work without valid /proc contents +# ** this doesn't *really* work, since there are too many checks that fail +# in an emulated environment! We'll have to do it by hand below anyway... +export FK_MACHINE="Globalscale Technologies Dreamplug" + +# configure all packages unpacked earlier by multistrap +dpkg --configure -a + +echo "Adding source packages to filesystem" +dpkg --get-selections > /tmp/selections +mkdir -p /sourcecode +cd sourcecode +cut -f 1 < /tmp/selections | cut -d ':' -f 1 > /tmp/packages +apt-get source --download-only `cat /tmp/packages` + +# sshd may be left running by the postinst, clean that up +/etc/init.d/ssh stop + +# process installed kernel to create uImage, uInitrd, dtb +# using flash-kernel would be a good approach, except it fails in the cross +# build environment due to too many environment checks... +#FK_MACHINE="Globalscale Technologies Dreamplug" flash-kernel +# so, let's do it manually... + +# flash-kernel's hook-functions provided to mkinitramfs have the unfortunate +# side-effect of creating /conf/param.conf in the initrd when run from our +# emulated chroot environment, which means our root= on the kernel command +# line is completely ignored! repack the initrd to remove this evil... + +mkdir /tmp/initrd-repack +(cd /tmp/initrd-repack ; \ + zcat /boot/initrd.img-3.2.0-3-kirkwood | cpio -i ; \ + rm -f conf/param.conf ; \ + find . | cpio --quiet -o -H newc | \ + gzip -9 > /boot/initrd.img-3.2.0-3-kirkwood ) +rm -rf /tmp/initrd-repack + +(cd /boot ; \ + cp /usr/lib/linux-image-3.2.0-3-kirkwood/kirkwood-dreamplug.dtb dtb ; \ + cat vmlinuz-3.2.0-3-kirkwood dtb >> temp-kernel ; \ + mkimage -A arm -O linux -T kernel -n 'Debian kernel 3.2.0-3-kirkwood' \ + -C none -a 0x8000 -e 0x8000 -d temp-kernel uImage ; \ + rm -f temp-kernel ; \ + mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 \ + -n 'Debian ramdisk 3.2.0-3-kirkwood' \ + -d initrd.img-3.2.0-3-kirkwood uInitrd ) + +# Establish an initial root password +echo "Set root password to "$rootpassword +echo root:$rootpassword | /usr/sbin/chpasswd + +# Create a default user +echo "Creating fbx user, password: $userpassword" +useradd $user +echo $user:$userpassword | /usr/sbin/chpasswd + +# By default, spawn a console on the serial port +echo "Adding a getty on the serial port" +echo "T0:12345:respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab + +echo "Deleting this very same script" +rm -f /install.sh + +echo "Syncing filesystem just in case something didn't get written" +sync + +echo "End configuration progress by exiting from the chroot" +exit |