/[smeserver]/cdrom.image/upgrade.cfg
ViewVC logotype

Diff of /cdrom.image/upgrade.cfg

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by gordonr, Sat Jul 2 06:33:16 2005 UTC Revision 1.9 by slords, Sat Jul 9 19:28:58 2005 UTC
# Line 3  text Line 3  text
3  cdrom  cdrom
4  skipx  skipx
5  mouse  mouse
6    network --device eth0 --bootproto dhcp
7    rootpw --iscrypted $1$iHhL195i$25OY88oyw2bxgU47MvuZf0
8    firewall --disabled
9    selinux --disabled
10    authconfig --enableshadow --enablemd5
11  bootloader --location=mbr  bootloader --location=mbr
12  zerombr yes  zerombr yes
13    
14  %post  %post
15  /sbin/syslogd &  /sbin/syslogd &
16  sleep 1  sleep 2
17  /sbin/e-smith/signal-event post-upgrade  /sbin/e-smith/signal-event post-upgrade
18    
19  kudzu --safe --quiet  %pre
20  /sbin/depmod -a -e -C /dev/null -F /boot/SystemMap-2.4.21-32.0.1.EL 2.4.21-32.0.1.EL  #!/bin/sh
21  /sbin/depmod -a -e -C /dev/null -F /boot/SystemMap-2.4.21-32.0.1.ELsmp 2.4.21-32.0.1.ELsmp  set -x
 /sbin/mkinitrd -v -f /boot/initrd-2.4.21-32.0.1.EL.img 2.4.21-32.0.1.EL  
 /sbin/mkinitrd -v -f /boot/initrd-2.4.21-32.0.1.ELsmp.img 2.4.21-32.0.1.ELsmp  
22    
23    # let's assume it's a SCSI system
24    if grep -q 'sda$' /proc/partitions; then
25        disk=sda
26    else
27        # No SCSI Drives is must be IDE
28        media=`cat /proc/ide/hda/media`
29        if [ $media == "disk" ] ; then
30            disk=hda
31        fi
32    fi
33    
34    set $disk
35    found=`echo $#`
36    if [ $found -gt "0" ] ; then
37        # Dump out current partitions
38        sfdisk -d /dev/$disk > /tmp/oldparts
39    
40        # Check if we have any ext2/3 or swap partitions
41        if grep -q 'Id=8[23]' /tmp/oldparts; then
42            echo -n "Converting partitions to RAID..." >/dev/tty1
43            # Convert ext2/3 and swap partitions to raid autodetect
44            sed 's/Id=8[32]/Id=fd/' /tmp/oldparts > /tmp/newparts
45    
46            # Find swap partition for future checks
47            swap=`grep 'Id=82' /tmp/oldparts | sed "s/$disk\([0-9]\+\) :.*/md\1/"`
48    
49            # Loop throught partitions and convert to degraded raid1
50            for part in `grep 'Id=8[23]' /tmp/oldparts | sed 's/ :.*//'`; do
51                mdpart=`echo $part | sed "s/$disk\([0-9]\+\)/md\1/"`
52            
53                echo -n "$part..." >/dev/tty1
54                mdadm --create $mdpart --run --level=1 --raid-devices=2 $part missing
55                if [ "$mdpart" == "$swap" ]; then
56                    # Recreate swap partition
57                    mkswap $swap
58                else
59                    # Resize ext2/3 partitions (fix superblock - part 1)
60                    resize2fs -f $mdpart
61                fi
62            done
63    
64            echo "done" >/dev/tty1
65    
66            # Write out new converted partition table
67            sfdisk --force /dev/$disk < /tmp/newparts
68    
69            echo "Checking filesystems on converted partitions. This may take a few minutes." >/dev/tty1
70            echo -n "Checking filesystems..." >/dev/tty1
71    
72            mkdir /mnt/tmp
73            for part in `grep 'Id=fd' /tmp/newparts | sed "s/$disk\([0-9]\+\) :.*/md\1/"`; do
74                if [ "$part" != "$swap" ]; then
75                    # Resize ext2/3 partitions (fix superblock - part 2)
76                    echo -n "$part..." >/dev/tty1
77                    e2fsck -f $part
78    
79                    # Check for /etc/fstab on partitions and convert entries
80                    mount $part /mnt/tmp
81                    if [ -r /mnt/tmp/etc/fstab ]; then
82                        cat /mnt/tmp/etc/fstab | sed "s/$disk\([0-9]\+\)/md\1/" > /mnt/tmp/etc/fstab.tmp
83                        mv /mnt/tmp/etc/fstab.tmp /mnt/tmp/etc/fstab
84                    fi
85                    umount /mnt/tmp
86                fi
87            done
88            echo "done" >/dev/tty1
89            rmdir /mnt/tmp
90            mdadm --stop --scan
91        fi
92    fi


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed