From nobody Tue Feb 10 00:00:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1589915485; cv=none; d=zohomail.com; s=zohoarc; b=KDBm9JTT4rZG9xUZ5YBQe2Xx7Z1Nrulth1+KptG5E9H3crtboRxQiFuHej+K/wT9EfBAD1vIN4ukppiaXlDHW8j6SUH3R3atbS25rPw91t0MqW0nxCn4TSV/rY3C2BkrHGWPUXtTCysvHJ9UBY3DPswNxsJ4+a0EMrJD78/92hs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589915485; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j722a1TFSv635r3c76B5b+1cbLtxNi0T7RHbHIrzEBA=; b=SJQvTdvgYZO6zGGIlUamoJE4GCSU+I/gwQPI6EYTcwv9D7VKDgfdqo2NRHvkMtJyPseXFlIgbGNyWtUgzf6+zPh0Ewc+QDrCVzotNnwFZ+fFWE8he1hZAwjZ5D/TMCDVjTFYASumdf7hxeoVJ4F0C1PIMm+Tqwn1ODNWP8S6nWM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1589915485815479.76162513201746; Tue, 19 May 2020 12:11:25 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jb7dy-0007w1-Fn; Tue, 19 May 2020 19:11:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jb7dx-0007vD-Kf for xen-devel@lists.xenproject.org; Tue, 19 May 2020 19:11:13 +0000 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::3]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6172d4c2-9a04-11ea-b9cf-bc764e2007e4; Tue, 19 May 2020 19:10:19 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jb7Vj-0001da-Lc; Tue, 19 May 2020 20:02:43 +0100 X-Inumbo-ID: 6172d4c2-9a04-11ea-b9cf-bc764e2007e4 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH 31/38] overlay-initrd-buster/sbin/reopen-console: Fix #932416 Date: Tue, 19 May 2020 20:02:23 +0100 Message-Id: <20200519190230.29519-32-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519190230.29519-1-ian.jackson@eu.citrix.com> References: <20200519190230.29519-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" This bug affects us. Cherry pick the changes to the relevant file from the commit in the upstream debian-installer repo: https://salsa.debian.org/installer-team/rootskel/commit/0ee43d05b83f8ef5a= 856f3282e002a111809cef9 Signed-off-by: Ian Jackson --- overlay-initrd-buster/sbin/reopen-console | 36 +++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/overlay-initrd-buster/sbin/reopen-console b/overlay-initrd-bus= ter/sbin/reopen-console index dd354deb..13b15a33 100755 --- a/overlay-initrd-buster/sbin/reopen-console +++ b/overlay-initrd-buster/sbin/reopen-console @@ -16,6 +16,17 @@ NL=3D" LOGGER_UP=3D0 LOG_FILE=3D/var/log/reopen-console =20 +# If we're running with preseeding, we have a problem with running d-i +# on multiple consoles. We'll end up running each of those d-i +# instances in parallel with all kinds of hilarious undefined +# behaviour as they trip over each other! If we detect that we're +# preseeding (via any of the possible preseed methods), DO NOT run d-i +# multiple times. Instead, fall back to the older, more simple +# behaviour and run it once. If the user wants to see or interact with +# their preseed on a specific console, they get to tell us which one +# they want to use. +PRESEEDING=3D0 + log() { # In very early startup we don't have syslog. Log to file that # we can flush out later so we can at least see what happened @@ -32,6 +43,20 @@ flush_logger () { rm $LOG_FILE } =20 +# If we have a preseed.cfg in the initramfs +if [ -e /preseed.cfg ]; then + log "Found /preseed.cfg; falling back to simple mode for preseeding" + PRESEEDING=3D1 +fi + +# Have we been told to do preseeding stuff on the boot command line? +for WORD in auto url; do + if (grep -qw "$WORD" /proc/cmdline); then + log "Found \"$WORD\" in the command line; falling back to simple mode for= preseeding" + PRESEEDING=3D1 + fi +done + consoles=3D preferred=3D # Retrieve all enabled consoles from kernel; ignore those @@ -44,7 +69,7 @@ do status=3D$(echo "$kernelconsoles" | grep $cons | sed -n -r -e 's/(^.*) *.= *\((.*)\).*$/\2/p' ) if [ -e "/dev/$cons" ] && [ $(echo "$status" | grep -o 'E') ]; then consoles=3D"${consoles:+$consoles$NL}$cons" - log " Adding $cons to consoles list" + log " Adding $cons to possible consoles list" fi # 'C' console is 'most prefered'. if [ $(echo "$status" | grep -o 'C') ]; then @@ -64,6 +89,13 @@ if [ -z "$preferred" ]; then log "Found no preferred console. Picking $preferred" fi =20 +# If we're preseeding, do simple stuff here (see above). We just +# want one console. Let's pick the preferred one ONLY +if [ $PRESEEDING =3D 1 ]; then + log "Running with preseeding. Picking preferred $preferred ONLY" + consoles=3D$preferred +fi + for cons in $consoles do echo "/dev/$cons " >> /var/run/console-devices @@ -88,7 +120,7 @@ LOGGER_UP=3D1 flush_logger =20 # Finally restart init to run debian-installer on discovered consoles -log "Restarting init to start d-i on the consoles we found" +log "Restarting init to start d-i on the console(s) we found" kill -HUP 1 =20 exit 0 --=20 2.20.1