# HG changeset patch # User Pascal Bellard # Date 1197397035 -3600 # Node ID 685b1188fff4048b44289ce92b9ada790e9db960 # Parent 15a98c96f18f5640c6306804cc60b96d36b9165f pave the road to flavors. Handle package provided hooks during gen-distro diff -r 15a98c96f18f -r 685b1188fff4 tazlito --- a/tazlito Tue Dec 11 19:15:58 2007 +0100 +++ b/tazlito Tue Dec 11 19:17:15 2007 +0100 @@ -111,6 +111,17 @@ done } +# exec hooks provided by some packages +genisohooks() +{ + local here=`pwd` + cd $ROOTFS + for i in $(ls etc/tazlito/*.$1 2> /dev/null); do + . $i $ROOTCD + done + cd $here +} + # Check if user is root. check_root() { @@ -124,8 +135,8 @@ # Check for the rootfs tree. check_rootfs() { - if [ ! -d "$ROOTFS" ] ; then - echo -e "\nUnable to find a distro rootfs to check.\n" + if [ ! -d "$ROOTFS/etc" ] ; then + echo -e "\nUnable to find a distro rootfs...\n" exit 0 fi } @@ -142,6 +153,8 @@ # Gen a new ISO image using isolinux. gen_livecd_isolinux() { + # Some packages may want to alter iso + genisohooks iso if [ ! -f "$ROOTCD/boot/isolinux/isolinux.bin" ] ; then echo -e "\nUnable to find isolinux binary.\n" exit 0 @@ -160,6 +173,8 @@ # Gen a new initramfs from the root file system. gen_initramfs() { + # Some packages may want to alter rootfs + genisohooks rootfs cd $ROOTFS echo "" # Use lzma if installed