You are not logged in.

#1 2024-03-13 18:34:02

ua4000
Member
Registered: 2015-10-14
Posts: 421

[SOLVED] mkinitcpio : HOOKS (a,b,c) for default - (x,y,z) for fallback

I have this idea to use for mkinitcpio configuration,

in default presets, an optimized one for my system:

HOOKS=(systemd autodetect microcode modconf keyboard sd-vconsole block filesystems fsck)

and in fallback preset a more robust/common one (e.g. current arch default):

HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)

I know the autodetect is already stripped in fallback,
but what is the best way to have both HOOKS specified like my idea ?

Last edited by ua4000 (2024-03-14 17:23:45)

Offline

#2 2024-03-13 18:56:50

frostschutz
Member
Registered: 2013-11-15
Posts: 1,419

Re: [SOLVED] mkinitcpio : HOOKS (a,b,c) for default - (x,y,z) for fallback

you can specify different config files in the preset (default_config, fallback_config)

Last edited by frostschutz (2024-03-13 18:57:09)

Offline

#3 2024-03-13 19:10:20

ua4000
Member
Registered: 2015-10-14
Posts: 421

Re: [SOLVED] mkinitcpio : HOOKS (a,b,c) for default - (x,y,z) for fallback

Ah, you mean something like this:

# /etc/mkinitcpio.d/linux-lts.preset

PRESETS=('default' 'fallback')

default_config="/etc/mkinitcpio-myoptimized.conf"               
                                                                               
fallback_config="/etc/mkinitcpio.conf"

While fallback could point to the current, not-modified, arch default,
and default to my optimized one ?

Edit: Thanks, it works:

# /etc/mkinitcpio-custom.conf 
HOOKS=(     systemd autodetect microcode modconf     keyboard sd-vconsole        block filesystems fsck)
# /etc/mkinitcpio.d/linux-lts.preset
...
default_config="/etc/mkinitcpio-custom.conf"
=> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'default'                                                       
==> Using configuration file: '/etc/mkinitcpio-custom.conf'                                                                         
  -> -k /boot/vmlinuz-linux-lts -c /etc/mkinitcpio-custom.conf -g /boot/initramfs-linux-lts.img                                     
==> Starting build: '6.6.21-1-lts'                                                                                                  
  -> Running build hook: [systemd]                                                                                                  
  -> Running build hook: [autodetect]                                                                                               
  -> Running build hook: [microcode]                                                                                                
  -> Running build hook: [modconf]                                                                                                  
  -> Running build hook: [keyboard]                                                                                                 
  -> Running build hook: [sd-vconsole]                                                                                              
  -> Running build hook: [block]                                                                                                    
  -> Running build hook: [filesystems]                                                                                              
  -> Running build hook: [fsck]                                                                                                     
==> Generating module dependencies                                                                                                  
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-lts.img'                                                        
  -> Early uncompressed CPIO image generation successful                                                                            
==> Initcpio image generation successful                                                                                            
==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: 'fallback'                                                      
==> Using default configuration file: '/etc/mkinitcpio.conf'                                                                        
  -> -k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts-fallback.img -S autodetect                                             
==> Starting build: '6.6.21-1-lts'                                                                                                  
  -> Running build hook: [base]                                                                                                     
  -> Running build hook: [udev]                                                                                                     
  -> Running build hook: [microcode]                                                                                                
  -> Running build hook: [modconf]                                                                                                  
  -> Running build hook: [kms]                                                                                                      
==> WARNING: Possibly missing firmware for module: 'ast'                                                                            
  -> Running build hook: [keyboard]                                                                                                 
==> WARNING: Possibly missing firmware for module: 'xhci_pci'                                                                       
  -> Running build hook: [keymap]                                                                                                   
  -> Running build hook: [consolefont]                                                                                              
==> WARNING: consolefont: no font found in configuration                                                                            
  -> Running build hook: [block]                                                                                                    
==> WARNING: Possibly missing firmware for module: 'qla2xxx'                                                                        
==> WARNING: Possibly missing firmware for module: 'qla1280'                                                                        
==> WARNING: Possibly missing firmware for module: 'qed'                                                                            
==> WARNING: Possibly missing firmware for module: 'aic94xx'                                                                        
==> WARNING: Possibly missing firmware for module: 'wd719x'                                                                         
==> WARNING: Possibly missing firmware for module: 'bfa'                                                                            
  -> Running build hook: [filesystems]                                                                                              
  -> Running build hook: [fsck]                                                                                                     
==> Generating module dependencies                                                                                                  
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-lts-fallback.img'                                               
  -> Early uncompressed CPIO image generation successful                                                                            
==> Initcpio image generation successful                                                                                            

Last edited by ua4000 (2024-03-13 19:42:43)

Offline

Board footer

Powered by FluxBB