2006-08-30 07:32:35 +02:00
|
|
|
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
|
|
|
|
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
|
|
|
|
|
2007-10-06 03:52:03 +02:00
|
|
|
squashimg="${BOOT_MOUNT}/archlive.sqfs"
|
2007-10-06 03:09:53 +02:00
|
|
|
if [ "${copytoram}" = "y" ]; then
|
2007-10-06 03:52:03 +02:00
|
|
|
/bin/cat ${squashimg} > /tmpfs/archlive.sqfs
|
|
|
|
squashimg="/tmpfs/archlive.sqfs"
|
2007-10-06 03:09:53 +02:00
|
|
|
fi
|
2006-09-11 10:36:37 +02:00
|
|
|
|
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}
|
|
|
|
}
|
2007-10-11 03:12:47 +02:00
|
|
|
|
|
|
|
# vim:ft=sh:ts=4:sw=4:et:
|