2006-08-30 07:32:35 +02:00
|
|
|
# vim: set ft=sh:
|
|
|
|
run_hook ()
|
|
|
|
{
|
|
|
|
if [ "x${ramdisk_size}" = "x" ]; then
|
|
|
|
ramdisk_size="75%"
|
|
|
|
fi
|
|
|
|
msg -n ":: Mounting tmpfs, size=${ramdisk_size}..."
|
|
|
|
mount -t tmpfs -o "size=${ramdisk_size}" tmpfs /tmpfs
|
|
|
|
mkdir /tmpfs/bootcd
|
|
|
|
msg "done."
|
|
|
|
|
2006-09-28 06:36:34 +02:00
|
|
|
if [ "x${BOOT_MOUNT}" -eq "x" ]; then
|
|
|
|
echo "ERROR: BOOT_MOUNT is not set. The boot-cd or boot-usb hook MUST"
|
|
|
|
echo " be run before this one. This image was improperly built"
|
2006-08-30 07:32:35 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2006-09-28 06:36:34 +02:00
|
|
|
squashimg="${BOOT_MOUNT}/archiso.sqfs"
|
2006-09-28 04:15:25 +02:00
|
|
|
if [ "${copytoram}" = "y" ]; then
|
2006-09-28 06:36:34 +02:00
|
|
|
/bin/cat ${squashimg} > /tmpfs/archiso.sqfs
|
|
|
|
squashimg="/tmpfs/archiso.sqfs"
|
2006-09-11 10:36:37 +02:00
|
|
|
fi
|
|
|
|
|
2006-09-28 04:15:25 +02:00
|
|
|
msg ":: Mounting squashfs image"
|
2006-08-30 07:32:35 +02:00
|
|
|
/bin/modprobe -q squashfs >/dev/null 2>&1
|
2006-08-30 07:36:12 +02:00
|
|
|
/bin/mkdir -p /tmpfs/squashfs_root
|
2006-09-28 04:15:25 +02:00
|
|
|
if ! /bin/losetup /dev/loop0 "${squashimg}" >/dev/null 2>&1; then
|
2006-08-30 07:32:35 +02:00
|
|
|
echo "ERROR: Cannot mount loop device /dev/loop0...aborting"
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-09-11 10:36:37 +02:00
|
|
|
|
2006-08-30 07:36:12 +02:00
|
|
|
/bin/mount -r -t squashfs /dev/loop0 /tmpfs/squashfs_root
|
2006-08-30 07:32:35 +02:00
|
|
|
|
2006-09-28 04:15:25 +02:00
|
|
|
msg ":: Mounting root (union) filesystem"
|
2006-08-30 07:32:35 +02:00
|
|
|
/bin/modprobe -q unionfs >/dev/null 2>&1
|
2006-09-28 04:15:25 +02:00
|
|
|
/bin/mount -t unionfs -o dirs=/tmpfs=rw:/tmpfs/squashfs_root=ro none /real_root
|
2006-08-30 07:32:35 +02:00
|
|
|
|
2006-08-30 07:36:12 +02:00
|
|
|
if [ -d /proc/sys/dev/cdrom ]; then
|
2006-08-30 07:32:35 +02:00
|
|
|
echo 0 > /proc/sys/dev/cdrom/lock
|
|
|
|
echo 1 > /proc/sys/dev/cdrom/autoeject
|
|
|
|
fi
|
|
|
|
|
|
|
|
udevpid=$(/bin/minips -C udevd -o pid=)
|
2006-08-30 07:36:12 +02:00
|
|
|
[ "x${udevpid}" != "x" ] && /bin/kill -9 $udevpid 2>&1 >/dev/null
|
2006-08-30 07:32:35 +02:00
|
|
|
#Yep, we're bailing out here. We don't need kinit.
|
2006-08-30 07:36:12 +02:00
|
|
|
msg ":: Passing control to Archlinux Initscripts...Please Wait"
|
2006-09-11 10:36:37 +02:00
|
|
|
/bin/umount /sys
|
|
|
|
/bin/umount /proc
|
|
|
|
/bin/umount /dev
|
2006-08-30 07:32:35 +02:00
|
|
|
exec /bin/run-init -c /dev/console /real_root /sbin/init ${CMDLINE}
|
|
|
|
}
|