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 HOOK="${ARGUMENT#hook=}"
69 HOSTNAME="${ARGUMENT#hostname=}"
71 export HOSTNAME LIVECONF
75 USERNAME="${ARGUMENT#username=}"
77 export USERNAME LIVECONF
81 USERFULLNAME="${ARGUMENT#userfullname=}"
83 export USERFULLNAME LIVECONF
92 STATICIP="${ARGUMENT#ip=}"
94 if [ -z "${STATICIP}" ]
102 keyb=*|kbd-chooser/method=*)
107 klayout=*|console-setup/layoutcode=*)
108 KLAYOUT="${ARGUMENT#*=}"
112 kvariant=*|console-setup/variantcode=*)
113 KVARIANT="${ARGUMENT#*=}"
117 kmodel=*|console-setup/modelcode=*)
118 KMODEL="${ARGUMENT#*=}"
123 KOPTIONS="${ARGUMENT#koptions=}"
132 live-media=*|bootfrom=*)
133 LIVE_MEDIA="${ARGUMENT#*=}"
137 live-media-encryption=*|encryption=*)
138 LIVE_MEDIA_ENCRYPTION="${ARGUMENT#*=}"
139 export LIVE_MEDIA_ENCRYPTION
143 LIVE_MEDIA_OFFSET="${ARGUMENT#live-media-offset=}"
144 export LIVE_MEDIA_OFFSET
148 LIVE_MEDIA_PATH="${ARGUMENT#live-media-path=}"
149 export LIVE_MEDIA_PATH
152 live-media-timeout=*)
153 LIVE_MEDIA_TIMEOUT="${ARGUMENT#live-media-timeout=}"
154 export LIVE_MEDIA_TIMEOUT
157 locale=*|debian-installer/locale=*)
158 LOCALE="${ARGUMENT#*=}"
163 MODULE="${ARGUMENT#module=}"
168 NETBOOT="${ARGUMENT#netboot=}"
173 NFSOPTS="${ARGUMENT#nfsopts=}"
178 NFS_COW="${ARGUMENT#nfscow=}"
183 NOACCESSIBILITY="Yes"
184 export NOACCESSIBILITY
208 NOCONSOLEKEYBOARD="Yes"
209 export NOCONSOLEKEYBOARD
233 NOKPERSONALIZER="Yes"
234 export NOKPERSONALIZER
243 NOLANGUAGESELECTOR="Yes"
244 export NOLANGUAGESELECTOR
258 NOPOWERMANAGEMENT="Yes"
259 export NOPOWERMANAGEMENT
263 NOPROGRAMCRASHES="Yes"
264 export NOPROGRAMCRASHES
268 NORESTRICTEDMANAGER="Yes"
269 export NORESTRICTEDMANAGER
283 NOUPDATENOTIFIER="Yes"
284 export NOUPDATENOTIFIER
299 export NOXSCREENSAVER
312 preseed/file=*|file=*)
313 LOCATION="${ARGUMENT#*=}"
323 location="${ARGUMENT#url=}"
325 mount -n -o bind /sys /root/sys
326 mount -n -o bind /proc /root/proc
327 mount -n -o bind /dev /root/dev
329 mkdir -p /root/var/run/network
331 chroot /root wget -P /tmp "${location}"
332 chroot /root ifdown -a
338 LOCATION="/tmp/$(basename "${location}")"
342 question="${ARGUMENT%%=*}"
343 value="${ARGUMENT#*=}"
344 PRESEEDS="${PRESEEDS}\"${question}=${value}\" "
359 TIMEZONE="${ARGUMENT#timezone=}"
369 TODISK="${ARGUMENT#todisk=}"
380 MODULETORAM="${ARGUMENT#toram=}"
381 export TORAM MODULETORAM
395 ROOT="${ARGUMENT#root=}"
400 UNIONTYPE="${ARGUMENT#union=}"
405 UTC="${ARGUMENT#utc=}"
415 XDRIVER="${ARGUMENT#xdriver=}"
420 XVIDEOMODE="${ARGUMENT#xvideomode=}"
426 # sort of compatibility with netboot.h from linux docs
427 if [ -z "${NETBOOT}" ]
429 if [ "${ROOT}" = "/dev/nfs" ]
433 elif [ "${ROOT}" = "/dev/cifs" ]
440 if [ -z "${MODULE}" ]
446 if [ -z "${UNIONTYPE}" ]
457 if [ -d "${DIRECTORY}"/"${LIVE_MEDIA_PATH}" ]
459 for FILESYSTEM in squashfs ext2 ext3 xfs dir jffs2
461 if [ "$(echo ${DIRECTORY}/${LIVE_MEDIA_PATH}/*.${FILESYSTEM})" != "${DIRECTORY}/${LIVE_MEDIA_PATH}/*.${FILESYSTEM}" ]
473 if [ "${IGNORE_UUID}" ] || [ ! -e /conf/uuid.conf ]
479 uuid="$(cat /conf/uuid.conf)"
481 for try_uuid_file in "${mountpoint}/.disk/casper-uuid"*
483 [ -e "${try_uuid_file}" ] || continue
485 try_uuid="$(cat "${try_uuid_file}")"
487 if [ "${uuid}" = "${try_uuid}" ]
496 get_backing_device ()
499 *.squashfs|*.ext2|*.ext3|*.jffs2)
500 echo $(setup_loop "${1}" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}")
508 panic "Unrecognized live filesystem: ${1}"
513 match_files_in_dir ()
515 # Does any files match pattern ${1} ?
518 if [ "$(echo ${pattern})" != "${pattern}" ]
526 mount_images_in_directory ()
533 if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" ||
534 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext2" ||
535 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext3" ||
536 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.jffs2" ||
537 match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.dir"
539 [ -n "${mac}" ] && adddirectory="${directory}/${LIVE_MEDIA_PATH}/${mac}"
540 setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}" "${adddirectory}"
548 sysfs_path="${1#/sys}"
550 if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])"
560 # FIXME: do something better like the scan of supported filesystems
564 vfat|iso9660|udf|ext2|ext3|ntfs|jffs2)
576 copyto="${copyfrom}_swap"
578 if [ -z "${MODULETORAM}" ]
580 size=$(fs_size "" ${copyfrom} "used")
582 MODULETORAMFILE="${copyfrom}/${LIVE_MEDIA_PATH}/${MODULETORAM}"
584 if [ -f "${MODULETORAMFILE}" ]
586 size=$( expr $(ls -la ${MODULETORAMFILE} | awk '{print $5}') / 1024 + 5000 )
588 log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
593 if [ "${copytodev}" = "ram" ]
596 freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ) )
597 mount_options="-o size=${size}k"
602 # it should be a writable block device
603 if [ -b "${copytodev}" ]
607 fstype=$(get_fstype "${dev}")
608 freespace=$(fs_size "${dev}")
610 [ "$quiet" != "y" ] && log_warning_msg "${copytodev} is not a block device."
615 if [ "${freespace}" -lt "${size}" ]
617 [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
621 # begin copying (or uncompressing)
623 echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
624 mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
626 if [ "${extension}" = "tgz" ]
629 tar zxf "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
630 rm -f "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
631 mount -r --move "${copyto}" "${rootmnt}"
634 if [ -n "${MODULETORAMFILE}" ]
636 cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
638 cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
643 mount -r --move ${copyto} ${copyfrom}
654 modprobe -q af_packet # For DHCP
659 ipconfig ${DEVICE} | tee /netboot.config
661 # source relevant ipconfig output
662 OLDHOSTNAME=${HOSTNAME}
663 . /tmp/net-${DEVICE}.conf
664 [ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
667 if [ "${NFSROOT}" = "auto" ]
669 NFSROOT=${ROOTSERVER}:${ROOTPATH}
672 if [ -n "${FETCH}" ] && do_httpmount
678 if [ "${NFSROOT#*:}" = "${NFSROOT}" ] && [ "$NETBOOT" != "cifs" ]
680 NFSROOT=${ROOTSERVER}:${NFSROOT}
683 [ "${quiet}" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
685 if [ "${NETBOOT}" != "nfs" ] && do_cifsmount
695 [ "${quiet}" != "y" ] && log_end_msg
702 extension=$(echo "${FETCH}" | sed 's/\(.*\)\.\(.*\)/\2/')
704 case "${extension}" in
706 [ "${quiet}" != "y" ] && log_begin_msg "Trying wget ${FETCH} -O ${mountpoint}/$(basename ${FETCH})"
707 mkdir -p "${mountpoint}/${LIVE_MEDIA_PATH}"
708 wget "${FETCH}" -O "${mountpoint}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
709 [ ${?} -eq 0 ] && rc=0
710 [ "${extension}" = "tgz" ] && live_dest="ram"
714 [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${FETCH}"
726 if [ -z "${NFSOPTS}" ]
731 [ "${quiet}" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
733 # FIXME: This for loop is an ugly HACK round an nfs bug
734 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13
736 nfsmount -o nolock -o ro ${NFSOPTS} "${NFSROOT}" "${mountpoint}" && rc=0 && break
747 if [ -x "/sbin/mount.cifs" ]
749 if [ -z "${NFSOPTS}" ]
751 CIFSOPTS="-ouser=root,password="
753 CIFSOPTS="${NFSOPTS}"
756 [ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
759 if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}"
773 size=$(fs_size "${fromdev}" "" "used")
775 if [ -b "${fromdev}" ]
778 if [ -n "${HOMEMOUNTED}" -a "${snap_type}" = "HOME" ]
780 todev=$(cat /proc/mounts | grep -s " $(base_path ${todir}) " | awk '{print $1}' )
781 freespace=$(df -k | grep -s ${todev} | awk '{print $4}')
783 freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ))
786 tomount="/mnt/tmpsnap"
788 if [ ! -d "${tomount}" ]
790 mkdir -p "${tomount}"
793 fstype=$(get_fstype "${fromdev}")
795 if [ -n "${fstype}" ]
798 mount -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}"
799 cp -a "${tomount}"/* ${todir}
802 log_warning_msg "Unrecognized fstype: ${fstype} on ${fromdev}:${snap_type}"
807 if echo ${fromdev} | grep -qs loop
809 losetup -d "${fromdev}"
816 [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
822 # Look for ${snap_label}.* in block devices and copy the contents to ${snap_mount}
823 # and remember the device and filename for resync on exit in live-initramfs.init
828 snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.ext2 ${snap_label}.ext3 ${snap_label}.jffs2")
830 if [ ! -z "${snapdata}" ]
832 snapdev="$(echo ${snapdata} | cut -f1 -d ' ')"
833 snapback="$(echo ${snapdata} | cut -f2 -d ' ')"
834 snapfile="$(echo ${snapdata} | cut -f3 -d ' ')"
836 if echo "${snapfile}" | grep -qs '\(squashfs\|ext2\|ext3\|jffs2\)'
838 # squashfs, jffs2 or ext2/ext3 snapshot
839 dev=$(get_backing_device "${snapback}/${snapfile}")
841 if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}"
843 log_warning_msg "Impossible to include the ${snapfile} Snapshot"
848 if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio -i -u -d 2>/dev/null)
850 log_warning_msg "Impossible to include the ${snapfile} Snapshot"
857 dev=$(find_cow_device "${snap_label}")
861 if echo "${dev}" | grep -qs loop
863 # strange things happens, user confused?
864 snaploop=$( losetup ${dev} | awk '{print $3}' | tr -d '()' )
865 snapfile=$(basename ${snaploop})
866 snapdev=$(cat /proc/mounts | awk '{print $2,$1}' | grep -es "^$( dirname ${snaploop} )" | cut -f2 -d ' ')
871 if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}"
873 log_warning_msg "Impossible to include the ${snap_label} Snapshot"
876 if [ -n "${snapfile}" ]
878 # it was a loop device, user confused
883 log_warning_msg "Impossible to include the ${snap_label} Snapshot"
888 echo "export ${snap_type}SNAP="${snap_mount}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
894 image_directory="${1}"
896 addimage_directory="${3}"
897 modprobe -q -b ${UNIONTYPE}
899 # run-init can't deal with images in a subdir, but we're going to
900 # move all of these away before it runs anyway. No, we're not,
901 # put them in / since move-mounting them into / breaks mono and
906 # Let's just mount the read-only file systems first
909 minor_kernel_version=$(uname -r|cut -c 5-|sed 's/[^0-9].*//')
911 if [ "${NETBOOT}" = "nfs" ] && [ "${minor_kernel_version}" -lt 22 ]
913 # go aroung a bug in nfs-unionfs locking for unionfs <= 1.4
915 elif [ "${UNIONTYPE}" = "aufs" ]
922 # Read image names from ${MODULE}.module if it exists
923 if [ -e "${image_directory}/filesystem.${MODULE}.module" ]
925 for IMAGE in $(cat ${image_directory}/filesystem.${MODULE}.module)
927 image_string="${image_string} ${image_directory}/${IMAGE}"
929 elif [ -e "${image_directory}/${MODULE}.module" ]
931 for IMAGE in $(cat ${image_directory}/${MODULE}.module)
933 image_string="${image_string} ${image_directory}/${IMAGE}"
936 # ${MODULE}.module does not exist, create a list of images
937 for FILESYSTEM in squashfs ext2 ext3 xfs jffs2 dir
939 for IMAGE in "${image_directory}"/*."${FILESYSTEM}"
943 image_string="${image_string} ${IMAGE}"
948 if [ -n "${addimage_directory}" ] && [ -d "${addimage_directory}" ]
950 for FILESYSTEM in squashfs ext2 ext3 xfs jffs2 dir
952 for IMAGE in "${addimage_directory}"/*."${FILESYSTEM}"
956 image_string="${image_string} ${IMAGE}"
963 image_string="$(echo ${image_string} | sed -e 's/ /\n/g' | sort )"
966 [ -n "${MODULETORAMFILE}" ] && image_string="${image_directory}/$(basename ${MODULETORAMFILE})"
970 for image in ${image_string}
972 imagename=$(basename "${image}")
976 # it is a plain directory: do nothing
977 rofsstring="${image}=${roopt}:${rofsstring}"
978 rofslist="${image} ${rofslist}"
979 elif [ -f "${image}" ]
981 backdev=$(get_backing_device "${image}")
982 fstype=$(get_fstype "${backdev}")
984 if [ "${fstype}" = "unknown" ]
986 panic "Unknown file system type on ${backdev} (${image})"
989 mkdir -p "${croot}/${imagename}"
990 echo "debug: Can not mount backdev ${backdev} (image = ${image}) on croot/imagename ${croot}/${imagename}"
991 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}"
995 rofsstring=${rofsstring%:}
999 # Looking for "${root_persistence}" device or file
1000 if [ -n "${PERSISTENT}" ]
1002 cowprobe=$(find_cow_device "${root_persistence}")
1004 if [ -b "${cowprobe}" ]
1006 cowdevice=${cowprobe}
1007 cow_fstype=$(get_fstype "${cowprobe}")
1009 [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium"
1013 elif [ -n "${NFS_COW}" ]
1015 # check if there are any nfs options
1016 if echo ${NFS_COW}|grep -q ','
1018 nfs_cow_opts="-o nolock,$(echo ${NFS_COW}|cut -d, -f2-)"
1019 nfs_cow=$(echo ${NFS_COW}|cut -d, -f1)
1021 nfs_cow_opts="-o nolock"
1027 cowdevice=$(echo ${nfs_cow}|sed "s/client_mac_address/${mac}/")
1030 panic "unable to determine mac address"
1037 if [ "${cow_fstype}" = "nfs" ]
1039 [ "${quiet}" != "y" ] && log_begin_msg \
1040 "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow"
1041 nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \
1042 panic "Can not mount ${cowdevice} on /cow"
1044 mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \
1045 panic "Can not mount ${cowdevice} on /cow"
1048 rofscount=$(echo ${rofslist} |wc -w)
1050 if [ -n "${EXPOSED_ROOT}" ]
1052 if [ ${rofscount} -ne 1 ]
1054 panic "only one RO file system supported with exposedroot: ${rofslist}"
1056 exposedrootfs=${rofslist%% }
1058 mount --bind ${exposedrootfs} ${rootmnt} || \
1059 panic "bind mount of ${exposedrootfs} failed"
1061 cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool
1062 /home /var/lib/live'
1064 for dir in ${cow_dirs}; do
1066 mount -t ${UNIONTYPE} \
1067 -o rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro \
1068 ${UNIONTYPE} "${rootmnt}${dir}" || \
1069 panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option \
1070 rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro"
1073 mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \
1074 ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \
1075 ${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}"
1078 # tmpfs file systems
1079 mkdir -p "${rootmnt}/live"
1080 mount -t tmpfs tmpfs ${rootmnt}/live
1082 # Adding other custom mounts
1083 if [ -n "${PERSISTENT}" ]
1085 # directly mount /home
1086 # FIXME: add a custom mounts configurable system
1087 homecow=$(find_cow_device "${home_persistence}" )
1089 if [ -b "${homecow}" ]
1091 mount -t $(get_fstype "${homecow}") -o rw,noatime "${homecow}" "${rootmnt}/home"
1092 export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy()
1094 [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
1097 # Look for other snapshots to copy in
1098 try_snap "${root_snapshot_label}" "${rootmnt}" "ROOT"
1099 try_snap "${home_snapshot_label}" "${rootmnt}/home" "HOME"
1102 if [ -n "${SHOWMOUNTS}" ]
1104 for d in ${rofslist}
1106 mkdir -p "${rootmnt}/live/${d##*/}"
1110 # do nothing # mount -o bind "${d}" "${rootmnt}/live/${d##*/}"
1114 mount --move "${d}" "${rootmnt}/live/${d##*/}"
1120 # shows cow fs on /cow for use by live-snapshot
1121 mkdir -p "${rootmnt}/live/cow"
1122 mount -o move /cow "${rootmnt}/live/cow"
1129 skip_uuid_check="${3}"
1131 if [ -z "${devname}" ]
1133 devname=$(sys2dev "${sysdev}")
1136 if [ -n "${LIVE_MEDIA_OFFSET}" ]
1138 loopdevname=$(setup_loop "${devname}" "loop" "/sys/block/loop*" "${LIVE_MEDIA_OFFSET}" '')
1139 devname="${loopdevname}"
1142 fstype=$(get_fstype "${devname}")
1144 if is_supported_fs ${fstype}
1146 mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
1148 if is_live_path ${mountpoint} && \
1149 ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
1154 umount ${mountpoint}
1158 if [ -n "${LIVE_MEDIA_OFFSET}" ]
1160 losetup -d "${loopdevname}"
1170 # first look at the one specified in the command line
1171 if [ ! -z "${LIVE_MEDIA}" ]
1173 if check_dev "null" "${LIVE_MEDIA}" "skip_uuid_check"
1179 # don't start autodetection before timeout has expired
1180 if [ -n "${LIVE_MEDIA_TIMEOUT}" ]
1182 if [ "${timeout}" -lt "${LIVE_MEDIA_TIMEOUT}" ]
1188 # or do the scan of block devices
1189 for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v 'dm-')
1191 devname=$(sys2dev "${sysblock}")
1192 fstype=$(get_fstype "${devname}")
1194 if /lib/udev/cdrom_id ${devname} > /dev/null
1196 if check_dev "null" "${devname}"
1200 elif is_nice_device "${sysblock}"
1202 for dev in $(subdevices "${sysblock}")
1204 if check_dev "${dev}"
1209 elif [ "${fstype}" = "squashfs" -o \
1210 "${fstype}" = "ext2" -o \
1211 "${fstype}" = "ext3" -o \
1212 "${fstype}" = "jffs2" ]
1214 # This is an ugly hack situation, the block device has
1215 # an image directly on it. It's hopefully
1216 # live-initramfs, so take it and run with it.
1217 ln -s "${devname}" "${devname}.${fstype}"
1218 echo "${devname}.${fstype}"
1226 set_usplash_timeout ()
1228 if [ -x /sbin/usplash_write ]
1230 /sbin/usplash_write "TIMEOUT 120"
1237 if [ -x /scripts/local-top/cryptroot ]; then
1238 /scripts/local-top/cryptroot
1249 [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-premount"
1250 run_scripts /scripts/live-premount
1251 [ "${quiet}" != "y" ] && log_end_msg
1253 # Needed here too because some things (*cough* udev *cough*)
1254 # changes the timeout
1258 if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ]
1262 livefs_root="${mountpoint}"
1264 panic "Unable to find a live file system on the network"
1267 if [ -n "${PLAIN_ROOT}" ] && [ -n "${ROOT}" ]
1269 # Do a local boot from hd
1272 # Scan local devices for the image
1273 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
1275 livefs_root=$(find_livefs ${i})
1277 if [ -n "${livefs_root}" ]
1287 if [ -z "${livefs_root}" ]
1289 panic "Unable to find a medium containing a live file system"
1295 elif [ "${TODISK}" ]
1297 live_dest="${TODISK}"
1300 if [ "${live_dest}" ]
1302 log_begin_msg "Copying live media to ${live_dest}"
1303 copy_live_to "${livefs_root}" "${live_dest}"
1307 if [ -n "${MODULETORAMFILE}" ]
1309 setup_unionfs "${livefs_root}" "${rootmnt}"
1312 mac="$(echo ${mac} | sed 's/-//g')"
1313 mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}"
1318 maybe_break live-bottom
1319 [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
1321 run_scripts /scripts/live-bottom
1322 [ "${quiet}" != "y" ] && log_end_msg
1326 cp live.log "${rootmnt}/var/log/"