]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/rootfiles/core/test/update.sh
Updated Kernel (2.6.32.24).
[people/pmueller/ipfire-2.x.git] / config / rootfiles / core / test / update.sh
index a531e912a27c02a592cd989d311625ab9b608a72..078e503d906b68579c8297e234c6fc3f1ddfd02a 100644 (file)
@@ -24,7 +24,7 @@
 . /opt/pakfire/lib/functions.sh
 /usr/local/bin/backupctrl exclude >/dev/null 2>&1
 #
-KVER="2.6.32.21"
+KVER="2.6.32.24"
 MOUNT=`grep "kernel" /boot/grub/grub.conf | tail -n 1`
 # Nur den letzten Parameter verwenden
 echo $MOUNT > /dev/null
@@ -51,6 +51,7 @@ echo etc/mkinitcpio.conf.org >> /opt/pakfire/tmp/ROOTFILES
 echo etc/mkinitcpio.d >> /opt/pakfire/tmp/ROOTFILES
 echo lib/initcpio >> /opt/pakfire/tmp/ROOTFILES
 echo sbin/mkinitcpio >> /opt/pakfire/tmp/ROOTFILES
+echo usr/bin/iw >> /opt/pakfire/tmp/ROOTFILES
 
 # Backup the files
 tar cjvf /var/ipfire/backup/core-upgrade_$KVER.tar.bz2 \
@@ -69,6 +70,8 @@ rm -rf /lib/modules/*-ipfire
 rm -rf /etc/mkinitcpio.*
 rm -rf /lib/initcpio
 rm -rf /sbin/mkinitcpio
+# Remove old iw (new is in usr/sbin)
+rm -rf /usr/bin/iw
 #
 # Backup grub.conf
 #
@@ -82,6 +85,12 @@ echo Unpack the updated files ...
 tar xvf /opt/pakfire/tmp/files --preserve --numeric-owner -C / \
        --no-overwrite-dir
 
+#
+# Stop services to save memory
+#
+/etc/init.d/snort stop
+/etc/init.d/squid stop
+
 # Convert /etc/fstab entries to UUID ...
 #
 echo Convert fstab entries to UUID ...
@@ -92,7 +101,7 @@ SWAP=`grep "/dev/" /proc/swaps | cut -d" " -f1`
 #
 
 if [ ! -z $ROOT ]; then
-       ROOTUUID=`blkid -sUUID $ROOT | cut -d'"' -f2`
+       ROOTUUID=`blkid -c /dev/null -sUUID $ROOT | cut -d'"' -f2`
        if [ ! -z $ROOTUUID ]; then
                sed -i "s|^$ROOT|UUID=$ROOTUUID|g" /etc/fstab
        #else
@@ -103,7 +112,7 @@ if [ ! -z $ROOT ]; then
 fi
 
 if [ ! -z $BOOT ]; then
-       BOOTUUID=`blkid -sUUID $BOOT | cut -d'"' -f2`
+       BOOTUUID=`blkid -c /dev/null -sUUID $BOOT | cut -d'"' -f2`
        if [ ! -z $BOOTUUID ]; then
                sed -i "s|^$BOOT|UUID=$BOOTUUID|g" /etc/fstab
        #else
@@ -114,7 +123,7 @@ if [ ! -z $BOOT ]; then
 fi
 
 if [ ! -z $VAR ]; then
-       VARUUID=`blkid -sUUID $VAR | cut -d'"' -f2`
+       VARUUID=`blkid -c /dev/null -sUUID $VAR | cut -d'"' -f2`
        if [ ! -z $VARUUID ]; then
                sed -i "s|^$VAR|UUID=$VARUUID|g" /etc/fstab
        #else
@@ -125,22 +134,39 @@ if [ ! -z $VAR ]; then
 fi
 
 if [ ! -z $SWAP ]; then
-       SWAPUUID=`blkid -sUUID $SWAP | cut -d'"' -f2`
+       SWAPUUID=`blkid -c /dev/null -sUUID $SWAP | cut -d'"' -f2`
        if [ ! -z $SWAPUUID ]; then
                sed -i "s|^$SWAP|UUID=$SWAPUUID|g" /etc/fstab
-       #else
-               #to do add uuid to swap
+       else
+               # Reformat swap to add a UUID
+               swapoff -a
+               mkswap $SWAP
+               swapon -a
+               SWAPUUID=`blkid -c /dev/null -sUUID $SWAP | cut -d'"' -f2`
+               if [ ! -z $SWAPUUID ]; then
+                       sed -i "s|^$SWAP|UUID=$SWAPUUID|g" /etc/fstab
+               fi
        fi
        else
        echo "WARNING! swap not found!!!"
 fi
 
+#
+# Start services
+#
+/etc/init.d/squid start
+/etc/init.d/snort start
+
 #
 # Modify grub.conf
 #
 echo
 echo Update grub configuration ...
-sed -i "s|ROOT|UUID=$ROOTUUID|g" /boot/grub/grub.conf
+if [ ! -z $ROOTUUID ]; then
+       sed -i "s|ROOT|UUID=$ROOTUUID|g" /boot/grub/grub.conf
+else
+       sed -i "s|ROOT|$ROOT|g" /boot/grub/grub.conf
+fi
 sed -i "s|KVER|$KVER|g" /boot/grub/grub.conf
 sed -i "s|MOUNT|$MOUNT|g" /boot/grub/grub.conf
 
@@ -154,13 +180,20 @@ else
        sed -i -e "s| panic=10 | console=ttyS0,38400n8 panic=10 |g" /boot/grub/grub.conf
 fi
 #
+# Change /dev/hd? to /dev/sda
+#
+if [ "${ROOT:0:7}" == "/dev/hd" ];then
+       sed -i -e "s|${ROOT:0:8}|/dev/sda|g" /boot/grub/grub.conf
+       sed -i -e "s|${ROOT:0:8}|/dev/sda|g" /etc/fstab
+fi
+#
 # ReInstall grub
 #
 grub-install --no-floppy ${ROOT::`expr length $ROOT`-1} --recheck
 #
 # Rebuild Language
 #
-#perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
+perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
 #
 # Delete old lm-sensor modullist to force search at next boot
 #