Subversion Repositories livecd

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
269 beyerleu 1
########################################################################
2
#
3
#  LiveCD with gnome dekstop
4
#
5
########################################################################
6
 
7
lang en_US.UTF-8
8
keyboard us
9
timezone US/Eastern
10
auth --useshadow --enablemd5
11
selinux --enforcing
12
firewall --enabled --service=mdns
13
repo --name=base     --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/os/
14
repo --name=updates  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/
15
xconfig --startxonboot
16
part / --size 4096 --fstype ext4
17
services --enabled=NetworkManager --disabled=network,sshd
18
 
19
%packages
20
syslinux
21
kernel
22
@base
23
 #package added to @base
24
  squashfs-tools
25
 #packages removed from @base
26
 -bind-utils
27
 -ed
28
 -kexec-tools
29
 -libaio
30
 -libhugetlbfs
31
 -microcode_ctl
32
 -psacct
33
 -quota
34
@basic-desktop
35
 #package removed from @basic-desktop
36
 -gok
37
@core
38
@desktop-platform
39
 #packages removed from @desktop-platform
40
 -redhat-lsb
41
@dial-up
42
@fonts
43
@general-desktop
44
 #package removed from @general-desktop
45
 -gnome-backgrounds
46
 -gnome-user-share
47
 -nautilus-sendto
48
 -orca
49
 -rhythmbox
50
 -vino
51
@graphical-admin-tools
52
@input-methods
53
@internet-applications
54
 #package added to @internet-applications
55
 xchat
56
 #packages removed from @internet-applications
57
 -ekiga
58
@internet-browser
59
@network-file-system-client
60
@network-tools
61
 #package added to @network-tools
62
 nmap
63
@remote-desktop-clients
64
 #packages added to @remote-desktop-clients
65
 rdesktop
66
 tsclient
67
@x11
68
 
69
# other usefull packages
70
busybox
71
mailx
72
memtest86+
73
livecd-tools
74
 
75
# livecd bits to set up the livecd and be able to install
76
anaconda
77
device-mapper-multipath
78
isomd5sum
79
 
80
## SL LiveCD specific changes
81
 
82
# packages to remove
83
-evolution
84
-evolution-help
85
-evolution-mapi
86
-scenery-backgrounds
87
-qt3
88
-xinetd
89
 
90
# packages to add
91
lftp
92
thunderbird
93
@openafs-client
94
 
95
%end
96
 
97
 
98
########################################################################
99
#
100
#  LiveCD post install 
101
#
102
########################################################################
103
 
104
%post
105
 
106
########################################################################
107
# LiveCD configuration file and LiveCD functions
108
########################################################################
109
 
110
cat > /etc/livesys.conf << 'EOF_livesysconf'
111
###--------------------------------------------------------------------
112
### Configuration file for LiveCD
113
###--------------------------------------------------------------------
114
 
273 beyerleu 115
# default LiveCD user
269 beyerleu 116
LIVECD_DEF_USER="sluser"
117
 
118
# delay in sec. before auto login
119
LOGIN_DELAY=15
120
 
273 beyerleu 121
# Services which are off (not running) on the LiveCD
122
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
123
              readahead_later kdump microcode_ctl openct pcscd postfix"
124
 
269 beyerleu 125
EOF_livesysconf
126
 
127
 
270 beyerleu 128
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
269 beyerleu 129
###--------------------------------------------------------------------
130
### livesys functions
131
###--------------------------------------------------------------------
132
 
133
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
134
egrep_o() {
135
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
136
}
137
 
138
# boot parameter
139
cmdline_parameter() {
140
   CMDLINE=/proc/cmdline
141
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1(\$|=|[[:space:]]+)" | egrep_o "$1"
142
}
143
 
144
# boot parameter value
145
cmdline_value()
146
{
147
   CMDLINE=/proc/cmdline
148
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1=([^[:space:]]+)" | egrep_o "=.*" | cut -b 2- | tail -n 1
149
}
150
 
151
exists() {
152
    which $1 >/dev/null 2>&1 || return
153
    $*
154
}
155
 
156
EOF_livesysfunctions
157
 
158
 
159
 
160
########################################################################
161
# Create a sub-script so the output can be captured
162
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
163
########################################################################
164
 
165
cat > /root/post-install << EOF_post
166
#!/bin/bash
167
 
168
 
169
echo ###################################################################
170
echo ## Creating the livesys init script - livesys
171
echo ###################################################################
172
 
173
cat > /etc/rc.d/init.d/livesys << EOF_initscript
174
#!/bin/bash
175
#
176
# live: Init script for live image
177
#
178
# chkconfig: 345 00 99
179
# description: Init script for live image.
180
 
181
. /etc/init.d/functions
182
. /etc/livesys.conf
183
. /etc/init.d/livesys.functions
184
 
185
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
186
    exit 0
187
fi
188
 
189
if [ -e /.liveimg-configured ] ; then
190
    configdone=1
191
fi
192
 
193
touch /.liveimg-configured
194
 
195
# read boot parameters out of /proc/cmdline
273 beyerleu 196
hostname=\\\$( cmdline_value hostname )
197
CELL=\\\$( cmdline_value cell )
198
SERVICEON=\\\$( cmdline_value serviceon )
199
SERVICEOFF=\\\$( cmdline_value serviceoff )
269 beyerleu 200
 
201
# set livecd user
202
LIVECD_USER=\\\$( cmdline_value user )
203
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
204
 
205
# mount live image
206
if [ -b \\\`readlink -f /dev/live\\\` ]; then
207
   mkdir -p /mnt/live
208
   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
209
fi
210
 
211
livedir="LiveOS"
212
for arg in \\\`cat /proc/cmdline\\\` ; do
213
  if [ "\\\${arg##live_dir=}" != "\\\${arg}" ]; then
214
    livedir=\\\${arg##live_dir=}
215
    return
216
  fi
217
done
218
 
219
# enable swaps unless requested otherwise
220
swaps=\\\`blkid -t TYPE=swap -o device\\\`
221
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -n "\\\$swaps" ] ; then
222
  for s in \\\$swaps ; do
223
    action "Enabling swap partition \\\$s" swapon \\\$s
224
  done
225
fi
226
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -f /mnt/live/\\\${livedir}/swap.img ] ; then
227
  action "Enabling swap file" swapon /mnt/live/\\\${livedir}/swap.img
228
fi
229
 
230
mountPersistentHome() {
231
  # support label/uuid
232
  if [ "\\\${homedev##LABEL=}" != "\\\${homedev}" -o "\\\${homedev##UUID=}" != "\\\${homedev}" ]; then
233
    homedev=\\\`/sbin/blkid -o device -t "\\\$homedev"\\\`
234
  fi
235
 
236
  # if we're given a file rather than a blockdev, loopback it
237
  if [ "\\\${homedev##mtd}" != "\\\${homedev}" ]; then
238
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
239
    mountopts="-t jffs2"
240
  elif [ ! -b "\\\$homedev" ]; then
241
    loopdev=\\\`losetup -f\\\`
242
    if [ "\\\${homedev##/mnt/live}" != "\\\${homedev}" ]; then
243
      action "Remounting live store r/w" mount -o remount,rw /mnt/live
244
    fi
245
    losetup \\\$loopdev \\\$homedev
246
    homedev=\\\$loopdev
247
  fi
248
 
249
  # if it's encrypted, we need to unlock it
250
  if [ "\\\$(/sbin/blkid -s TYPE -o value \\\$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
251
    echo
252
    echo "Setting up encrypted /home device"
253
    plymouth ask-for-password --command="cryptsetup luksOpen \\\$homedev EncHome"
254
    homedev=/dev/mapper/EncHome
255
  fi
256
 
257
  # and finally do the mount
258
  mount \\\$mountopts \\\$homedev /home
259
  # if we have /home under what's passed for persistent home, then
260
  # we should make that the real /home.  useful for mtd device on olpc
261
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
262
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
263
  if [ -d /home/\\\$LIVECD_USER ]; then USERADDARGS="-M" ; fi
264
}
265
 
266
findPersistentHome() {
267
  for arg in \\\`cat /proc/cmdline\\\` ; do
268
    if [ "\\\${arg##persistenthome=}" != "\\\${arg}" ]; then
269
      homedev=\\\${arg##persistenthome=}
270
      return
271
    fi
272
  done
273
}
274
 
275
if strstr "\\\`cat /proc/cmdline\\\`" persistenthome= ; then
276
  findPersistentHome
277
elif [ -e /mnt/live/\\\${livedir}/home.img ]; then
278
  homedev=/mnt/live/\\\${livedir}/home.img
279
fi
280
 
281
# if we have a persistent /home, then we want to go ahead and mount it
282
if ! strstr "\\\`cat /proc/cmdline\\\`" nopersistenthome && [ -n "\\\$homedev" ] ; then
283
  action "Mounting persistent /home" mountPersistentHome
284
fi
285
 
286
# make it so that we don't do writing to the overlay for things which
287
# are just tmpdirs/caches
288
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
289
mount -t tmpfs tmp /tmp
290
mount -t tmpfs vartmp /var/tmp
291
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
292
 
273 beyerleu 293
# turn off services, which are not useful on LiveCD, to preserve resources
294
if [ "\\\$SERVICE_OFF" ]; then
295
    for service in \\\$SERVICE_OFF ; do
296
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
297
    done
298
fi
299
 
300
# services off, from command line paramter
301
if [ "\\\$SERVICEOFF" ]; then
302
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
303
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
304
    done
305
fi
306
 
307
# services on, from command line paramter
308
if [ "\\\$SERVICEON" ]; then
309
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
310
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
311
    done
312
fi
313
 
314
# set afs cell if given by boot parameter
315
[ "\\\$CELL" ] && echo \\\$CELL > /usr/vice/etc/ThisCell
316
 
317
# set the LiveCD hostname
318
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
319
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
320
/bin/hostname \\\$hostname
321
 
322
 
323
###################################################
324
# EXIT here if LiveCD has already been configured #
325
###################################################
269 beyerleu 326
if [ -n "\\\$configdone" ]; then
327
  exit 0
328
fi
329
 
330
## fix various bugs and issues
331
# unmute sound card
332
exists alsaunmute 0 2> /dev/null
333
 
270 beyerleu 334
# turn off firstboot for livecd boots
335
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
336
 
337
# start afs with option -memcache (is this correct?)
338
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
339
 
269 beyerleu 340
# Stopgap fix for RH #217966; should be fixed in HAL instead
341
touch /media/.hal-mtab
342
 
343
## create the LiveCD default user
344
# add default user with no password
345
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
346
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
347
# give default user sudo privileges
348
echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
349
 
350
## configure default user's desktop
351
# set up timed auto-login at 10 seconds
352
cat >> /etc/gdm/custom.conf << FOE
353
[daemon]
354
TimedLoginEnable=true
355
TimedLogin=LIVECD_USER
356
TimedLoginDelay=$LOGIN_DELAY
357
FOE
358
sed -i "s|LIVECD_USER|\\\$LIVECD_USER|" /etc/gdm/custom.conf
359
 
360
# add keyboard and display configuration utilities to the desktop
361
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
362
cp /usr/share/applications/gnome-keyboard.desktop           /home/\\\$LIVECD_USER/Desktop/
363
cp /usr/share/applications/gnome-display-properties.desktop /home/\\\$LIVECD_USER/Desktop/
364
 
365
# disable screensaver locking
366
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool   /apps/gnome-screensaver/lock_enabled "false" >/dev/null
367
 
368
# disable PackageKit update checking by default
369
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t int /apps/gnome-packagekit/update-icon/frequency_get_updates "0" >/dev/null
370
 
371
# detecting disk partitions and logical volumes 
372
CreateDesktopIconHD()
373
{
374
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
375
[Desktop Entry]
376
Encoding=UTF-8
377
Version=1.0
378
Type=Link
379
Name=Local hard drives
380
Name[en_US]=Local hard drives
381
Name[fr_CA]=Disques durs locaux
382
URL=/mnt/disc
383
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
384
EOF_HDicon
385
 
386
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
387
}
388
 
389
CreateDesktopIconLVM()
390
{
391
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
392
 
393
cat > /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon
394
[Desktop Entry]
395
Encoding=UTF-8
396
Version=1.0
397
Type=Link
398
Name=Local logical volumes
399
Name[en_US]=Local logical volumes
400
Name[fr_CA]=Volumes logiques locaux
401
URL=/mnt/lvm
402
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
403
EOF_LVMicon
404
 
405
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
406
}
407
 
408
# don't mount disk partitions if 'nodiskmount' is given as a boot option
409
if ! strstr "\\\`cat /proc/cmdline\\\`" nodiskmount ; then
410
	MOUNTOPTION="ro"
411
	HARD_DISKS=\\\`egrep "[sh]d.\\\$" /proc/partitions | tr -s ' ' | sed 's/^  *//' | cut -d' ' -f4\\\`
412
 
413
	echo "Mounting hard disk partitions... "
414
	for DISK in \\\$HARD_DISKS; do
415
	    # Get the device and system info from fdisk (but only for fat and linux partitions).
416
	    FDISK_INFO=\\\`fdisk -l /dev/\\\$DISK | tr [A-Z] [a-z] | egrep "fat|linux" | egrep -v "swap|extended|lvm" | sed 's/*//' | tr -s ' ' | tr ' ' ':' | cut -d':' -f1,6-\\\`
417
	    for FDISK_ENTRY in \\\$FDISK_INFO; do
418
		PARTITION=\\\`echo \\\$FDISK_ENTRY | cut -d':' -f1\\\`
419
		MOUNTPOINT="/mnt/disc/\\\${PARTITION##/dev/}"
420
		mkdir -p \\\$MOUNTPOINT
421
		MOUNTED=FALSE
422
 
423
		# get the partition type
424
		case \\\`echo \\\$FDISK_ENTRY | cut -d':' -f2-\\\` in
425
		*fat*) 
426
		    FSTYPES="vfat"
427
		    EXTRAOPTIONS=",uid=500";;
428
		*)
429
		    FSTYPES="ext4 ext3 ext2"
430
		    EXTRAOPTIONS="";;
431
		esac
432
 
433
		# try to mount the partition
434
		for FSTYPE in \\\$FSTYPES; do
435
		    if mount -o "\\\${MOUNTOPTION}\\\${EXTRAOPTIONS}" -t \\\$FSTYPE \\\$PARTITION \\\$MOUNTPOINT &>/dev/null; then
436
			echo "\\\$PARTITION \\\$MOUNTPOINT \\\$FSTYPE noauto,\\\${MOUNTOPTION}\\\${EXTRAOPTIONS} 0 0" >> /etc/fstab
437
			echo -n "\\\$PARTITION "
438
			MOUNTED=TRUE
439
			CreateDesktopIconHD
440
		    fi
441
		done
442
		[ \\\$MOUNTED = "FALSE" ] && rmdir \\\$MOUNTPOINT
443
	    done
444
	done
445
	echo
446
fi
447
 
448
# don't mount logical volumes if 'nolvmmount' is given as a boot option
449
if ! strstr "\\\`cat /proc/cmdline\\\`" nolvmmount ; then
450
        MOUNTOPTION="ro"
451
	FSTYPES="ext4 ext3 ext2"
452
	echo "Scanning for logical volumes..."
453
	if ! lvm vgscan 2>&1 | grep "No volume groups"; then
454
	    echo "Activating logical volumes ..."
455
	    modprobe dm_mod >/dev/null
456
	    lvm vgchange -ay
457
	    LOGICAL_VOLUMES=\\\`lvm lvdisplay -c | sed "s/^  *//" | cut -d: -f1\\\`
458
	    if [ ! -z "\\\$LOGICAL_VOLUMES" ]; then
459
		echo "Making device nodes ..."
460
		lvm vgmknodes
461
		echo -n "Mounting logical volumes ... "
462
		for VOLUME_NAME in \\\$LOGICAL_VOLUMES; do
463
		    VG_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f3\\\`
464
		    LV_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f4\\\`
465
		    MOUNTPOINT="/mnt/lvm/\\\${VG_NAME}-\\\${LV_NAME}"
466
		    mkdir -p \\\$MOUNTPOINT
467
 
468
		    MOUNTED=FALSE
469
		    for FSTYPE in \\\$FSTYPES; do
470
			if mount -o \\\$MOUNTOPTION -t \\\$FSTYPE \\\$VOLUME_NAME \\\$MOUNTPOINT &>/dev/null; then
471
			    echo "\\\$VOLUME_NAME \\\$MOUNTPOINT \\\$FSTYPE defaults,\\\${MOUNTOPTION} 0 0" >> /etc/fstab
472
			    echo -n "\\\$VOLUME_NAME "
473
			    MOUNTED=TRUE
474
			    CreateDesktopIconLVM
475
			    break
476
			fi
477
		    done
478
		    [ \\\$MOUNTED = FALSE ] && rmdir \\\$MOUNTPOINT
479
		done
480
		echo
481
 
482
	    else
483
		echo "No logical volumes found"
484
	    fi
485
	fi
486
fi
487
 
488
# give back ownership to the default user
489
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
490
 
491
EOF_initscript
492
echo ###################################################################
493
echo ## End of livesys script
494
echo ###################################################################
495
 
496
 
497
 
498
echo ###################################################################
499
echo ## Creating the livesys init script - livesys-late
500
echo ###################################################################
501
 
502
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
503
#!/bin/bash
504
#
505
# live: Late init script for live image
506
#
507
# chkconfig: 345 99 01
508
# description: Late init script for live image.
509
 
510
. /etc/init.d/functions
511
. /etc/livesys.conf
512
. /etc/init.d/livesys.functions
513
 
514
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
515
    exit 0
516
fi
517
 
518
touch /.liveimg-late-configured
519
 
520
# read boot parameters out of /proc/cmdline
521
ks=\\\$( cmdline_value ks )
522
xdriver=\\\$( cmdline_value xdriver )
523
kb=\\\$( cmdline_value kb )
524
 
525
# if liveinst or textinst is given, start anaconda
526
if [ "\\\$( cmdline_parameter liveinst )" ]; then
527
   plymouth --quit
528
   /usr/sbin/liveinst \\\$ks
529
fi
530
if [ "\\\$( cmdline_parameter textinst )" ] ; then
531
   plymouth --quit
532
   /usr/sbin/liveinst --text \\\$ks
533
fi
534
 
535
# configure X, allowing user to override xdriver
536
if [ "\\\$xdriver" ]; then
537
    exists system-config-display --noui --reconfig --set-depth=24 --set-driver=\\\$xdriver
538
fi
539
 
540
# configure keyboard
541
if [ "\\\$kb" ]; then
542
    exists system-config-keyboard --noui \\\$kb 
543
fi
544
 
545
EOF_lateinitscript
546
echo ###################################################################
547
echo ## End of livesys-late script
548
echo ###################################################################
549
 
550
 
551
 
552
echo ###################################################################
553
echo ## Configure the LiveCD
554
echo ###################################################################
555
 
556
# workaround avahi segfault (#279301)
557
touch /etc/resolv.conf
558
/sbin/restorecon /etc/resolv.conf
559
 
560
chmod 755 /etc/rc.d/init.d/livesys
561
/sbin/restorecon /etc/rc.d/init.d/livesys
562
/sbin/chkconfig --add livesys
563
 
564
chmod 755 /etc/rc.d/init.d/livesys-late
565
/sbin/restorecon /etc/rc.d/init.d/livesys-late
566
/sbin/chkconfig --add livesys-late
567
 
568
# go ahead and pre-make the man -k cache (#455968)
569
/usr/sbin/makewhatis -w
570
 
571
# save a little bit of space at least...
572
rm -f /var/lib/rpm/__db*
573
rm -f /boot/initrd*
574
rm -f /boot/initramfs*
575
# make sure there aren't core files lying around
576
rm -f /core*
577
 
578
# convince readahead not to collect
579
rm -f /.readahead_collect
580
touch /var/lib/readahead/early.sorted
581
 
582
# workaround clock syncing on shutdown that we don't want (#297421)
583
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
584
 
585
# import RPM GPG keys
586
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
587
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
588
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl6
589
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
590
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl
591
 
592
# evolution is in the gnome launch panel (workaround to start thunderbird instead)
593
[ ! -e /usr/bin/evolution ] && ln -s /usr/bin/thunderbird /usr/bin/evolution
594
 
595
EOF_post
596
 
597
# run post-install script
598
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
599
 
600
%end
601
########################################################################
602
# End of configure LiveCD in chroot
603
########################################################################
604
 
605
 
606
 
607
%post --nochroot
608
########################################################################
609
# Post install in no chroot
610
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
611
########################################################################
612
cat > /root/postnochroot-install << EOF_postnochroot
613
#!/bin/bash
614
 
615
# Copy licensing information
616
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
617
 
618
# add livecd-iso-to-disk utility on the LiveCD
619
# only works on x86, x86_64
620
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
621
  if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
622
  cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
623
fi
624
 
625
# customize boot menu entries
626
grep -B4 'menu default'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
627
grep -B3 'xdriver=vesa'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/basicvideo.txt
628
grep -A3 'label check0'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/check.txt
629
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
630
grep -A2 'label local'   \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt
631
 
632
sed "s/label linux0/label linuxtext0/"   \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textboot.txt
633
sed -i "s/Boot/Boot (Text Mode)/"                                           \$LIVE_ROOT/isolinux/textboot.txt
634
sed -i "s/liveimg/liveimg 3/"                                               \$LIVE_ROOT/isolinux/textboot.txt
635
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textboot.txt
636
 
637
sed "s/label linux0/label install0/"     \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/install.txt
638
sed -i "s/Boot/Install/"                                                    \$LIVE_ROOT/isolinux/install.txt
639
sed -i "s/liveimg/liveimg liveinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/install.txt
640
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/install.txt
641
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/install.txt
642
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/install.txt
643
 
644
sed "s/label linux0/label textinstall0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textinstall.txt
645
sed -i "s/Boot/Install (Text Mode)/"                                        \$LIVE_ROOT/isolinux/textinstall.txt
646
sed -i "s/liveimg/liveimg textinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/textinstall.txt
647
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/textinstall.txt
648
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/textinstall.txt
649
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textinstall.txt
650
 
651
cat \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/check.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/current.txt
652
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
653
cat \$LIVE_ROOT/isolinux/cleaned.txt \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/textboot.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/install.txt \$LIVE_ROOT/isolinux/textinstall.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/isolinux.cfg
654
rm -f \$LIVE_ROOT/isolinux/*.txt
655
 
656
EOF_postnochroot
657
 
658
# run postnochroot-install script
659
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
660
 
661
%end
662
########################################################################
663
# End of configure LiveCD in nochroot
664
########################################################################