Subversion Repositories livecd

Rev

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

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