vi binary/isolinux/isolinux.cfg
ui menu.c32-boot-info-table -o remaster.iso binary
live-run script:
#!/bin/bash
live_param_file="/proc/cmdline"
live_param_list="$(grep -Ewo "live_run[[:digit:]]*" $live_param_file | uniq | sort -V)"
live_param_list="$(echo $live_param_list)"
if [ -z "$live_param_list" ]; then
exit 1
else
echo "Found live_run* parameter in boot parameters and the order to run: $live_param_list" >> /var/log/syslog
mod_live_param_file="$(mktemp /tmp/mod_live_command.XXXXXX)"
fi
for live_param in $live_param_list; do
if LC_ALL=C grep -Eq "($live_param=\"|$live_param=\\\\\")" $live_param_file; then
# For case like live_run="sleep 5" or live_run=\"sleep 5\"
LC_ALL=C grep -oE -- "$live_param=(\"|\\\\\")[^\"]*(\"|\\\\\")([[:space:]]|$)+" $live_param_file | sed -r -e "s|=\\\\\"|=\"|g" -e "s@\\\\\"([[:space:]]|$)+@\"@g" | sed -r -e 's|^\"(.*)=|\1=\"|g' >> $mod_live_param_file
elif LC_ALL=C grep -Eq "\"$live_param=" $live_param_file; then
# For case live: "live_run=sleep 5", "live_run1=mount UUID=XXXYYZZ /mnt"
LC_ALL=C grep -oE -- "\"$live_param=[^\"]*\"([[:space:]]|$)+" $live_param_file | sed -r -e "s|=\\\\\"|=\"|g" -e "s@\\\\\"([[:space:]]|$)+@\"@g" | sed -r -e 's|^\"(.*=)(.*=.*)*|\1\"\2|g' >> $mod_live_param_file
else
# For case like xxx=xyz, no space in its assignment
LC_ALL=C grep -oE -- "$live_param=([[:alnum:]]|_|-|\.|\/|:)*([[:space:]]|$)+" $live_param_file >> $mod_live_param_file
fi
done
. $mod_live_param_file
for live_param in $live_param_list; do
eval live_command=\$$live_param
if [ -n "$live_command" ]; then
echo "Now run \"$live_param\": $live_command..." >> /var/log/syslog
if [ "$(LANG=C file -Ls "$live_command" 2>/dev/null | grep -iE "shell script")" ]; then
$live_command
else
eval $live_command
fi
fi
done
[ -f "$mod_live_param_file" ] && rm -f $mod_live_param_file