/[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.8 - (show annotations) (download)
Sat Jul 9 18:57:26 2005 UTC (18 years, 10 months ago) by slords
Branch: MAIN
Changes since 1.7: +9 -2 lines
Change selinux policy from disabled to permissive and fix outstanding
selinux policy bug (missing lokkit)

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 --permissive
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 # Make SELinux rescan filesystems on reboot
20 touch /.autorelabel
21
22 %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 echo -n "Converting partitions to RAID..." >/dev/tty1
46 # 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
56 echo -n "$part..." >/dev/tty1
57 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
67 echo "done" >/dev/tty1
68
69 # Write out new converted partition table
70 sfdisk --force /dev/$disk < /tmp/newparts
71
72 echo "Checking filesystems on converted partitions. This may take a few minutes." >/dev/tty1
73 echo -n "Checking filesystems..." >/dev/tty1
74
75 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 echo -n "$part..." >/dev/tty1
80 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 echo "done" >/dev/tty1
92 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