2013-01-24 10:50:02 +00:00
|
|
|
## runtime-postinstall.tmpl
|
|
|
|
## post-install setup required to make the system work.
|
|
|
|
|
|
|
|
<%page args="root, basearch, libdir, configdir"/>
|
|
|
|
<%
|
2015-03-22 23:24:16 +00:00
|
|
|
PYTHONDIR = sorted(glob("usr/"+libdir+"/python?.?"))[0]
|
2013-01-24 10:50:02 +00:00
|
|
|
stubs = ("list-harddrives", "raidstart", "raidstop")
|
|
|
|
configdir = configdir + "/common"
|
|
|
|
%>
|
|
|
|
|
|
|
|
## move_stubs()
|
|
|
|
move usr/share/anaconda/restart-anaconda usr/bin
|
|
|
|
%for stub in stubs:
|
|
|
|
-move usr/share/anaconda/${stub}-stub usr/bin/${stub}
|
|
|
|
%endfor
|
|
|
|
|
|
|
|
## move_repos()
|
|
|
|
move etc/yum.repos.d etc/anaconda.repos.d
|
|
|
|
|
2015-03-22 23:24:16 +00:00
|
|
|
## Setup mdadm config to turn off homehost
|
|
|
|
remove etc/mdadm.conf
|
|
|
|
append etc/mdadm.conf "HOMEHOST <ignore>\n"
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
## Configure systemd to start anaconda
|
|
|
|
remove etc/systemd/system/default.target
|
|
|
|
symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
|
|
|
|
|
2014-04-08 00:19:29 +00:00
|
|
|
## Make sure tmpfs is enabled
|
|
|
|
mkdir etc/systemd/system/local-fs.target.wants/
|
|
|
|
symlink /lib/systemd/system/tmp.mount etc/systemd/system/local-fs.target.wants/tmp.mount
|
|
|
|
|
2017-01-09 03:17:38 +00:00
|
|
|
## Start rngd
|
|
|
|
mkdir etc/systemd/system/basic.target.wants/
|
|
|
|
symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
## Disable unwanted systemd services
|
|
|
|
systemctl disable systemd-readahead-collect.service \
|
|
|
|
systemd-readahead-replay.service \
|
|
|
|
mdmonitor.service \
|
2014-04-08 00:19:29 +00:00
|
|
|
mdmonitor-takeover.service \
|
2015-03-22 23:24:16 +00:00
|
|
|
lvm2-monitor.service \
|
2016-04-10 04:00:00 +00:00
|
|
|
dnf-makecache.timer \
|
|
|
|
NetworkManager.service
|
2013-01-24 10:50:02 +00:00
|
|
|
## These services can't be disabled normally (they're linked into place in
|
|
|
|
## /usr/lib/systemd rather than /etc/systemd), so we have to mask them.
|
|
|
|
systemctl mask fedora-configure.service fedora-loadmodules.service \
|
|
|
|
fedora-autorelabel.service fedora-autorelabel-mark.service \
|
2016-04-10 04:00:00 +00:00
|
|
|
fedora-wait-storage.service media.mount \
|
|
|
|
systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer \
|
|
|
|
ldconfig.service
|
|
|
|
|
2017-01-09 03:17:38 +00:00
|
|
|
## Remove the more terrible parts of systemd-tmpfiles.
|
|
|
|
## etc.conf is written with the assumption that /etc/ is empty, which is
|
|
|
|
## ridiculous, and it also creates a broken /etc/resolv.conf, which breaks
|
|
|
|
## networking.
|
|
|
|
remove usr/lib/tmpfiles.d/etc.conf
|
2013-01-24 10:50:02 +00:00
|
|
|
|
2015-03-22 23:24:16 +00:00
|
|
|
## Make logind activate anaconda-shell@.service on switch to empty VT
|
|
|
|
symlink anaconda-shell@.service lib/systemd/system/autovt@.service
|
|
|
|
replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf
|
|
|
|
|
2014-04-08 00:19:29 +00:00
|
|
|
## Don't write the journal to the overlay, just keep it in RAM
|
|
|
|
remove var/log/journal
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
## install some basic configuration files
|
|
|
|
append etc/resolv.conf ""
|
|
|
|
append etc/fstab ""
|
|
|
|
install ${configdir}/i18n etc/sysconfig
|
|
|
|
install ${configdir}/rsyslog.conf etc
|
|
|
|
install ${configdir}/bash_history root/.bash_history
|
|
|
|
install ${configdir}/profile root/.profile
|
|
|
|
install ${configdir}/libuser.conf etc
|
|
|
|
install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf
|
2016-04-10 04:00:00 +00:00
|
|
|
install ${configdir}/spice-vdagentd etc/sysconfig
|
|
|
|
mkdir etc/NetworkManager/conf.d
|
|
|
|
install ${configdir}/91-anaconda-autoconnect-slaves.conf etc/NetworkManager/conf.d
|
|
|
|
install ${configdir}/vconsole.conf etc
|
2017-01-09 03:17:38 +00:00
|
|
|
install ${configdir}/92-anaconda-loglevel-debug.conf etc/NetworkManager/conf.d
|
2013-01-24 10:50:02 +00:00
|
|
|
|
2013-02-13 12:45:57 +00:00
|
|
|
## disable NetworkManager
|
|
|
|
install ${configdir}/NetworkManager.state var/lib/NetworkManager/NetworkManager.state
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
## set up sshd
|
|
|
|
install ${configdir}/sshd_config.anaconda etc/ssh
|
|
|
|
install ${configdir}/pam.sshd etc/pam.d/sshd
|
|
|
|
install ${configdir}/pam.sshd etc/pam.d/login
|
|
|
|
install ${configdir}/pam.sshd etc/pam.d/remote
|
|
|
|
|
|
|
|
## set up "install" user account
|
|
|
|
append etc/passwd "install:x:0:0:root:/root:/usr/libexec/anaconda/run-anaconda"
|
|
|
|
append etc/shadow "install::14438:0:99999:7:::"
|
|
|
|
## remove root password
|
|
|
|
replace "root:\*:" "root::" etc/shadow
|
|
|
|
|
|
|
|
## gconf settings
|
|
|
|
gconfset /desktop/gnome/interface/accessibility bool true
|
|
|
|
|
2017-01-09 03:17:38 +00:00
|
|
|
## gsettings settings
|
|
|
|
install ${configdir}/org.gtk.Settings.Debug.gschema.override usr/share/glib-2.0/schemas
|
|
|
|
runcmd chroot ${root} glib-compile-schemas /usr/share/glib-2.0/schemas
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
move usr/libexec/anaconda/auditd sbin
|
|
|
|
|
|
|
|
## for compatibility with Ancient Anaconda Traditions
|
|
|
|
symlink lib/modules /modules
|
|
|
|
symlink lib/firmware /firmware
|
|
|
|
symlink ../run/install mnt/install
|
|
|
|
|
|
|
|
## create_depmod_conf()
|
|
|
|
append etc/depmod.d/dd.conf "search updates built-in"
|
|
|
|
|
2017-01-09 03:17:38 +00:00
|
|
|
## create multipath.conf so multipath gets auto-started
|
|
|
|
append etc/multipath.conf "defaults {\n\tfind_multipaths yes\n\tuser_friendly_names yes\n}\n"
|
|
|
|
|
2013-06-13 13:16:38 +00:00
|
|
|
## include additional modules in initramfs
|
2015-11-28 15:05:33 +00:00
|
|
|
append etc/dracut.conf.d/extra-install-modules.conf "add_drivers+=' ehci-pci xhci-hcd xhci-pci '"
|
2016-04-10 04:00:00 +00:00
|
|
|
|
2015-09-25 13:21:36 +00:00
|
|
|
## no longer hard dependencies of anaconda module (for smaller EFI initrd), so add them here
|
|
|
|
append etc/dracut.conf.d/extra-install-modules.conf "add_dracutmodules+=' livenet nfs img-lib convertfs ifcfg '"
|
2013-06-13 13:16:38 +00:00
|
|
|
|
2014-04-08 00:19:29 +00:00
|
|
|
## make lvm auto-activate
|
2015-03-22 23:24:16 +00:00
|
|
|
remove etc/lvm/archive/*
|
|
|
|
remove etc/lvm/archive
|
|
|
|
remove etc/lvm/backup/*
|
|
|
|
remove etc/lvm/backup
|
|
|
|
remove etc/lvm/cache/*
|
|
|
|
remove etc/lvm/cache
|
|
|
|
remove etc/lvm/lvm.conf
|
2014-04-08 00:19:29 +00:00
|
|
|
append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n"
|
|
|
|
|
2017-04-08 23:05:59 +00:00
|
|
|
## have basic /dev files
|
|
|
|
remove dev/null
|
|
|
|
runcmd mknod ${root}/dev/null c 1 3
|
|
|
|
runcmd mknod ${root}/dev/urandom c 1 9
|
|
|
|
|
2015-03-22 23:24:16 +00:00
|
|
|
## Record the package versions used to create the image
|
|
|
|
runcmd chroot ${root} /bin/rpm -qa --pipe "tee /root/lorax-packages.log"
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
## TODO: we could run prelink here if we wanted?
|