Subversion Repositories livecd

Rev

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