nixos/plymouth: Respect plymouth.enable=0 in scripted stage 1 (#355601)

authored by Will Fancher and committed by GitHub 0465e2ef c0851de9

+27 -12
+27 -12
nixos/modules/system/boot/plymouth.nix
··· 333 333 334 334 # We use `mkAfter` to ensure that LUKS password prompt would be shown earlier than the splash screen. 335 335 boot.initrd.preLVMCommands = mkIf (!config.boot.initrd.systemd.enable) (mkAfter '' 336 - mkdir -p /etc/plymouth 337 - mkdir -p /run/plymouth 338 - ln -s $extraUtils/etc/plymouth/logo.png /etc/plymouth/logo.png 339 - ln -s ${configFile} /etc/plymouth/plymouthd.conf 340 - ln -s $extraUtils/share/plymouth/plymouthd.defaults /run/plymouth/plymouthd.defaults 341 - ln -s $extraUtils/share/plymouth/themes /run/plymouth/themes 342 - ln -s $extraUtils/lib/plymouth /run/plymouth/plugins 343 - ln -s $extraUtils/etc/fonts /etc/fonts 336 + plymouth_enabled=1 337 + for o in $(cat /proc/cmdline); do 338 + case $o in 339 + plymouth.enable=0) 340 + plymouth_enabled=0 341 + ;; 342 + esac 343 + done 344 + 345 + if [ "$plymouth_enabled" != 0 ]; then 346 + mkdir -p /etc/plymouth 347 + mkdir -p /run/plymouth 348 + ln -s $extraUtils/etc/plymouth/logo.png /etc/plymouth/logo.png 349 + ln -s ${configFile} /etc/plymouth/plymouthd.conf 350 + ln -s $extraUtils/share/plymouth/plymouthd.defaults /run/plymouth/plymouthd.defaults 351 + ln -s $extraUtils/share/plymouth/themes /run/plymouth/themes 352 + ln -s $extraUtils/lib/plymouth /run/plymouth/plugins 353 + ln -s $extraUtils/etc/fonts /etc/fonts 344 354 345 - plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session 346 - plymouth show-splash 355 + plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session 356 + plymouth show-splash 357 + fi 347 358 ''); 348 359 349 360 boot.initrd.postMountCommands = mkIf (!config.boot.initrd.systemd.enable) '' 350 - plymouth update-root-fs --new-root-dir="$targetRoot" 361 + if [ "$plymouth_enabled" != 0 ]; then 362 + plymouth update-root-fs --new-root-dir="$targetRoot" 363 + fi 351 364 ''; 352 365 353 366 # `mkBefore` to ensure that any custom prompts would be visible. 354 367 boot.initrd.preFailCommands = mkIf (!config.boot.initrd.systemd.enable) (mkBefore '' 355 - plymouth quit --wait 368 + if [ "$plymouth_enabled" != 0 ]; then 369 + plymouth quit --wait 370 + fi 356 371 ''); 357 372 358 373 };