Here is an untested patch against bzr casper-debian as of today...
It implements ( tftp and http methods for getting a squashfs into the initramfs)
Regards
Alex Owen
On 22/02/07, Alex Owen <[EMAIL PROTECTED]> wrote:
Hi,
Clever idea... I like it!
I have a slight modification of the idea...
Casper could used tftp (busybox is in casper initrd and has tftp
builtin) to pull the suqashfs from the PXE/tftp server. This would
mean that the initrd would not need to be modified to include the
squashfs.
make-live -t net --filesystem squashfs
Would then generate the needed files (a -t tftp method could be added
to make-live later).
The idea could be extended further so that squashfs could be pulled
from http as well as tftp. Busy box has both "wget" and "tftp" so we
could use frominitrd=<method>://<server>/path/to/squashfs
<method> could be "tftp" or "http"
Anyway those are my random thoughts... may be one weekend I'll have
time to put a patch together but I won't mind if someone beats me to
it!
Bye for now
Alex Owen
=== modified file 'scripts/casper'
--- scripts/casper 2007-02-16 16:54:16 +0000
+++ scripts/casper 2007-02-25 22:44:01 +0000
@@ -51,6 +51,8 @@
export ACCESS=${x#access=} ;;
xdebconf)
export XDEBCONF="Yes" ;;
+ toram=*)
+ export TORAM=${x#toram=} ;;
toram)
export TORAM="Yes" ;;
todisk=*)
@@ -189,10 +191,28 @@
copy_live_to() {
copyfrom="${1}"
copytodev="${2}"
+
+ copymethod=${copyfrom%%:*}
+ if [ "$copymethod" -a "$copymethod" != "$copyfrom" ] ; then
+ copypath=${copyfrom##*://}
+ copyserver=${copypath%%/*}
+ copypath=${copyfrom##*://$copyserver}
+ copyfile=${copypath##*/}
+ copyfrom=/casper
+ if [ "$copymethod" = "tftp" ] ; then
+ bytes=$( tftp $copyserver -g -r $copypath -l /proc/self/fd/1 2>/dev/null | wc -c )
+ size=$(( $bytes / 1024 +1))
+ elif [ "$copymethod" = "http" ] ; then
+ bytes=$( wget http://${copyserver}${copypath} -O- 2>/dev/null | wc -c )
+ size=$(( $bytes / 1024 +1))
+ fi
+ else
+ copymethod=""
+ size=$(fs_size "" ${copyfrom} "used")
+ fi
+
copyto="${copyfrom}_swap"
- size=$(fs_size "" ${copyfrom} "used")
-
if [ "${copytodev}" = "ram" ]; then
# copying to ram:
freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ) )
@@ -221,8 +241,14 @@
mkdir "${copyto}"
echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
- cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
- umount ${copyfrom}
+ if [ "$copymethod" = "tftp" ] ; then
+ tftp $copyserver -g -r $copypath -l ${copyto}/${copyfile}
+ elif [ "$copymethod" = "http" ] ; then
+ wget http://${copyserver}${copypath} -O${copyto}/${copyfile}
+ else
+ cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
+ umount ${copyfrom}
+ fi
mount -r -o move ${copyto} ${copyfrom}
rmdir ${copyto}
return 0
@@ -605,7 +631,15 @@
set_usplash_timeout
- if [ ! -z "${NETBOOT}" ]; then
+ if [ "${TORAM}" -a "${TORAM}" != "Yes" ]; then
+ copy_live_to "TORAM" "ram"
+ unset TORAM
+ fi
+
+
+ if is_casper_path "" ; then
+ livefs_root="${mountpoint}"
+ elif [ ! -z "${NETBOOT}" ]; then
if do_netmount ; then
livefs_root="${mountpoint}"
else
_______________________________________________
Debian-live-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel