[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#775317: Depreciated kernel graphics params



Control: tags -1 + patch

I've made a stab at writing a patch.

I'm new to the d-i codebase, and perl, and I don't have a test
environment set up to run and test the code, so please review carefully.

Two areas of concern I have:
1) While I understood the use of grub-gencfg well enough to implement
the fix within it and with the use of it, I was a little confused by the
block of code in build/config/x86.cfg, starting on line 211, which
instead is using 'bootvars-substitute' (as done for syslinux configs).
This suggests to me (without delving too deep into the code at this
stage) that there is a config file with possible KERNEL and INITRD
placeholders, possibly provided by debian-cd per the comment block
higher up. I can't find such a file or generation of such a file.
Perhaps the use of 'bootvars-substitute' instead of grub-gencfg is a
mistake here? I added substitution of VIDEO_MODE and VIDEO_MODE_GTK
placeholders with the gfxpayload setting, but this could cause the
elusive config files to break if these are currently present as kernel
params.
2) With a sid based live image produced with live build and using the
grub2 bootloader (live-build is where I'm doing a lot of dev work at the
moment), I manually loaded the graphical installer at 1024x768, and
found that the Jessie theme banner displayed at the top is blurry at
this resolution, whereas it is fine at 800x600. In this patch I set a
range of possible resolutions, with 1024x768 being the default. Unless
you're happy with the blurry image, either the default needs switching
down to 800x600 in this patch, or the image needs replacing with a
higher res copy.
commit 364b428be604a25064f90bb9146c62e962b2c8c5
Author: jnqnfe <jnqnfe@gmail.com>
Date:   Fri Jan 30 04:04:41 2015 +0000

    Implement use of grub gfxpayload setting instead of 'vga=' param

diff --git a/build/config/amd64.cfg b/build/config/amd64.cfg
index 62df865..50a7eef 100644
--- a/build/config/amd64.cfg
+++ b/build/config/amd64.cfg
@@ -17,6 +17,8 @@ SYSLINUX_CFG=standard
 # defined in graphics.nsi around line 58
 VIDEO_MODE="vga=788"
 VIDEO_MODE_GTK="vga=788"
+GRUB_VIDEO_MODE="1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480"
+GRUB_VIDEO_MODE_GTK="1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480"
 
 GRUB_EFI=y
 GRUB_PLATFORM=x86_64-efi
diff --git a/build/config/amd64/cdrom/gtk.cfg b/build/config/amd64/cdrom/gtk.cfg
index b915e3d..74342aa 100644
--- a/build/config/amd64/cdrom/gtk.cfg
+++ b/build/config/amd64/cdrom/gtk.cfg
@@ -11,6 +11,7 @@ EXTRANAME = gtk/
 KEEP_GI_LANGS = 1
 
 VIDEO_MODE=$(VIDEO_MODE_GTK)
+GRUB_VIDEO_MODE=$(GRUB_VIDEO_MODE_GTK)
 
 # All images that include cdebconf should include symbols needed by these
 # plugins.
diff --git a/build/config/amd64/hd-media/gtk.cfg b/build/config/amd64/hd-media/gtk.cfg
index db19305..5062c5b 100644
--- a/build/config/amd64/hd-media/gtk.cfg
+++ b/build/config/amd64/hd-media/gtk.cfg
@@ -10,6 +10,7 @@ TARGET = $(KERNEL) $(INITRD)
 KEEP_GI_LANGS = 1
 
 VIDEO_MODE=$(VIDEO_MODE_GTK)
+GRUB_VIDEO_MODE=$(GRUB_VIDEO_MODE_GTK)
 
 # All images that include cdebconf should include symbols needed by these
 # plugins.
diff --git a/build/config/amd64/netboot-gtk.cfg b/build/config/amd64/netboot-gtk.cfg
index 144f2fe..d05bc57 100644
--- a/build/config/amd64/netboot-gtk.cfg
+++ b/build/config/amd64/netboot-gtk.cfg
@@ -17,6 +17,7 @@ MANIFEST-MINIISO = "not so tiny CD image that boots the graphical netboot instal
 KEEP_GI_LANGS = 1
 
 VIDEO_MODE=$(VIDEO_MODE_GTK)
+GRUB_VIDEO_MODE=$(GRUB_VIDEO_MODE_GTK)
 
 # All images that include cdebconf should include symbols needed by these
 # plugins.
diff --git a/build/config/arm64.cfg b/build/config/arm64.cfg
index c45f4c4..dce179a 100644
--- a/build/config/arm64.cfg
+++ b/build/config/arm64.cfg
@@ -5,6 +5,12 @@ KERNELMAJOR = 2.6
 KERNELVERSION = $(LINUX_KERNEL_ABI)-arm64
 KERNELNAME = vmlinuz
 
+# The default video modes
+# These should be kept in sync with win32-loader's preseed line as
+# defined in graphics.nsi around line 58
+GRUB_VIDEO_MODE="1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480"
+GRUB_VIDEO_MODE_GTK="1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480"
+
 GRUB_EFI=y
 GRUB_PLATFORM=arm64-efi
 GRUB_EFI_NAME=aa64
@@ -33,6 +39,8 @@ arch_cd_info_dir: arm64_grub_efi
 		grub-gencfg \
 			KERNEL /%install%/vmlinuz \
 			INITRD /%install%/initrd.gz \
+			VIDEO_MODE $(GRUB_VIDEO_MODE) \
+			VIDEO_MODE_GTK $(GRUB_VIDEO_MODE_GTK) \
 			HEADER boot/arm64/grub/grub-efi.cfg \
 		> $(TEMP_CD_INFO_DIR)/grub/grub.cfg; \
 		cp -a $(GRUB_FONT) $(TEMP_CD_INFO_DIR)/grub/font.pf2; \
@@ -59,6 +67,8 @@ arch_miniiso: arm64_grub_efi
 		grub-gencfg \
 			KERNEL /linux \
 			INITRD /initrd.gz \
+			VIDEO_MODE $(GRUB_VIDEO_MODE) \
+			VIDEO_MODE_GTK $(GRUB_VIDEO_MODE_GTK) \
 			HEADER boot/arm64/grub/grub-efi.cfg \
 		> $(TEMP_CD_TREE)/boot/grub/grub.cfg; \
 		cp -a $(GRUB_FONT) $(TEMP_CD_TREE)/boot/grub/font.pf2; \
@@ -91,6 +101,8 @@ arch_netboot_dir: arm64_grub_efi
 		grub-gencfg \
 			KERNEL /$(NETBOOT_PATH)/linux \
 			INITRD /$(NETBOOT_PATH)/initrd.gz \
+			VIDEO_MODE $(GRUB_VIDEO_MODE) \
+			VIDEO_MODE_GTK $(GRUB_VIDEO_MODE_GTK) \
 			HEADER boot/arm64/grub/grub-efi.cfg \
 		> $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub/grub.cfg; \
 	fi
diff --git a/build/config/i386.cfg b/build/config/i386.cfg
index 209af53..bc49d6b 100644
--- a/build/config/i386.cfg
+++ b/build/config/i386.cfg
@@ -19,6 +19,8 @@ SYSLINUX_CFG=standard
 # defined in graphics.nsi around line 58
 VIDEO_MODE="vga=788"
 VIDEO_MODE_GTK="vga=788"
+GRUB_VIDEO_MODE="1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480"
+GRUB_VIDEO_MODE_GTK="1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480"
 
 GRUB_EFI=n
 GRUB_PLATFORM=i386-efi
diff --git a/build/config/i386/cdrom/gtk.cfg b/build/config/i386/cdrom/gtk.cfg
index ab1e39f..a7606ed 100644
--- a/build/config/i386/cdrom/gtk.cfg
+++ b/build/config/i386/cdrom/gtk.cfg
@@ -13,6 +13,7 @@ EXTRANAME = gtk/
 KEEP_GI_LANGS = 1
 
 VIDEO_MODE=$(VIDEO_MODE_GTK)
+GRUB_VIDEO_MODE=$(GRUB_VIDEO_MODE_GTK)
 
 # All images that include cdebconf should include symbols needed by these
 # plugins.
diff --git a/build/config/i386/hd-media/gtk.cfg b/build/config/i386/hd-media/gtk.cfg
index db19305..5062c5b 100644
--- a/build/config/i386/hd-media/gtk.cfg
+++ b/build/config/i386/hd-media/gtk.cfg
@@ -10,6 +10,7 @@ TARGET = $(KERNEL) $(INITRD)
 KEEP_GI_LANGS = 1
 
 VIDEO_MODE=$(VIDEO_MODE_GTK)
+GRUB_VIDEO_MODE=$(GRUB_VIDEO_MODE_GTK)
 
 # All images that include cdebconf should include symbols needed by these
 # plugins.
diff --git a/build/config/i386/netboot-gtk.cfg b/build/config/i386/netboot-gtk.cfg
index 144f2fe..d05bc57 100644
--- a/build/config/i386/netboot-gtk.cfg
+++ b/build/config/i386/netboot-gtk.cfg
@@ -17,6 +17,7 @@ MANIFEST-MINIISO = "not so tiny CD image that boots the graphical netboot instal
 KEEP_GI_LANGS = 1
 
 VIDEO_MODE=$(VIDEO_MODE_GTK)
+GRUB_VIDEO_MODE=$(GRUB_VIDEO_MODE_GTK)
 
 # All images that include cdebconf should include symbols needed by these
 # plugins.
diff --git a/build/config/x86.cfg b/build/config/x86.cfg
index 3caadd2..fb4d02a 100644
--- a/build/config/x86.cfg
+++ b/build/config/x86.cfg
@@ -215,6 +215,8 @@ arch_cd_info_dir: x86_syslinux x86_grub_efi
 		cat boot/x86/grub/grub-efi.cfg \
 		| bootvars-subst KERNEL /%install%/vmlinuz \
 			INITRD /%install%/initrd.gz \
+			VIDEO_MODE $(GRUB_VIDEO_MODE) \
+			VIDEO_MODE_GTK $(GRUB_VIDEO_MODE_GTK) \
 		> $(TEMP_CD_INFO_DIR)/grub/grub.cfg; \
 		cp -a $(GRUB_FONT) $(TEMP_CD_INFO_DIR)/grub/font.pf2; \
 		cp -a $(TEMP_GRUB_EFI)/boot/grub/$(GRUB_PLATFORM)/* \
@@ -303,9 +305,9 @@ arch_miniiso: x86_syslinux x86_grub_efi
 		grub-gencfg \
 			KERNEL /linux \
 			INITRD /initrd.gz \
+			VIDEO_MODE $(GRUB_VIDEO_MODE) \
+			VIDEO_MODE_GTK $(GRUB_VIDEO_MODE_GTK) \
 			HEADER boot/x86/grub/grub-efi.cfg \
-			-- \
-			$(VIDEO_MODE) \
 		> $(TEMP_CD_TREE)/boot/grub/grub.cfg; \
 		cp -a $(GRUB_FONT) $(TEMP_CD_TREE)/boot/grub/font.pf2; \
 		cp -a $(TEMP_GRUB_EFI)/boot/grub/$(GRUB_PLATFORM)/* \
@@ -418,9 +420,9 @@ arch_netboot_dir: x86_syslinux x86_grub_efi
 		grub-gencfg \
 			KERNEL /$(NETBOOT_PATH)/linux \
 			INITRD /$(NETBOOT_PATH)/initrd.gz \
+			VIDEO_MODE $(GRUB_VIDEO_MODE) \
+			VIDEO_MODE_GTK $(GRUB_VIDEO_MODE_GTK) \
 			HEADER boot/x86/grub/grub-efi.cfg \
-			-- \
-			$(VIDEO_MODE) \
 		> $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/grub/grub.cfg; \
 	fi
 
diff --git a/build/util/grub-gencfg b/build/util/grub-gencfg
index e31399d..5a93bb8 100755
--- a/build/util/grub-gencfg
+++ b/build/util/grub-gencfg
@@ -13,6 +13,9 @@
 #    INITRD64           Alternative initrd for optional 64-bit entries
 #    INITRD64_GTK       Alternative graphical initrd for optional 64-bit entries
 #
+#    VIDEO_MODE         Normal gfxpayload setting to use (required)
+#    VIDEO_MODE_GTK     Graphical gfxpayload setting to use (optional)
+#
 #    THEME_PATH         Path (in boot env) where themes are kept
 #    HEADER             Local path to file cat include as a header
 #
@@ -33,9 +36,10 @@
 #    INITRD64 "/%install-amd%/initrd.gz" \
 #    INITRD_GTK "/%install%/gtk/initrd.gz" \
 #    INITRD64_GTK "/%install-amd%/gtk/initrd.gz" \
+#    VIDEO_MODE "1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480" \
+#    VIDEO_MODE_GTK "1024x768x32,800x600x32,640x480x32,1024x768,800x600,640x480" \
 #    THEME_PATH "/boot/grub/theme/" \
-#    HEADER "build/boot/x86/grub/grub-efi.cfg" \
-#    -- vga=788
+#    HEADER "build/boot/x86/grub/grub-efi.cfg"
 #
 # Will reproduce something similar to
 # debian-testing-amd64-netinst.iso::/boot/grub/grub.cfg weekly build
@@ -58,6 +62,7 @@ my @OPTS = @ARGV;
 
 die "No kernel?" unless $VARS{KERNEL};
 die "No initrd?" unless $VARS{INITRD};
+die "No video mode?" unless $VARS{VIDEO_MODE};
 
 my $graphical = defined $VARS{INITRD_GTK};
 my $sixtyfour = defined $VARS{KERNEL64} && defined $VARS{INITRD64}
@@ -132,9 +137,11 @@ sub menuentry ($;%)
     my $initrd = $xattr{Graphical} ? $VARS{INITRD_GTK} : $VARS{INITRD};
     $initrd = $xattr{Graphical} ? $VARS{INITRD64_GTK} : $VARS{INITRD64}
         if $xattr{SixtyFour};
+    my $gfxpayload = $xattr{Graphical} ? $VARS{VIDEO_MODE_GTK} : $VARS{VIDEO_MODE};
 
     die "no kernel" unless $kernel;
     die "no initrd" unless $initrd;
+    die "no gfxpayload" unless $gfxpayload;
 
     my @cmdline;
     # Ordering here is to allow diffing against previous versions of this file.
@@ -152,6 +159,7 @@ sub menuentry ($;%)
     print_indented (<<EOE);
 menuentry '$title' {
     set background_color=black
+    set gfxpayload=$gfxpayload
     linux    $kernel $cmdline
     initrd   $initrd
 }

Reply to: