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