xbps-base-files: revamped initramfs-tools trigger.

The initramfs-tools trigger has been improved to allow rebuilding
all initramfs when a package != kernel runs it.

Bump to 0.23.

--HG--
extra : convert_revision : ca2da46184b8a879ba0e24eff1f79ae75f539449
This commit is contained in:
Juan RP 2009-10-03 08:33:36 +02:00
parent 2104be8be4
commit 49430c3e66
2 changed files with 24 additions and 12 deletions

View File

@ -1,6 +1,6 @@
# Template file for 'xbps-base-files'
pkgname=xbps-base-files
version=0.22
version=0.23
build_style=custom-install
short_desc="xbps base system files"
maintainer="Juan RP <xtraeme@gmail.com>"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -e
#
# Runs update-initramfs(8) to create/update an initramfs for specified
# version (if the pkg that is triggering it) or for the currently
@ -9,22 +9,34 @@
# $3 = pkgname
# $4 = version
#
case "$1" in
ACTION="$1"
TARGET="$2"
PKGNAME="$3"
VERSION="$4"
update_initramfs=usr/sbin/update-initramfs
case "$ACTION" in
targets)
echo "post-install"
;;
run)
[ ! -x usr/sbin/update-initramfs ] && exit 0
[ "$2" != "post-install" ] && exit 1
[ ! -x ${update_initramfs} ] && exit 0
[ "$TARGET" != "post-install" ] && exit 1
initramfs_cmd="update-initramfs"
initramfs_args="update-initramfs"
if [ "$3" = "kernel" -a ! -f ./var/lib/initramfs-tools/$4 ]; then
initramfs_cmd="$initramfs_cmd -c -k $4"
elif [ "$3" != "kernel" -o ! -f ./var/lib/initramfs-tools/$4 ]; then
initramfs_cmd="$initramfs_cmd -c -k $(xbps-pkgdb version kernel)"
if [ "$PKGNAME" = "kernel" ]; then
if [ ! -f var/lib/initramfs-tools/${VERSION} ]; then
# Create new initramfs
initramfs_args="-c -k ${VERSION}"
else
# Update existing initramfs
initramfs_args="-u -k ${VERSION}"
fi
else
initramfs_cmd="$initramfs_cmd -u -k $4"
# Update initramfs for all kernels
initramfs_args="-u -k all"
fi
if [ ! -e /proc/filesystems ]; then
@ -37,7 +49,7 @@ run)
sys_mounted=1
fi
${initramfs_cmd}
${update_initramfs} ${initramfs_args}
if [ -n "$proc_mounted" ]; then
umount /proc