Skip to contentSkip to conversation

GRUB_GFXMODE_LINUX user variable

PATCH In review Robert Millan 2 participants 4 messages Mar 29, 2009 – Apr 1, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GRUB_GFXMODE_LINUX user variable

This patch adds GRUB_GFXMODE_LINUX user variable to make it easy for users to set graphical mode before booting Linux.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."

2009-03-29 Robert Millan <[email protected]>

* util/grub-mkconfig.in (GRUB_GFXMODE_LINUX): Export variable.
* util/grub.d/10_linux.in (linux_entry): If $GRUB_GFXMODE_LINUX was set by the user, set mode as per specified before boot.

grub.d/10_linux.in +5 -0
Index: util/grub.d/10_linux.in
===================================================================
@@ -107,6 +107,11 @@ EOF
 	initrd	${rel_dirname}/${initrd}
 EOF
   fi
+  if [ "$GRUB_GFXMODE_LINUX" ] ; then cat << EOF
+	set gfxmode=$GRUB_GFXMODE_LINUX
+	terminal_output gfxterm
+EOF
+  fi
   cat << EOF
 }
 EOF
grub-mkconfig.in +2 -1
Index: util/grub-mkconfig.in
===================================================================
@@ -173,7 +173,8 @@ esac
 export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES
 
 # These are optional, user-defined variables.
-export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE
+export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_OUTPUT \
+	GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE GRUB_GFXMODE_LINUX
 
 if test "x${grub_cfg}" != "x"; then
   rm -f ${grub_cfg}.new
#1 lore raw
Quoted 2 lines · On Sunday 29 March 2009 11:31:29 Robert Millan wrote:

This patch adds GRUB_GFXMODE_LINUX user variable to make it easy for users to set graphical mode before booting Linux.

Is this really Linux-specific? It look somehow coincidental to me that this is used only for Linux. If other operating systems, such as FreeBSD, support that way of switching a video mode, I think you would want to reuse the same variable.

Thanks,
Okuji

#2 lore raw
Quoted 8 lines · Yoshinori K. Okuji
Quoted 2 lines · On Sunday 29 March 2009 11:31:29 Robert Millan wrote:

This patch adds GRUB_GFXMODE_LINUX user variable to make it easy for users to set graphical mode before booting Linux.

Is this really Linux-specific? It look somehow coincidental to me that this is used only for Linux. If other operating systems, such as FreeBSD, support that way of switching a video mode, I think you would want to reuse the same variable.

Agreed. Also, perhaps we should define an env variable like gfxmode, so that loaders can switch mode themselves and "terminal_output gfxterm" doesn't have to be used.

I like the terms "payload" and "loadee" because they don't imply what we're loading is a kernel (Linux) or a standalone OS (invaders/memtest86). How about using "gfxmode_payload=WIDTHxHEIGHT[xDEPTH]" ?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#3 lore raw
Quoted 5 lines · On Wednesday 01 April 2009 22:05:57 Robert Millan wrote:
Quoted 4 lines · Yoshinori K. Okuji
Quoted 2 lines · On Sunday 29 March 2009 11:31:29 Robert Millan wrote:

This patch adds GRUB_GFXMODE_LINUX user variable to make it easy for users to set graphical mode before booting Linux.

Quoted 8 lines
Quoted 4 lines

Is this really Linux-specific? It look somehow coincidental to me that this is used only for Linux. If other operating systems, such as FreeBSD, support that way of switching a video mode, I think you would want to reuse the same variable.

Agreed. Also, perhaps we should define an env variable like gfxmode, so that loaders can switch mode themselves and "terminal_output gfxterm" doesn't have to be used.

Not bad. ;)

Quoted 3 lines

I like the terms "payload" and "loadee" because they don't imply what we're loading is a kernel (Linux) or a standalone OS (invaders/memtest86). How about using "gfxmode_payload=WIDTHxHEIGHT[xDEPTH]" ?

I am more used to Multiboot's terminology, so I prefer "OS Image".

Regards,
Okuji