summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorben2016-02-06 02:20:47 +0100
committertorben2016-02-06 02:20:47 +0100
commit0e509e8ce08451f5c2307587d2d977109a08ffb4 (patch)
tree443868c4d4df627fde65cc5717393e72bdb14f74
parentFix dependencies. (diff)
parentmerge (diff)
downloadsystemd-init-0e509e8ce08451f5c2307587d2d977109a08ffb4.tar.gz
systemd-init-0e509e8ce08451f5c2307587d2d977109a08ffb4.tar.xz
systemd-init-0e509e8ce08451f5c2307587d2d977109a08ffb4.zip
Merge branch 'master' of git.openslx.org:openslx-ng/systemd-init
-rw-r--r--builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh24
-rwxr-xr-xbuilder/dnbd3-rootfs/module-setup.sh19
-rw-r--r--dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default4
3 files changed, 40 insertions, 7 deletions
diff --git a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh
new file mode 100644
index 00000000..1e9366e2
--- /dev/null
+++ b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh
@@ -0,0 +1,24 @@
+#!/bin/env bash
+# Dracut may not be installed on the new root. Thus copy all services over.
+systemdsystemunitdir="$(
+ dirname "$(find / -name dracut-mount.service -type f -print -quit)")"
+mkdir --parents "${NEWROOT}/${systemdsystemunitdir}"
+for file in \
+ dracut-cmdline.service \
+ dracut-initqueue.service \
+ dracut-mount.service \
+ dracut-pre-mount.service \
+ dracut-pre-pivot.service \
+ dracut-pre-trigger.service \
+ dracut-pre-udev.service; do
+ cp "${systemdsystemunitdir}/$file" \
+ "${NEWROOT}/${systemdsystemunitdir}/$file"
+ ln -s ../"$file" \
+ "${NEWROOT}/${systemdsystemunitdir}/initrd.target.wants/$file"
+done
+
+# Needed to be able to go back to dracut at system shutdown.
+mkdir /temp_mnt
+mount --bind / /temp_mnt/
+cp -rT /temp_mnt /run/initramfs
+umount /temp_mnt && rmdir /temp_mnt
diff --git a/builder/dnbd3-rootfs/module-setup.sh b/builder/dnbd3-rootfs/module-setup.sh
index 3b9f877e..a1514f91 100755
--- a/builder/dnbd3-rootfs/module-setup.sh
+++ b/builder/dnbd3-rootfs/module-setup.sh
@@ -6,8 +6,14 @@ core.import logging
core.import utils
# TODO set log level via dracut logging options
-logging.set_level debug
-logging.set_commands_level debug
+# (use $dracut_args
+#((len=${#dracut_args[@]}))
+#for ((i=0; i < len; i++)); do
+ #[[ ${dracut_args[$i]} == "--regenerate-all" ]] && \
+ #unset dracut_args[$i]
+#done
+logging.set_log_level debug
+logging.set_commands_log_level debug
core.import "$(core_abs_path "$(dirname "${BASH_SOURCE[0]}")/scripts/build.sh")"
@@ -78,7 +84,7 @@ check() {
depends() {
# DEBUG: echo base network bash kernel-modules systemd-initrd dracut-systemd fs-lib rootfs-block
- echo base network bash kernel-modules
+ echo base network bash kernel-modules shutdown
# NOTE: btrfs module should be used if it would work.
}
@@ -145,11 +151,14 @@ install() {
/usr/bin/dnbd3root
inst_simple "${moddir}/services/dnbd3root.service" \
"${systemdsystemunitdir}/dnbd3root.service"
- # don't kill at switch_root
+
+ # copy systemd services to new root (so they don't get killed after
+ # switch_root)
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-root-fs.target.wants"
ln_r "${systemdsystemunitdir}/dnbd3root.service" \
"${systemdsystemunitdir}/initrd-root-fs.target.wants/dnbd3root.service"
- inst_hook pre-pivot 95 "$moddir/hooks/copy-dnbd3-generator-into-newroot.sh"
+ inst_hook pre-pivot 00 "$moddir/hooks/copy-dnbd3-generator-into-newroot.sh"
+ inst_hook pre-pivot 00 "$moddir/hooks/copy-dracut-systemd-files-into-newroot.sh"
else
inst_hook pre-mount 10 "$moddir/hooks/prepare-root-partition.sh"
fi
diff --git a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
index 2134db2f..8e985237 100644
--- a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
+++ b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
@@ -14,13 +14,13 @@ SYSAPPEND 2
LABEL arch
MENU LABEL ^archLinux debug
KERNEL /archLinux-vmlinuz-linux
-APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ systemd.log_level=info systemd.journald.forward_to_console=1
+APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break=pre-pivot rd.break=pre-shutdown ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ systemd.log_level=info systemd.journald.forward_to_console=1
SYSAPPEND 2
LABEL arch
MENU LABEL ^archlinux serial debug
KERNEL /archLinux-vmlinuz-linux
-APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ systemd.log_level=info systemd.journald.forward_to_console=1 console=tty0 console=ttyS0,128000
+APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break=pre-pivot rd.break=pre-shutdown ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ systemd.log_level=info systemd.journald.forward_to_console=1 console=tty0 console=ttyS0,128000
SYSAPPEND 2
LABEL ubuntu