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

Re: Graphical installer on arm64 (netboot and cdrom)



On 20/04/2020 19:36, Alper Nebi Yasak wrote:
On 20/04/2020 18:38, Steve McIntyre wrote:
Does /dev/tty0 show up in /proc/consoles in your setup? We might need
to tweak that yet...

Here is a small but untested patch for rootskel's reopen-console for that.

I don't think this (having to set console=tty0 on arm64) is going to change on the kernel side, see:
https://lore.kernel.org/linux-serial/20200513143755.GM17734@linux-b0ei/

where Petr Mladek said:
My suggestion is:

   + Fix SPCR setting or device tree of your device when the defaults
     are not as expected.

   + Use command line to force your value when the defaults are not
     as expected and you could not change them.

So I tested my earlier patch, and did a bit more. I've attached three patches, first two for debian-installer and the third for rootskel.

The first patch fixes arm64 netboot and netboot-gtk mini.iso images which now have 'Graphical install' GRUB entries using /gtk/initrd.gz files which don't exist, by making that file identical to /initrd.gz.

The second patch adds "console=tty0" to GRUB entries marked as "Graphical" in grub-gencfg. Without this, "Graphical automated install" runs on the serial console (since that may be the "preferred" console due to stdout-path or SPCR on arm64). The console=tty0 cmdline argument also ends up in the installed system's /etc/default/grub.cfg, which is correct IMO.

The third patch considers tty0 a possible console even if it's not in /proc/consoles (the patch I sent earlier). The text-mode installer already launches on the display in the stdout-path case, but not on the SPCR case. With this it launches on the display in that case as well.

I've tested on an arm64 QEMU VM. After all the patches:
- "Install" launches on serial and display
- "Graphical install" launches on display and serial
- "Automated install" launches only on serial
- "Graphical automated install" launches only on display

On systems where console is set with stdout-path instead, "Graphical install" would launch only on display, but the others would be the same.
>From 2970cde5a6217a76a0b499987c4e9c40485db891 Mon Sep 17 00:00:00 2001
From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Date: Mon, 18 May 2020 22:35:07 +0300
Subject: [PATCH] Include a /gtk/initrd.gz in graphical arm mini.iso builds

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
---
 build/config/arm.cfg | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/build/config/arm.cfg b/build/config/arm.cfg
index 4e12bae63..fcf8858b2 100644
--- a/build/config/arm.cfg
+++ b/build/config/arm.cfg
@@ -46,6 +46,10 @@ arch_miniiso: arm_grub_efi
 
 	ln -f $(TEMP_KERNEL) $(TEMP_CD_TREE)/linux
 	ln -f $(TEMP_INITRD) $(TEMP_CD_TREE)/initrd.gz
+	if [ "$(GRAPHICAL_INSTALLER)" = y ]; then \
+		mkdir -p $(TEMP_CD_TREE)/gtk; \
+		ln -f $(TEMP_INITRD) $(TEMP_CD_TREE)/gtk/initrd.gz; \
+	fi
 
 	mkdir -p $(TEMP_CD_TREE)/.disk
 	echo "Debian GNU/Linux $(DEBIAN_VERSION) $(ARCH) - netboot mini.iso $(BUILD_DATE)"\
-- 
2.26.2

>From f776932c463ed2f921255e395a72373e8ef403b5 Mon Sep 17 00:00:00 2001
From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Date: Mon, 18 May 2020 22:50:34 +0300
Subject: [PATCH] Explicitly set console=tty0 for graphical GRUB entries

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
---
 build/util/grub-gencfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/build/util/grub-gencfg b/build/util/grub-gencfg
index 97fe42432..f4b6adbda 100755
--- a/build/util/grub-gencfg
+++ b/build/util/grub-gencfg
@@ -169,6 +169,7 @@ sub menuentry ($;%)
     push @cmdline, "theme=dark" if $xattr{Dark};
     push @cmdline, "---";
     push @cmdline, "quiet" if $xattr{Quiet};
+    push @cmdline, "console=tty0" if $xattr{Graphical};
 
     my $cmdline = join(" ", @cmdline);
 
-- 
2.26.2

>From 1713b6544d4950d2861710b48aff16b4b0a119af Mon Sep 17 00:00:00 2001
From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Date: Mon, 20 Apr 2020 19:27:18 +0300
Subject: [PATCH] Use /dev/tty0 as a console even if it's not in /proc/consoles

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
---
 src/sbin/reopen-console-linux | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/sbin/reopen-console-linux b/src/sbin/reopen-console-linux
index 13b15a3..0816be4 100755
--- a/src/sbin/reopen-console-linux
+++ b/src/sbin/reopen-console-linux
@@ -78,6 +78,13 @@ do
 	fi
 done
 
+# /dev/tty0 may not show up in /proc/consoles (at least on QEMU aarch64),
+# debian-installer should run on it anyway if it exists.
+if [ -c /dev/tty0 ] && ! { echo "$consoles" | grep -q "^tty0$"; }; then
+	consoles="${consoles:+$consoles$NL}tty0"
+	log "   Adding tty0 to possible consoles list"
+fi
+
 if [ -z "$consoles" ]; then
 	# Nothing found? Default to /dev/console.
 	log "Found no consoles! Defaulting to /dev/console"
-- 
2.26.2


Reply to: