Skip to content

Commit

Permalink
dracut: Added bootloader plugin
Browse files Browse the repository at this point in the history
This plugin generates a new initramfs.
Use /etc/dracut.conf to configure dracut.
  • Loading branch information
cavalier38 committed Nov 2, 2012
1 parent 33edf46 commit 232d362
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions kernel/dracut/plugin.d/bootloader-dracut.plugin
@@ -0,0 +1,34 @@
#!/bin/bash
#############################################################
# #
# bootloader-dracut.plugin - plugin that generate initramfs #
# #
#############################################################
# #
# Copyright 2005 by Peter de Ridder under GPLv2 #
# #
#############################################################


plugin_kernel_updatebootloader_dracut()
{
local KVERSION

debug_msg "plugin_kernel_updatebootloader_dracut ($@)"

KVERSION=`echo $1 | cut -d- -f1`

# create an old copy of the previous initramfs
if [ -f "/boot/initramfs-$KVERSION.img" ]; then
cp -p "/boot/initramfs-$KVERSION.img" "/boot/initramfs-$KVERSION.old.img"
fi

# we can force dracut as we copied the old initramfs
dracut -f "/boot/initramfs-$KVERSION.img" "$KVERSION"

# right now we want to have it run all bootloaders?
return 2
}


plugin_register KERNEL_UPDATEBOOTLOADER plugin_kernel_updatebootloader_dracut

0 comments on commit 232d362

Please sign in to comment.