On 2024-03-23, Florian Obser <flor...@openbsd.org> wrote: > > diff --git libexec/reorder_kernel/reorder_kernel.sh > libexec/reorder_kernel/reorder_kernel.sh > index fb1d151f42a..809d1e18e55 100644 > --- libexec/reorder_kernel/reorder_kernel.sh > +++ libexec/reorder_kernel/reorder_kernel.sh > @@ -30,6 +30,14 @@ SHA256=/var/db/kernel.SHA256 > # Silently skip if on a NFS mounted filesystem. > df -t nonfs $KERNEL_DIR >/dev/null 2>&1 > > +# Silently skip if battery is less than 50% remaining. > +# We know nothing of the quality of the powergrid and we do not > +# want the relink to fail halfway through because of power outage. > +(( $(/usr/sbin/apm -l) < 50 ))
Don't forget upd(4)! Maybe it could also time an md5 -ttt run and demand more available battery if the machine is slow. > +# Disable halt(8) & reboot(8) to prevent interuption of the kernel relink. > +/bin/chmod 000 /sbin/{halt, reboot} Also hw.allowpowerdown=0 and shutdown. And what about the watchdog? > We should also disable panic(9) in the kernel while reorder_kernel is > running. Maybe a sysctl? Disabling panic, that's genius, it would solve so many problems!