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/bin/finalize | |
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/bin/finalize')
-rwxr-xr-x | freedom-maker/bin/finalize | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/freedom-maker/bin/finalize b/freedom-maker/bin/finalize new file mode 100755 index 0000000..9995b77 --- /dev/null +++ b/freedom-maker/bin/finalize @@ -0,0 +1,65 @@ +#! /bin/bash +# +# Copyright 2011 by Bdale Garbee <bdale@gag.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +# based on work by <ivan@sanchezortega.es>, who released his script under +# the following license terms: +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# As long as you retain this notice you can do whatever you want with +# this stuff. If we meet some day, and you think this stuff is worth it, +# you can buy me a beer in return. +# ---------------------------------------------------------------------------- + +# finalize +# +# Readies the root filesystem to silently complete package +# configuration on the first boot-up. + +# We don't tolerate errors. +set -e + +# Until udev is configured and run for the first time, dev nodes won't be created, but we need some basic ones for spawning a console (console) and creating RSA keys for SSH (urandom). +echo "Creating basic device nodes" +mknod $target/dev/console c 5 1 +mknod $target/dev/random c 1 8 +mknod $target/dev/urandom c 1 9 +mknod $target/dev/null c 1 3 +mknod $target/dev/ptmx c 5 2 + +# Set up hostname +echo "Setting up hostname." +echo $hostname > $target/etc/hostname + +# prepare to copy, when we do it later. +chown root:root $target/sbin/copy2dream +chmod 744 $target/sbin/copy2dream + +# prepare chroot project finalization +cp bin/projects-chroot $target/ + +echo "Using qemu-user-static to perform first-boot configuration now." +chmod 755 $target/install.sh +cp /usr/bin/qemu-arm-static $target/usr/bin +echo "Running install script from source/install.sh" +chroot $target /install.sh +echo "Running install script from bin/projects-chroot" +chroot $target /projects-chroot + +# clean up. +rm "${target}/projects-chroot" +rm "${target}/usr/bin/qemu-arm-static" |