]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Add a script to rebuild the initrd
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 19 Feb 2009 22:40:36 +0000 (23:40 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 19 Feb 2009 22:40:36 +0000 (23:40 +0100)
config/rootfiles/common/stage2
config/rootfiles/core/27/files
src/scripts/rebuild-initrd [new file with mode: 0644]

index 93451abdbf0ab4cf8d395273156b9a2228682a3f..53e7e59bbbcac141508ed4e0169a90b1d37fa0d1 100644 (file)
@@ -66,6 +66,7 @@ usr/local/bin/qosd
 usr/local/bin/readhash
 usr/local/bin/run-parts
 usr/local/bin/scanhd
+usr/local/bin/rebuild-initrd
 usr/local/bin/setddns.pl
 usr/local/bin/settime
 usr/local/bin/timecheck
index 6b3bbbc55257503aa10040b3dd423f877d464d63..32537b66a859c6e5f85b95455c367bf31b811cc5 100644 (file)
@@ -53,4 +53,5 @@ usr/bin/athkey
 usr/bin/athstats
 usr/bin/madwifi-unload
 usr/bin/wlanconfig
-usr/bin/wpakey
\ No newline at end of file
+usr/bin/wpakey
+usr/local/bin/rebuild-initrd
diff --git a/src/scripts/rebuild-initrd b/src/scripts/rebuild-initrd
new file mode 100644 (file)
index 0000000..79ec1c3
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 3 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2008 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+#
+KVER=`uname -r | cut -d"-" -f1`
+ROOT=`grep "root=" /boot/grub/grub.conf | cut -d"=" -f2 | cut -d" " -f1 | tail -n 1`
+echo
+echo Rebuild the Initramdisk ...
+cp -f /etc/mkinitcpio.conf.org /etc/mkinitcpio.conf
+#
+# Made initramdisk
+#
+if [ "${ROOT:0:7}" == "/dev/sd" ]; then
+    # Remove ide hook if root is on sda 
+    sed -i "s| ide | |g" /etc/mkinitcpio.conf
+else
+if [ "${ROOT:0:7}" == "/dev/hd" ]; then
+    # Remove pata & sata hook if root is on hda 
+    sed -i "s| pata | |g" /etc/mkinitcpio.conf
+    sed -i "s| sata | |g" /etc/mkinitcpio.conf
+fi
+fi
+mkinitcpio -k $KVER-ipfire -g /boot/ipfirerd-$KVER.img