Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

dracut: Added bootloader plugin #151

Merged
merged 2 commits into from

2 participants

@cavalier38
Collaborator

This plugin generates a new initramfs.
Use /etc/dracut.conf to configure dracut.

@Ratler Ratler merged commit 4f99230 into lunar-linux:master
cavalier38 added some commits
@cavalier38 cavalier38 dracut: Added bootloader plugin
This plugin generates a new initramfs.
Use /etc/dracut.conf to configure dracut.
232d362
@cavalier38 cavalier38 dracut: correct year 3f1d8d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 2, 2012
  1. @cavalier38

    dracut: Added bootloader plugin

    cavalier38 authored
    This plugin generates a new initramfs.
    Use /etc/dracut.conf to configure dracut.
  2. @cavalier38

    dracut: correct year

    cavalier38 authored
This page is out of date. Refresh to see the latest.
Showing with 34 additions and 0 deletions.
  1. +34 −0 kernel/dracut/plugin.d/bootloader-dracut.plugin
View
34 kernel/dracut/plugin.d/bootloader-dracut.plugin
@@ -0,0 +1,34 @@
+#!/bin/bash
+#############################################################
+# #
+# bootloader-dracut.plugin - plugin that generate initramfs #
+# #
+#############################################################
+# #
+# Copyright 2012 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
Something went wrong with that request. Please try again.