Files
linux-3.16.37/SNAP/usher
Jay Larson 9957ddd7b9 THe following changes were made:
* Moved to new version scheme
  * Added brief
  * Split off linux-headers-3.16.37 and linux-firmware as separate packages
2017-03-24 15:46:35 -05:00

51 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
case $1 in
preinst)
exit 0
;;
postinst)
KERNEL_VER=`ls -C1rt ${TARGET}/boot/vmlinuz*|sed 's/.*vmlinuz-//'`
if [[ ${TARGET} ]]; then
echo "Running within ${TARGET} for kernel $KERNEL_VER"
if ! mountpoint -q ${TARGET}/dev; then
mount -t devtmpfs none ${TARGET}/dev
fi
if ! mountpoint -q ${TARGET}/proc; then
mount -t proc none ${TARGET}/proc
fi
if ! mountpoint -q ${TARGET}/sys; then
mount -t sysfs none ${TARGET}/sys
fi
chroot ${TARGET} /bin/bash -c "/sbin/mkinitramfs $KERNEL_VER"
chroot ${TARGET} /bin/bash -c \
"/sbin/grub-mkconfig -o /boot/grub/grub.cfg"
if mountpoint -q ${TARGET}/dev; then
umount ${TARGET}/dev
fi
if mountpoint -q ${TARGET}/proc; then
umount ${TARGET}/proc
fi
if mountpoint -q ${TARGET}/sys; then
umount ${TARGET}/sys
fi
else
echo "Running for kernel $KERNEL_VER"
mkinitramfs $KERNEL_VER
grub-mkconfig -o /boot/grub/grub.cfg
fi
;;
prerm)
exit 0
;;
postrm)
exit 0
;;
esac