(1) Mounted the original ISO to a mountpoint
Code:
mkdir mountpoint
mount -o loop ./systemrescuecd-x86-3.7.1.iso ./mountpoint
(2) Copied all directory structure and files from this mountpoint to a new directory structure
Code:
mkdir ./new_structure
cd ./mountpoint
cp -av * ../new_structure/.
(3) In the copied structure, edited isolinux/isolinux.cfg to add the boot options I wanted:
isolinux.cfg before editing:
Code:
...
TIMEOUT 900
...
LABEL rescuecd_std
MENU LABEL 1) SystemRescueCd: default boot options
KERNEL ifcpu64.c32
APPEND rescue64 scandelay=1 -- rescue32 scandelay=1
TEXT HELP
Boot standard kernel with default options (should always work). You should
use this entry if you don't know which one to use. You can press [TAB] and
add extra boot options after rescue32 or/and rescue64 if required
ENDTEXT
...
isolinux.cfg after editing:
Code:
...
TIMEOUT 50
...
LABEL rescuecd_std
MENU LABEL 1) SystemRescueCd: default boot options
KERNEL ifcpu64.c32
APPEND rescue64 scandelay=1 rootpass=the_new_password setkmap=us dodhcp docache ar_ignorefail ar_nowait -- rescue32 scandelay=1 rootpass=the_new_password setkmap=us dodhcp docache ar_ignorefail ar_nowait
TEXT HELP
Boot standard kernel with default options (should always work). You should
use this entry if you don't know which one to use. You can press [TAB] and
add extra boot options after rescue32 or/and rescue64 if required
ENDTEXT
...
(4) At the root of the copied directory structure, created a new file named "autorun":
Code:
#!/bin/bash
# You must create your "DOMAIN" manually on the freedns website, http://freedns.afraid.org
DOMAIN='my_domain_name.anydns.com'
NAME_SERVER='ns1.afraid.org'
CHECK_URL='http://freedns.afraid.org/dynamic/check.php'
# You must get the "UPDATE_URL" specific for your "DOMAIN" from the freedns website
UPDATE_URL='http://freedns.afraid.org/dynamic/update.php?jhH7*%^JRdik*67VjrLKJ.<Iugy%oKJB:jlhh9y6io75vRGoYB[piJ;IJ_(*y806Ot65lL&ll'
current_ip=`wget -q -O - $CHECK_URL | grep Detected | sed s/[^0-9.]//g`
registered_ip=`nslookup $DOMAIN $NAME_SERVER | tail -2 | grep Address | sed s/[^0-9.]//g`
if [ "$registered_ip" == "" -o "$current_ip" == "" -o "$registered_ip" != "$current_ip" ]
then
wget -q -O /dev/null "$UPDATE_URL"
fi
cat > /usr/bin/checkip <<EOF
#!/bin/bash
wget -q -O - $CHECK_URL | grep Detected | sed s/[^0-9.]//g
EOF
chmod 555 /usr/bin/checkip
cat > /usr/bin/checkdns <<EOF
#!/bin/bash
nslookup $DOMAIN $NAME_SERVER | tail -2 | grep Address | sed s/[^0-9.]//g
EOF
chmod 555 /usr/bin/checkdns
cat > /usr/bin/updatedns <<EOF
#!/bin/bash
wget -q -O /dev/null "$UPDATE_URL"
EOF
chmod 555 /usr/bin/updatedns
exit 0
5) Made the new autorun file executable ("chmod 555 ./autorun")
6) Created a new ISO image from the copied/modified directory structure:
Code:
mkisofs -o /tmp/custom_sysrescuecd.iso \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-J \
-R \
-V custom_sysrescuecd \
.
7) Burned the new ISO to a CD (I used Brasero, but could have done it from the commandline using cdrecord, wodim, etc.)