Path/logic problems with ISO customization script

You can report problems, make suggestions, about the new BETA versions in this forum. For stuff related to final releases, please post a message in other forums
Post Reply
BenKlingon
Posts: 1
Joined: 21 Oct 2011, 22:32

Path/logic problems with ISO customization script

Post by BenKlingon » 21 Oct 2011, 22:38

I had trouble with the customization script included in the stable and beta versions. The 'extract' 'squashfs' 'setkmap' 'isogen' functions had issues.

The problems seem to stem from the df command not working correctly when the /mnt/custom device is of the 'bind' mount type, and that some syslinux/isolinux files/directories have changed naming.

This is the diff that allowed the program to create a remastered ISO correctly in my setup, hopefully it will help someone else:

Code: Select all

--- /usr/sbin/sysresccd-custom  2011-09-30 18:47:56.000000000 +0000
+++ /mnt/tmp/WORK/sysresccd-custom      2011-10-21 20:59:15.000000000 +0000
@@ -90,7 +90,8 @@
 # $1 == MB required by the function
 check_freespace()
 {
-       SIZE=`(\df -m -P /mnt/custom) | grep " /mnt/custom$" | tail -n 1 | awk '{print $4}'`
+       #SIZE=`(\df -m -P /mnt/custom) | grep " /mnt/custom$" | tail -n 1 | awk '{print $4}'`
+       SIZE=`(\df -m -P /mnt/custom) | tail -n 1 | awk '{print $4}'`
 
        if [ $SIZE -gt $1 ]
        then
@@ -113,7 +114,7 @@
 do_extract()
 {
        # ---- check the original contents
-       for curfile in /livemnt/boot/sysrcd.dat /livemnt/boot/sysrcd.md5 /livemnt/boot/isolinux/rescuecd
+       for curfile in /livemnt/boot/sysrcd.dat /livemnt/boot/sysrcd.md5 /livemnt/boot/syslinux/rescuecd
        do
                if [ ! -f "${curfile}" ]
                then
@@ -126,7 +127,7 @@
        rm -rf /mnt/custom/customcd/isoroot/*
        
        # ---- copy critical files and directories
-       for curfile in version isolinux
+       for curfile in version syslinux
        do
                cp -a /livemnt/boot/${curfile} /mnt/custom/customcd/isoroot/ || die "copy: cannot copy ${curfile} to /mnt/custom/customcd/isoroot/"
        done
@@ -196,16 +197,16 @@
                die "do_setkmap: you must specify the keymap you want to use (eg: \"$0 setkmap uk\")"
        fi
 
-       if [ ! -d "/mnt/custom/customcd/isoroot/isolinux" ]
+       if [ ! -d "/mnt/custom/customcd/isoroot/syslinux" ]
        then
                die "do_setkmap: you have to run command copy before setkmap"
        fi
 
        echo "Keymap to be loaded: ${KEYMAP}"
 
-       # Set keymap in isolinux.cfg
-       cp /mnt/custom/customcd/isoroot/isolinux/isolinux.cfg /mnt/custom/customcd/isoroot/isolinux/isolinux.bak
-       sed -i -r -e "s: setkmap=[a-z0-9]+::g ; s:APPEND:APPEND setkmap=${KEYMAP}:gi" /mnt/custom/customcd/isoroot/isolinux/isolinux.cfg
+       # Set keymap in syslinux.cfg
+       cp /mnt/custom/customcd/isoroot/syslinux/syslinux.cfg /mnt/custom/customcd/isoroot/syslinux/syslinux.bak
+       sed -i -r -e "s: setkmap=[a-z0-9]+::g ; s:APPEND:APPEND setkmap=${KEYMAP}:gi" /mnt/custom/customcd/isoroot/syslinux/syslinux.cfg
 } 
 
 ## MAIN FUNCTIONS: Create the new ISO image
@@ -226,7 +227,7 @@
        mkdir -p /mnt/custom/customcd/isofile/
        rm -rf /mnt/custom/customcd/isofile/*.iso
 
-       if [ ! -d "/mnt/custom/customcd/isoroot/isolinux" ]
+       if [ ! -d "/mnt/custom/customcd/isoroot/syslinux" ]
        then
                die "do_isogen: you must create a squashfs filesystem before you run isogen"
        fi
@@ -236,7 +237,7 @@
        echo "Volume name of the CDRom: ${ISO_VOLUME}"
 
        cmd="mkisofs -J -l -o /mnt/custom/customcd/isofile/sysresccd-${curtime}.iso \
-               -b isolinux/isolinux.bin -c isolinux/boot.cat -input-charset utf-8 \
+               -b syslinux/isolinux.bin -c syslinux/boot.cat -input-charset utf-8 \
                -no-emul-boot -boot-load-size 4 -boot-info-table \
                -V '${ISO_VOLUME}' /mnt/custom/customcd/isoroot"
        ${cmd}


gernot
Posts: 1130
Joined: 07 Apr 2010, 16:19

Re: Path/logic problems with ISO customization script

Post by gernot » 22 Oct 2011, 07:36

looks like you customize a USB stick installation (syslinux).
Your changes break customizing from CD (isolinux).

In some cases its possible to replace syslinux or isolinux with ???linux to match both cases.

Second problem is that your custom ISO don't boot from CD.

Gernot

Post Reply