Subversion Repositories livecd

Rev

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

Rev 280 Rev 281
Line -... Line 1...
-
 
1
########################################################################
1
#
2
#
2
# sl6-live-base.ks
3
# sl6-live-base.ks
3
#
4
#
4
# Defines the basics for all kickstarts of sl6-live
5
# Defines the basics for all kickstarts of sl6-live
5
# Kickstarts including this template can override these settings
6
# Kickstarts including this template can override these settings
6
#
7
#
-
 
8
########################################################################
7
 
9
 
8
lang en_US.UTF-8
10
lang en_US.UTF-8
9
keyboard us
11
keyboard us
10
timezone US/Eastern
12
timezone US/Eastern
11
auth --useshadow --enablemd5
13
auth --useshadow --enablemd5
Line 18... Line 20...
18
xconfig --startxonboot
20
xconfig --startxonboot
19
services --enabled=NetworkManager --disabled=network,sshd
21
services --enabled=NetworkManager --disabled=network,sshd
20
 
22
 
21
 
23
 
22
########################################################################
24
########################################################################
-
 
25
#
23
# Basic software packages
26
# Basic software packages
-
 
27
#
24
########################################################################
28
########################################################################
25
 
-
 
26
%packages
29
%packages
27
syslinux
30
syslinux
28
kernel
31
kernel
29
 
32
 
30
# basic software groups
33
# basic software groups
Line 55... Line 58...
55
device-mapper-multipath
58
device-mapper-multipath
56
isomd5sum
59
isomd5sum
57
 
60
 
58
%end
61
%end
59
 
62
 
60
 
-
 
61
########################################################################
63
########################################################################
62
#
64
#
63
#  LiveCD post install 
65
#  LiveCD post install in chroot 
64
#
66
#
65
########################################################################
67
########################################################################
66
 
-
 
67
%post
68
%post
68
 
69
 
69
########################################################################
70
#***********************************************************************
70
# LiveCD configuration file and LiveCD functions
71
# Create LiveCD configuration file and LiveCD functions
71
########################################################################
72
#***********************************************************************
72
 
73
 
73
cat > /etc/livesys.conf << 'EOF_livesysconf'
74
cat > /etc/livesys.conf << 'EOF_livesysconf'
74
###--------------------------------------------------------------------
75
#--------------------------------------------------------------------
75
### Configuration file for LiveCD
76
# Configuration file for LiveCD
76
###--------------------------------------------------------------------
77
#--------------------------------------------------------------------
77
 
78
 
78
# default LiveCD user
79
# default LiveCD user
79
LIVECD_DEF_USER="sluser"
80
LIVECD_DEF_USER="sluser"
80
 
81
 
81
# delay in sec. before auto login
82
# delay in sec. before auto login
Line 90... Line 91...
90
 
91
 
91
EOF_livesysconf
92
EOF_livesysconf
92
 
93
 
93
 
94
 
94
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
95
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
95
###--------------------------------------------------------------------
96
#--------------------------------------------------------------------
96
### livesys functions
97
# livesys functions
97
###--------------------------------------------------------------------
98
#--------------------------------------------------------------------
98
 
99
 
99
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
100
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
100
egrep_o() {
101
egrep_o() {
101
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
102
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
102
}
103
}
Line 120... Line 121...
120
}
121
}
121
 
122
 
122
EOF_livesysfunctions
123
EOF_livesysfunctions
123
 
124
 
124
 
125
 
125
 
-
 
126
########################################################################
126
#***********************************************************************
127
# Create a sub-script so the output can be captured
127
# Create /root/post-install
128
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
128
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
129
########################################################################
129
#***********************************************************************
130
 
130
 
131
cat > /root/post-install << EOF_post
131
cat > /root/post-install << EOF_post
132
#!/bin/bash
132
#!/bin/bash
133
 
133
 
-
 
134
#***********************************************************************
-
 
135
# Create the livesys init script - /etc/rc.d/init.d/livesys
-
 
136
#***********************************************************************
134
 
137
 
135
echo ###################################################################
-
 
136
echo ## Creating the livesys init script - livesys
138
echo "Creating the livesys init script - livesys"
137
echo ###################################################################
-
 
138
 
139
 
139
cat > /etc/rc.d/init.d/livesys << EOF_initscript
140
cat > /etc/rc.d/init.d/livesys << EOF_initscript
140
#!/bin/bash
141
#!/bin/bash
141
#
142
#
142
# live: Init script for live image
143
# live: Init script for live image
Line 280... Line 281...
280
# set the LiveCD hostname
281
# set the LiveCD hostname
281
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
282
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
282
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
283
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
283
/bin/hostname \\\$hostname
284
/bin/hostname \\\$hostname
284
 
285
 
-
 
286
#-----------------------------------------------------------------------
-
 
287
# EXIT here if LiveCD has already been configured         
-
 
288
# happens if you start the LiveCD with persistent changes 
-
 
289
#-----------------------------------------------------------------------
285
 
290
 
286
###########################################################
-
 
287
# EXIT here if LiveCD has already been configured         #
-
 
288
# happens if you start the LiveCD with persistent changes #
-
 
289
###########################################################
-
 
290
[ "\\\$configdone" ] && exit 0
291
[ "\\\$configdone" ] && exit 0
291
 
292
 
292
# turn off services, which are not useful on LiveCD, to preserve resources
293
# turn off services, which are not useful on LiveCD, to preserve resources
293
if [ "\\\$SERVICES_OFF" ]; then
294
if [ "\\\$SERVICES_OFF" ]; then
294
    for service in \\\$SERVICES_OFF ; do
295
    for service in \\\$SERVICES_OFF ; do
Line 333... Line 334...
333
## create the LiveCD default user
334
## create the LiveCD default user
334
# add default user with no password
335
# add default user with no password
335
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
336
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
336
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
337
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
337
# give default user sudo privileges
338
# give default user sudo privileges
338
echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
339
# echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
339
 
340
 
340
## configure default user's desktop
341
## configure default user's desktop
341
# set up timed auto-login at 10 seconds
342
# set up timed auto-login at 10 seconds
342
cat >> /etc/gdm/custom.conf << FOE
343
cat >> /etc/gdm/custom.conf << FOE
343
[daemon]
344
[daemon]
Line 366... Line 367...
366
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
367
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
367
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
368
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
368
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
369
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
369
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
370
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
370
 
371
 
371
# start system-config-firewall with sudo
372
# start system-config-firewall with su 
-
 
373
# (bugfix: system-config-firewall does not work when root has no password)
372
sed -i "s|^Exec=.*|Exec=sudo /usr/bin/system-config-firewall|" /usr/share/applications/system-config-firewall.desktop
374
sed -i "s|^Exec=.*|Exec=su - -c /usr/bin/system-config-firewall|" /usr/share/applications/system-config-firewall.desktop
373
sed -i "s|^Terminal=.*|Terminal=true|"                         /usr/share/applications/system-config-firewall.desktop
375
sed -i "s|^Terminal=.*|Terminal=true|"                            /usr/share/applications/system-config-firewall.desktop
374
 
-
 
375
 
376
 
-
 
377
#-----------------------------------------------------------------------
376
### detecting disk partitions and logical volumes (disabled by default)
378
# detecting disk partitions and logical volumes (disabled by default)
377
### use boot parameter automount to enable it
379
# use boot parameter automount to enable it
-
 
380
#-----------------------------------------------------------------------
378
 
381
 
379
CreateDesktopIconHD()
382
CreateDesktopIconHD()
380
{
383
{
381
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
384
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
382
[Desktop Entry]
385
[Desktop Entry]
Line 494... Line 497...
494
 
497
 
495
# give back ownership to the default user
498
# give back ownership to the default user
496
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
499
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
497
 
500
 
498
EOF_initscript
501
EOF_initscript
499
echo ###################################################################
502
#***********************************************************************
500
echo ## End of livesys script
503
# End of livesys script
501
echo ###################################################################
504
#***********************************************************************
502
 
505
 
503
 
506
 
-
 
507
#***********************************************************************
-
 
508
# Create the livesys init script - /etc/rc.d/init.d/livesys-late
-
 
509
#***********************************************************************
504
 
510
 
505
echo ###################################################################
-
 
506
echo ## Creating the livesys init script - livesys-late
511
echo "Creating the livesys init script - livesys-late"
507
echo ###################################################################
-
 
508
 
512
 
509
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
513
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
510
#!/bin/bash
514
#!/bin/bash
511
#
515
#
512
# live: Late init script for live image
516
# live: Late init script for live image
Line 549... Line 553...
549
if [ "\\\$kb" ]; then
553
if [ "\\\$kb" ]; then
550
    exists system-config-keyboard --noui \\\$kb 
554
    exists system-config-keyboard --noui \\\$kb 
551
fi
555
fi
552
 
556
 
553
EOF_lateinitscript
557
EOF_lateinitscript
554
echo ###################################################################
558
#***********************************************************************
555
echo ## End of livesys-late script
559
# End of livesys-late script
556
echo ###################################################################
560
#***********************************************************************
557
 
561
 
558
 
562
 
-
 
563
#***********************************************************************
-
 
564
# Configure the LiveCD
-
 
565
# Everthing configured here will survive LiveCD install to harddisk !
-
 
566
#***********************************************************************
559
 
567
 
560
echo ###################################################################
-
 
561
echo ## Configure the LiveCD
568
echo "Configure the LiveCD"
562
echo ###################################################################
-
 
563
 
569
 
564
# workaround avahi segfault (#279301)
570
# workaround avahi segfault (#279301)
565
touch /etc/resolv.conf
571
touch /etc/resolv.conf
566
/sbin/restorecon /etc/resolv.conf
572
/sbin/restorecon /etc/resolv.conf
567
 
573
 
Line 575... Line 581...
575
 
581
 
576
# go ahead and pre-make the man -k cache (#455968)
582
# go ahead and pre-make the man -k cache (#455968)
577
/usr/sbin/makewhatis -w
583
/usr/sbin/makewhatis -w
578
 
584
 
579
# create locate db
585
# create locate db
580
/etc/cron.daily/mlocate.cron 2>/dev/null
586
/etc/cron.daily/mlocate.cron
581
 
587
 
582
# run prelinking
588
# run prelinking
583
/etc/cron.daily/prelink 2>/dev/null
589
/etc/cron.daily/prelink
584
 
590
 
585
# save a little bit of space at least...
591
# save a little bit of space at least...
586
rm -f /var/lib/rpm/__db*
592
rm -f /var/lib/rpm/__db*
587
rm -f /boot/initrd*
593
rm -f /boot/initrd*
588
rm -f /boot/initramfs*
594
rm -f /boot/initramfs*
Line 611... Line 617...
611
# run post-install script
617
# run post-install script
612
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
618
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
613
 
619
 
614
%end
620
%end
615
########################################################################
621
########################################################################
-
 
622
#
616
# End of configure LiveCD in chroot
623
# End of configure LiveCD in chroot
-
 
624
#
617
########################################################################
625
########################################################################
618
 
626
 
619
 
627
 
620
 
-
 
621
%post --nochroot
-
 
622
########################################################################
628
########################################################################
-
 
629
#
623
# Post install in no chroot
630
#  LiveCD post no chroot install 
624
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
-
 
-
 
631
#
625
########################################################################
632
########################################################################
-
 
633
%post --nochroot
-
 
634
 
-
 
635
#***********************************************************************
-
 
636
# Create /root/postnochroot-install
-
 
637
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
-
 
638
#***********************************************************************
-
 
639
 
626
cat > /root/postnochroot-install << EOF_postnochroot
640
cat > /root/postnochroot-install << EOF_postnochroot
627
#!/bin/bash
641
#!/bin/bash
628
 
642
 
629
# Copy licensing information
643
# Copy licensing information
630
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
644
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
Line 672... Line 686...
672
# run postnochroot-install script
686
# run postnochroot-install script
673
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
687
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
674
 
688
 
675
%end
689
%end
676
########################################################################
690
########################################################################
-
 
691
#
677
# End of configure LiveCD in nochroot
692
# End of configure LiveCD in nochroot
-
 
693
#
678
########################################################################
694
########################################################################