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

Annotation of /cdrom.image/upgrade.cfg

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


Revision 1.10 - (hide annotations) (download)
Sat Jul 9 20:20:39 2005 UTC (19 years, 4 months ago) by slords
Branch: MAIN
Changes since 1.9: +3 -0 lines
Upgrade still needs to manually call selinux disable

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

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