# Distributed under the GPL v2
# $Id$
+ 13 Oct 2012; Robin H. Johnson <robbat2@gentoo.org> defaults/initrd.defaults,
+ defaults/initrd.scripts, defaults/linuxrc, doc/genkernel.8.txt:
+ Bug #351873: More livecd control, and initramfs livecd argument
+ documentation.
+
13 Oct 2012; Robin H. Johnson <robbat2@gentoo.org> arch/alpha/kernel-config,
arch/ppc/kernel-config, arch/x86/kernel-config, arch/x86_64/kernel-config,
defaults/kernel-config:
fi
REAL_ROOT=''
+CONSOLE='/dev/console'
+NEW_ROOT='/newroot'
CDROOT='0'
CDROOT_DEV=''
CDROOT_TYPE='auto'
-NEW_ROOT='/newroot'
CDROOT_PATH='/mnt/cdrom'
-CONSOLE='/dev/console'
+# This is the file that the cdroot will be checked for as a
+# marker. It must exist RELATIVE to the cdroot.
+CDROOT_MARKER='/livecd'
LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'
# a bunch of extra devices
[ -n "${CDROOT_DEV}" ] && DEVICES="${CDROOT_DEV}"
- findmediamount "cdrom" "${SUBDIR}/livecd" "REAL_ROOT" "${CDROOT_PATH}" ${DEVICES}
+ findmediamount "cdrom" "${SUBDIR}/${CDROOT_MARKER}" "REAL_ROOT" "${CDROOT_PATH}" ${DEVICES}
}
bootstrapKey() {
REAL_ROOTFLAGS=''
ROOTFSTYPE='auto'
CRYPT_SILENT=0
+
mkdir -p /etc/cmdline /etc/modprobe.d
for x in ${CMDLINE}
do
cdroot_type=*)
CDROOT_TYPE=${x#*=}
;;
+ cdroot_marker=*)
+ CDROOT_MARKER=${x#*=}
+ ;;
# Start livecd loop, looptype options
loop=*)
LOOP=${x#*=}
# If encrypted, find key and mount, otherwise mount as usual
if [ -n "${CRYPT_ROOT}" ]
then
- CRYPT_ROOT_KEY="$(head -n 1 "${CDROOT_PATH}"/livecd)"
+ CRYPT_ROOT_KEY="$(head -n 1 "${CDROOT_PATH}"/${CDROOT_MARKER})"
CRYPT_ROOT='/dev/loop0'
good_msg 'You booted an encrypted livecd' "${CRYPT_SILENT}"
*cdroot*[=<...>]::
*cdroot_type*=<...>::
- TO BE DOCUMENTED
+*cdroot_marker*=<...>::
+ Used for LiveCDs. *cdroot* without arguments will cause the initramfs to
+ scan all devices for a LiveCD. An argument to *cdroot* will cause it to
+ scan only that device. A LiveCD is any device containing a file with the
+ name & Path of *cdroot_marker* (default of "/livecd"). *cdroot_type*
+ (default of "auto") is the filesystem type to use while mounting devices
+ to check. On success, the LiveCD will be mounted at $CDROOT_PATH.
*loop*=<...>::
*looptype*=<...>::
- TO BE DOCUMENTED
+ Used for LiveCDs. After mounting the LiveCD or ISO, look for a file at
+ *loop*=path to use as a loopback image for the main type. Mount it with
+ filesystem type *looptype*. Possible values for *looptype*: normal,
+ squashfs, gcloop, zisofs, noloop, sgimips. If *looptype* is not specified,
+ a guess is made, based on the name or extension of *loop*.
*isoboot*=<...>::
Loop-mount an ISO file from the boot device to get the filesystem image.