Subversion Repositories livecd

Rev

Details | Last modification | View Log | RSS feed

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