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