Subversion Repositories livecd

Rev

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

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