[PATCH 2/4] Add systemd and agetty to the installation environment.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Also, set up anaconda.target to be the default systemd unit.
---
 share/ramdisk.ltmpl        |   35 ++++++++++++++++++++++-------------
 src/pylorax/installtree.py |   29 ++++++++---------------------
 2 files changed, 30 insertions(+), 34 deletions(-)

diff --git a/share/ramdisk.ltmpl b/share/ramdisk.ltmpl
index c2d682d..22e3254 100644
--- a/share/ramdisk.ltmpl
+++ b/share/ramdisk.ltmpl
@@ -139,6 +139,7 @@ install "smartmontools"
 install "smc-meera-fonts"
 install "specspo"
 install "strace"
+install "systemd"
 install "systemd-sysvinit"
 install "tigervnc-server-minimal"
 install "tigervnc-server-module"
@@ -184,6 +185,7 @@ install "${product}-release"
 % endif
 
 ## required directories
+mkdir "/etc/sysconfig"
 mkdir "/var/run/dbus"
 
 ## not required packages installed as dependencies
@@ -195,7 +197,6 @@ remove "avahi-autoipd"
 remove "avahi-libs"
 remove "basesystem"
 remove "checkpolicy"
-remove "chkconfig"
 remove "clusterlib"
 remove "clutter"
 remove "clutter-gesture"
@@ -226,7 +227,6 @@ remove "fedora-release-rawhide"
 remove "fence-agents"
 remove "fence-virt"
 remove "file"
-remove "filesystem"
 remove "fipscheck"
 remove "flac"
 remove "fontpackages-filesystem"
@@ -345,7 +345,6 @@ remove "sound-theme-freedesktop"
 remove "squashfs-tools"
 remove "system-config-firewall-base"
 remove "system-config-users"
-remove "systemd-units"
 remove "telnet"
 remove "tigervnc-license"
 remove "ttmkfdir"
@@ -486,7 +485,6 @@ remove --path "/usr/share/mime/video"
 remove --path "/usr/share/mime/x-content"
 remove --path "/usr/share/mime/x-epoc"
 remove --path "/boot"
-remove --path "/cgroup"
 remove --path "/home"
 remove --path "/media"
 remove --path "/mnt"
@@ -496,13 +494,11 @@ remove --path "/usr/etc"
 remove --path "/usr/games"
 remove --path "/usr/local"
 remove --path "/usr/tmp"
-remove --path "/var/cache"
 remove --path "/var/db"
 remove --path "/var/games"
 remove --path "/var/lib/rpm/*"
 remove --path "/var/lib/yum"
 remove --path "/var/local"
-remove --path "/var/log"
 remove --path "/var/mail"
 remove --path "/var/nis"
 remove --path "/var/opt"
@@ -536,7 +532,6 @@ remove "ModemManager" "/usr/${libdir}/*"
 remove "ModemManager" "/usr/sbin/*"
 remove "ModemManager" "/usr/share/icons/*"
 remove "NetworkManager" "/etc/rc.d/*"
-remove "NetworkManager" "/lib/systemd/*"
 remove "NetworkManager" "/usr/bin/*"
 remove "NetworkManager" "/usr/share/NetworkManager/*"
 remove "NetworkManager" "/usr/share/locale/*/NetworkManager.mo"
@@ -564,6 +559,7 @@ remove "audit-libs" "/etc/*"
 remove "audit-libs" "/${libdir}/libauparse*"
 remove "authconfig" "/usr/sbin/*"
 remove "authconfig" "/usr/share/*"
+remove "avahi" "/lib/systemd/*"
 remove "avahi" "/usr/share/locale/*"
 remove "bash" "/etc/*"
 remove "bash" "/usr/bin/*"
@@ -581,6 +577,10 @@ remove "ca-certificates" "/etc/pki/java/*"
 remove "ca-certificates" "/etc/pki/tls/certs/ca-bundle.trust.crt"
 remove "ca-certificates" "/etc/ssl/*"
 remove "cairo" "/usr/${libdir}/libcairo-script*"
+remove "chkconfig" "/sbin/chkconfig"
+remove "chkconfig" "/usr/sbin/alternatives"
+remove "chkconfig" "/usr/sbin/update-alternatives"
+remove "chkconfig" "/var/lib/alternatives"
 remove "cjkuni-uming-fonts" "/etc/X11/*"
 remove "coreutils" "/etc/*"
 remove "coreutils" "/bin/link"
@@ -652,7 +652,6 @@ remove "createrepo" "/usr/share/*"
 remove "cryptsetup-luks" "/usr/share/*"
 remove "cyrus-sasl-lib" "/usr/sbin/*"
 remove "db4" "/usr/*"
-remove "dbus" "/lib/systemd/*"
 remove "dbus-glib" "/usr/bin/*"
 remove "dbus-x11" "/etc/X11/*"
 remove "dejavu-sans-fonts" "/usr/share/fonts/dejavu/DejaVuSans-BoldOblique*"
@@ -694,6 +693,7 @@ remove "fedora-gnome-theme" "/usr/share/themes/*"
 remove "file-libs" "/usr/share/*"
 remove "findutils" "/usr/bin/oldfind"
 remove "findutils" "/usr/share/*"
+remove "firstboot" "/lib/systemd/*"
 remove "firstboot" "/usr/sbin/*"
 remove "firstboot" "/usr/share/firstboot/*"
 remove "firstboot" "/usr/share/locale/*"
@@ -863,7 +863,9 @@ remove "hwdata" "/usr/share/hwdata/oui.txt"
 remove "hwdata" "/usr/share/hwdata/pnp.ids"
 remove "hwdata" "/usr/share/hwdata/upgradelist"
 remove "initscripts" "/etc/ppp/*"
-remove "initscripts" "/lib/systemd/*"
+remove "initscripts" "/lib/systemd/system/fedora-readonly.service"
+remove "initscripts" "/lib/systemd/system/fedora-storage-init.service"
+remove "initscripts" "/lib/systemd/system/fedora-wait-storage.service"
 remove "initscripts" "/usr/sbin/*"
 remove "initscripts" "/usr/share/locale/*"
 remove "iproute" "/etc/*"
@@ -1109,9 +1111,17 @@ remove "system-config-date" "/usr/share/icons/*"
 remove "system-config-keyboard" "/etc/*"
 remove "system-config-keyboard" "/usr/bin/*"
 remove "system-config-keyboard" "/usr/share/icons/*"
-remove "systemd" "/bin/*"
-remove "systemd" "/lib/systemd/*"
-remove "systemd" "/usr/share/systemd/*"
+remove "systemd-units" "/lib/systemd/system/bluetooth.target"
+remove "systemd-units" "/lib/systemd/system/http-daemon.target"
+remove "systemd-units" "/lib/systemd/system/kexec*"
+remove "systemd-units" "/lib/systemd/system/local-fs.target.wants/media.mount"
+remove "systemd-units" "/lib/systemd/system/mail-transfer-agent.target"
+remove "systemd-units" "/lib/systemd/system/media.mount"
+remove "systemd-units" "/lib/systemd/system/printer*"
+remove "systemd-units" "/lib/systemd/system/*plymouth*"
+remove "systemd-units" "/lib/systemd/system/quota*"
+remove "systemd-units" "/lib/systemd/system/smartcard*"
+remove "systemd-units" "/lib/systemd/system/systemd-remount-api-vfs.service"
 remove "sysvinit-tools" "/bin/*"
 remove "sysvinit-tools" "/usr/bin/*"
 remove "tar" "/usr/share/locale/*"
@@ -1122,7 +1132,6 @@ remove "util-linux" "/bin/taskset"
 remove "util-linux" "/etc/pam.d/chfn"
 remove "util-linux" "/etc/pam.d/chsh"
 remove "util-linux" "/sbin/addpart"
-remove "util-linux" "/sbin/agetty"
 remove "util-linux" "/sbin/cfdisk"
 remove "util-linux" "/sbin/ctrlaltdel"
 remove "util-linux" "/sbin/delpart"
diff --git a/src/pylorax/installtree.py b/src/pylorax/installtree.py
index 0146d37..0b32522 100644
--- a/src/pylorax/installtree.py
+++ b/src/pylorax/installtree.py
@@ -336,43 +336,25 @@ class LoraxInstallTree(BaseLoraxClass):
 
     def misc_tree_modifications(self):
         if self.basearch in ("s390", "s390x"):
-            # copy shutdown
-            src = joinpaths(self.root, "usr", self.libdir, "anaconda/shutdown")
-            dst = joinpaths(self.root, "sbin", "init")
-            os.unlink(dst)
-            shutil.copy2(src, dst)
-
             # copy linuxrc.s390
             src = joinpaths(self.root, "usr/share/anaconda/linuxrc.s390")
             dst = joinpaths(self.root, "sbin", "init")
             os.unlink(dst)
             shutil.copy2(src, dst)
-        else:
-            # replace init with anaconda init
-            src = joinpaths(self.root, "usr", self.libdir, "anaconda", "init")
-            dst = joinpaths(self.root, "sbin", "init")
-            os.unlink(dst)
-            shutil.copy2(src, dst)
 
         # init symlinks
         target = "/sbin/init"
         name = joinpaths(self.root, "init")
         os.symlink(target, name)
 
-        for fname in ["halt", "poweroff", "reboot"]:
-            name = joinpaths(self.root, "sbin", fname)
-            os.unlink(name)
-            os.symlink("init", name)
-
-        for fname in ["runlevel", "shutdown", "telinit"]:
-            name = joinpaths(self.root, "sbin", fname)
-            os.unlink(name)
-
         # mtab symlink
         #target = "/proc/mounts"
         #name = joinpaths(self.root, "etc", "mtab")
         #os.symlink(target, name)
 
+        os.unlink(self.root+"/etc/systemd/system/default.target")
+        os.symlink("/lib/systemd/system/anaconda.target", self.root+"/etc/systemd/system/default.target")
+
         # create resolv.conf
         touch(joinpaths(self.root, "etc", "resolv.conf"))
 
@@ -436,6 +418,11 @@ class LoraxInstallTree(BaseLoraxClass):
             dst = joinpaths(self.root, "etc/selinux", "config")
             shutil.copy2(src, dst)
 
+        # get sysconfig files
+        src = joinpaths(src_dir, "network")
+        dst = joinpaths(self.root, "etc/sysconfig")
+        shutil.copy2(src, dst)
+
     def setup_sshd(self, src_dir):
         # get sshd config
         src = joinpaths(src_dir, "sshd_config.anaconda")
-- 
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux