archboot/lib/initcpio/hooks/arch_addons

49 lines
1.8 KiB
Text
Raw Normal View History

2009-12-11 11:28:56 +01:00
# Created by Tobias Powalowski <tpowa@archlinux.org>
2007-02-22 23:46:50 +01:00
run_hook ()
{
2007-10-22 07:56:38 +02:00
if grep -qw arch-addons /proc/cmdline; then
ARCH_ADDON="optical storage floppy disk"
### exclude kernel ntfs it seems broken!
2009-12-11 11:50:55 +01:00
msg "Disabling kernel NTFS module for mounting, due to known issues!"
2007-10-22 07:56:38 +02:00
mv /lib/modules/$(uname -r)/kernel/fs/ntfs/ntfs.ko /lib/modules/$(uname -r)/kernel/fs/ntfs/ntfs.ko.old
2009-12-11 11:50:55 +01:00
msg " Waiting 10 seconds for usb/fw devices to come ready..."
2007-10-22 07:56:38 +02:00
sleep 10
for i in $ARCH_ADDON; do
2009-12-11 11:50:55 +01:00
msg "Checking $i devices for addons..."
2007-10-22 07:56:38 +02:00
for k in $(find /dev -maxdepth 1 -group "$i"); do
if mount $k /addons > /dev/null 2>&1; then
2009-12-11 11:50:55 +01:00
msg "Looking for new config files on $k, checking /config directory..."
2007-10-22 07:56:38 +02:00
if [ -d "/addons/config" ]; then
2009-12-11 11:50:55 +01:00
msg "Copying new config files to /etc install environment..."
2007-10-22 07:56:38 +02:00
cp -r /addons/config/* /etc/
2009-12-11 11:50:55 +01:00
msg "Finished."
2007-10-22 07:56:38 +02:00
RETRIGGER_UDEV="1"
else
2009-12-11 11:50:55 +01:00
msg "No files found to copy in /config directory on media $i."
2007-10-22 07:56:38 +02:00
fi
2009-12-11 11:50:55 +01:00
msg "Looking for new packages to install on $k, checking /packages directory..."
2007-10-22 07:56:38 +02:00
if [ -d "/addons/packages" ]; then
mkdir /tmp/packages/
2009-12-11 11:50:55 +01:00
msg "Copying new packages to /tmp/packages/ install environment..."
2007-10-22 07:56:38 +02:00
cp /addons/packages/*.pkg.tar.gz /tmp/packages/
2009-12-11 11:50:55 +01:00
msg "Installing new packages to install environment..."
pacman -U /tmp/packages/* || msg "Dependency resolution failed!"
2007-10-22 07:56:38 +02:00
RETRIGGER_UDEV="1"
else
2009-12-11 11:50:55 +01:00
msg "No new files found to copy and install in /packages directory on media $k."
2007-10-22 07:56:38 +02:00
fi
umount /addons
sleep 2
2007-02-22 23:46:50 +01:00
fi
2007-10-22 07:56:38 +02:00
done
done
mv /lib/modules/$(uname -r)/kernel/fs/ntfs/ntfs.ko.old /lib/modules/$(uname -r)/kernel/fs/ntfs/ntfs.ko
if [ "$RETRIGGER_UDEV" = "1" ]; then
2009-12-11 11:50:55 +01:00
msg "Retrigger udev uevents..."
udevadm trigger
udevadm settle
2007-10-22 07:56:38 +02:00
fi
2007-02-22 23:46:50 +01:00
fi
}