Browse Source

systemd: ship emergency.service which triggers a reboot

This reboots the system instead of starting a shell on boot problems.
Because the slot will only be marked as sucessfully booted as the last
step in a normal boot, repeated emergency boots will cause a fallback at
the boot chooser level to the other slot.

Testing this is possible by passing 'emergency' via the kernel command
line.
hheinold/ntpdate
Jan Luebbe 6 years ago
committed by Holger Hans Peter Freyther
parent
commit
2ad885f06a
  1. 3
      recipes-apps/tasks/task-sysmocom-tools.bb
  2. 9
      recipes-config/sysmocom-systemd/files/emergency.service
  3. 14
      recipes-config/sysmocom-systemd/sysmocom-systemd_1.0.bb

3
recipes-apps/tasks/task-sysmocom-tools.bb

@ -3,7 +3,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = " \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
ALLOW_EMPTY_${PN} = "1"
PR = "r9"
PR = "r10"
RDEPENDS_${PN} = "\
lmsensors-scripts \
@ -16,4 +16,5 @@ RDEPENDS_${PN} = "\
ca-cacert-rootcert \
sysmocom-backup \
sysmocom-backup-default \
sysmocom-systemd \
"

9
recipes-config/sysmocom-systemd/files/emergency.service

@ -0,0 +1,9 @@
[Unit]
Description=Emergency Reboot
DefaultDependencies=no
Conflicts=shutdown.target
Before=shutdown.target
[Service]
ExecStart=/bin/systemctl --force reboot
Type=oneshot

14
recipes-config/sysmocom-systemd/sysmocom-systemd_1.0.bb

@ -0,0 +1,14 @@
DESCRIPTION = "sysmocom systemd customization"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = " \
file://emergency.service \
"
do_install() {
install -d ${D}${sysconfdir}/systemd/system
install -m 0644 ${WORKDIR}/emergency.service ${D}${sysconfdir}/systemd/system
}
CONFFILES_${PN} += "${sysconfdir}/systemd/system/emergency.service"
Loading…
Cancel
Save