diff options
| author | Michal Suchanek <hramrach@centrum.cz> | 2008-06-09 17:29:01 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:48:00 +0100 |
| commit | eedba054799e9809e7178938e372ece8c58d15c9 (patch) | |
| tree | 0c4ae6cdacdf5b755715a8f4a36413f96b2d9d6e | |
| parent | 478ce068a690a986456b8d8159e9c3937c364868 (diff) | |
| download | live-boot-eedba054799e9809e7178938e372ece8c58d15c9.tar.gz live-boot-eedba054799e9809e7178938e372ece8c58d15c9.zip | |
Add support for httpfs= and ftpfs= parameters.
| -rw-r--r-- | debian/control | 2 | ||||
| -rwxr-xr-x | hooks/live | 21 | ||||
| -rwxr-xr-x | scripts/live | 73 |
3 files changed, 80 insertions, 16 deletions
diff --git a/debian/control b/debian/control index ff00194..893828d 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Package: live-initramfs Architecture: all Depends: ${misc:Depends}, busybox, file, initramfs-tools, sudo, udev, user-setup Recommends: eject, loop-aes-utils, uuid-runtime, wget -Suggests: genext2fs (>= 1.4.1), squashfs-tools, mtd-tools +Suggests: curlftpfs, genext2fs (>= 1.4.1), httpfs2, squashfs-tools, mtd-tools Description: Debian Live initramfs hook live-initramfs is a hook for the initramfs-tools, used to generate a initramfs capable to boot live systems, such as those created by live-helper. This @@ -135,3 +135,24 @@ if [ -x /usr/bin/wget ] then copy_exec /usr/bin/wget /bin fi + +# FUSE kernel module +manual_add_modules fuse + +# FUSE filesystem: httpfs +if [ -x /usr/bin/httpfs_ssl ] +then + copy_exec /usr/bin/httpfs2_ssl /bin/httpfs +else + if [ -x /usr/bin/httpfs ] + then + copy_exec /usr/bin/httpfs2 /bin/httpfs + fi +fi + +# FUSE filesystem: curlftpfs +if [ -x /usr/bin/curlftpfs ] +then + copy_exec /usr/bin/curlftpfs /bin +fi + diff --git a/scripts/live b/scripts/live index b6762bc..62b5224 100755 --- a/scripts/live +++ b/scripts/live @@ -65,6 +65,16 @@ Arguments () export HOOK ;; + ftpfs=*) + FTPFS="${ARGUMENT#ftpfs=}" + export FTPFS + ;; + + httpfs=*) + HTTPFS="${ARGUMENT#httpfs=}" + export HTTPFS + ;; + hostname=*) HOSTNAME="${ARGUMENT#hostname=}" LIVECONF="changed" @@ -656,7 +666,7 @@ do_netmount () NFSROOT=${ROOTSERVER}:${ROOTPATH} fi - if [ -n "${FETCH}" ] && do_httpmount + if ( [ -n "${FETCH}" ] || [ -n "${HTTPFS}" ] || [ -n "${FTPFS}" ] ) && do_httpmount then rc=0 return ${rc} @@ -686,20 +696,53 @@ do_netmount () do_httpmount () { rc=1 - extension=$(echo "${FETCH}" | sed 's/\(.*\)\.\(.*\)/\2/') - - case "${extension}" in - squashfs|tgz|tar) - [ "${quiet}" != "y" ] && log_begin_msg "Trying wget ${FETCH} -O ${mountpoint}/$(basename ${FETCH})" - mkdir -p "${mountpoint}/${LIVE_MEDIA_PATH}" - wget "${FETCH}" -O "${mountpoint}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})" - [ ${?} -eq 0 ] && rc=0 - [ "${extension}" = "tgz" ] && live_dest="ram" - ;; + dest="${mountpoint}/${LIVE_MEDIA_PATH}" + mount -t ramfs ram "${mountpoint}" + mkdir -p "${dest}" - *) - [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${FETCH}" - esac + for webfile in HTTPFS FTPFS FETCH + do + url="$(eval echo \"\$\{${webfile}\}\")" + extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')" + + if [ -n "$url" ] + then + case "${extension}" in + squashfs|tgz|tar) + if [ "${webfile}" = "FETCH" ] + then + [ "${quiet}" != "y" ] && + log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})" + wget "${url}" -O "${dest}/$(basename ${url})" + else + [ "${quiet}" != "y" ] && + log_begin_msg "Trying to mount ${url} on ${dest}/$(basename ${url})" + if [ "${webfile}" = "FTPFS" ] + then + FUSE_MOUNT="curlftpfs" + url="$(dirname ${url})" + else + FUSE_MOUNT="httpfs" + fi + modprobe fuse + $FUSE_MOUNT "${url}" "${dest}" + fi + [ ${?} -eq 0 ] && rc=0 + [ "${extension}" = "tgz" ] && live_dest="ram" + break + ;; + + *) + [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${url}" + ;; + esac + fi + done + + if [ ${rc} != 0 ] + then + umount "${mountpoint}" + fi return ${rc} } @@ -1281,7 +1324,7 @@ mountroot () set_usplash_timeout - if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ] + if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ] || [ ! -z "${HTTPFS}" ] || [ ! -z "${FTPFS}" ] then if do_netmount then |
