Bug#766530: Please allow overriding GRUB_CMDLINE_LINUX_RECOVER in /etc/default/grub

Enrico Zini enrico at debian.org
Thu Oct 23 19:47:01 UTC 2014


Package: grub-pc
Version: 2.02~beta2-15
Severity: wishlist

Hello,

now that my machine runs systemd, I would like to take advantage of its
features for debugging/recovery, and improve on the default offer for a
recovery boot entry in grub. Like for example something like this:

	systemd.log_target=kmsg systemd.log_level=debug systemd.debug-shell

Unfortunately, GRUB_CMDLINE_LINUX_RECOVERY is pretty much hardcoded in
/etc/grub.d/10_linux and there is so much complex logic in 10_linux that
I wouldn't just go on and replace it with my own config.

This is the bit where GRUB_CMDLINE_LINUX_RECOVERY is set:

	if [ -x /lib/recovery-mode/recovery-menu ]; then
	    GRUB_CMDLINE_LINUX_RECOVERY=recovery
	else
	    GRUB_CMDLINE_LINUX_RECOVERY=single
	fi
	if [ "$ubuntu_recovery" = 1 ]; then
	    GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY nomodeset"
	fi

I tried, and it is sufficient to just wrap it in an if to allow
overriding it:

	if [ -z "$GRUB_CMDLINE_LINUX_RECOVERY" ]
	then
		if [ -x /lib/recovery-mode/recovery-menu ]; then
		    GRUB_CMDLINE_LINUX_RECOVERY=recovery
		else
		    GRUB_CMDLINE_LINUX_RECOVERY=single
		fi
	fi
	if [ "$ubuntu_recovery" = 1 ]; then
	    GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY nomodeset"
	fi

And also to tell grub-mkconfig to export GRUB_CMDLINE_LINUX_RECOVERY
together with the other variables.


And now I go and try try fancy things out, like adding this to my /etc/default/grub:

	# Hopefully this will work in the future by default
	GRUB_CMDLINE_LINUX_RECOVERY="systemd.log_target=kmsg systemd.log_level=debug systemd.debug-shell"
	# Hopefully this won't be needed by default
	export GRUB_CMDLINE_LINUX_RECOVERY

Time to submit this, reboot and play.


Thanks,

Enrico

-- Package-specific info:

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]  1.5.53
ii  grub-common            2.02~beta2-15
ii  grub-pc-bin            2.02~beta2-15
ii  grub2-common           2.02~beta2-15
ii  ucf                    3.0030

grub-pc recommends no packages.

grub-pc suggests no packages.

-- debconf information:
  grub-pc/chainload_from_menu.lst: true
* grub2/linux_cmdline:
  grub-pc/timeout: 5
  grub-pc/install_devices_failed: false
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_empty: false
  grub2/kfreebsd_cmdline:
  grub-pc/disk_description:
  grub-pc/install_devices_failed_upgrade: true
* grub2/linux_cmdline_default: quiet
  grub-pc/mixed_legacy_and_grub2: true
* grub-pc/install_devices: *redacted*
  grub2/device_map_regenerated:
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/kopt_extracted: false
  grub-pc/partition_description:
* grub-pc/install_devices_disks_changed: *redacted*
  grub-pc/hidden_timeout: false



More information about the Pkg-grub-devel mailing list