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

Contents of /cdrom.image/upgrade.cfg

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


Revision 1.9 - (show annotations) (download)
Sat Jul 9 19:28:58 2005 UTC (18 years, 11 months ago) by slords
Branch: MAIN
Changes since 1.8: +1 -4 lines
re-disable selinux (way too many warnings to deal with now)

1 upgrade
2 text
3 cdrom
4 skipx
5 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
12 zerombr yes
13
14 %post
15 /sbin/syslogd &
16 sleep 2
17 /sbin/e-smith/signal-event post-upgrade
18
19 %pre
20 #!/bin/sh
21 set -x
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

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