dracut: add support for kernel hooks.
This commit is contained in:
parent
2cb27b0045
commit
b99dbd3ae3
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Kernel post-install hook for dracut.
|
||||
#
|
||||
# Arguments passed to this script: $1 pkgname, $2 version.
|
||||
#
|
||||
PKGNAME="$1"
|
||||
VERSION="$2"
|
||||
|
||||
if [ ! -x /usr/bin/dracut ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
dracut --xz --force ${VERSION}
|
||||
exit $?
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Kernel post-remove hook for dracut.
|
||||
#
|
||||
# Arguments passed to this script: $1 pkgname, $2 version.
|
||||
#
|
||||
PKGNAME="$1"
|
||||
VERSION="$2"
|
||||
|
||||
if [ -f /boot/initramfs-${VERSION}.img ]; then
|
||||
rm -f /boot/initramfs-${VERSION}.img
|
||||
fi
|
||||
exit $?
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'dracut'
|
||||
pkgname=dracut
|
||||
version=018
|
||||
revision=2
|
||||
revision=3
|
||||
noarch=yes
|
||||
build_style=gnu-makefile
|
||||
make_build_args="sysconfdir=/etc systemdsystemunitdir=/lib/systemd/system"
|
||||
|
@ -36,3 +36,11 @@ pre_install() {
|
|||
# fix path to busybox.
|
||||
sed -i "s|/sbin/busybox|/bin/busybox|g" modules.d/05busybox/module-setup.sh
|
||||
}
|
||||
|
||||
post_install() {
|
||||
# kernel hooks.
|
||||
vinstall ${FILESDIR}/kernel-hook-postinst \
|
||||
755 etc/kernel.d/post-install 10-dracut
|
||||
vinstall ${FILESDIR}/kernel-hook-postrm \
|
||||
755 etc/kernel.d/post-remove 10-dracut
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue