7 if [ -x /scripts
/local-top
/cryptroot
]
9 /scripts
/local-top
/cryptroot
16 tail -f boot.log
>&7 &
21 _CMDLINE
="$(cat /proc/cmdline)"
25 case "${LIVE_DEBUG}" in
31 case "${LIVE_READ_ONLY}" in
39 # Needed here too because some things (*cough* udev *cough*)
42 if [ ! -z "${NETBOOT}" ] || [ ! -z "${FETCH}" ] || [ ! -z "${HTTPFS}" ] || [ ! -z "${FTPFS}" ]
46 livefs_root
="${mountpoint}"
48 panic
"Unable to find a live file system on the network"
51 if [ -n "${ISCSI_PORTAL}" ]
53 do_iscsi
&& livefs_root
="${mountpoint}"
54 elif [ -n "${PLAIN_ROOT}" ] && [ -n "${ROOT}" ]
56 # Do a local boot from hd
59 if [ -x /usr
/bin
/memdiskfind
]
61 MEMDISK
=$
(/usr
/bin
/memdiskfind
)
65 # We found a memdisk, set up phram
66 modprobe phram phram
=memdisk
,${MEMDISK}
68 # Load mtdblock, the memdisk will be /dev/mtdblock0
73 # Scan local devices for the image
77 livefs_root
=$
(find_livefs
${i})
79 if [ -n "${livefs_root}" ]
90 if [ -z "${livefs_root}" ]
92 panic
"Unable to find a medium containing a live file system"
95 case "${LIVE_VERIFY_CHECKSUMS}" in
97 Verify_checksums
"${livefs_root}"
106 live_dest
="${TODISK}"
109 if [ "${live_dest}" ]
111 log_begin_msg
"Copying live media to ${live_dest}"
112 copy_live_to
"${livefs_root}" "${live_dest}"
116 # if we do not unmount the ISO we can't run "fsck /dev/ice" later on
117 # because the mountpoint is left behind in /proc/mounts, so let's get
118 # rid of it when running from RAM
119 if [ -n "$FROMISO" ] && [ "${TORAM}" ]
121 losetup
-d /dev
/loop0
123 if is_mountpoint
/live
/fromiso
126 rmdir --ignore-fail-on-non-empty /live
/fromiso \
127 >/dev
/null
2>&1 || true
131 if [ -n "${MODULETORAMFILE}" ] ||
[ -n "${PLAIN_ROOT}" ]
133 setup_unionfs
"${livefs_root}" "${rootmnt}"
136 mac
="$(echo ${mac} | sed 's/-//g')"
137 mount_images_in_directory
"${livefs_root}" "${rootmnt}" "${mac}"
141 if [ -n "${ROOT_PID}" ]
143 echo "${ROOT_PID}" > "${rootmnt}"/live
/root.pid
148 # unionfs-fuse needs /dev to be bind-mounted for the duration of
149 # live-bottom; udev's init script will take care of things after that
150 case "${UNIONTYPE}" in
152 mount
-n -o bind /dev
"${rootmnt}/dev"
156 # Move to the new root filesystem so that programs there can get at it.
157 if [ ! -d /root
/live
/image
]
159 mkdir
-p /root
/live
/image
160 mount
--move /live
/image
/root
/live
/image
163 # aufs2 in kernel versions around 2.6.33 has a regression:
164 # directories can't be accessed when read for the first the time,
165 # causing a failure for example when accessing /var/lib/fai
166 # when booting FAI, this simple workaround solves it
167 ls /root
/* >/dev
/null
2>&1
169 # Move findiso directory to the new root filesystem so that programs there can get at it.
170 if [ -d /live
/findiso
] && [ ! -d /root
/live
/findiso
]
172 mkdir
-p /root
/live
/findiso
173 mount
-n --move /live
/findiso
/root
/live
/findiso
176 # if we do not unmount the ISO we can't run "fsck /dev/ice" later on
177 # because the mountpoint is left behind in /proc/mounts, so let's get
178 # rid of it when running from RAM
179 if [ -n "$FINDISO" ] && [ "${TORAM}" ]
181 losetup
-d /dev
/loop0
183 if is_mountpoint
/root
/live
/findiso
185 umount
/root
/live
/findiso
186 rmdir --ignore-fail-on-non-empty /root
/live
/findiso \
187 >/dev
/null
2>&1 || true
191 if [ -f /etc
/resolv.conf
] && [ ! -s ${rootmnt}/etc
/resolv.conf
]
193 log_begin_msg
"Copying /etc/resolv.conf to ${rootmnt}/etc/resolv.conf"
194 cp -v /etc
/resolv.conf
${rootmnt}/etc
/resolv.conf
198 if ! [ -d "/lib/live/boot" ]
200 panic
"A wrong rootfs was mounted."
206 case "${LIVE_SWAPON}" in
214 umount
"${rootmnt}/dev"
221 [ -w "${rootmnt}/var/log/" ] && mkdir -p "${rootmnt}/var/log/live" && cp boot.log "${rootmnt}/var/log/live" 2>/dev
/null