aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add support for LVM thin provisioningThomas Deutschmann2019-08-301-0/+28
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: openLUKS(): gpg was moved to /usr/binThomas Deutschmann2019-08-291-2/+2
| | | | | Bug: https://bugs.gentoo.org/693006 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: start_volumes(): dmsetup was moved to /usr/sbinThomas Deutschmann2019-08-291-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: preserve_log(): Stop determining mountpoint when reached "/"Thomas Deutschmann2019-08-211-1/+1
| | | | | | | | | | | | In commit 271c330 we stopped determining mountpoint already when we were testing for $CHROOT value. However, $CHROOT is the mountpoint we are looking for when no additional volumes were mounted. This sanity check should only get triggered when we reached "/" while looping through path for logfile. Fixes 271c330 ("initrd.scripts: preserve_log(): Add support for additional mountpoints") Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Set ZPOOL_IMPORT_UDEV_TIMEOUT_MS=0Georgy Yakovlev2019-08-161-0/+1
| | | | | | | | It'll eliminate need of doing dozfs=cache. Link: https://github.com/zfsonlinux/zfs/pull/9109 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: preserve_log(): Add support for additional mountpointsThomas Deutschmann2019-08-163-23/+54
| | | | | | | | | | This commit will add support for copying init.log to $NEWROOT/var/log/genkernel-boot.log for example even when $NEWROOT/var/log is an own partition. To make this work, you must tell genkernel via /etc/initramfs.mounts to mount the additional mount point. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Remove dead codeThomas Deutschmann2019-08-071-2/+0
| | | | | | | Call to verbose_kmsg() was moved in commit 5842219. No need to keep this any longer. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: wait_sshd(): Make use of good_msg_n()Thomas Deutschmann2019-08-071-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: kill_network(): Make use of good_msg_n()Thomas Deutschmann2019-08-071-10/+6
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Rework resume-boot.shThomas Deutschmann2019-08-071-6/+19
| | | | | | | | | | - We no longer use $GK_SHELL_LOCKFILE which was removed in in previous commit ("initrd.scripts: run_shell(): Use LOCK file"). - We now try to kill all $SH processes allowing to use resume-boot in remote and local rescue shell. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: prompt_user(): Read answer from $GK_PROMPT_FILE on timeoutThomas Deutschmann2019-08-073-6/+42
| | | | | | | | | | | | | | | | | | | | This commit will bring back read timeout which was removed in Commit a280829. Read timeout is still disabled by default but can now be controlled via gk.prompt.timeout kernel command-line argument. When gk.prompt.timeout is != 0, the current prompt will be written to $GK_PROMPT_FILE. This will allow remote user to notice that there's a prompt. In addition, on timeout, $GK_PROMPT_FILE will be read allowing remote user to answer prompt and hopefully to fix the problem and resume booting. To make this work, gk.prompt.timeout will be set to 30 seconds by default when SSH usage is enabled. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Remove dead codeThomas Deutschmann2019-08-071-5/+0
| | | | | | | This code shouldn't work (anymore) because $CHROOT is read-only at this stage. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* busybox: Use raidautorun instead of mdstartThomas Deutschmann2019-08-072-3/+1
| | | | | | raidautorun applet is upstream's replacement for mdstart. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Log initramfs output/commandsThomas Deutschmann2019-08-075-220/+506
| | | | | | | | | | | | | | | | | | 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>
* login-remote.sh: Make shellcheck happyThomas Deutschmann2019-08-061-14/+14
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Fix console supportThomas Deutschmann2019-08-062-7/+33
| | | | | | | | | | | | - Make sure we set console after processing CMDLINE so that we will use last set console which matches kernel documentation. - Strip any set option from console= value. - Regain control after spawning a shell. Bug: https://bugs.gentoo.org/473128 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: run_shell(): Use LOCK fileThomas Deutschmann2019-08-062-3/+5
| | | | | | | We cannot write PID because we use exec and don't return before the shell we just spawned was closed. 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-064-12/+27
| | | | | | | | | | | | | | | | | | | | 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.defaults: Remove duplicated definition of $NORMALThomas Deutschmann2019-08-061-1/+0
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: Move splash() function to initrd.scriptsThomas Deutschmann2019-08-064-12/+4
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Make shell startup output more beautiful and usefulThomas Deutschmann2019-08-063-7/+22
| | | | | | | | | | | | - Hide busybox version - Show genkernel version - Show running kernel version - Use emphasis (bold format) in text Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* busyy-config: UpdateThomas Deutschmann2019-08-041-2/+3
| | | | | | | | | | - Enable FEATURE_FAST_TOP by default - Unset SVOK by default - Enable WALL by default Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Create /dev/tty{0,1}Thomas Deutschmann2019-08-041-0/+2
| | | | | | | /dev/tty1 is used by local debug shell for example. Fixes: cf85138 ("initramfs: Don't call mknod when --busybox is used") Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: cleanup(): Don't bring down network interface when ↵Thomas Deutschmann2019-07-291-1/+6
| | | | | | | | | real_root=/dev/nfs At this stage we already have mounted root over network so we should not bring down the network interface. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: start_network(): Handle already running interfaceThomas Deutschmann2019-07-291-1/+32
| | | | | | | | | | | | | | When kernel was built with CONFIG_IP_PNP_DHCP=y option for example and ip=dhcp was specified on kernel command-line, interface maybe already up and running (configured). In this case it doesn't make any sense to fire up udhcpc which would only get the same network configuration. However, when interface is already up but manual IP configuration was specified, we must restart interface to get back into a known state and apply our own configuration like told by the user because we support more complex configurations. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Change kernel and initramfs default filename in $BOOTDIRThomas Deutschmann2019-07-291-3/+3
| | | | | | | | | | | | | | | | | | This commit will change default kernel and initramfs filename: kernel-genkernel-%%ARCH%%-%%KV%% -> vmlinuz-%%KV%% System.map-genkernel--%%ARCH%%-%%KV%% -> System.map-%%KV%% initramfs-genkernel-%%ARCH%%-%%KV%% -> initramfs-%%KV%%.img The new naming will be consistent with kernel's "make install" and will allow to match files in /lib/modules with actual kernel. In addition, $ARCH value was moved to kernel's LOCALVERSION. This will ensure that this information is still present and when you do cross-compilation, that /lib/modules content don't get mixed. Bug: https://bugs.gentoo.org/390407 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* Make initramfs and kernel filename customizableThomas Deutschmann2019-07-291-0/+7
| | | | | | | | | | | | | New options like --initramfs-filename or --kernel-filename will allow user to customize filenames used when installing initramfs or kernel into $BOOTDIR. Therefore --kernelname (KNAME) option was removed. Filename can contain placeholders like '%%ARCH%%' which will get replaced at runtime. Man page contains more information. Bug: https://bugs.gentoo.org/395095 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* keymaps: Add bepo and colemak keymapThomas Deutschmann2019-07-2846-96/+94
| | | | | Bug: https://bugs.gentoo.org/442102 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initramfs: Don't call mknod when --busybox is usedThomas Deutschmann2019-07-211-0/+8
| | | | | | This will basically allow us to run genkernel as user. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: start_volumes(): Normalize error messagesThomas Deutschmann2019-07-211-5/+7
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Load network modules only when neededv4.0.0_beta6Thomas Deutschmann2019-07-182-13/+75
| | | | | | | | | | | | To avoid problems related to drivers requiring special firmware which might be not available when loading the module because the user don't really need that module but it was added based on genkernel's module_load file, we will no longer load network modules on boot. Instead we will only load network modules when needed, for example when dosshd is set or NFS is used. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: start_sshd(): Don't start sshd when network wasn't startedThomas Deutschmann2019-07-181-0/+6
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: ipv6_tentative(): Hide errorsThomas Deutschmann2019-07-181-1/+1
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: kill_network(): Don't try to kill network when interfacec is ↵Thomas Deutschmann2019-07-181-1/+7
| | | | | | missing Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: start_network(): Don't try to start network when interface ↵Thomas Deutschmann2019-07-181-0/+11
| | | | | | | | is missing In addition, try to detect when udhcpc failed. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.scripts: sdelay(): Show waiting indicatorThomas Deutschmann2019-07-171-2/+8
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Umount /newroot when it was rejected before prompting for a new ↵Thomas Deutschmann2019-07-161-0/+12
| | | | | | | root device Bug: https://bugs.gentoo.org/520018 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Tell user why we consider a root device as invalidThomas Deutschmann2019-07-161-6/+30
| | | | | Bug: https://bugs.gentoo.org/520018 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Change ROOTDELAY handlingThomas Deutschmann2019-07-162-8/+12
| | | | | | | | | | | | | | | | | | | Before this change we converted $ROOTDELAY into microseconds and decremented that value on each loop iteration. Once that value was <=0 we threw a timeout. Because we substracted a fixed value we didn't take into account that a command from loop could already have taken some time. During testing, in worst case, running with ROOTDELAY=10 and invalid root=UUID= parameter, it was seen that it took up to ~35s instead of 10s before linuxrc prompted for new root value. With this change, we now set a timeout based on current time in seconds + ROOTDELAY. Loop will end if current time is >= timeout. In addition, ROOTDELAY default value was changed from 1 to 5. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* initrd.script: prompt_user(): Remove read timeoutThomas Deutschmann2019-07-161-6/+6
| | | | | | | | | | | It really makes no sense to timeout while reading user input: We only prompt when we are unable to continue. It's very unlikely that we are able to continue after some time without any changes. Instead, given that it can take some time to enter requested information, a timeout will likely result in bad user experience when user run into timeout while typing an UUID for example. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: break out when REAL_ROOT is on ZFS but kernel was started without dozfsThomas Deutschmann2019-07-161-2/+2
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Really prompt for new root block device when got_good_root is 0Thomas Deutschmann2019-07-161-19/+18
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Add rootdelay timeout indicatorThomas Deutschmann2019-07-162-1/+19
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Add catch all block to avoid unnecessary rootdelay for devices ↵Thomas Deutschmann2019-07-151-0/+8
| | | | | | already present Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Fix waiting on rootThomas Deutschmann2019-07-151-21/+6
| | | | | | | | The idea of that loop is to respect ROOTDELAY and allow for slow devices to come up. But if we will prompt already on first failure, this doesn't work. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: No need to call 'busybox findfs'Thomas Deutschmann2019-07-152-13/+1
| | | | | | Normal findfs is already 'busybox findfs'. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Set got_good_root=1 when we got root via LABEL|UUID|PARTUUIDThomas Deutschmann2019-07-151-0/+2
| | | | Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
* linuxrc: Relax NEWROOT validationThomas Deutschmann2019-07-151-1/+3
| | | | | | | | | If the root device specified by the user is invalid then all we are going to lose is the possibility to ask for a new root device in a nice way. So no need to be smart here. Closes: https://bugs.gentoo.org/479730 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>