diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index 9ebeeccf..1c0e16eb 100644 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -158,3 +158,8 @@ HWOPTS="keymap cache modules virtio hyperv ${HWOPTS_BLK} bcache lvm dmraid multi # This is the set of default HWOPTS, in the order that they are loaded. # This is whitespace aligned with HWOPTS above. MY_HWOPTS=" modules virtio hyperv ${HWOPTS_BLK} lvm dmraid mdadm fs crypto" + +# Defaults for HTTPBOOT option to allow mounting the iso locally +ISO_PATH="/iso" +ISO_NAME="/gentoo.iso" +ISO_TEMP="${ISO_PATH}/temp" diff --git a/defaults/linuxrc b/defaults/linuxrc index 2f94eb46..9496c30e 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -85,6 +85,10 @@ do cdroot_marker=*) CDROOT_MARKER=${x#*=} ;; + httpboot=*) + HTTPBOOT=1 + HTTPBOOT_URL=${x#*=} + ;; # Start livecd loop, looptype options loop=*) LOOP=${x#*=} @@ -732,6 +736,15 @@ then # Setup the root filesystem bootstrapFS + if [ "${HTTPBOOT}" = '1' ]; then + [ ! -d "${ISO_TEMP}" ] && mkdir -p "${ISO_TEMP}" + good_msg "Fetching ISO from ${HTTPBOOT_URL}" + run wget "${HTTPBOOT_URL}" -O "${ISO_PATH}${ISO_NAME}" -q && good_msg "Written to ${ISO_PATH}${ISO_NAME}" + good_msg "Mounting ${ISO_PATH}${ISO_NAME} in ${CDROOT_PATH}" + run mount -o ro,loop "${ISO_PATH}${ISO_NAME}" "${CDROOT_PATH}" && good_msg "Mounted ${ISO_PATH}${ISO_NAME} in ${CDROOT_PATH}" + got_good_root=1 + fi + if [ "${aufs}" = '1' ] then setup_aufs