Subversion Repositories livecd

Rev

Rev 28 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 29
Line 13... Line 13...
13
 
13
 
14
###############################################################
14
###############################################################
15
# Definitions
15
# Definitions
16
###############################################################
16
###############################################################
17
 
17
 
-
 
18
# RPMs that are no longer needed and can break future udpates
-
 
19
RPMS_TO_REMOVE="kernel-module-squashfs \
-
 
20
                kernel-module-unionfs \
-
 
21
                unionfs \
-
 
22
                squashfs"
-
 
23
 
-
 
24
# RPMs that can break future Scientific Linux udpates
-
 
25
# because there are not part of Scientific Linux
-
 
26
RPMS_TO_REMOVE_SL="kernel-module-ntfs"
-
 
27
                   
-
 
28
# RPMs that can break future PSI udpates
-
 
29
# because there are not part of PSI Scientific Linux
-
 
30
RPMS_TO_REMOVE_PSI=""
-
 
31
                   
18
# files which should be restored from .ori files
32
# files which should be restored from .ori files
19
FILES_RESTORE="/etc/init.d/netfs \
33
FILES_RESTORE="/etc/init.d/netfs \
20
           /etc/init.d/autofs \
34
           /etc/init.d/autofs \
21
           /etc/init.d/halt \
35
           /etc/init.d/halt \
22
           /etc/init.d/network
36
           /etc/init.d/network
23
           /etc/init.d/functions \
37
           /etc/init.d/functions \
24
           /etc/rc.d/rc.sysinit \
38
           /etc/rc.d/rc.sysinit \
25
           /etc/sysconfig/afs \
39
           /etc/sysconfig/afs \
26
           /etc/motd \
40
           /etc/motd \
27
           /etc/redhat-release \
41
           /etc/redhat-release \
28
	   /etc/rc.d/rc.local \
42
	   /etc/rc.d/rc.local"
29
           /etc/rc.d/rc.sysinit"
-
 
30
 
43
 
31
LIVECD_INIT_SCRIPTS="runfirst \
44
LIVECD_INIT_SCRIPTS="runfirst \
32
                    runveryfirst \
45
                    runveryfirst \
33
                    runlast \
46
                    runlast \
34
                    kudzu-auto"
47
                    kudzu-auto"
Line 76... Line 89...
76
    -win=[partition]    Your active Windows partition. If not given, 
89
    -win=[partition]    Your active Windows partition. If not given, 
77
                        $SCRIPTNAME tries to find it
90
                        $SCRIPTNAME tries to find it
78
    -nogrub             Do not install grub. You have to install 
91
    -nogrub             Do not install grub. You have to install 
79
                        manually a bootloader (not recommended)
92
                        manually a bootloader (not recommended)
80
    -floppy             Needed, if grub should be installed on floppy
93
    -floppy             Needed, if grub should be installed on floppy
-
 
94
    -norpmremove        Do not remove RPMs that break future updates 
-
 
95
                        (not recommended)
81
    -y                  Answer all questions with yes
96
    -y                  Answer all questions with yes
82
 
97
 
83
  Example:
98
  Example:
84
 
99
 
85
  $SCRIPTNAME -swap=/dev/sda3 -mbr=/dev/sda /dev/sda2
100
  $SCRIPTNAME -swap=/dev/sda3 -mbr=/dev/sda /dev/sda2
Line 153... Line 168...
153
	   shift; continue;;
168
	   shift; continue;;
154
 
169
 
155
       -nogrub)
170
       -nogrub)
156
            NOGRUB=$1; shift; continue;;
171
            NOGRUB=$1; shift; continue;;
157
 
172
 
-
 
173
       -norpmremove)
-
 
174
            NORPMREMOVE=$1; shift; continue;;
-
 
175
 
158
       -floppy)
176
       -floppy)
159
            FLOPPY=$1; shift; continue;;
177
            FLOPPY=$1; shift; continue;;
160
 
178
 
161
       -y)
179
       -y)
162
            YES=$1; shift; continue;;
180
            YES=$1; shift; continue;;
Line 548... Line 566...
548
mv $NEW/etc/cron_backup/sysstat $NEW/etc/cron.d/ 2>/dev/null
566
mv $NEW/etc/cron_backup/sysstat $NEW/etc/cron.d/ 2>/dev/null
549
mv $NEW/etc/cron_backup/00-makewhatis.cron.weekly $NEW/etc/cron.weekly/00-makewhatis.cron 2>/dev/null
567
mv $NEW/etc/cron_backup/00-makewhatis.cron.weekly $NEW/etc/cron.weekly/00-makewhatis.cron 2>/dev/null
550
mv $NEW/etc/cron_backup/* $NEW/etc/cron.daily/
568
mv $NEW/etc/cron_backup/* $NEW/etc/cron.daily/
551
 
569
 
552
 
570
 
-
 
571
### prepare chroot to $NEW
-
 
572
### -----------------------------------------------------------
-
 
573
mount --bind /dev $NEW/dev
-
 
574
mount --bind /sys $NEW/sys
-
 
575
mount -t proc proc $NEW/proc
-
 
576
 
-
 
577
 
553
### turn on kudzu again
578
### turn on kudzu again
554
### -----------------------------------------------------------
579
### -----------------------------------------------------------
555
chroot $NEW chkconfig kudzu on
580
chroot $NEW chkconfig kudzu on
556
 
581
 
557
 
582
 
-
 
583
### remove RPMs that can break future updates  
-
 
584
### -----------------------------------------------------------
-
 
585
if [ ! $NORPMREMOVE ]; then
-
 
586
    echo "Remove RPMs that may break future updates ..."
-
 
587
    chroot $NEW rpm -qa 2>/dev/null > /tmp/rpmlist
-
 
588
 
-
 
589
    # Scientific Linux RPMs
-
 
590
    RPMSTOREMOVE="$RPMS_TO_REMOVE $RPMS_TO_REMOVE_SL"
-
 
591
 
-
 
592
    # PSI Scientific Linux RPMs
-
 
593
    if [ -e /etc/sysconfig/cfengine ]; then
-
 
594
	RPMSTOREMOVE="$RPMS_TO_REMOVE $RPMS_TO_REMOVE_PSI"
-
 
595
    fi
-
 
596
 
-
 
597
    for rpm in $RPMSTOREMOVE; do
-
 
598
	rpms_remove=$( cat /tmp/rpmlist | grep "^$rpm" )
-
 
599
	for rpm_remove in $rpms_remove; do	
-
 
600
	    chroot $NEW rpm -e --nodeps $rpm_remove 2>/dev/null
-
 
601
	    [ "$?" = "0" ] && echo "$rpm_remove removed"
-
 
602
	done
-
 
603
    done
-
 
604
    echo "done."; echo
-
 
605
fi
-
 
606
 
-
 
607
 
558
### umount $INSTALL_PART
608
### umount $INSTALL_PART
559
### -----------------------------------------------------------
609
### -----------------------------------------------------------
-
 
610
umount $NEW/dev
-
 
611
umount $NEW/sys
-
 
612
umount $NEW/proc
560
umount $INSTALL_PART
613
umount $INSTALL_PART
561
 
614
 
562
 
615
 
563
### print summary
616
### print summary
564
### -----------------------------------------------------------
617
### -----------------------------------------------------------