tazlito rev 13

pave the road to flavors. Handle package provided hooks during gen-distro
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 11 19:17:15 2007 +0100 (2007-12-11)
parents 15a98c96f18f
children d112006c4f76
files tazlito
line diff
     1.1 --- a/tazlito	Tue Dec 11 19:15:58 2007 +0100
     1.2 +++ b/tazlito	Tue Dec 11 19:17:15 2007 +0100
     1.3 @@ -111,6 +111,17 @@
     1.4  	done
     1.5  }
     1.6  
     1.7 +# exec hooks provided by some packages
     1.8 +genisohooks()
     1.9 +{
    1.10 +	local here=`pwd`
    1.11 +	cd $ROOTFS
    1.12 +	for i in $(ls etc/tazlito/*.$1 2> /dev/null); do
    1.13 +		. $i $ROOTCD
    1.14 +	done
    1.15 +	cd $here
    1.16 +}
    1.17 +
    1.18  # Check if user is root.
    1.19  check_root()
    1.20  {
    1.21 @@ -124,8 +135,8 @@
    1.22  # Check for the rootfs tree.
    1.23  check_rootfs()
    1.24  {
    1.25 -	if [ ! -d "$ROOTFS" ] ; then
    1.26 -		echo -e "\nUnable to find a distro rootfs to check.\n"
    1.27 +	if [ ! -d "$ROOTFS/etc" ] ; then
    1.28 +		echo -e "\nUnable to find a distro rootfs...\n"
    1.29  		exit 0
    1.30  	fi
    1.31  }
    1.32 @@ -142,6 +153,8 @@
    1.33  # Gen a new ISO image using isolinux.
    1.34  gen_livecd_isolinux()
    1.35  {
    1.36 +	# Some packages may want to alter iso
    1.37 +	genisohooks iso
    1.38  	if [ ! -f "$ROOTCD/boot/isolinux/isolinux.bin" ] ; then
    1.39  		echo -e "\nUnable to find isolinux binary.\n"
    1.40  		exit 0
    1.41 @@ -160,6 +173,8 @@
    1.42  # Gen a new initramfs from the root file system.
    1.43  gen_initramfs()
    1.44  {
    1.45 +	# Some packages may want to alter rootfs
    1.46 +	genisohooks rootfs
    1.47  	cd $ROOTFS
    1.48  	echo ""
    1.49  	# Use lzma if installed