]> git.ipfire.org Git - ipfire-2.x.git/blob - updates/1.4.4/setup
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[ipfire-2.x.git] / updates / 1.4.4 / setup
1 #!/bin/bash
2
3 UPGRADEVERSION="1.4.4"
4 PREVIOUSVERSION="1.4.3"
5 echo "This is the $UPGRADEVERSION update patch for IPCop $PREVIOUSVERSION installing."
6
7 CURRENTVERSION=`cat /etc/issue | awk '{ print $2 }' | sed -e 's/v//'`
8
9 if [ "$CURRENTVERSION" != "$PREVIOUSVERSION" ]; then
10 echo "You are not running IPCop v$PREVIOUSVERSION for this patch to install."
11 echo "Aborting installation."
12 exit -1
13 fi
14
15 /bin/rm -rf /var/patches/patch-*.tar.gz.gpg
16
17 # Fix grub
18 ROOTDEV=`/bin/ls -l /dev/harddisk4 | /usr/bin/awk '{ print $NF }'`
19 echo "title IPCop old (2.4.27)" >> /boot/grub/grub.conf
20 echo " root (hd0,0)" >> /boot/grub/grub.conf
21 echo " kernel /vmlinuz-2.4.27 root=${ROOTDEV} panic=10 acpi=off ro" >> /boot/grub/grub.conf
22 if [ -f /boot/ipcoprd.img ]; then
23 echo " initrd /ipcoprd-2.4.27.img" >> /boot/grub/grub.conf
24 fi
25 echo " savedefault" >> /boot/grub/grub.conf
26
27 # Fix initrd
28 if [ -f /boot/ipcoprd.img ]; then
29 # Find out scsi module
30 IMAGE=`/usr/bin/mktemp /tmp/ipcoprd.img.XXXXXX`
31 MNTPOINT=`/usr/bin/mktemp -d /tmp/ipcoprd.mnt.XXXXXX`
32 /bin/gzip -d -c /boot/ipcoprd.img > $IMAGE
33 /bin/mount -o loop $IMAGE $MNTPOINT
34 SCSIDRIVER=`/bin/ls -1 $MNTPOINT/lib | \
35 /bin/grep -v sd_mod.o.gz |\
36 /bin/grep -v sg.o.gz |\
37 /bin/grep -v sr_mod.o.gz |\
38 /bin/grep -v 53c700.o.gz |\
39 /bin/grep -v NCR53C9x.o.gz |\
40 /bin/grep -v libata.o.gz |\
41 /bin/grep -v scsi_mod.o.gz |\
42 /bin/grep -v ataraid.o.gz |\
43 /bin/grep -v mptbase.o.gz |\
44 /bin/grep -v isa-pnp.o |\
45 /bin/grep -v ds.o.gz |\
46 /bin/grep -v pcmcia_core.o.gz |\
47 /bin/sed 's/.o.gz//'`
48 /bin/umount $MNTPOINT
49 /bin/rm -rf $MNTPOINT $IMAGE
50 /bin/mv -f /boot/ipcoprd.img /boot/ipcoprd-2.4.27.img
51 /bin/mv -f /boot/ipcoprd-smp.img /boot/ipcoprd-smp-2.4.27.img
52 if [ "$SCSIDRIVER" ]; then
53 /sbin/mkinitrd --with=scsi_mod --with=${SCSIDRIVER} --with=sd_mod --with=sr_mod --with=libata --with=ataraid /boot/ipcoprd.img 2.4.29
54 /sbin/mkinitrd --with=scsi_mod --with=${SCSIDRIVER} --with=sd_mod --with=sr_mod --with=libata --with=ataraid /boot/ipcoprd-smp.img 2.4.29-smp
55 fi
56 fi
57
58 /bin/sed -i -e "s+= '1.4.*$+= '$UPGRADEVERSION';+" /var/ipcop/header.pl
59 /bin/tar -zxpf patch.tar.gz -C /
60