Added --enable-rule-generator, usher for mkinitramfs, and dependencies

This commit is contained in:
2016-10-31 16:16:52 -05:00
parent ec928bb00e
commit cbb0f3339f
2 changed files with 37 additions and 2 deletions

34
SNAP/usher Executable file
View File

@@ -0,0 +1,34 @@
#!/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}/proc; then
mount -t proc none ${TARGET}/proc
fi
chroot ${TARGET} /bin/bash -c "/sbin/mkinitramfs $KERNEL_VER"
if mountpoint -q ${TARGET}/proc; then
umount ${TARGET}/proc
fi
else
echo "Running for kernel $KERNEL_VER"
mkinitramfs $KERNEL_VER
fi
;;
prerm)
exit 0
;;
postrm)
exit 0
;;
esac