forked from lunar-linux/moonbase-core
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This plugin generates a new initramfs. Use /etc/dracut.conf to configure dracut.
- Loading branch information
1 parent
33edf46
commit 232d362
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |