Subversion Repositories livecd

Rev

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