From 485a777f795a46fd507991388bcdfb2113bcad31 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 5 May 2009 05:28:24 +0200 Subject: [PATCH] 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 --- templates/xbps-base-files/template | 2 +- triggers/initramfs-tools | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/templates/xbps-base-files/template b/templates/xbps-base-files/template index b0b657dd7e4..dcafdb3ff3d 100644 --- a/templates/xbps-base-files/template +++ b/templates/xbps-base-files/template @@ -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 " diff --git a/triggers/initramfs-tools b/triggers/initramfs-tools index 9d25d563243..055444c4997 100755 --- a/triggers/initramfs-tools +++ b/triggers/initramfs-tools @@ -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