Open MichaIng opened 5 years ago
Actually without local console access, console-setup
(including keyboard-configuration etc) as well has no use. Saves another boot service and 15M disk space.
Further thoughts:
vcgencmd
does not work anymore. We use this to check some video values in DietPi-Config, but the related menu entries could be simply hidden/skipped in case of headless active.
cat << _EOF_ > /tmp/headless.dts
/dts-v1/;
/plugin/;
/ { compatible = "brcm,bcm2835";
fragment@0 {
target-path = "/soc/mailbox@7e00b840";
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target-path = "/soc/fb";
__overlay__ {
status = "disabled";
};
};
}; EOF dtc -@ -I dts -O dtb -o /tmp/headless.dtbo /tmp/headless.dts mv /tmp/headless.dtbo /boot/overlays G_CONFIG_INJECT 'dtoverlay=headless' 'dtoverlay=headless' /DietPi/config.txt dtoverlay headless
- Allow to re-enable video + keyboard + tty1 via flag file `/boot/disable_headless`. This will be checked on preboot, if present fully enables all feature required to access local console, then does a reboot (since required for e.g. RPi to enable video).
Also the console-setup
package wouldn't be required anymore then.
SBCs without video capabilities are btw shipped with getty@tty1.service
disabled with recent images: https://github.com/MichaIng/DietPi/commit/fb2168c
Background
CONFIG_HDMI_OUTPUT
dietpi.txt
entry anddietpi-config
> Display Options > Display Resolution > Headless, to have display output completely disabled during boot process viatvservice -o
and framebuffer size set to minimum 16x16./boot/config.txt
was required in case of emergency local console access (besides serial console, of course).config.txt
setting to disable video output and the whole framebuffer completely from early boot on, without the need to runtvservice -o
, implemented with DietPi v6.20. To access local console, it is now required to disable those settings, although framebuffer size can be skipped, which will be commented instead, forced to0
by the video disable setting. So practically no change in required end user effort to enable emergency local console access. Also this matches the method how we enable headless mode on Odroid C1 and C2 viaboot.ini
.GRUB_CMDLINE_LINUX_DEFAULT="... i8042.nokbd video=LVDS-1:d"
, although not yet tested on real system (VM only so far).Disable TTY1 on headless systems
systemctl mask getty@tty1.service
and of course with maskedsystemd-logind
./boot
(usually FAT file system) needs to be accessed to re-enable local console from external system, but as well the RootFS (ext4 file system), where the mask needs to be removed viarm /etc/systemd/system/getty@tty1.service
systemctl restart dropbear
blindly. Very rare case and often a real reboot is required or more than one command, if even SSH is not reachable anymore.Jep so thinkable, not more than a tiny optimization (one backgroud process less), one more manual step required in emergency case, requires testing in combination with other software titles, possibly attempting to access TTY1.
Reference: https://askubuntu.com/a/1017325
Long term tests