livecd: remaster/livecd_chroot (NEW) - small poldek/chroot helper

havner havner at pld-linux.org
Tue Oct 17 11:15:11 CEST 2006


Author: havner                       Date: Tue Oct 17 09:15:11 2006 GMT
Module: livecd                        Tag: HEAD
---- Log message:
- small poldek/chroot helper

---- Files affected:
livecd/remaster:
   livecd_chroot (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: livecd/remaster/livecd_chroot
diff -u /dev/null livecd/remaster/livecd_chroot:1.1
--- /dev/null	Tue Oct 17 11:15:11 2006
+++ livecd/remaster/livecd_chroot	Tue Oct 17 11:15:06 2006
@@ -0,0 +1,60 @@
+#!/bin/sh
+# Lukasz Pawelczyk <havner at pld-linux.org> 2005
+# $Id$
+
+. /etc/rc.d/init.d/functions-live
+
+POLDEK_OPTS=
+CHROOT=
+POLDEK=
+UPDATE=
+
+load_config
+
+usage() {
+	echo "--chroot, -c	- chroot to livecd"
+	echo "--poldek, -p	- run poldek on chroot system"
+	echo "--update, -u	- run poldek --upa on defined sources"
+}
+
+while [ "$#" -gt "0" ]; do
+	case "$1" in
+		--chroot | -c )
+		CHROOT=yes
+		shift
+		;;
+		--poldek | -p )
+		POLDEK=yes
+		shift
+		;;
+		--update | -u )
+		UPDATE=yes
+		shift
+		;;
+		--help )
+		usage
+		exit 1
+		;;
+		* )
+		echo "Unknown parameter"
+		exit 1
+		;;
+	esac
+done
+
+if [ "$CHROOT" = "yes" ]; then
+	chroot $ROOTFS /bin/bash --login
+	exit $?
+fi
+
+if [ "$POLDEK" = "yes" ]; then
+	poldek $POLDEK_OPTS --root="$ROOTFS" --uniq
+	exit $?
+fi
+
+if [ "$UPDATE" = "yes" ]; then
+	poldek $POLDEK_OPTS --upa
+	exit $?
+fi
+
+usage
================================================================


More information about the pld-cvs-commit mailing list