aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* linuxrc: Log initramfs output/commandsThomas Deutschmann2019-08-071-6/+12
| | | | | | | | | | | | | | | | | | By default, any {bad,good,warn}_msg output and external command calls will now be logged to /tmp/init.log in initramfs. This can be turned off via gk.log.disabled={1,yes} kernel command-line argument. This is especially helpful when working with remote servers when you can access initramfs system through SSH. In addition, initramfs' log file can be preserved, i.e. copied to real system just before switch_root call. This can be controlled via gk.log.keep kernel command-line argument: When just enabled, initramfs will copy log to $NEWROOT/genkernel-boot.log. Keep in my that the file path must be accessible for initramfs and by default, initramfs will only mount / as $NEWROOT and no additional mountpoints. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* unlock-luks.sh: Make shellcheck happyThomas Deutschmann2019-08-061-10/+9
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* unlock-lucks.sh: Kill running cryptsetup prompt with SIGINTThomas Deutschmann2019-08-061-2/+3
| | | | | | | | | | When using SIGTERM, running terminal would require a "reset" because cryptsetup cannot restore fds. Using SIGINT will end cryptsetup prompt gracefully allowing cryptsetup to restore fds and keep terminal working. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Rework debug modeThomas Deutschmann2019-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | This commit will introduce $GK_DEBUGMODE_STATEFILE and a new function is_debug() to check if debug mode is enabled or not. Using a state file instead of a variable will allow us to enable/disable debug mode from outside: I.e. when you have booted in debug mode and are working remotely, you can now remove the state file, which will disable debug mode. This will allow you to resume booting without dropping in another local debug shell. It works the other way, too: When you did NOT boot in debug mode but experiencing a problem and want to drop in another debug shell after next step, you can now enable debug mode by creating the state file. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: Move splash() function to initrd.scriptsThomas Deutschmann2019-08-061-4/+0
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rework --ssh supportThomas Deutschmann2019-07-141-0/+130
- To enable sshd in initramfs user MUST now set "dosshd" kernel command-line parameter. - "gk.sshd.wait" kernel command-line parameter was added to interrupt boot process for X seconds to allow for remote login (can be used like an remote rescue shell). - For remote unlock of LUKS-encrypted root or swap device, user can still send unencrypted keyfile via SSH like $ cat ~/root.unencrypted.key | ssh root@<remote-host> -C post root or user can now just SSH into the remote host and call "unlock-luks" like remote rescueshell ~ # unlock-luks root to get a cryptsetup prompt. NOTE: When manually unlocking the encrypted LUKS device, user must call "resume-boot" afterwards to resume booting. - "--ssh-authorized-keys-file" parameter added which can be used to specify a different file than default "/etc/dropbear/authorized_keys" file. - "--ssh-host-keys" parameter added to control if in initramfs embedded sshd should create its own pair of hosts keys (which will be stored in "/etc/dropbear for re-use, default), use host keys from host system or should generate host keys at runtime on each boot. - "ip" kernel command-line parameter will now default to DHCP usage but does also support addr/CIDR notation to specify a static address. - "gk.net.iface" kernel command-line parameter was added to use a different interface than "eth0". You can either use an interface name or use a MAC address. - "gk.net.gw" kernel command-line parameter was added which will allow user to set specific gateway when DHCP isn't used. - "gk.net.routes" kernel command-line parameter was added which will allow user to set additional routes when DHCP isn't used. Please read manpage for additional parameters and more details. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>