livecd: functions-live, installer/installer.sh, remaster/livecd_cr...

havner havner at pld-linux.org
Wed Jul 12 12:53:12 CEST 2006


Author: havner                       Date: Wed Jul 12 10:53:12 2006 GMT
Module: livecd                        Tag: HEAD
---- Log message:
- changed configuration handling a little
- started to add parameters to gen_iso

---- Files affected:
livecd:
   functions-live (1.18 -> 1.19) 
livecd/installer:
   installer.sh (1.116 -> 1.117) 
livecd/remaster:
   livecd_create (1.4 -> 1.5) , livecd_gen_initrd (1.15 -> 1.16) , livecd_gen_iso (1.22 -> 1.23) , livecd_remaster_config (1.6 -> 1.7) , livecd_remaster_prep (1.16 -> 1.17) 

---- Diffs:

================================================================
Index: livecd/functions-live
diff -u livecd/functions-live:1.18 livecd/functions-live:1.19
--- livecd/functions-live:1.18	Tue Jul 11 14:22:08 2006
+++ livecd/functions-live	Wed Jul 12 12:53:07 2006
@@ -1,8 +1,6 @@
 # Lukasz Pawelczyk <havner at pld-linux.org> 2004
 # $Id$
 
-LIVECD_VERSION=1.0-rc4
-
 SYMLINKS="
 /etc/X11/WindowMaker
 /etc/X11/gdm
@@ -142,40 +140,31 @@
 fi
 }
 
-check_config() {
+load_config() {
+
+# default values for all livecd remaster scripts
+MAINDIR=~/LIVECD
+CD=$MAINDIR/CD
+INITRD=$MAINDIR/INITRD
+ROOTFS=$MAINDIR/ROOTFS
+ISODIR=$MAINDIR
+SQUASHFS=$MAINDIR/SQUASHFS
+MNT_CDROM=/media/cdrom
+MNT_INITRD=$MAINDIR/mnt_initrd
+MNT_SQUASHFS=$MAINDIR/mnt_squashfs
+LIVECD_VERSION="PLD LiveCD remastered"
+
 if [ -n "$HOME_ETC" -a -f "$HOME_ETC/.livecd_remaster" ]; then
 	. $HOME_ETC/.livecd_remaster
 elif [ -f ~/.livecd_remaster ]; then
 	. ~/.livecd_remaster
-elif [ "$1" = "create" ]; then
-	echo "There is no config file in your home or \$HOME_ETC dir, creating."
-	if [ -d "$HOME_ETC" ]; then
-		P=$HOME_ETC/.livecd_remaster
-	else
-		P=~/.livecd_remaster
-	fi
-	cat >> "$P" << EOF
-# main
-MAINDIR=~/LIVECD
-CD=\$MAINDIR/CD
-INITRD=\$MAINDIR/INITRD
-ROOTFS=\$MAINDIR/ROOTFS
-ISODIR=\$MAINDIR		# generated iso will be placed here
-
-# temp
-SQUASHFS=\$MAINDIR/SQUASHFS
-
-# remaster_prep
-MNT_CDROM=/media/cdrom
-MNT_INITRD=\$MAINDIR/mnt_initrd
-MNT_SQUASHFS=\$MAINDIR/mnt_squashfs
-EOF
-	echo "$P generated. Please have a look at this file"
-	echo "and read README before using this script."
-	exit 1
 else
 	echo "There is no config file in your home or \$HOME_ETC dir."
-	exit 1
+	echo "Default values has been loaded."
+fi
+
+if [ "$1" = "nocheck" ]; then
+	return
 fi
 
 [ -d "$MAINDIR" ]	|| (echo "Main dir: \"$MAINDIR\" does not exist."; exit 1)
@@ -194,7 +183,7 @@
 
 check_deps() {
 while [ "$#" != "0" ]; do
-	if [ ! -f "$ROOTFS/$1" -a ! -f "`chroot $ROOTFS which $1`" ]; then
+	if [ ! -f "$ROOTFS/$1" -a ! -f "`chroot $ROOTFS which $1 2>/dev/null`" ]; then
 		echo "Install $1 before running this script."
 		FAIL=true
 	fi
@@ -205,7 +194,7 @@
 
 check_deps_local() {
 while [ "$#" != "0" ]; do
-	if [ ! -f "$1" -a ! -f "`which $1`" ]; then
+	if [ ! -f "$1" -a ! -f "`which $1 2>/dev/null`" ]; then
 		echo "Install $1 before running this script."
 		FAIL=true
 	fi

================================================================
Index: livecd/installer/installer.sh
diff -u livecd/installer/installer.sh:1.116 livecd/installer/installer.sh:1.117
--- livecd/installer/installer.sh:1.116	Fri Jan 27 02:03:29 2006
+++ livecd/installer/installer.sh	Wed Jul 12 12:53:07 2006
@@ -5,7 +5,7 @@
 . /etc/rc.d/init.d/functions-live
 
 INSTALLER_ID='$Id$'
-LIVECD_TOP="PLD LiveCD $LIVECD_VERSION $INSTALLER_ID"
+LIVECD_TOP="PLD LiveCD $INSTALLER_ID"
 LIVECD_BANNER="PLD LiveCD Installer"
 
 # give it $npart, it will return $gpart

================================================================
Index: livecd/remaster/livecd_create
diff -u livecd/remaster/livecd_create:1.4 livecd/remaster/livecd_create:1.5
--- livecd/remaster/livecd_create:1.4	Tue Jul  4 14:32:04 2006
+++ livecd/remaster/livecd_create	Wed Jul 12 12:53:07 2006
@@ -5,7 +5,7 @@
 
 . /etc/rc.d/init.d/functions-live
 
-check_config
+load_config
 
 cd $ROOTFS
 

================================================================
Index: livecd/remaster/livecd_gen_initrd
diff -u livecd/remaster/livecd_gen_initrd:1.15 livecd/remaster/livecd_gen_initrd:1.16
--- livecd/remaster/livecd_gen_initrd:1.15	Tue Jul 11 14:49:33 2006
+++ livecd/remaster/livecd_gen_initrd	Wed Jul 12 12:53:08 2006
@@ -1,11 +1,12 @@
 #!/bin/sh
 # Adam Gołębiowski <adamg at pld-linux.org> 2005
+# Lukasz Pawelczyk <havner at pld-linux.org> 2005
 # $Id$
 
 . /etc/rc.d/init.d/functions-live
 
 check_root
-check_config
+load_config
 check_deps initrd-busybox genromfs /usr/share/pci-database/ide.pci /boot/memtest86+ /usr/lib/syslinux/isolinux.bin
 
 cd $INITRD/lib/modules

================================================================
Index: livecd/remaster/livecd_gen_iso
diff -u livecd/remaster/livecd_gen_iso:1.22 livecd/remaster/livecd_gen_iso:1.23
--- livecd/remaster/livecd_gen_iso:1.22	Tue Jul 11 14:49:33 2006
+++ livecd/remaster/livecd_gen_iso	Wed Jul 12 12:53:08 2006
@@ -5,10 +5,38 @@
 # Source function library
 . /etc/rc.d/init.d/functions-live
 
+# parameters variables (can be added to ~/.livecd_remaster)
+NOSQUASHFS=
+LOCALES_UPDATE=
+SYMLINKS=
+
 check_root
-check_config
+load_config
 check_deps_local busybox mkisofs mksquashfs
 
+usage() {
+	echo "--nosquashfs, -ns		- dont recreate squashfs"
+	echo "--locales-update, -lu	- update locales inside rootfs (localedb)"
+	echo "--symlinks, -s		- update livecd symlinks"
+}
+
+while [ "$#" -gt "0" ]; do
+	case "$1" in
+		--nosquash | -ns )
+		NOSQUASHFS=yes
+		shift
+		;;
+		--help )
+		usage
+		exit 1
+		;;
+		* )
+		echo "Unknown parameter"
+		exit 1
+		;;
+	esac
+done
+
 fix_dirs() {
 rmdir $ROOTFS/bin 
 rmdir $ROOTFS/sbin 
@@ -72,14 +100,16 @@
 [ "$?" != 0 ] && echo fail && exit 1
 echo done
 
-echo "Generating squashfs... "
-rm -rf $CD/pldcd
-mksquashfs $SQUASHFS/ $CD/pldcd #-info
-[ "$?" != 0 ] && echo fail && exit 1
-chmod 644 $CD/pldcd
-cd $CD
-md5sum pldcd > $CD/pldcd.md5
-echo done
+if [ ! "$NOSQUASHFS" = "yes" ]; then
+	echo "Generating squashfs... "
+	rm -rf $CD/pldcd
+	mksquashfs $SQUASHFS/ $CD/pldcd #-info
+	[ "$?" != 0 ] && echo fail && exit 1
+	chmod 644 $CD/pldcd
+	cd $CD
+	md5sum pldcd > $CD/pldcd.md5
+	echo done
+fi
 
 rmdir $ROOTFS/bin 
 rmdir $ROOTFS/sbin 
@@ -101,7 +131,7 @@
 echo "Generating pldcd.iso... "
 rm -f $MAINDIR/pldcd.iso
 cd $CD
-mkisofs -J -R -V "PLD Live CD ${LIVECD_VERSION}" -o $ISODIR/pldcd.iso \
+mkisofs -J -R -V "$LIVECD_VERSION" -o $ISODIR/pldcd.iso \
 -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
 -no-emul-boot -boot-load-size 4 -boot-info-table .
 [ "$?" != 0 ] && echo fail && exit 1

================================================================
Index: livecd/remaster/livecd_remaster_config
diff -u livecd/remaster/livecd_remaster_config:1.6 livecd/remaster/livecd_remaster_config:1.7
--- livecd/remaster/livecd_remaster_config:1.6	Mon Feb 27 17:28:48 2006
+++ livecd/remaster/livecd_remaster_config	Wed Jul 12 12:53:08 2006
@@ -12,3 +12,5 @@
 MNT_CDROM=/media/cdrom
 MNT_INITRD=$MAINDIR/mnt_initrd
 MNT_SQUASHFS=$MAINDIR/mnt_squashfs
+
+LIVECD_VERSION="PLD LiveCD remastered"

================================================================
Index: livecd/remaster/livecd_remaster_prep
diff -u livecd/remaster/livecd_remaster_prep:1.16 livecd/remaster/livecd_remaster_prep:1.17
--- livecd/remaster/livecd_remaster_prep:1.16	Mon Jul 10 16:10:48 2006
+++ livecd/remaster/livecd_remaster_prep	Wed Jul 12 12:53:08 2006
@@ -2,13 +2,14 @@
 # Lukasz Pawelczyk <havner at pld-linux.org> 2004
 # $Id$
 
-#TODO: make 'mount --bind' compatible
+# TODO: big update on this one
+# TODO: make 'mount --bind' compatible
 
 # Source function library
 . /etc/rc.d/init.d/functions-live
 
 check_root
-check_config create
+load_config nocheck
 
 if [ -d "$MAINDIR" ]; then
 	echo "$MAINDIR already exists."
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/livecd/functions-live?r1=1.18&r2=1.19&f=u
    http://cvs.pld-linux.org/livecd/installer/installer.sh?r1=1.116&r2=1.117&f=u
    http://cvs.pld-linux.org/livecd/remaster/livecd_create?r1=1.4&r2=1.5&f=u
    http://cvs.pld-linux.org/livecd/remaster/livecd_gen_initrd?r1=1.15&r2=1.16&f=u
    http://cvs.pld-linux.org/livecd/remaster/livecd_gen_iso?r1=1.22&r2=1.23&f=u
    http://cvs.pld-linux.org/livecd/remaster/livecd_remaster_config?r1=1.6&r2=1.7&f=u
    http://cvs.pld-linux.org/livecd/remaster/livecd_remaster_prep?r1=1.16&r2=1.17&f=u



More information about the pld-cvs-commit mailing list