Subversion Repositories livecd

Rev

Rev 283 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 283 Rev 285
Line 11... Line 11...
11
keyboard us
11
keyboard us
12
timezone US/Eastern
12
timezone US/Eastern
13
auth --useshadow --enablemd5
13
auth --useshadow --enablemd5
14
selinux --enforcing
14
selinux --enforcing
15
firewall --enabled --service=mdns
15
firewall --enabled --service=mdns
16
repo --name=base      --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/os/
16
repo --name=base     --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/os/
17
repo --name=security  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/security/
17
repo --name=security --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/security/
18
#fastbugs repo disabled per default
18
#fastbugs repo disabled per default
19
#repo --name=fastbugs  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/fastbugs/
19
#repo --name=fastbugs  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/fastbugs/
20
xconfig --startxonboot
20
xconfig --startxonboot
21
services --enabled=NetworkManager --disabled=network,sshd
21
services --enabled=NetworkManager --disabled=network,sshd
22
 
22
 
Line 24... Line 24...
24
########################################################################
24
########################################################################
25
#
25
#
26
# Basic software packages
26
# Basic software packages
27
#
27
#
28
########################################################################
28
########################################################################
-
 
29
 
29
%packages
30
%packages
30
syslinux
31
syslinux
31
kernel
32
kernel
32
 
33
 
33
# basic software groups
34
# basic software groups
Line 43... Line 44...
43
@remote-desktop-clients
44
@remote-desktop-clients
44
# packages added to @remote-desktop-clients
45
# packages added to @remote-desktop-clients
45
rdesktop
46
rdesktop
46
tsclient
47
tsclient
47
@x11
48
@x11
-
 
49
 
48
@openafs-client
50
@openafs-client
49
 
51
 
50
# other usefull packages
52
# other usefull packages
51
busybox
53
busybox
52
mailx
54
mailx
Line 58... Line 60...
58
device-mapper-multipath
60
device-mapper-multipath
59
isomd5sum
61
isomd5sum
60
 
62
 
61
%end
63
%end
62
 
64
 
-
 
65
 
63
########################################################################
66
########################################################################
64
#
67
#
65
#  LiveCD post install in chroot 
68
#  LiveCD post install 
66
#
69
#
67
########################################################################
70
########################################################################
-
 
71
 
68
%post
72
%post
69
 
73
 
70
#***********************************************************************
74
########################################################################
71
# Create LiveCD configuration file and LiveCD functions
75
# LiveCD configuration file and LiveCD functions
72
#***********************************************************************
76
########################################################################
73
 
77
 
74
cat > /etc/livesys.conf << 'EOF_livesysconf'
78
cat > /etc/livesys.conf << 'EOF_livesysconf'
75
#--------------------------------------------------------------------
79
###--------------------------------------------------------------------
76
# Configuration file for LiveCD
80
### Configuration file for LiveCD
77
#--------------------------------------------------------------------
81
###--------------------------------------------------------------------
78
 
82
 
79
# default LiveCD user
83
# default LiveCD user
80
LIVECD_DEF_USER="sluser"
84
LIVECD_DEF_USER="sluser"
81
 
85
 
82
# delay in sec. before auto login
86
# delay in sec. before auto login
Line 91... Line 95...
91
 
95
 
92
EOF_livesysconf
96
EOF_livesysconf
93
 
97
 
94
 
98
 
95
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
99
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
96
#--------------------------------------------------------------------
100
###--------------------------------------------------------------------
97
# livesys functions
101
### livesys functions
98
#--------------------------------------------------------------------
102
###--------------------------------------------------------------------
99
 
103
 
100
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
104
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
101
egrep_o() {
105
egrep_o() {
102
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
106
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
103
}
107
}
Line 121... Line 125...
121
}
125
}
122
 
126
 
123
EOF_livesysfunctions
127
EOF_livesysfunctions
124
 
128
 
125
 
129
 
-
 
130
 
126
#***********************************************************************
131
########################################################################
127
# Create /root/post-install
132
# Create a sub-script so the output can be captured
128
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
133
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
129
#***********************************************************************
134
########################################################################
130
 
135
 
131
cat > /root/post-install << EOF_post
136
cat > /root/post-install << EOF_post
132
#!/bin/bash
137
#!/bin/bash
133
 
138
 
134
#***********************************************************************
-
 
135
# Create the livesys init script - /etc/rc.d/init.d/livesys
-
 
136
#***********************************************************************
-
 
137
 
139
 
-
 
140
echo ###################################################################
138
echo "Creating the livesys init script - livesys"
141
echo ## Creating the livesys init script - livesys
-
 
142
echo ###################################################################
139
 
143
 
140
cat > /etc/rc.d/init.d/livesys << EOF_initscript
144
cat > /etc/rc.d/init.d/livesys << EOF_initscript
141
#!/bin/bash
145
#!/bin/bash
142
#
146
#
143
# live: Init script for live image
147
# live: Init script for live image
Line 173... Line 177...
173
# cups server
177
# cups server
174
CUPS=\\\$( cmdline_value cups )
178
CUPS=\\\$( cmdline_value cups )
175
 
179
 
176
# password
180
# password
177
PW=\\\$( cmdline_value pw )
181
PW=\\\$( cmdline_value pw )
178
[ ! \\\$PW ] && PW=$( cmdline_value passwd )
182
[ ! \\\$PW ] && PW=\\\$( cmdline_value passwd )
179
 
183
 
180
# set livecd user
184
# set livecd user
181
LIVECD_USER=\\\$( cmdline_value user )
185
LIVECD_USER=\\\$( cmdline_value user )
182
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
186
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
183
 
187
 
Line 285... Line 289...
285
# set the LiveCD hostname
289
# set the LiveCD hostname
286
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
290
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
287
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
291
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
288
/bin/hostname \\\$hostname
292
/bin/hostname \\\$hostname
289
 
293
 
290
#-----------------------------------------------------------------------
-
 
291
# EXIT here if LiveCD has already been configured         
-
 
292
# happens if you start the LiveCD with persistent changes 
-
 
293
#-----------------------------------------------------------------------
-
 
294
 
294
 
-
 
295
###########################################################
-
 
296
# EXIT here if LiveCD has already been configured         #
-
 
297
# happens if you start the LiveCD with persistent changes #
-
 
298
###########################################################
295
[ "\\\$configdone" ] && exit 0
299
[ "\\\$configdone" ] && exit 0
296
 
300
 
297
# turn off services, which are not useful on LiveCD, to preserve resources
301
# turn off services, which are not useful on LiveCD, to preserve resources
298
if [ "\\\$SERVICES_OFF" ]; then
302
if [ "\\\$SERVICES_OFF" ]; then
299
    for service in \\\$SERVICES_OFF ; do
303
    for service in \\\$SERVICES_OFF ; do
Line 377... Line 381...
377
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
381
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
378
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
382
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
379
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
383
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
380
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
384
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
381
 
385
 
382
# start system-config-firewall with su 
386
# start system-config-firewall with su
383
# (bugfix: system-config-firewall does not work when root has no password)
-
 
384
sed -i "s|^Exec=.*|Exec=su - -c /usr/bin/system-config-firewall|" /usr/share/applications/system-config-firewall.desktop
387
sed -i "s|^Exec=.*|Exec=su - -c /usr/bin/system-config-firewall|" /usr/share/applications/system-config-firewall.desktop
385
sed -i "s|^Terminal=.*|Terminal=true|"                            /usr/share/applications/system-config-firewall.desktop
388
sed -i "s|^Terminal=.*|Terminal=true|"                         /usr/share/applications/system-config-firewall.desktop
386
 
389
 
387
#-----------------------------------------------------------------------
-
 
-
 
390
 
388
# detecting disk partitions and logical volumes (disabled by default)
391
### detecting disk partitions and logical volumes (disabled by default)
389
# use boot parameter automount to enable it
392
### use boot parameter automount to enable it
390
#-----------------------------------------------------------------------
-
 
391
 
393
 
392
CreateDesktopIconHD()
394
CreateDesktopIconHD()
393
{
395
{
394
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
396
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
395
[Desktop Entry]
397
[Desktop Entry]
Line 507... Line 509...
507
 
509
 
508
# give back ownership to the default user
510
# give back ownership to the default user
509
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
511
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
510
 
512
 
511
EOF_initscript
513
EOF_initscript
512
#***********************************************************************
514
echo ###################################################################
513
# End of livesys script
515
echo ## End of livesys script
514
#***********************************************************************
516
echo ###################################################################
515
 
517
 
516
 
518
 
517
#***********************************************************************
-
 
518
# Create the livesys init script - /etc/rc.d/init.d/livesys-late
-
 
519
#***********************************************************************
-
 
520
 
519
 
-
 
520
echo ###################################################################
521
echo "Creating the livesys init script - livesys-late"
521
echo ## Creating the livesys init script - livesys-late
-
 
522
echo ###################################################################
522
 
523
 
523
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
524
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
524
#!/bin/bash
525
#!/bin/bash
525
#
526
#
526
# live: Late init script for live image
527
# live: Late init script for live image
Line 563... Line 564...
563
if [ "\\\$kb" ]; then
564
if [ "\\\$kb" ]; then
564
    exists system-config-keyboard --noui \\\$kb 
565
    exists system-config-keyboard --noui \\\$kb 
565
fi
566
fi
566
 
567
 
567
EOF_lateinitscript
568
EOF_lateinitscript
568
#***********************************************************************
569
echo ###################################################################
569
# End of livesys-late script
570
echo ## End of livesys-late script
570
#***********************************************************************
571
echo ###################################################################
571
 
572
 
572
 
573
 
573
#***********************************************************************
-
 
574
# Configure the LiveCD
-
 
575
# Everthing configured here will survive LiveCD install to harddisk !
-
 
576
#***********************************************************************
-
 
577
 
574
 
-
 
575
echo ###################################################################
578
echo "Configure the LiveCD"
576
echo ## Configure the LiveCD
-
 
577
echo ###################################################################
579
 
578
 
580
# workaround avahi segfault (#279301)
579
# workaround avahi segfault (#279301)
581
touch /etc/resolv.conf
580
touch /etc/resolv.conf
582
/sbin/restorecon /etc/resolv.conf
581
/sbin/restorecon /etc/resolv.conf
583
 
582
 
Line 593... Line 592...
593
/usr/sbin/makewhatis -w
592
/usr/sbin/makewhatis -w
594
 
593
 
595
# create locate db
594
# create locate db
596
/etc/cron.daily/mlocate.cron
595
/etc/cron.daily/mlocate.cron
597
 
596
 
598
# run prelinking
-
 
599
/etc/cron.daily/prelink
-
 
600
 
-
 
601
# save a little bit of space at least...
597
# save a little bit of space at least...
602
rm -f /var/lib/rpm/__db*
598
rm -f /var/lib/rpm/__db*
603
rm -f /boot/initrd*
599
rm -f /boot/initrd*
604
rm -f /boot/initramfs*
600
rm -f /boot/initramfs*
605
# make sure there aren't core files lying around
601
# make sure there aren't core files lying around
Line 627... Line 623...
627
# run post-install script
623
# run post-install script
628
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
624
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
629
 
625
 
630
%end
626
%end
631
########################################################################
627
########################################################################
632
#
-
 
633
# End of configure LiveCD in chroot
628
# End of configure LiveCD in chroot
634
#
-
 
635
########################################################################
629
########################################################################
636
 
630
 
637
 
631
 
638
########################################################################
-
 
639
#
-
 
640
#  LiveCD post no chroot install 
-
 
641
#
-
 
642
########################################################################
-
 
643
%post --nochroot
-
 
644
 
632
 
-
 
633
%post --nochroot
645
#***********************************************************************
634
########################################################################
646
# Create /root/postnochroot-install
635
# Post install in no chroot
647
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
636
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
648
#***********************************************************************
637
########################################################################
649
 
-
 
650
cat > /root/postnochroot-install << EOF_postnochroot
638
cat > /root/postnochroot-install << EOF_postnochroot
651
#!/bin/bash
639
#!/bin/bash
652
 
640
 
653
# Copy licensing information
641
# Copy licensing information
654
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
642
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
Line 696... Line 684...
696
# run postnochroot-install script
684
# run postnochroot-install script
697
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
685
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
698
 
686
 
699
%end
687
%end
700
########################################################################
688
########################################################################
701
#
-
 
702
# End of configure LiveCD in nochroot
689
# End of configure LiveCD in nochroot
703
#
-
 
704
########################################################################
690
########################################################################