Subversion Repositories livecd

Rev

Go to most recent revision | 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
 
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
 
124
cat > . /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
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
 
291
## fix various bugs and issues
292
# unmute sound card
293
exists alsaunmute 0 2> /dev/null
294
 
295
# Stopgap fix for RH #217966; should be fixed in HAL instead
296
touch /media/.hal-mtab
297
 
298
# set the LiveCD hostname
299
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
300
sed -i -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=\\\$hostname/g' /etc/sysconfig/network
301
/bin/hostname \\\$hostname
302
 
303
## create the LiveCD default user
304
# add default user with no password
305
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
306
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
307
# give default user sudo privileges
308
echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
309
 
310
## configure default user's desktop
311
# set up timed auto-login at 10 seconds
312
cat >> /etc/gdm/custom.conf << FOE
313
[daemon]
314
TimedLoginEnable=true
315
TimedLogin=LIVECD_USER
316
TimedLoginDelay=$LOGIN_DELAY
317
FOE
318
sed -i "s|LIVECD_USER|\\\$LIVECD_USER|" /etc/gdm/custom.conf
319
 
320
# add keyboard and display configuration utilities to the desktop
321
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
322
cp /usr/share/applications/gnome-keyboard.desktop           /home/\\\$LIVECD_USER/Desktop/
323
cp /usr/share/applications/gnome-display-properties.desktop /home/\\\$LIVECD_USER/Desktop/
324
 
325
# disable screensaver locking
326
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool   /apps/gnome-screensaver/lock_enabled "false" >/dev/null
327
 
328
# disable PackageKit update checking by default
329
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
330
 
331
# detecting disk partitions and logical volumes 
332
CreateDesktopIconHD()
333
{
334
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
335
[Desktop Entry]
336
Encoding=UTF-8
337
Version=1.0
338
Type=Link
339
Name=Local hard drives
340
Name[en_US]=Local hard drives
341
Name[fr_CA]=Disques durs locaux
342
URL=/mnt/disc
343
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
344
EOF_HDicon
345
 
346
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
347
}
348
 
349
CreateDesktopIconLVM()
350
{
351
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
352
 
353
cat > /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon
354
[Desktop Entry]
355
Encoding=UTF-8
356
Version=1.0
357
Type=Link
358
Name=Local logical volumes
359
Name[en_US]=Local logical volumes
360
Name[fr_CA]=Volumes logiques locaux
361
URL=/mnt/lvm
362
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
363
EOF_LVMicon
364
 
365
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
366
}
367
 
368
# don't mount disk partitions if 'nodiskmount' is given as a boot option
369
if ! strstr "\\\`cat /proc/cmdline\\\`" nodiskmount ; then
370
	MOUNTOPTION="ro"
371
	HARD_DISKS=\\\`egrep "[sh]d.\\\$" /proc/partitions | tr -s ' ' | sed 's/^  *//' | cut -d' ' -f4\\\`
372
 
373
	echo "Mounting hard disk partitions... "
374
	for DISK in \\\$HARD_DISKS; do
375
	    # Get the device and system info from fdisk (but only for fat and linux partitions).
376
	    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-\\\`
377
	    for FDISK_ENTRY in \\\$FDISK_INFO; do
378
		PARTITION=\\\`echo \\\$FDISK_ENTRY | cut -d':' -f1\\\`
379
		MOUNTPOINT="/mnt/disc/\\\${PARTITION##/dev/}"
380
		mkdir -p \\\$MOUNTPOINT
381
		MOUNTED=FALSE
382
 
383
		# get the partition type
384
		case \\\`echo \\\$FDISK_ENTRY | cut -d':' -f2-\\\` in
385
		*fat*) 
386
		    FSTYPES="vfat"
387
		    EXTRAOPTIONS=",uid=500";;
388
		*)
389
		    FSTYPES="ext4 ext3 ext2"
390
		    EXTRAOPTIONS="";;
391
		esac
392
 
393
		# try to mount the partition
394
		for FSTYPE in \\\$FSTYPES; do
395
		    if mount -o "\\\${MOUNTOPTION}\\\${EXTRAOPTIONS}" -t \\\$FSTYPE \\\$PARTITION \\\$MOUNTPOINT &>/dev/null; then
396
			echo "\\\$PARTITION \\\$MOUNTPOINT \\\$FSTYPE noauto,\\\${MOUNTOPTION}\\\${EXTRAOPTIONS} 0 0" >> /etc/fstab
397
			echo -n "\\\$PARTITION "
398
			MOUNTED=TRUE
399
			CreateDesktopIconHD
400
		    fi
401
		done
402
		[ \\\$MOUNTED = "FALSE" ] && rmdir \\\$MOUNTPOINT
403
	    done
404
	done
405
	echo
406
fi
407
 
408
# don't mount logical volumes if 'nolvmmount' is given as a boot option
409
if ! strstr "\\\`cat /proc/cmdline\\\`" nolvmmount ; then
410
        MOUNTOPTION="ro"
411
	FSTYPES="ext4 ext3 ext2"
412
	echo "Scanning for logical volumes..."
413
	if ! lvm vgscan 2>&1 | grep "No volume groups"; then
414
	    echo "Activating logical volumes ..."
415
	    modprobe dm_mod >/dev/null
416
	    lvm vgchange -ay
417
	    LOGICAL_VOLUMES=\\\`lvm lvdisplay -c | sed "s/^  *//" | cut -d: -f1\\\`
418
	    if [ ! -z "\\\$LOGICAL_VOLUMES" ]; then
419
		echo "Making device nodes ..."
420
		lvm vgmknodes
421
		echo -n "Mounting logical volumes ... "
422
		for VOLUME_NAME in \\\$LOGICAL_VOLUMES; do
423
		    VG_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f3\\\`
424
		    LV_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f4\\\`
425
		    MOUNTPOINT="/mnt/lvm/\\\${VG_NAME}-\\\${LV_NAME}"
426
		    mkdir -p \\\$MOUNTPOINT
427
 
428
		    MOUNTED=FALSE
429
		    for FSTYPE in \\\$FSTYPES; do
430
			if mount -o \\\$MOUNTOPTION -t \\\$FSTYPE \\\$VOLUME_NAME \\\$MOUNTPOINT &>/dev/null; then
431
			    echo "\\\$VOLUME_NAME \\\$MOUNTPOINT \\\$FSTYPE defaults,\\\${MOUNTOPTION} 0 0" >> /etc/fstab
432
			    echo -n "\\\$VOLUME_NAME "
433
			    MOUNTED=TRUE
434
			    CreateDesktopIconLVM
435
			    break
436
			fi
437
		    done
438
		    [ \\\$MOUNTED = FALSE ] && rmdir \\\$MOUNTPOINT
439
		done
440
		echo
441
 
442
	    else
443
		echo "No logical volumes found"
444
	    fi
445
	fi
446
fi
447
 
448
# give back ownership to the default user
449
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
450
 
451
EOF_initscript
452
echo ###################################################################
453
echo ## End of livesys script
454
echo ###################################################################
455
 
456
 
457
 
458
echo ###################################################################
459
echo ## Creating the livesys init script - livesys-late
460
echo ###################################################################
461
 
462
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
463
#!/bin/bash
464
#
465
# live: Late init script for live image
466
#
467
# chkconfig: 345 99 01
468
# description: Late init script for live image.
469
 
470
. /etc/init.d/functions
471
. /etc/livesys.conf
472
. /etc/init.d/livesys.functions
473
 
474
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
475
    exit 0
476
fi
477
 
478
touch /.liveimg-late-configured
479
 
480
# read boot parameters out of /proc/cmdline
481
ks=\\\$( cmdline_value ks )
482
xdriver=\\\$( cmdline_value xdriver )
483
kb=\\\$( cmdline_value kb )
484
 
485
# if liveinst or textinst is given, start anaconda
486
if [ "\\\$( cmdline_parameter liveinst )" ]; then
487
   plymouth --quit
488
   /usr/sbin/liveinst \\\$ks
489
fi
490
if [ "\\\$( cmdline_parameter textinst )" ] ; then
491
   plymouth --quit
492
   /usr/sbin/liveinst --text \\\$ks
493
fi
494
 
495
# configure X, allowing user to override xdriver
496
if [ "\\\$xdriver" ]; then
497
    exists system-config-display --noui --reconfig --set-depth=24 --set-driver=\\\$xdriver
498
fi
499
 
500
# configure keyboard
501
if [ "\\\$kb" ]; then
502
    exists system-config-keyboard --noui \\\$kb 
503
fi
504
 
505
EOF_lateinitscript
506
echo ###################################################################
507
echo ## End of livesys-late script
508
echo ###################################################################
509
 
510
 
511
 
512
echo ###################################################################
513
echo ## Configure the LiveCD
514
echo ###################################################################
515
 
516
# workaround avahi segfault (#279301)
517
touch /etc/resolv.conf
518
/sbin/restorecon /etc/resolv.conf
519
 
520
chmod 755 /etc/rc.d/init.d/livesys
521
/sbin/restorecon /etc/rc.d/init.d/livesys
522
/sbin/chkconfig --add livesys
523
 
524
chmod 755 /etc/rc.d/init.d/livesys-late
525
/sbin/restorecon /etc/rc.d/init.d/livesys-late
526
/sbin/chkconfig --add livesys-late
527
 
528
# turn off firstboot for livecd boots
529
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
530
 
531
# turn off services, which are not useful on LiveCD, to preserve resources
532
chkconfig --level 345 mdmonitor       off 2>/dev/null
533
chkconfig --level 345 setroubleshoot  off 2>/dev/null
534
chkconfig --level 345 auditd          off 2>/dev/null
535
chkconfig --level 345 crond           off 2>/dev/null
536
chkconfig --level 345 atd             off 2>/dev/null
537
chkconfig --level 345 readahead_early off 2>/dev/null
538
chkconfig --level 345 readahead_later off 2>/dev/null
539
chkconfig --level 345 kdump           off 2>/dev/null
540
chkconfig --level 345 microcode_ctl   off 2>/dev/null
541
chkconfig --level 345 openct          off 2>/dev/null
542
chkconfig --level 345 pcscd           off 2>/dev/null
543
chkconfig --level 345 postfix         off 2>/dev/null
544
 
545
# start afs with option -memcache (is this correct?)
546
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
547
 
548
# go ahead and pre-make the man -k cache (#455968)
549
/usr/sbin/makewhatis -w
550
 
551
# save a little bit of space at least...
552
rm -f /var/lib/rpm/__db*
553
rm -f /boot/initrd*
554
rm -f /boot/initramfs*
555
# make sure there aren't core files lying around
556
rm -f /core*
557
 
558
# convince readahead not to collect
559
rm -f /.readahead_collect
560
touch /var/lib/readahead/early.sorted
561
 
562
# workaround clock syncing on shutdown that we don't want (#297421)
563
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
564
 
565
# import RPM GPG keys
566
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
567
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
568
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl6
569
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
570
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl
571
 
572
# evolution is in the gnome launch panel (workaround to start thunderbird instead)
573
[ ! -e /usr/bin/evolution ] && ln -s /usr/bin/thunderbird /usr/bin/evolution
574
 
575
EOF_post
576
 
577
# run post-install script
578
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
579
 
580
%end
581
########################################################################
582
# End of configure LiveCD in chroot
583
########################################################################
584
 
585
 
586
 
587
%post --nochroot
588
########################################################################
589
# Post install in no chroot
590
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
591
########################################################################
592
cat > /root/postnochroot-install << EOF_postnochroot
593
#!/bin/bash
594
 
595
# Copy licensing information
596
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
597
 
598
# add livecd-iso-to-disk utility on the LiveCD
599
# only works on x86, x86_64
600
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
601
  if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
602
  cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
603
fi
604
 
605
# customize boot menu entries
606
grep -B4 'menu default'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
607
grep -B3 'xdriver=vesa'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/basicvideo.txt
608
grep -A3 'label check0'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/check.txt
609
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
610
grep -A2 'label local'   \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt
611
 
612
sed "s/label linux0/label linuxtext0/"   \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textboot.txt
613
sed -i "s/Boot/Boot (Text Mode)/"                                           \$LIVE_ROOT/isolinux/textboot.txt
614
sed -i "s/liveimg/liveimg 3/"                                               \$LIVE_ROOT/isolinux/textboot.txt
615
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textboot.txt
616
 
617
sed "s/label linux0/label install0/"     \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/install.txt
618
sed -i "s/Boot/Install/"                                                    \$LIVE_ROOT/isolinux/install.txt
619
sed -i "s/liveimg/liveimg liveinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/install.txt
620
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/install.txt
621
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/install.txt
622
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/install.txt
623
 
624
sed "s/label linux0/label textinstall0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textinstall.txt
625
sed -i "s/Boot/Install (Text Mode)/"                                        \$LIVE_ROOT/isolinux/textinstall.txt
626
sed -i "s/liveimg/liveimg textinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/textinstall.txt
627
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/textinstall.txt
628
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/textinstall.txt
629
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textinstall.txt
630
 
631
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
632
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
633
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
634
rm -f \$LIVE_ROOT/isolinux/*.txt
635
 
636
EOF_postnochroot
637
 
638
# run postnochroot-install script
639
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
640
 
641
%end
642
########################################################################
643
# End of configure LiveCD in nochroot
644
########################################################################