381 |
beyerleu |
1 |
|
|
|
2 |
lang en_GB.UTF-8
|
|
|
3 |
keyboard us
|
|
|
4 |
timezone Europe/Brussels --isUtc
|
|
|
5 |
auth --useshadow --enablemd5
|
|
|
6 |
selinux --enforcing
|
|
|
7 |
firewall --enabled --service=mdns
|
|
|
8 |
xconfig --startxonboot
|
|
|
9 |
part / --size 8192 --fstype ext4
|
|
|
10 |
services --enabled=NetworkManager --disabled=network,sshd
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
# Root password
|
|
|
14 |
rootpw --iscrypted $6$K2nKf02kVKG68960$OywvoaViphSITuro/liKvCj7Pm/CH/xqzz/lsoXyaKSR1lYf0vHAqSUc483a9MCCBkIwfr/hNMfqwxqVO0OEg1
|
|
|
15 |
|
382 |
beyerleu |
16 |
# SL repositories (fastbugs enabled per default)
|
|
|
17 |
#repo --name=base --baseurl=http://ftp.scientificlinux.org/linux/scientific/7.0/$basearch/os/
|
|
|
18 |
#repo --name=security --baseurl=http://ftp.scientificlinux.org/linux/scientific/7.0/$basearch/updates/security/
|
|
|
19 |
#repo --name=fastbugs --baseurl=http://ftp.scientificlinux.org/linux/scientific/7.0/$basearch/updates/fastbugs/
|
381 |
beyerleu |
20 |
|
382 |
beyerleu |
21 |
# or use a mirror close to you
|
|
|
22 |
repo --name=base --baseurl=http://mirror.switch.ch/ftp/mirror/scientificlinux/7.0/$basearch/os/
|
|
|
23 |
repo --name=security --baseurl=http://mirror.switch.ch/ftp/mirror/scientificlinux/7.0/$basearch/updates/security/
|
|
|
24 |
repo --name=fastbugs --baseurl=http://mirror.switch.ch/ftp/mirror/scientificlinux/7.0/$basearch/updates/fastbugs/
|
|
|
25 |
|
|
|
26 |
|
381 |
beyerleu |
27 |
%packages
|
|
|
28 |
@base
|
|
|
29 |
@core
|
|
|
30 |
@dial-up
|
|
|
31 |
@directory-client
|
|
|
32 |
@fonts
|
|
|
33 |
@kde-desktop
|
|
|
34 |
@guest-agents
|
|
|
35 |
@guest-desktop-agents
|
|
|
36 |
@input-methods
|
|
|
37 |
@internet-browser
|
|
|
38 |
@java-platform
|
|
|
39 |
@multimedia
|
|
|
40 |
@network-file-system-client
|
|
|
41 |
@print-client
|
|
|
42 |
@x11
|
|
|
43 |
@internet-applications
|
|
|
44 |
@office-suite
|
|
|
45 |
@remote-desktop-clients
|
|
|
46 |
@kde-apps
|
|
|
47 |
@kde-media
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
#Live install tools
|
|
|
51 |
anaconda
|
|
|
52 |
system-config-keyboard
|
|
|
53 |
firefox
|
|
|
54 |
|
|
|
55 |
# For UEFI/Secureboot support
|
|
|
56 |
grub2
|
|
|
57 |
grub2-efi
|
|
|
58 |
efibootmgr
|
|
|
59 |
shim
|
|
|
60 |
|
|
|
61 |
%end
|
|
|
62 |
|
|
|
63 |
%post
|
|
|
64 |
# FIXME: it'd be better to get this installed from a package
|
|
|
65 |
cat > /etc/rc.d/init.d/livesys << EOF
|
|
|
66 |
#!/bin/bash
|
|
|
67 |
#
|
|
|
68 |
# live: Init script for live image
|
|
|
69 |
#
|
|
|
70 |
# chkconfig: 345 00 99
|
|
|
71 |
# description: Init script for live image.
|
|
|
72 |
### BEGIN INIT INFO
|
|
|
73 |
# X-Start-Before: display-manager
|
|
|
74 |
### END INIT INFO
|
|
|
75 |
|
|
|
76 |
. /etc/init.d/functions
|
|
|
77 |
|
|
|
78 |
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then
|
|
|
79 |
exit 0
|
|
|
80 |
fi
|
|
|
81 |
|
|
|
82 |
if [ -e /.liveimg-configured ] ; then
|
|
|
83 |
configdone=1
|
|
|
84 |
fi
|
|
|
85 |
|
|
|
86 |
exists() {
|
|
|
87 |
which \$1 >/dev/null 2>&1 || return
|
|
|
88 |
\$*
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
# Make sure we don't mangle the hardware clock on shutdown
|
|
|
92 |
ln -sf /dev/null /etc/systemd/system/hwclock-save.service
|
|
|
93 |
|
|
|
94 |
livedir="LiveOS"
|
|
|
95 |
for arg in \`cat /proc/cmdline\` ; do
|
|
|
96 |
if [ "\${arg##rd.live.dir=}" != "\${arg}" ]; then
|
|
|
97 |
livedir=\${arg##rd.live.dir=}
|
|
|
98 |
return
|
|
|
99 |
fi
|
|
|
100 |
if [ "\${arg##live_dir=}" != "\${arg}" ]; then
|
|
|
101 |
livedir=\${arg##live_dir=}
|
|
|
102 |
return
|
|
|
103 |
fi
|
|
|
104 |
done
|
|
|
105 |
|
|
|
106 |
# enable swaps unless requested otherwise
|
|
|
107 |
swaps=\`blkid -t TYPE=swap -o device\`
|
|
|
108 |
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
|
|
|
109 |
for s in \$swaps ; do
|
|
|
110 |
action "Enabling swap partition \$s" swapon \$s
|
|
|
111 |
done
|
|
|
112 |
fi
|
|
|
113 |
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /run/initramfs/live/\${livedir}/swap.img ] ; then
|
|
|
114 |
action "Enabling swap file" swapon /run/initramfs/live/\${livedir}/swap.img
|
|
|
115 |
fi
|
|
|
116 |
|
|
|
117 |
mountPersistentHome() {
|
|
|
118 |
# support label/uuid
|
|
|
119 |
if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
|
|
|
120 |
homedev=\`/sbin/blkid -o device -t "\$homedev"\`
|
|
|
121 |
fi
|
|
|
122 |
|
|
|
123 |
# if we're given a file rather than a blockdev, loopback it
|
|
|
124 |
if [ "\${homedev##mtd}" != "\${homedev}" ]; then
|
|
|
125 |
# mtd devs don't have a block device but get magic-mounted with -t jffs2
|
|
|
126 |
mountopts="-t jffs2"
|
|
|
127 |
elif [ ! -b "\$homedev" ]; then
|
|
|
128 |
loopdev=\`losetup -f\`
|
|
|
129 |
if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
|
|
|
130 |
action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
|
|
|
131 |
fi
|
|
|
132 |
losetup \$loopdev \$homedev
|
|
|
133 |
homedev=\$loopdev
|
|
|
134 |
fi
|
|
|
135 |
|
|
|
136 |
# if it's encrypted, we need to unlock it
|
|
|
137 |
if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
|
|
|
138 |
echo
|
|
|
139 |
echo "Setting up encrypted /home device"
|
|
|
140 |
plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
|
|
|
141 |
homedev=/dev/mapper/EncHome
|
|
|
142 |
fi
|
|
|
143 |
|
|
|
144 |
# and finally do the mount
|
|
|
145 |
mount \$mountopts \$homedev /home
|
|
|
146 |
# if we have /home under what's passed for persistent home, then
|
|
|
147 |
# we should make that the real /home. useful for mtd device on olpc
|
|
|
148 |
if [ -d /home/home ]; then mount --bind /home/home /home ; fi
|
|
|
149 |
[ -x /sbin/restorecon ] && /sbin/restorecon /home
|
|
|
150 |
if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
|
|
|
151 |
}
|
|
|
152 |
|
|
|
153 |
findPersistentHome() {
|
|
|
154 |
for arg in \`cat /proc/cmdline\` ; do
|
|
|
155 |
if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
|
|
|
156 |
homedev=\${arg##persistenthome=}
|
|
|
157 |
return
|
|
|
158 |
fi
|
|
|
159 |
done
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
|
|
|
163 |
findPersistentHome
|
|
|
164 |
elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then
|
|
|
165 |
homedev=/run/initramfs/live/\${livedir}/home.img
|
|
|
166 |
fi
|
|
|
167 |
|
|
|
168 |
# if we have a persistent /home, then we want to go ahead and mount it
|
|
|
169 |
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
|
|
|
170 |
action "Mounting persistent /home" mountPersistentHome
|
|
|
171 |
fi
|
|
|
172 |
|
|
|
173 |
# make it so that we don't do writing to the overlay for things which
|
|
|
174 |
# are just tmpdirs/caches
|
|
|
175 |
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
|
|
|
176 |
mount -t tmpfs vartmp /var/tmp
|
|
|
177 |
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1
|
|
|
178 |
|
|
|
179 |
if [ -n "\$configdone" ]; then
|
|
|
180 |
exit 0
|
|
|
181 |
fi
|
|
|
182 |
|
|
|
183 |
# add live user with no passwd
|
|
|
184 |
action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
|
|
|
185 |
passwd -d liveuser > /dev/null
|
|
|
186 |
usermod -aG wheel liveuser > /dev/null
|
|
|
187 |
|
|
|
188 |
# Remove root password lock
|
|
|
189 |
passwd -d root > /dev/null
|
|
|
190 |
|
|
|
191 |
# turn off firstboot for livecd boots
|
|
|
192 |
systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
|
|
|
193 |
systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
|
|
|
194 |
systemctl stop firstboot-text.service 2> /dev/null || :
|
|
|
195 |
systemctl stop firstboot-graphical.service 2> /dev/null || :
|
|
|
196 |
|
|
|
197 |
# don't use prelink on a running live image
|
|
|
198 |
sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :
|
|
|
199 |
|
|
|
200 |
# turn off mdmonitor by default
|
|
|
201 |
systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
|
|
|
202 |
systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
|
|
|
203 |
systemctl stop mdmonitor.service 2> /dev/null || :
|
|
|
204 |
systemctl stop mdmonitor-takeover.service 2> /dev/null || :
|
|
|
205 |
|
|
|
206 |
# don't enable the gnome-settings-daemon packagekit plugin
|
|
|
207 |
gsettings set org.gnome.settings-daemon.plugins.updates active 'false' || :
|
|
|
208 |
|
|
|
209 |
# don't start cron/at as they tend to spawn things which are
|
|
|
210 |
# disk intensive that are painful on a live image
|
|
|
211 |
systemctl --no-reload disable crond.service 2> /dev/null || :
|
|
|
212 |
systemctl --no-reload disable atd.service 2> /dev/null || :
|
|
|
213 |
systemctl stop crond.service 2> /dev/null || :
|
|
|
214 |
systemctl stop atd.service 2> /dev/null || :
|
|
|
215 |
|
|
|
216 |
# Mark things as configured
|
|
|
217 |
touch /.liveimg-configured
|
|
|
218 |
|
|
|
219 |
# add static hostname to work around xauth bug
|
|
|
220 |
# https://bugzilla.redhat.com/show_bug.cgi?id=679486
|
|
|
221 |
echo "localhost" > /etc/hostname
|
|
|
222 |
|
|
|
223 |
# Fixing the lang install issue when other lang than English is selected . See http://bugs.centos.org/view.php?id=7217
|
|
|
224 |
/usr/bin/cp /usr/lib/python2.7/site-packages/blivet/size.py /usr/lib/python2.7/site-packages/blivet/size.py.orig
|
|
|
225 |
/usr/bin/sed -i "s#return self.humanReadable()#return self.humanReadable().encode('utf-8')#g" /usr/lib/python2.7/site-packages/blivet/size.py
|
|
|
226 |
|
|
|
227 |
EOF
|
|
|
228 |
|
|
|
229 |
# bah, hal starts way too late
|
|
|
230 |
cat > /etc/rc.d/init.d/livesys-late << EOF
|
|
|
231 |
#!/bin/bash
|
|
|
232 |
#
|
|
|
233 |
# live: Late init script for live image
|
|
|
234 |
#
|
|
|
235 |
# chkconfig: 345 99 01
|
|
|
236 |
# description: Late init script for live image.
|
|
|
237 |
|
|
|
238 |
. /etc/init.d/functions
|
|
|
239 |
|
|
|
240 |
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
|
|
|
241 |
exit 0
|
|
|
242 |
fi
|
|
|
243 |
|
|
|
244 |
exists() {
|
|
|
245 |
which \$1 >/dev/null 2>&1 || return
|
|
|
246 |
\$*
|
|
|
247 |
}
|
|
|
248 |
|
|
|
249 |
touch /.liveimg-late-configured
|
|
|
250 |
|
|
|
251 |
# read some variables out of /proc/cmdline
|
|
|
252 |
for o in \`cat /proc/cmdline\` ; do
|
|
|
253 |
case \$o in
|
|
|
254 |
ks=*)
|
|
|
255 |
ks="--kickstart=\${o#ks=}"
|
|
|
256 |
;;
|
|
|
257 |
xdriver=*)
|
|
|
258 |
xdriver="\${o#xdriver=}"
|
|
|
259 |
;;
|
|
|
260 |
esac
|
|
|
261 |
done
|
|
|
262 |
|
|
|
263 |
# if liveinst or textinst is given, start anaconda
|
|
|
264 |
if strstr "\`cat /proc/cmdline\`" liveinst ; then
|
|
|
265 |
plymouth --quit
|
|
|
266 |
/usr/sbin/liveinst \$ks
|
|
|
267 |
fi
|
|
|
268 |
if strstr "\`cat /proc/cmdline\`" textinst ; then
|
|
|
269 |
plymouth --quit
|
|
|
270 |
/usr/sbin/liveinst --text \$ks
|
|
|
271 |
fi
|
|
|
272 |
|
|
|
273 |
# configure X, allowing user to override xdriver
|
|
|
274 |
if [ -n "\$xdriver" ]; then
|
|
|
275 |
cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
|
|
|
276 |
Section "Device"
|
|
|
277 |
Identifier "Videocard0"
|
|
|
278 |
Driver "\$xdriver"
|
|
|
279 |
EndSection
|
|
|
280 |
FOE
|
|
|
281 |
fi
|
|
|
282 |
|
|
|
283 |
EOF
|
|
|
284 |
|
|
|
285 |
chmod 755 /etc/rc.d/init.d/livesys
|
|
|
286 |
/sbin/restorecon /etc/rc.d/init.d/livesys
|
|
|
287 |
/sbin/chkconfig --add livesys
|
|
|
288 |
|
|
|
289 |
chmod 755 /etc/rc.d/init.d/livesys-late
|
|
|
290 |
/sbin/restorecon /etc/rc.d/init.d/livesys-late
|
|
|
291 |
/sbin/chkconfig --add livesys-late
|
|
|
292 |
|
|
|
293 |
# enable tmpfs for /tmp
|
|
|
294 |
systemctl enable tmp.mount
|
|
|
295 |
|
|
|
296 |
# work around for poor key import UI in PackageKit
|
|
|
297 |
rm -f /var/lib/rpm/__db*
|
|
|
298 |
releasever=$(rpm -q --qf '%{version}\n' --whatprovides system-release)
|
|
|
299 |
basearch=$(uname -i)
|
|
|
300 |
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
|
|
|
301 |
echo "Packages within this LiveCD"
|
|
|
302 |
rpm -qa
|
|
|
303 |
# Note that running rpm recreates the rpm db files which aren't needed or wanted
|
|
|
304 |
rm -f /var/lib/rpm/__db*
|
|
|
305 |
|
|
|
306 |
# go ahead and pre-make the man -k cache (#455968)
|
|
|
307 |
/usr/bin/mandb
|
|
|
308 |
|
|
|
309 |
# save a little bit of space at least...
|
|
|
310 |
rm -f /boot/initramfs*
|
|
|
311 |
# make sure there aren't core files lying around
|
|
|
312 |
rm -f /core*
|
|
|
313 |
|
|
|
314 |
# convince readahead not to collect
|
|
|
315 |
# FIXME: for systemd
|
|
|
316 |
|
|
|
317 |
cat >> /etc/rc.d/init.d/livesys << EOF
|
|
|
318 |
|
|
|
319 |
|
|
|
320 |
# disable updates plugin
|
|
|
321 |
cat >> /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override << FOE
|
|
|
322 |
[org.gnome.settings-daemon.plugins.updates]
|
|
|
323 |
active=false
|
|
|
324 |
FOE
|
|
|
325 |
|
|
|
326 |
# Show the system-config-keyboard tool on the desktop
|
|
|
327 |
mkdir /home/liveuser/Desktop -p >/dev/null
|
|
|
328 |
cat /usr/share/applications/system-config-keyboard.desktop | sed '/NotShowIn/d' |sed 's/Terminal=false/Terminal=true/' > /home/liveuser/Desktop/system-config-keyboard.desktop
|
|
|
329 |
cat /usr/share/applications/liveinst.desktop | sed '/NoDisplay/d' > /home/liveuser/Desktop/liveinst.desktop
|
|
|
330 |
chmod +x /home/liveuser/Desktop/*.desktop
|
|
|
331 |
chown -R liveuser:liveuser /home/liveuser
|
|
|
332 |
|
|
|
333 |
# Liveuser face
|
|
|
334 |
if [ -e /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png ] ; then
|
|
|
335 |
cp /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png /home/liveuser/.face
|
|
|
336 |
chown liveuser:liveuser /home/liveuser/.face
|
|
|
337 |
fi
|
|
|
338 |
|
|
|
339 |
# make the installer show up
|
|
|
340 |
if [ -f /usr/share/applications/liveinst.desktop ]; then
|
|
|
341 |
# Show harddisk install in shell dash
|
|
|
342 |
sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop
|
|
|
343 |
# need to move it to anaconda.desktop to make shell happy
|
|
|
344 |
#cp /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
|
|
|
345 |
fi
|
|
|
346 |
cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
|
|
|
347 |
[org.gnome.shell]
|
|
|
348 |
favorite-apps=['liveinst.desktop','firefox.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop', 'anaconda.desktop']
|
|
|
349 |
FOE
|
|
|
350 |
|
|
|
351 |
# add liveinst.desktop to favorites menu
|
|
|
352 |
mkdir -p /home/liveuser/.kde/share/config/
|
|
|
353 |
cat > /home/liveuser/.kde/share/config/kickoffrc << MENU_EOF
|
|
|
354 |
[Favorites]
|
|
|
355 |
FavoriteURLs=/usr/share/applications/kde4/konqbrowser.desktop,/usr/share/applications/kde4/dolphin.desktop,/usr/share/applications/kde4/systemsettings.desktop,/usr/share/applications/liveinst.desktop
|
|
|
356 |
MENU_EOF
|
|
|
357 |
|
|
|
358 |
# set up auto-login
|
|
|
359 |
cat > /etc/gdm/custom.conf << FOE
|
|
|
360 |
[daemon]
|
|
|
361 |
AutomaticLoginEnable=True
|
|
|
362 |
AutomaticLogin=liveuser
|
|
|
363 |
FOE
|
|
|
364 |
|
|
|
365 |
# Turn off PackageKit-command-not-found while uninstalled
|
|
|
366 |
if [ -f /etc/PackageKit/CommandNotFound.conf ]; then
|
|
|
367 |
sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
|
|
|
368 |
fi
|
|
|
369 |
|
|
|
370 |
# make sure to set the right permissions and selinux contexts
|
|
|
371 |
chown -R liveuser:liveuser /home/liveuser/
|
|
|
372 |
restorecon -R /home/liveuser/
|
|
|
373 |
|
|
|
374 |
# Fixing default locale to us
|
|
|
375 |
localectl set-keymap us
|
|
|
376 |
localectl set-x11-keymap us
|
|
|
377 |
EOF
|
|
|
378 |
|
|
|
379 |
# rebuild schema cache with any overrides we installed
|
|
|
380 |
glib-compile-schemas /usr/share/glib-2.0/schemas
|
|
|
381 |
|
|
|
382 |
|
|
|
383 |
%end
|