From nobody Mon Feb 9 13:37:37 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1556207545; cv=none; d=zoho.com; s=zohoarc; b=MDP46z3Yoj2Q0sYsXQMVnT4BELHrxjmWPoX2GMg7JPEsjhAfDZ+FE7ilm5DKEfw/V3pFnJj6Ip/1iSl18XpP1p94tdRVv6FHQ+n2P2wYu/CYwttrDvpW6SgZXhiHfNf45UMIvwoPiHIF6zglr/hOX8U9kiTCFNv7zwTZM4C3O1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556207545; h=Content-Type: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:ARC-Authentication-Results; bh=fNMXIySb24WK0okkb8wuPa33ieJRcuJ88/I2nEGzPoE=; b=HPc1UBxV8x12/jqCU2ajFam/MoCearFQGA9RwbtQRHIyT8CJj4xVLbZCWr9BY+dNXbpb6jQK2Wh6XvI5cLg8JBTpKBc0+7YhfZ4Xqmk0jpN6zW56U5pF+p3beMEXtXs1Kjky6diFSBcqB2U6ErvDeh19gSbtpWRPvJXVIoDtM08= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1556207544761591.9005544611841; Thu, 25 Apr 2019 08:52:24 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hJgeR-0002pj-Kf; Thu, 25 Apr 2019 15:51:07 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hJgeP-0002op-N8 for xen-devel@lists.xenproject.org; Thu, 25 Apr 2019 15:51:05 +0000 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id ee815c5e-6771-11e9-843c-bc764e045a96; Thu, 25 Apr 2019 15:51:04 +0000 (UTC) X-Inumbo-ID: ee815c5e-6771-11e9-843c-bc764e045a96 X-IronPort-AV: E=Sophos;i="5.60,394,1549929600"; d="scan'208";a="84415677" From: Ian Jackson To: Date: Thu, 25 Apr 2019 16:50:55 +0100 Message-ID: <20190425155056.23145-6-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190425155056.23145-1-ian.jackson@eu.citrix.com> References: <20190425155056.23145-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [OSSTEST PATCH 5/6] Debian: preferred arch: Apply setarch to sshd X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Many build systems (including Xen's, and autoconf) use uname to try to discern the system's architecture. When running i386 userland on an amd64 kernel, this gives the wrong answer. These build systems then go off and try to do a sort of cross compile thing, and, generally, fall over. The uname -m value (which is what is at issue) is an inherited process property. Linux provides a utility `setarch' which changes this. We need to apply this to all builds; and it is not really convenient to add an adverbial command to every build via the existing ssh build shell rune mechanisms. A fairly simple way to get the right behaviour is to wrap sshd instead. sshd doesn't mind what `personality' it sees. Replacing /usr/bin/sshd with a wrapper shell script might break start-stop-daemon's attempts to shut down or restart sshd but we don't care about that in osstest (certainly not on build installs, where this feature is to be used). Nothing uses this yet. Signed-off-by: Ian Jackson --- Osstest/Debian.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index addaaad2..8abd6aed 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -1337,6 +1337,7 @@ END my $kern_arch_info =3D $xopts{LinuxKernPreferredArchInfo}; # LinuxKernPreferredArchInfo contains # Kernel_Debian the Debian arch for the kernel we would prefer + # Userland_setarch personality to restore using setarch my $kern_arch =3D $kern_arch_info->{Kernel_Debian}; if ($kern_arch && $ho->{Flags}{"arch-$r{arch}"} && !$ho->{Flags}{"arch-$kern_arch"}) { @@ -1354,10 +1355,16 @@ END $kern_arch =3D undef; } if ($kern_arch) { - logm("Using $kern_arch kernel for $r{arch} userland"); + my $setarch =3D "setarch $kern_arch_info->{Userland_setarch}"; + logm("Using $kern_arch kernel for $r{arch} userland ($setarch)"); preseed_hook_command($ho, 'late_command', $sfx, </target/usr/sbin/sshd.osstest-wrap +#!/bin/sh +exec $setarch /usr/sbin/sshd.distrib "\$@" +ENDW +chmod a+x /target/usr/sbin/sshd.osstest-wrap in-target sh -xec ' # the $r{arch} kernels end up being the default so shuffle them # where update-grub will not find them @@ -1368,6 +1375,8 @@ in-target sh -xec ' apt-get update apt-get install -f -y linux-image-$kern_arch update-grub + dpkg-divert --rename /usr/sbin/sshd + ln -s sshd.osstest-wrap /usr/sbin/sshd ' END } --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel