[Debian-live-changes] r2295 - people/matth

matth-guest at alioth.debian.org matth-guest at alioth.debian.org
Sat Jun 30 01:14:33 UTC 2007


Author: matth-guest
Date: 2007-06-30 01:14:33 +0000 (Sat, 30 Jun 2007)
New Revision: 2295

Added:
   people/matth/live-sysvinit-http-gpg-hook.patch
Log:
adds in live-sysvinit live_profile.sh for bootstraping the http/gpg code
from init.d


Added: people/matth/live-sysvinit-http-gpg-hook.patch
===================================================================
--- people/matth/live-sysvinit-http-gpg-hook.patch	                        (rev 0)
+++ people/matth/live-sysvinit-http-gpg-hook.patch	2007-06-30 01:14:33 UTC (rev 2295)
@@ -0,0 +1,79 @@
+diff -urN live-sysvinit/debian/rules live-sysvinit.new/debian/rules
+--- live-sysvinit/debian/rules	2007-06-30 02:29:08.000000000 +0200
++++ live-sysvinit.new/debian/rules	2007-06-29 23:20:42.000000000 +0200
+@@ -39,6 +39,7 @@
+ 	dh_install
+ 	dh_installinit --name apt-upgrade --onlyscripts --no-restart-on-upgrade --no-start -- start 99 2 6 .
+ 	dh_installinit --name iptables --onlyscripts --no-restart-on-upgrade --no-start -- start 99 2 6 .
++	dh_installinit --name live-profile.sh --onlyscripts --no-restart-on-upgrade --no-start -- start 19 2 6 .
+ 	dh_compress
+ 	dh_fixperms
+ 	dh_installdeb
+diff -urN live-sysvinit/scripts/live-profile.sh live-sysvinit.new/scripts/live-profile.sh
+--- live-sysvinit/scripts/live-profile.sh	1970-01-01 01:00:00.000000000 +0100
++++ live-sysvinit.new/scripts/live-profile.sh	2007-06-30 01:46:19.000000000 +0200
+@@ -0,0 +1,64 @@
++#!/bin/sh
++#
++# Debian-Live init.d bootstrap code that fetches
++# and executes the real init payload from an http share.
++#
++# you need to add to the bootappend something like "liveprofile=http://server/path"
++# the GPG symmetrical encrypted profile is supposed (for now) to be like
++# ${hostname}-sysvinit.tar.gz.gpg and contain at least a script called live-startup.sh
++# that just call optionally others
++#
++# External deps : gpg, wget
++#
++# -- Mathieu GELI <mathieu.geli at gmail.com>
++
++PROFILE_PATH=`cat /proc/cmdline | perl -ne 'm/liveprofile=(\S+)/ and print $1'`
++
++if [ -z "$PROFILE_PATH" ]; then
++    echo "No profile url path indicated, leaving."
++    exit 1
++fi
++
++PROFILE_GPG="`hostname -s`-sysvinit.tar.gz.gpg"
++PROFILE_TAR="`basename \"${PROFILE_GPG}\" .gpg`"
++TMP_DIR=`mktemp -d /tmp/debian-live.XX` || exit 4
++
++# gets the gpg file from http, decypher, uncompress and executes live-startup.sh
++case "$1" in
++    start)
++	cd ${TMP_DIR}
++	echo "Retrieving live profile"
++	wget --quiet ${PROFILE_PATH}/${PROFILE_GPG}
++	if [ $? != 0 ]; then
++	    echo "wget: Failed to download profile"
++	    exit 2
++	fi
++	echo "Decyphering profile"
++	printf "Enter GPG passphrase: "
++	read -s passphrase
++	echo 
++	gpg --home /root --no-default-keyring --output  ${PROFILE_TAR} --passphrase ${passphrase} --decrypt ${PROFILE_GPG}
++	
++	if [ $? != 0 ]; then
++	    echo "gpg: Failed to decypher the profile, error: $?"
++	    exit 3
++	fi
++
++	echo "Uncompressing profile"
++	tar zxvf ${PROFILE_TAR} >/dev/null
++
++	echo "Bootstraping init code"
++	. live_startup.sh
++	# cleaning up stuff
++	#cd ${OLDPWD}
++        #rm -fr ${TMP_DIR}
++
++	;;
++
++    stop)
++	break
++	;;
++    *)
++	echo "$0 start"
++	;;
++esac




More information about the Debian-live-changes mailing list