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/etc/init.d/first-run | |
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/etc/init.d/first-run')
-rwxr-xr-x | freedom-maker/source/etc/init.d/first-run | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/freedom-maker/source/etc/init.d/first-run b/freedom-maker/source/etc/init.d/first-run new file mode 100755 index 0000000..8df2c2d --- /dev/null +++ b/freedom-maker/source/etc/init.d/first-run @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Script to complete the post-install process on first FBX boot. + +### BEGIN INIT INFO +# Provides: first-run +# Default-Start: 1 2 +# Required-Start: 2 +# Required-Stop: +# Default-Stop: +# Short-Description: Finish FBX install on DreamPlug +### END INIT INFO + +function tweak-kernel { + # Update the kernel unless requested otherwise. + + if [ -e /var/freedombox/dont-tweak-kernel ] + then + rm /var/freedombox/dont-tweak-kernel + else + kernel_version="$(/bin/ls $mountpoint/boot/vmlinuz-*-kirkwood | sort -rn | head -n1 | sed s#$mountpoint/boot/vmlinuz-##)" + + mount -t proc proc /proc + flash-kernel $kernel_version + umount /proc + fi +} + +function wifi-ap-setup { + # configure wireless access point with spinifex's prebuilt firmware + + echo "Sleeping 30s for DHCP" + sleep 30 # wait for dhcp + + echo "Installing UAP Firmware." + wget -O /tmp/marvell_wifi_firmware.tar.gz http://www.spinifex.com.au/plugs/downloads/dreamplug/marvell_wifi_firmware.tar.gz + tar -C /tmp -zxf /tmp/marvell_wifi_firmware.tar.gz + mkdir -p /lib/firmware/mrvl + cp /tmp/lib/firmware/mrvl/* /lib/firmware/mrvl +} + +function create-keys { + echo "Creating Keys." + + echo "Creating SSH keys." + rm /etc/ssh/ssh_host_* + dpkg-reconfigure openssh-server + + echo "Need to create other keys." + # gpg --batch --gen-key + # see http://lists.gnupg.org/pipermail/gnupg-users/2003-March/017376.html +} + +function remove-self { + rm -f /etc/init.d/first-run + rm -f /etc/rc1.d/S01first-run + rm -f /etc/rc2.d/S01first-run + rm /etc/init.d/first-run + rm /etc/rc1.d/S01first-run + rm /etc/rc2.d/S01first-run +} + +create-keys +# wifi-ap-setup + +# the last things we do before quitting. +tweak-kernel +remove-self + +echo "Kernel flashed. Rebooting." +reboot |