From: Arne Fitzenreiter Date: Thu, 19 Feb 2009 22:40:36 +0000 (+0100) Subject: Add a script to rebuild the initrd X-Git-Tag: v2.5-beta1~159 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25926240664459c149e247e6b6a0088a17c6f50c;p=ipfire-2.x.git Add a script to rebuild the initrd --- diff --git a/config/rootfiles/common/stage2 b/config/rootfiles/common/stage2 index 93451abdbf..53e7e59bbb 100644 --- a/config/rootfiles/common/stage2 +++ b/config/rootfiles/common/stage2 @@ -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 diff --git a/config/rootfiles/core/27/files b/config/rootfiles/core/27/files index 6b3bbbc552..32537b66a8 100644 --- a/config/rootfiles/core/27/files +++ b/config/rootfiles/core/27/files @@ -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 index 0000000000..79ec1c36d7 --- /dev/null +++ b/src/scripts/rebuild-initrd @@ -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 . # +# # +############################################################################ +# +# +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