Subversion Repositories livecd

Rev

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

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