5 export PATH="/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
7 echo "/root/lib" >> /etc/ld.so.conf
8 echo "/root/usr/lib" >> /etc/ld.so.conf
10 mountpoint="/live/image"
11 LIVE_MEDIA_PATH="live"
13 root_persistence="live-rw"
14 home_persistence="home-rw"
15 root_snapshot_label="live-sn"
16 home_snapshot_label="home-sn"
19 USERFULLNAME="Live user"
22 mkdir -p "${mountpoint}"
24 [ -f /etc/live.conf ] && . /etc/live.conf
25 export USERNAME USERFULLNAME HOSTNAME
27 . /scripts/live-helpers
29 if [ ! -f /live.vars ]
38 for ARGUMENT in $(cat /proc/cmdline)
42 ACCESS="${ARGUMENT#access=}"
47 DEFCONSOLE="${ARGUMENT#*=}"
59 FETCH="${ARGUMENT#fetch=}"
64 HOSTNAME="${ARGUMENT#hostname=}"
66 export HOSTNAME LIVECONF
70 USERNAME="${ARGUMENT#username=}"
72 export USERNAME LIVECONF
76 USERFULLNAME="${ARGUMENT#userfullname=}"
78 export USERFULLNAME LIVECONF
87 STATICIP="${ARGUMENT#ip=}"
89 if [ -z "${STATICIP}" ]
97 keyb=*|kbd-chooser/method=*)
102 klayout=*|console-setup/layoutcode=*)
103 KLAYOUT="${ARGUMENT#*=}"
107 kvariant=*|console-setup/variantcode=*)
108 KVARIANT="${ARGUMENT#*=}"
112 kmodel=*|console-setup/modelcode=*)
113 KMODEL="${ARGUMENT#*=}"
118 KOPTIONS="${ARGUMENT#koptions=}"
127 live-media=*|bootfrom=*)
128 LIVE_MEDIA="${ARGUMENT#*=}"
132 live-media-encryption=*|encryption=*)
133 LIVE_MEDIA_ENCRYPTION="${ARGUMENT#*=}"
134 export LIVE_MEDIA_ENCRYPTION
138 LIVE_MEDIA_OFFSET="${ARGUMENT#live-media-offset=}"
139 export LIVE_MEDIA_OFFSET
143 LIVE_MEDIA_PATH="${ARGUMENT#live-media-path=}"
144 export LIVE_MEDIA_PATH
147 live-media-timeout=*)
148 LIVE_MEDIA_TIMEOUT="${ARGUMENT#live-media-timeout=}"
149 export LIVE_MEDIA_TIMEOUT
152 locale=*|debian-installer/locale=*)
153 LOCALE="${ARGUMENT#*=}"
158 MODULE="${ARGUMENT#module=}"
163 NETBOOT="${ARGUMENT#netboot=}"
168 NFSOPTS="${ARGUMENT#nfsopts=}"
173 NFS_COW="${ARGUMENT#nfscow=}"
178 NOACCESSIBILITY="Yes"
179 export NOACCESSIBILITY
203 NOCONSOLEKEYBOARD="Yes"
204 export NOCONSOLEKEYBOARD
228 NOKPERSONALIZER="Yes"
229 export NOKPERSONALIZER
238 NOLANGUAGESELECTOR="Yes"
239 export NOLANGUAGESELECTOR
253 NOPOWERMANAGEMENT="Yes"
254 export NOPOWERMANAGEMENT
258 NOPROGRAMCRASHES="Yes"
259 export NOPROGRAMCRASHES
263 NORESTRICTEDMANAGER="Yes"
264 export NORESTRICTEDMANAGER
278 NOUPDATENOTIFIER="Yes"
279 export NOUPDATENOTIFIER
294 export NOXSCREENSAVER
307 preseed/file=*|file=*)
308 LOCATION="${ARGUMENT#*=}"
318 location="${ARGUMENT#url=}"
320 mount -n -o bind /sys /root/sys
321 mount -n -o bind /proc /root/proc
322 mount -n -o bind /dev /root/dev
324 mkdir -p /root/var/run/network
326 chroot /root wget -P /tmp "${location}"
327 chroot /root ifdown -a
333 LOCATION="/tmp/$(basename "${location}")"
337 question="${ARGUMENT%%=*}"
338 value="${ARGUMENT#*=}"
339 PRESEEDS="${PRESEEDS}\"${question}=${value}\" "
354 TIMEZONE="${ARGUMENT#timezone=}"
364 TODISK="${ARGUMENT#todisk=}"
375 MODULETORAM="${ARGUMENT#toram=}"
376 export TORAM MODULETORAM
385 UNIONTYPE="${ARGUMENT#union=}"
390 UTC="${ARGUMENT#utc=}"
400 XDRIVER="${ARGUMENT#xdriver=}"
405 XVIDEOMODE="${ARGUMENT#xvideomode=}"
411 # sort of compatibility with netboot.h from linux docs
412 if [ -z "${NETBOOT}" ]
414 if [ "${ROOT}" = "/dev/nfs" ]
418 elif [ "${ROOT}" = "/dev/cifs" ]
425 if [ -z "${MODULE}" ]
431 if [ -z "${UNIONTYPE}" ]
442 if [ -d "${DIRECTORY}"/"${LIVE_MEDIA_PATH}" ]
444 for FILESYSTEM in squashfs ext2 ext3 xfs dir jffs2
446 if [ "$(echo ${DIRECTORY}/${LIVE_MEDIA_PATH}/*.${FILESYSTEM})" != "${DIRECTORY}/${LIVE_MEDIA_PATH}/*.${FILESYSTEM}" ]
458 if [ "${IGNORE_UUID}" ] || [ ! -e /conf/uuid.conf ]
464 uuid="$(cat /conf/uuid.conf)"
466 for try_uuid_file in "${mountpoint}/.disk/casper-uuid"*
468 [ -e "${try_uuid_file}" ] || continue
470 try_uuid="$(cat "${try_uuid_file}")"
472 if [ "${uuid}" = "${try_uuid}" ]
481 get_backing_device ()
484 *.squashfs|*.ext2|*.ext3|*.jffs2)
485 echo $(setup_loop "${1}" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}")
493 panic "Unrecognized live filesystem: ${1}"
498 match_files_in_dir ()
500 # Does any files match pattern ${1} ?
503 if [ "$(echo ${pattern})" != "${pattern}" ]
511 mount_images_in_directory ()
518 if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" ||
519 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext2" ||
520 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext3" ||
521 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.jffs2" ||
522 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.dir"
524 [ -n "${mac}" ] && adddirectory="${directory}/${LIVE_MEDIA_PATH}/${mac}"
525 setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}" "${adddirectory}"
533 sysfs_path="${1#/sys}"
535 if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])"
545 # FIXME: do something better like the scan of supported filesystems
549 vfat|iso9660|udf|ext2|ext3|ntfs|jffs2)
561 copyto="${copyfrom}_swap"
563 if [ -z "${MODULETORAM}" ]
565 size=$(fs_size "" ${copyfrom} "used")
567 MODULETORAMFILE="${copyfrom}/${LIVE_MEDIA_PATH}/${MODULETORAM}"
569 if [ -f "${MODULETORAMFILE}" ]
571 size=$( expr $(ls -la ${MODULETORAMFILE} | awk '{print $5}') / 1024 + 5000 )
573 log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
578 if [ "${copytodev}" = "ram" ]
581 freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ) )
582 mount_options="-o size=${size}k"
587 # it should be a writable block device
588 if [ -b "${copytodev}" ]
592 fstype=$(get_fstype "${dev}")
593 freespace=$(fs_size "${dev}")
595 [ "$quiet" != "y" ] && log_warning_msg "${copytodev} is not a block device."
600 if [ "${freespace}" -lt "${size}" ]
602 [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
606 # begin copying (or uncompressing)
608 echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
609 mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
611 if [ "${extension}" = "tgz" ]
614 tar zxf "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
615 rm -f "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
616 mount -r --move "${copyto}" "${rootmnt}"
619 if [ -n "${MODULETORAMFILE}" ]
621 cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
623 cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
628 mount -r --move ${copyto} ${copyfrom}
639 modprobe -q af_packet # For DHCP
644 ipconfig ${DEVICE} | tee /netboot.config
646 # source relevant ipconfig output
647 OLDHOSTNAME=${HOSTNAME}
648 . /tmp/net-${DEVICE}.conf
649 [ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
652 if [ "${NFSROOT}" = "auto" ]
654 NFSROOT=${ROOTSERVER}:${ROOTPATH}
657 if [ -n "${FETCH}" ] && do_httpmount
663 if [ "${NFSROOT#*:}" = "${NFSROOT}" ] && [ "$NETBOOT" != "cifs" ]
665 NFSROOT=${ROOTSERVER}:${NFSROOT}
668 [ "${quiet}" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
670 if [ "${NETBOOT}" != "nfs" ] && do_cifsmount
680 [ "${quiet}" != "y" ] && log_end_msg
687 extension=$(echo "${FETCH}" | sed 's/\(.*\)\.\(.*\)/\2/')
689 case "${extension}" in
691 [ "${quiet}" != "y" ] && log_begin_msg "Trying wget ${FETCH} -O ${mountpoint}/$(basename ${FETCH})"
692 mkdir -p "${mountpoint}/${LIVE_MEDIA_PATH}"
693 wget "${FETCH}" -O "${mountpoint}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
694 [ ${?} -eq 0 ] && rc=0
695 [ "${extension}" = "tgz" ] && live_dest="ram"
699 [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${FETCH}"
711 if [ -z "${NFSOPTS}" ]
716 [ "${quiet}" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
718 # FIXME: This for loop is an ugly HACK round an nfs bug
719 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13
721 nfsmount -o nolock -o ro ${NFSOPTS} "${NFSROOT}" "${mountpoint}" && rc=0 && break
732 if [ -x "/sbin/mount.cifs" ]
734 if [ -z "${NFSOPTS}" ]
736 CIFSOPTS="-ouser=root,password="
738 CIFSOPTS="${NFSOPTS}"
741 [ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
744 if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}"
758 size=$(fs_size "${fromdev}" "" "used")
760 if [ -b "${fromdev}" ]
763 if [ -n "${HOMEMOUNTED}" -a "${snap_type}" = "HOME" ]
765 todev=$(cat /proc/mounts | grep -s " $(base_path ${todir}) " | awk '{print $1}' )
766 freespace=$(df -k | grep -s ${todev} | awk '{print $4}')
768 freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ))
771 tomount="/mnt/tmpsnap"
773 if [ ! -d "${tomount}" ]
775 mkdir -p "${tomount}"
778 fstype=$(get_fstype "${fromdev}")
780 if [ -n "${fstype}" ]
783 mount -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}"
784 cp -a "${tomount}"/* ${todir}
787 log_warning_msg "Unrecognized fstype: ${fstype} on ${fromdev}:${snap_type}"
792 if echo ${fromdev} | grep -qs loop
794 losetup -d "${fromdev}"
801 [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
807 # Look for ${snap_label}.* in block devices and copy the contents to ${snap_mount}
808 # and remember the device and filename for resync on exit in live-initramfs.init
813 snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3 ${snap_label}.jffs2")
815 if [ ! -z "${snapdata}" ]
817 snapdev="$(echo ${snapdata} | cut -f1 -d ' ')"
818 snapback="$(echo ${snapdata} | cut -f2 -d ' ')"
819 snapfile="$(echo ${snapdata} | cut -f3 -d ' ')"
821 if echo "${snapfile}" | grep -qs '\(squashfs\|ext2\|ext3\|jffs2\)'
823 # squashfs, jffs2 or ext2/ext3 snapshot
824 dev=$(get_backing_device "${snapback}/${snapfile}")
826 if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}"
828 log_warning_msg "Impossible to include the ${snapfile} Snapshot"
833 if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio -i -u -d 2>/dev/null)
835 log_warning_msg "Impossible to include the ${snapfile} Snapshot"
842 dev=$(find_cow_device "${snap_label}")
846 if echo "${dev}" | grep -qs loop
848 # strange things happens, user confused?
849 snaploop=$( losetup ${dev} | awk '{print $3}' | tr -d '()' )
850 snapfile=$(basename ${snaploop})
851 snapdev=$(cat /proc/mounts | awk '{print $2,$1}' | grep -es "^$( dirname ${snaploop} )" | cut -f2 -d ' ')
856 if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}"
858 log_warning_msg "Impossible to include the ${snap_label} Snapshot"
861 if [ -n "${snapfile}" ]
863 # it was a loop device, user confused
868 log_warning_msg "Impossible to include the ${snap_label} Snapshot"
873 echo "export ${snap_type}SNAP="${snap_mount}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
879 image_directory="${1}"
881 addimage_directory="${3}"
882 modprobe -q -b ${UNIONTYPE}
884 # run-init can't deal with images in a subdir, but we're going to
885 # move all of these away before it runs anyway. No, we're not,
886 # put them in / since move-mounting them into / breaks mono and
891 # Let's just mount the read-only file systems first
894 minor_kernel_version=$(uname -r|cut -c 5-|sed 's/[^0-9].*//')
896 if [ "${NETBOOT}" = "nfs" ] && [ "${minor_kernel_version}" -lt 22 ]
898 # go aroung a bug in nfs-unionfs locking for unionfs <= 1.4
900 elif [ "${UNIONTYPE}" = "aufs" ]
907 # Read image names from ${MODULE}.module if it exists
908 if [ -e "${image_directory}/filesystem.${MODULE}.module" ]
910 for IMAGE in $(cat ${image_directory}/filesystem.${MODULE}.module)
912 image_string="${image_string} ${image_directory}/${IMAGE}"
914 elif [ -e "${image_directory}/${MODULE}.module" ]
916 for IMAGE in $(cat ${image_directory}/${MODULE}.module)
918 image_string="${image_string} ${image_directory}/${IMAGE}"
921 # ${MODULE}.module does not exist, create a list of images
922 for FILESYSTEM in squashfs ext2 ext3 xfs jffs2 dir
924 for IMAGE in "${image_directory}"/*."${FILESYSTEM}"
928 image_string="${image_string} ${IMAGE}"
933 if [ -n "${addimage_directory}" ] && [ -d "${addimage_directory}" ]
935 for FILESYSTEM in squashfs ext2 ext3 xfs jffs2 dir
937 for IMAGE in "${addimage_directory}"/*."${FILESYSTEM}"
941 image_string="${image_string} ${IMAGE}"
948 image_string="$(echo ${image_string} | sed -e 's/ /\n/g' | sort )"
951 [ -n "${MODULETORAMFILE}" ] && image_string="${image_directory}/$(basename ${MODULETORAMFILE})"
955 for image in ${image_string}
957 imagename=$(basename "${image}")
961 # it is a plain directory: do nothing
962 rofsstring="${image}=${roopt}:${rofsstring}"
963 rofslist="${image} ${rofslist}"
964 elif [ -f "${image}" ]
966 backdev=$(get_backing_device "${image}")
967 fstype=$(get_fstype "${backdev}")
969 if [ "${fstype}" = "unknown" ]
971 panic "Unknown file system type on ${backdev} (${image})"
974 mkdir -p "${croot}/${imagename}"
975 echo "debug: Can not mount backdev ${backdev} (image = ${image}) on croot/imagename ${croot}/${imagename}"
976 mount -t "${fstype}" -o ro,noatime "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
980 rofsstring=${rofsstring%:}
984 # Looking for "${root_persistence}" device or file
985 if [ -n "${PERSISTENT}" ]
987 cowprobe=$(find_cow_device "${root_persistence}")
989 if [ -b "${cowprobe}" ]
991 cowdevice=${cowprobe}
992 cow_fstype=$(get_fstype "${cowprobe}")
994 [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium"
998 elif [ -n "${NFS_COW}" ]
1000 # check if there are any nfs options
1001 if echo ${NFS_COW}|grep -q ','
1003 nfs_cow_opts="-o nolock,$(echo ${NFS_COW}|cut -d, -f2-)"
1004 nfs_cow=$(echo ${NFS_COW}|cut -d, -f1)
1006 nfs_cow_opts="-o nolock"
1012 cowdevice=$(echo ${nfs_cow}|sed "s/client_mac_address/${mac}/")
1015 panic "unable to determine mac address"
1022 if [ "${cow_fstype}" = "nfs" ]
1024 [ "${quiet}" != "y" ] && log_begin_msg \
1025 "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow"
1026 nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \
1027 panic "Can not mount ${cowdevice} on /cow"
1029 mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \
1030 panic "Can not mount ${cowdevice} on /cow"
1033 rofscount=$(echo ${rofslist} |wc -w)
1035 if [ -n "${EXPOSED_ROOT}" ]
1037 if [ ${rofscount} -ne 1 ]
1039 panic "only one RO file system supported with exposedroot: ${rofslist}"
1041 exposedrootfs=${rofslist%% }
1043 mount --bind ${exposedrootfs} ${rootmnt} || \
1044 panic "bind mount of ${exposedrootfs} failed"
1046 cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool
1047 /home /var/lib/live'
1049 for dir in ${cow_dirs}; do
1051 mount -t ${UNIONTYPE} \
1052 -o rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro \
1053 ${UNIONTYPE} "${rootmnt}${dir}" || \
1054 panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option \
1055 rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro"
1058 mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \
1059 ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \
1060 ${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}"
1063 # tmpfs file systems
1064 mkdir -p "${rootmnt}/live"
1065 mount -t tmpfs tmpfs ${rootmnt}/live
1067 # Adding other custom mounts
1068 if [ -n "${PERSISTENT}" ]
1070 # directly mount /home
1071 # FIXME: add a custom mounts configurable system
1072 homecow=$(find_cow_device "${home_persistence}" )
1074 if [ -b "${homecow}" ]
1076 mount -t $(get_fstype "${homecow}") -o rw,noatime "${homecow}" "${rootmnt}/home"
1077 export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy()
1079 [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
1082 # Look for other snapshots to copy in
1083 try_snap "${root_snapshot_label}" "${rootmnt}" "ROOT"
1084 try_snap "${home_snapshot_label}" "${rootmnt}/home" "HOME"
1087 if [ -n "${SHOWMOUNTS}" ]
1089 for d in ${rofslist}
1091 mkdir -p "${rootmnt}/live/${d##*/}"
1095 # do nothing # mount -o bind "${d}" "${rootmnt}/live/${d##*/}"
1099 mount --move "${d}" "${rootmnt}/live/${d##*/}"
1105 # shows cow fs on /cow for use by live-snapshot
1106 mkdir -p "${rootmnt}/live/cow"
1107 mount -o move /cow "${rootmnt}/live/cow"
1114 skip_uuid_check="${3}"
1116 if [ -z "${devname}" ]
1118 devname=$(sys2dev "${sysdev}")
1121 if [ -n "${LIVE_MEDIA_OFFSET}" ]
1123 loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVE_MEDIA_OFFSET}" '')
1124 devname="${loopdevname}"
1127 fstype=$(get_fstype "${devname}")
1129 if is_supported_fs ${fstype}
1131 mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
1133 if is_live_path ${mountpoint} && \
1134 ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
1139 umount ${mountpoint}
1143 if [ -n "${LIVE_MEDIA_OFFSET}" ]
1145 losetup -d "${loopdevname}"
1155 # first look at the one specified in the command line
1156 if [ ! -z "${LIVE_MEDIA}" ]
1158 if check_dev "null" "${LIVE_MEDIA}" "skip_uuid_check"
1164 # don't start autodetection before timeout has expired
1165 if [ -n "${LIVE_MEDIA_TIMEOUT}" ]
1167 if [ "${timeout}" -lt "${LIVE_MEDIA_TIMEOUT}" ]
1173 # or do the scan of block devices
1174 for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v 'dm-')
1176 devname=$(sys2dev "${sysblock}")
1177 fstype=$(get_fstype "${devname}")
1179 if /lib/udev/cdrom_id ${devname} > /dev/null
1181 if check_dev "null" "${devname}"
1185 elif is_nice_device "${sysblock}"
1187 for dev in $(subdevices "${sysblock}")
1189 if check_dev "${dev}"
1194 elif [ "${fstype}" = "squashfs" -o \
1195 "${fstype}" = "ext2" -o \
1196 "${fstype}" = "ext3" -o \
1197 "${fstype}" = "jffs2" ]
1199 # This is an ugly hack situation, the block device has
1200 # an image directly on it. It's hopefully
1201 # live-initramfs, so take it and run with it.
1202 ln -s "${devname}" "${devname}.${fstype}"
1203 echo "${devname}.${fstype}"
1211 set_usplash_timeout ()
1213 if [ -x /sbin/usplash_write ]
1215 /sbin/usplash_write "TIMEOUT 120"
1222 if [ -x /scripts/local-top/cryptroot ]; then
1223 /scripts/local-top/cryptroot
1234 [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-premount"
1235 run_scripts /scripts/live-premount
1236 [ "${quiet}" != "y" ] && log_end_msg
1238 # Needed here too because some things (*cough* udev *cough*)
1239 # changes the timeout
1243 if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ]
1247 livefs_root="${mountpoint}"
1249 panic "Unable to find a live file system on the network"
1252 # Scan local devices for the image
1253 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
1255 livefs_root=$(find_livefs ${i})
1257 if [ -n "${livefs_root}" ]
1266 if [ -z "${livefs_root}" ]
1268 panic "Unable to find a medium containing a live file system"
1274 elif [ "${TODISK}" ]
1276 live_dest="${TODISK}"
1279 if [ "${live_dest}" ]
1281 log_begin_msg "Copying live media to ${live_dest}"
1282 copy_live_to "${livefs_root}" "${live_dest}"
1286 if [ -n "${MODULETORAMFILE}" ]
1288 setup_unionfs "${livefs_root}" "${rootmnt}"
1291 mac="$(echo ${mac} | sed 's/-//g')"
1292 mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}"
1297 maybe_break live-bottom
1298 [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
1300 run_scripts /scripts/live-bottom
1301 [ "${quiet}" != "y" ] && log_end_msg
1305 cp live.log "${rootmnt}/var/log/"