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.
This commit is contained in:
parent
78b77de220
commit
2ad885f06a
|
@ -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 \
|
||||
"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Emergency Reboot
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
Before=shutdown.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/systemctl --force reboot
|
||||
Type=oneshot
|
|
@ -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…
Reference in New Issue