7 if [ -x /scripts/local-top/cryptroot ]
9 /scripts/local-top/cryptroot
16 tail -f boot.log >&7 &
21 _CMDLINE="$(cat /proc/cmdline)"
24 case "${LIVE_DEBUG}" in
30 case "${LIVE_READ_ONLY}" in
38 # Needed here too because some things (*cough* udev *cough*)
41 if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ] || [ ! -z "${HTTPFS}" ] || [ ! -z "${FTPFS}" ]
45 livefs_root="${mountpoint}"
47 panic "Unable to find a live file system on the network"
50 if [ -n "${ISCSI_PORTAL}" ]
52 do_iscsi && livefs_root="${mountpoint}"
53 elif [ -n "${PLAIN_ROOT}" ] && [ -n "${ROOT}" ]
55 # Do a local boot from hd
58 if [ -x /usr/bin/memdiskfind ]
60 MEMDISK=$(/usr/bin/memdiskfind)
64 # We found a memdisk, set up phram
65 modprobe phram phram=memdisk,${MEMDISK}
67 # Load mtdblock, the memdisk will be /dev/mtdblock0
72 # Scan local devices for the image
76 livefs_root=$(find_livefs ${i})
78 if [ -n "${livefs_root}" ]
89 if [ -z "${livefs_root}" ]
91 panic "Unable to find a medium containing a live file system"
94 case "${LIVE_VERIFY_CHECKSUMS}" in
96 Verify_checksums "${livefs_root}"
105 live_dest="${TODISK}"
108 if [ "${live_dest}" ]
110 log_begin_msg "Copying live media to ${live_dest}"
111 copy_live_to "${livefs_root}" "${live_dest}"
115 # if we do not unmount the ISO we can't run "fsck /dev/ice" later on
116 # because the mountpoint is left behind in /proc/mounts, so let's get
117 # rid of it when running from RAM
118 if [ -n "$FROMISO" ] && [ "${TORAM}" ]
120 losetup -d /dev/loop0
122 if is_mountpoint /live/fromiso
125 rmdir --ignore-fail-on-non-empty /live/fromiso \
126 >/dev/null 2>&1 || true
130 if [ -n "${MODULETORAMFILE}" ] || [ -n "${PLAIN_ROOT}" ]
132 setup_unionfs "${livefs_root}" "${rootmnt}"
135 mac="$(echo ${mac} | sed 's/-//g')"
136 mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}"
140 if [ -n "${ROOT_PID}" ]
142 echo "${ROOT_PID}" > "${rootmnt}"/live/root.pid
147 # unionfs-fuse needs /dev to be bind-mounted for the duration of
148 # live-bottom; udev's init script will take care of things after that
149 case "${UNIONTYPE}" in
151 mount -n -o bind /dev "${rootmnt}/dev"
155 # Move to the new root filesystem so that programs there can get at it.
156 if [ ! -d /root/live/image ]
158 mkdir -p /root/live/image
159 mount --move /live/image /root/live/image
162 # aufs2 in kernel versions around 2.6.33 has a regression:
163 # directories can't be accessed when read for the first the time,
164 # causing a failure for example when accessing /var/lib/fai
165 # when booting FAI, this simple workaround solves it
166 ls /root/* >/dev/null 2>&1
168 # Move findiso directory to the new root filesystem so that programs there can get at it.
169 if [ -d /live/findiso ] && [ ! -d /root/live/findiso ]
171 mkdir -p /root/live/findiso
172 mount -n --move /live/findiso /root/live/findiso
175 # if we do not unmount the ISO we can't run "fsck /dev/ice" later on
176 # because the mountpoint is left behind in /proc/mounts, so let's get
177 # rid of it when running from RAM
178 if [ -n "$FINDISO" ] && [ "${TORAM}" ]
180 losetup -d /dev/loop0
182 if is_mountpoint /root/live/findiso
184 umount /root/live/findiso
185 rmdir --ignore-fail-on-non-empty /root/live/findiso \
186 >/dev/null 2>&1 || true
190 if [ -f /etc/resolv.conf ] && [ ! -s ${rootmnt}/etc/resolv.conf ]
192 log_begin_msg "Copying /etc/resolv.conf to ${rootmnt}/etc/resolv.conf"
193 cp -v /etc/resolv.conf ${rootmnt}/etc/resolv.conf
197 if ! [ -d "/lib/live/boot" ]
199 panic "A wrong rootfs was mounted."
205 case "${LIVE_SWAPON}" in
213 umount "${rootmnt}/dev"
220 [ -w "${rootmnt}/var/log/" ] && mkdir -p /var/log/live && cp boot.log "${rootmnt}/var/log/live" 2>/dev/null