Hi guys! Here's a small patch for the Casper scripts that adds the live-media-offset=<bytes> boot option, which allows you to specify (you got it) an offset at which the live-media is...
For example, if you want to "hide" the Debian Live ISO after a visible ISO containing only some documentation files (like Sun Microsystems did with their Solaris 8 for Intel - and possibly others - install CD), all you have to do is add it to the isolinux.cfg file, like: default linux label linux kernel vmlinuz append initrd=initrd.gz boot=casper live-media-offset=6400000 This is in case the visible ISO is 6.2MB big (3125 sectors) and the hidden Debian Live ISO right after it. -- Sébastien Raveau computer and network security student head of the hawKeye network monitor project http://hawkeye.sourceforge.net/
diff -c -r scripts.orig/casper scripts/casper
*** scripts.orig/casper 2006-11-28 13:52:10.000000000 +0100
--- scripts/casper 2006-11-28 13:51:47.000000000 +0100
***************
*** 68,73 ****
--- 68,75 ----
export LIVEMEDIA=${x#bootfrom=} ;;
live-media=*)
export LIVEMEDIA=${x#live-media=} ;;
+ live-media-offset=*)
+ export LIVEMEDIA_OFFSET=${x#live-media-offset=} ;;
live-media-timeout=*)
export LIVEMEDIA_TIMEOUT=${x#live-media-timeout=} ;;
debian-installer/locale=*)
***************
*** 472,477 ****
--- 474,483 ----
if [ -z "${devname}" ]; then
devname=$(sys2dev "${sysdev}")
fi
+ if [ -n "${LIVEMEDIA_OFFSET}" ]; then
+ loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVEMEDIA_OFFSET}")
+ devname="${loopdevname}"
+ fi
fstype=$(get_fstype "${devname}")
if is_supported_fs ${fstype}; then
mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
***************
*** 482,487 ****
--- 488,496 ----
umount $mountpoint
fi
fi
+ if [ -n "${LIVEMEDIA_OFFSET}" ]; then
+ losetup -d "${loopdevname}"
+ fi
return 1
}
diff -c -r scripts.orig/casper-helpers scripts/casper-helpers
*** scripts.orig/casper-helpers 2006-11-28 13:52:20.000000000 +0100
--- scripts/casper-helpers 2006-11-28 13:51:47.000000000 +0100
***************
*** 110,115 ****
--- 110,116 ----
local fspath=$1
local module=$2
local pattern=$3
+ local offset=$4
modprobe "${MP_QUIET}" -b "$module"
udevsettle
***************
*** 117,123 ****
for loopdev in $pattern; do
if [ "$(cat $loopdev/size)" -eq 0 ]; then
dev=$(sys2dev "${loopdev}")
! losetup "$dev" "$fspath"
echo "$dev"
return 0
fi
--- 118,128 ----
for loopdev in $pattern; do
if [ "$(cat $loopdev/size)" -eq 0 ]; then
dev=$(sys2dev "${loopdev}")
! if [ -n "$offset" ]; then
! losetup -o "$offset" "$dev" "$fspath"
! else
! losetup "$dev" "$fspath"
! fi
echo "$dev"
return 0
fi
pgpup2AfJWadk.pgp
Description: PGP signature
_______________________________________________ Debian-live-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel

