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