Update archiso hooks to work with next mkinitcpio 0.6
Some basic changes to make archiso hooks work with the next mkinitcpio 0.6 Tested under KVM, a ""2010.02"" and works fine with it. NOTE: current mkinitcpio-0.5.99.2-2 does not include "losetup", maybe will be included in next version, see #[1]. For now must be added manually. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
parent
a2f6841ce3
commit
1baefc75a6
@ -9,7 +9,7 @@ _mnt_bind()
|
|||||||
# args: /path/to/image_file
|
# args: /path/to/image_file
|
||||||
_mnt_squashfs()
|
_mnt_squashfs()
|
||||||
{
|
{
|
||||||
/bin/modprobe -q loop >/dev/null 2>&1
|
/sbin/modprobe -q loop >/dev/null 2>&1
|
||||||
|
|
||||||
img="${1}"
|
img="${1}"
|
||||||
base_img="${img##*/}";
|
base_img="${img##*/}";
|
||||||
@ -27,7 +27,7 @@ _mnt_squashfs()
|
|||||||
while [ ! -e "/dev/loop${LOOP_NUM}" ]; do
|
while [ ! -e "/dev/loop${LOOP_NUM}" ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
if ! /bin/losetup "/dev/loop${LOOP_NUM}" ${img}; then
|
if ! /sbin/losetup "/dev/loop${LOOP_NUM}" ${img}; then
|
||||||
echo "ERROR: Cannot mount loop device /dev/loop${LOOP_NUM}"
|
echo "ERROR: Cannot mount loop device /dev/loop${LOOP_NUM}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -70,7 +70,7 @@ run_hook ()
|
|||||||
PS1="ramfs$ " /bin/sh -i
|
PS1="ramfs$ " /bin/sh -i
|
||||||
done
|
done
|
||||||
|
|
||||||
eval $(fstype < /dev/archiso 2>/dev/null)
|
FSTYPE=$(blkid -o value -s TYPE /dev/archiso 2>/dev/null)
|
||||||
if [ -n "${FSTYPE}" ]; then
|
if [ -n "${FSTYPE}" ]; then
|
||||||
if [ "${FSTYPE}" = "unknown" ]; then
|
if [ "${FSTYPE}" = "unknown" ]; then
|
||||||
# First try mounting then with vfat, maybe someone put the image on
|
# First try mounting then with vfat, maybe someone put the image on
|
||||||
@ -98,8 +98,8 @@ run_hook ()
|
|||||||
echo "ERROR: /dev/archiso found, but the filesystem type is unknown."
|
echo "ERROR: /dev/archiso found, but the filesystem type is unknown."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/bin/modprobe -q squashfs >/dev/null 2>&1
|
/sbin/modprobe -q squashfs >/dev/null 2>&1
|
||||||
/bin/modprobe -q aufs >/dev/null 2>&1
|
/sbin/modprobe -q aufs >/dev/null 2>&1
|
||||||
|
|
||||||
msg ":: Mounting root (aufs) filesystem"
|
msg ":: Mounting root (aufs) filesystem"
|
||||||
/bin/mount -t aufs -o dirs=/tmpfs=rw none /real_root
|
/bin/mount -t aufs -o dirs=/tmpfs=rw none /real_root
|
||||||
@ -137,17 +137,19 @@ run_hook ()
|
|||||||
|
|
||||||
if [ "${break}" = "y" ]; then
|
if [ "${break}" = "y" ]; then
|
||||||
echo ":: Break requested, type 'exit' to resume operation"
|
echo ":: Break requested, type 'exit' to resume operation"
|
||||||
echo " NOTE: klibc contains no 'ls' binary, use 'echo *' instead"
|
|
||||||
PS1="ramfs$ " /bin/sh -i
|
PS1="ramfs$ " /bin/sh -i
|
||||||
fi
|
fi
|
||||||
|
|
||||||
udevpid=$(/bin/minips -C udevd -o pid=)
|
#Special handling if udev is running
|
||||||
[ "x${udevpid}" != "x" ] && /bin/kill -9 $udevpid 2>&1 >/dev/null
|
udevpid=$(/bin/pidof udevd)
|
||||||
#Yep, we're bailing out here. We don't need kinit.
|
if [ -n "${udevpid}" ]; then
|
||||||
|
/bin/kill -9 ${udevpid} > /dev/null 2>&1
|
||||||
|
/bin/sleep 0.01
|
||||||
|
fi
|
||||||
msg ":: Passing control to Arch Linux Initscripts...Please Wait"
|
msg ":: Passing control to Arch Linux Initscripts...Please Wait"
|
||||||
/bin/umount /sys
|
/bin/umount /sys
|
||||||
/bin/umount /proc
|
/bin/umount /proc
|
||||||
exec /bin/run-init -c /dev/console /real_root /sbin/init ${CMDLINE}
|
exec /sbin/switch_root -c /dev/console /real_root /sbin/init ${CMDLINE}
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim:ft=sh:ts=4:sw=4:et:
|
# vim:ft=sh:ts=4:sw=4:et:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
run_hook ()
|
run_hook ()
|
||||||
{
|
{
|
||||||
if [ -n "${archisolabel}" ]; then
|
if [ -n "${archisolabel}" ]; then
|
||||||
echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", IMPORT{program}=\"vol_id --export \$tempnode\"" > /lib/udev/rules.d/00-archiso-device.rules
|
echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", IMPORT{program}=\"/sbin/blkid -o udev \$tempnode\"" > /lib/udev/rules.d/00-archiso-device.rules
|
||||||
echo "ENV{ID_FS_LABEL_ENC}==\"${archisolabel}\", SYMLINK+=\"archiso\"" >> /lib/udev/rules.d/00-archiso-device.rules
|
echo "ENV{ID_FS_LABEL_ENC}==\"${archisolabel}\", SYMLINK+=\"archiso\"" >> /lib/udev/rules.d/00-archiso-device.rules
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user