Subversion Repositories livecd

Rev

Rev 269 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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