2011-08-09 21:37:43 +00:00
|
|
|
## runtime-postinstall.tmpl
|
|
|
|
## post-install setup required to make the system work.
|
|
|
|
|
2011-07-25 23:39:48 +00:00
|
|
|
<%page args="root, basearch, libdir, configdir"/>
|
2011-05-05 22:24:58 +00:00
|
|
|
<%
|
2012-04-17 18:39:04 +00:00
|
|
|
stubs = ("list-harddrives", "raidstart", "raidstop")
|
2011-10-21 20:12:12 +00:00
|
|
|
configdir = configdir + "/common"
|
2011-05-05 22:24:58 +00:00
|
|
|
%>
|
|
|
|
|
|
|
|
## move_stubs()
|
|
|
|
move usr/share/anaconda/restart-anaconda usr/bin
|
|
|
|
%for stub in stubs:
|
2011-10-26 17:06:05 +00:00
|
|
|
-move usr/share/anaconda/${stub}-stub usr/bin/${stub}
|
2011-05-05 22:24:58 +00:00
|
|
|
%endfor
|
|
|
|
|
|
|
|
## move_repos()
|
|
|
|
move etc/yum.repos.d etc/anaconda.repos.d
|
|
|
|
|
2014-10-28 17:29:38 +00:00
|
|
|
## Setup mdadm config to turn off homehost
|
|
|
|
remove etc/mdadm.conf
|
|
|
|
append etc/mdadm.conf "HOMEHOST <ignore>\n"
|
|
|
|
|
2011-09-08 00:36:22 +00:00
|
|
|
## Configure systemd to start anaconda
|
|
|
|
remove etc/systemd/system/default.target
|
|
|
|
symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
|
2012-06-19 19:14:27 +00:00
|
|
|
|
2013-02-14 17:50:19 +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
|
|
|
|
|
2016-01-28 22:52:10 +00:00
|
|
|
## Start rngd
|
2016-09-13 01:36:03 +00:00
|
|
|
mkdir etc/systemd/system/basic.target.wants/
|
2016-01-28 22:52:10 +00:00
|
|
|
symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
|
|
|
|
|
2012-06-19 19:14:27 +00:00
|
|
|
## Disable unwanted systemd services
|
|
|
|
systemctl disable systemd-readahead-collect.service \
|
|
|
|
systemd-readahead-replay.service \
|
|
|
|
mdmonitor.service \
|
|
|
|
mdmonitor-takeover.service \
|
2014-07-18 21:17:08 +00:00
|
|
|
lvm2-monitor.service \
|
|
|
|
dnf-makecache.timer
|
2012-06-19 19:14:27 +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 \
|
2015-06-12 22:56:12 +00:00
|
|
|
fedora-wait-storage.service media.mount \
|
2015-07-19 14:58:48 +00:00
|
|
|
systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer \
|
|
|
|
ldconfig.service
|
2011-08-09 21:37:43 +00:00
|
|
|
|
2017-08-14 20:58:25 +00:00
|
|
|
## remove because it cannot be disabled
|
|
|
|
remove usr/lib/systemd/system-generators/lvm2-activation-generator
|
|
|
|
|
2015-10-06 15:47:17 +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
|
|
|
|
|
2014-01-10 19:54:26 +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
|
|
|
|
|
2013-04-23 18:29:00 +00:00
|
|
|
## Don't write the journal to the overlay, just keep it in RAM
|
|
|
|
remove var/log/journal
|
|
|
|
|
2011-08-09 21:37:43 +00:00
|
|
|
## install some basic configuration files
|
2012-06-19 23:48:13 +00:00
|
|
|
append etc/fstab ""
|
2011-10-31 14:55:15 +00:00
|
|
|
install ${configdir}/i18n etc/sysconfig
|
2011-05-05 22:24:58 +00:00
|
|
|
install ${configdir}/rsyslog.conf etc
|
2011-10-21 20:12:12 +00:00
|
|
|
install ${configdir}/bash_history root/.bash_history
|
|
|
|
install ${configdir}/profile root/.profile
|
2011-05-05 22:24:58 +00:00
|
|
|
install ${configdir}/libuser.conf etc
|
2012-04-25 20:21:27 +00:00
|
|
|
install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf
|
2013-08-05 17:11:05 +00:00
|
|
|
install ${configdir}/spice-vdagentd etc/sysconfig
|
2015-06-25 12:22:01 +00:00
|
|
|
mkdir etc/NetworkManager/conf.d
|
|
|
|
install ${configdir}/91-anaconda-autoconnect-slaves.conf etc/NetworkManager/conf.d
|
2015-08-04 21:11:56 +00:00
|
|
|
install ${configdir}/vconsole.conf etc
|
2015-10-23 09:09:19 +00:00
|
|
|
install ${configdir}/92-anaconda-loglevel-debug.conf etc/NetworkManager/conf.d
|
2014-01-30 11:24:13 +00:00
|
|
|
install ${configdir}/90-anaconda-no-auto-default.conf etc/NetworkManager/conf.d
|
2011-05-05 22:24:58 +00:00
|
|
|
|
2011-08-09 21:37:43 +00:00
|
|
|
## set up sshd
|
2011-05-05 22:24:58 +00:00
|
|
|
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
|
2011-11-02 18:48:13 +00:00
|
|
|
|
|
|
|
## set up "install" user account
|
2012-10-11 17:18:17 +00:00
|
|
|
append etc/passwd "install:x:0:0:root:/root:/usr/libexec/anaconda/run-anaconda"
|
2011-05-05 22:24:58 +00:00
|
|
|
append etc/shadow "install::14438:0:99999:7:::"
|
2011-11-02 18:48:13 +00:00
|
|
|
## remove root password
|
2011-11-07 15:58:51 +00:00
|
|
|
replace "root:\*:" "root::" etc/shadow
|
2011-05-05 22:24:58 +00:00
|
|
|
|
2015-10-14 18:54:33 +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
|
|
|
|
|
2011-05-05 22:24:58 +00:00
|
|
|
move usr/libexec/anaconda/auditd sbin
|
|
|
|
|
2011-10-18 20:31:50 +00:00
|
|
|
## for compatibility with Ancient Anaconda Traditions
|
2011-10-26 17:57:46 +00:00
|
|
|
symlink lib/modules /modules
|
|
|
|
symlink lib/firmware /firmware
|
2012-03-19 18:22:52 +00:00
|
|
|
symlink ../run/install mnt/install
|
2011-05-14 07:25:44 +00:00
|
|
|
|
2011-05-27 15:03:38 +00:00
|
|
|
## create_depmod_conf()
|
|
|
|
append etc/depmod.d/dd.conf "search updates built-in"
|
2011-06-30 20:05:43 +00:00
|
|
|
|
2013-03-06 22:20:49 +00:00
|
|
|
## create multipath.conf so multipath gets auto-started
|
2019-08-19 18:10:14 +00:00
|
|
|
append etc/multipath.conf "defaults {\n\tfind_multipaths smart\n\tuser_friendly_names yes\n}\n"
|
2013-03-06 22:20:49 +00:00
|
|
|
|
|
|
|
## make lvm auto-activate
|
2014-09-19 11:28:40 +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
|
2014-10-28 17:41:24 +00:00
|
|
|
remove etc/lvm/lvm.conf
|
2013-03-06 22:20:49 +00:00
|
|
|
append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n"
|
|
|
|
|
2014-10-21 17:04:47 +00:00
|
|
|
## Record the package versions used to create the image
|
2017-02-21 18:24:56 +00:00
|
|
|
## rpm initializes nss, which requires /dev/urandom to be present, hence the mknod
|
|
|
|
runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/random c 1 8
|
|
|
|
runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/urandom c 1 9
|
|
|
|
runcmd chroot ${root} /usr/bin/rpm -qa --pipe "tee /root/lorax-packages.log"
|
2014-10-21 17:04:47 +00:00
|
|
|
|
2011-06-30 20:05:43 +00:00
|
|
|
## TODO: we could run prelink here if we wanted?
|