1 |
commit: 5dbad2e10c32043f90e6507438d93c9a9d480e07 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 25 13:40:42 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 25 13:40:42 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=5dbad2e1 |
7 |
|
8 |
initrd.scripts: modules_scan(): Disable smart module loading when root needs an external program |
9 |
|
10 |
When using dolvm or domdadm for example, root won't be available until lvm |
11 |
program scanned for volumes and made them available or mdadm program was |
12 |
called to assemble RAID. |
13 |
So checking for root block device after each module was loaded won't save |
14 |
us any time instead will just waste time. |
15 |
|
16 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
17 |
|
18 |
defaults/initrd.scripts | 22 +++++++++++----------- |
19 |
1 file changed, 11 insertions(+), 11 deletions(-) |
20 |
|
21 |
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts |
22 |
index 561788d..c19701c 100644 |
23 |
--- a/defaults/initrd.scripts |
24 |
+++ b/defaults/initrd.scripts |
25 |
@@ -53,17 +53,17 @@ modules_scan() { |
26 |
# We don't know if kernel supports root filesystem so |
27 |
# better load all filesystems ... |
28 |
smart_loading= |
29 |
- elif [ -n "${CRYPT_ROOT}" ] || [ -n "${CRYPT_SWAP}" ] |
30 |
- then |
31 |
- if [ "${1}" = "crypto" ] |
32 |
- then |
33 |
- smart_loading= |
34 |
- elif [ "${1}" = "usb" ] |
35 |
- then |
36 |
- # We don't know if user is using an USB keyboard to |
37 |
- # enter passphrase so better load USB ... |
38 |
- smart_loading= |
39 |
- fi |
40 |
+ elif [ "${USE_MDADM}" = '1' ] \ |
41 |
+ || [ "${USE_LVM_NORMAL}" = '1' ] \ |
42 |
+ || [ "${USE_CRYPTSETUP}" = '1' ] \ |
43 |
+ || [ "${USE_BTRFS}" = '1' ] \ |
44 |
+ || [ "${USE_ZFS}" = '1' ] \ |
45 |
+ || [ "${USE_DMRAID_NORMAL}" = '1' ] |
46 |
+ then |
47 |
+ # All of this will require the call of another program before |
48 |
+ # root becomes available so checking for root after each module |
49 |
+ # was loaded will only waste time. |
50 |
+ smart_loading= |
51 |
fi |
52 |
|
53 |
MODS=$(cat /etc/modules/${1} 2>/dev/null) |