xbps-base-files: fixes for the initramfs-tools trigger.
Only mount /proc and /sys if they aren't mounted already, use /lib/rc/bin/mouninfo from OpenRC. Bump revision. --HG-- extra : convert_revision : 18f901f72548eaef1e040984cc72aa11ce6ea76c
This commit is contained in:
parent
b606a97d36
commit
485a777f79
@ -1,6 +1,6 @@
|
||||
# Template file for 'xbps-base-files'
|
||||
pkgname=xbps-base-files
|
||||
version=0.14
|
||||
version=0.15
|
||||
build_style=custom-install
|
||||
short_desc="xbps base system files"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
|
@ -16,15 +16,12 @@ targets)
|
||||
echo "post-install"
|
||||
;;
|
||||
run)
|
||||
[ ! -x ./usr/sbin/update-initramfs ] && exit 0
|
||||
[ ! -x usr/sbin/update-initramfs ] && exit 0
|
||||
[ ! -x lib/rc/bin/mountinfo ] && exit 0
|
||||
[ "$2" != "post-install" ] && exit 1
|
||||
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
mntproc_cmd="mount -t proc proc /proc"
|
||||
umntproc_cmd="umount /proc"
|
||||
mntsys_cmd="mount -t sysfs none /sys"
|
||||
umntsys_cmd="umount /sys"
|
||||
initramfs_cmd="update-initramfs"
|
||||
|
||||
if [ "$3" = "kernel" -a ! -f ./var/lib/initramfs-tools/$4 ]; then
|
||||
@ -35,11 +32,23 @@ run)
|
||||
initramfs_cmd="$initramfs_cmd -u -k $4"
|
||||
fi
|
||||
|
||||
${mntproc_cmd}
|
||||
${mntsys_cmd}
|
||||
if ! /lib/rc/bin/mountinfo -q /proc; then
|
||||
mount -t proc proc /proc
|
||||
proc_mounted=1
|
||||
fi
|
||||
if ! /lib/rc/bin/mountinfo -q /sys; then
|
||||
mount -t sysfs sysfs /sys
|
||||
sys_mounted=1
|
||||
fi
|
||||
|
||||
${initramfs_cmd}
|
||||
${umntproc_cmd}
|
||||
${umntsys_cmd}
|
||||
|
||||
if [ -n "$proc_mounted" ]; then
|
||||
umount /proc
|
||||
fi
|
||||
if [ -n "$sys_mounted" ]; then
|
||||
umount /sys
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user