Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1813668lqe; Tue, 9 Apr 2024 00:33:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeNrrNfkFEYpCo3zkm7c04fC2HDsoWfauZJxqZJbcwl2nPjgzq3OYcRfp/52vFi4VZL4iGMkfbaVuBVfQunQS0L+jkWOY+vLCfV8qHBQ== X-Google-Smtp-Source: AGHT+IFH54+fxS9EZfcFbWHozCIcU4poxe/6HwHSCDEiObq9lci0z5oy9KH37b3s5uPVwp2x4h9E X-Received: by 2002:a17:902:e80f:b0:1e4:45b8:7b6 with SMTP id u15-20020a170902e80f00b001e445b807b6mr4582810plg.48.1712647982634; Tue, 09 Apr 2024 00:33:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712647982; cv=pass; d=google.com; s=arc-20160816; b=z0qrXSmVZCnSLFWSNARYMgvt3NIHGc+uIfjIHtPx8xux1x3TzUyM1nuKbhamJIO+EV 5WDSRlLOXPJM63BVjkBHkhWK4sfVdqAzgYFfNLWjcA/G64m4duYHiaQEaiaLpOdlDOm4 d7d/fVJAoEUDdC+UTGf8tLISPwmIJ0vCqPLdLpwlJQYo5In/NIiVP2nEyKjUNbUpHhtK oOp75D5dBrpOXXHNZkbguO7NaOgVlRZvpw56bHSYZJuEvnaN/mFLprY9j/4TbI0vheL/ W7x1UCy4WW+G3Oh3uPVkCpM/ziZQCFlZGJCQZ0l5Ce4FtwZOBz1HPANVrR9SZgUpcGVi 3LXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=pPlFRJ8SFuDnkXHqmbQgQnUnXyCLw1rG7kPikkOu6Os=; fh=LLgfFQ/VTqeVL5ku4k8M8FUiQpAxJbhBgNJC+lG8y0k=; b=qxDWnTPhhwiuj7Q0hiuSs1Xu5wTKbmbP/OEF3xkTfwqlSUrxt4DyweYxVDdb4J8GCy HojDnn0w3JOk06a2L06MnAKjSafEnmtIdfS/nfjjDtEuyTDTqqO5CBpOXjGh+/NakIDn Kl/0o+tMvEFmo7vs7N2bB841NTOR4jUJ9UnII6iyycPxebhUEqlL1nSvVWsfllCm6+2X f6XJeZbOcEKKKRPntgyHhXaS+3n3mKZQ8yfwKPeyjsSD3Xza/lprws74eegmHDeCnWF6 HGn/cJzjdZVDri1HPI1iKrtncECtqVa15lnJZwVGlUI0K70zNMU3gv8Kb0/9+3nh7Oes 2aUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@leemhuis.info header.s=he214686 header.b="V/l8NogV"; arc=pass (i=1 spf=pass spfdomain=leemhuis.info dkim=pass dkdomain=leemhuis.info); spf=pass (google.com: domain of linux-kernel+bounces-136360-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136360-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p8-20020a170902780800b001e4b1495befsi321810pll.559.2024.04.09.00.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 00:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136360-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@leemhuis.info header.s=he214686 header.b="V/l8NogV"; arc=pass (i=1 spf=pass spfdomain=leemhuis.info dkim=pass dkdomain=leemhuis.info); spf=pass (google.com: domain of linux-kernel+bounces-136360-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136360-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4D00C2830F4 for ; Tue, 9 Apr 2024 07:33:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 851A67FBAF; Tue, 9 Apr 2024 07:31:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=leemhuis.info header.i=@leemhuis.info header.b="V/l8NogV" Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B834F79955; Tue, 9 Apr 2024 07:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.237.130.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712647858; cv=none; b=JC7BP9HwyslE8lbiKFdd4MdU3e9W2GCSLF3XmruA0r9wjFnhW6awmbhXBWn2LAm7qveKiM3i4+jFQTBz4n47j9M8zKJQqAqvR4XRdjhLbxfODxAzJ6avZE0brdeH0lqhQbfd223Nx3A9j56ZR9pUNlNcjXQmWsp77aadjxT7+pk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712647858; c=relaxed/simple; bh=CMX6aA9wScU43YKlAsL1ntr9Wuy50Tzw1OIpyrleAiQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CiGCzo88akwT7Unbxcw6iS4VxZBl281GAtIJ7B3+UCZnIuyfFiaeCUHHXsh0osuEsobnMYNzpS65VoAnrY3CBKYP6y/L4ENZIXeSpzvjpl1T9FyX1sqieTzvwY8tq5W8n6X/WA3Y60J0ldKdIwezSJB+BCbHn2OxdTJ9nlmSB4Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=leemhuis.info; spf=pass smtp.mailfrom=leemhuis.info; dkim=pass (2048-bit key) header.d=leemhuis.info header.i=@leemhuis.info header.b=V/l8NogV; arc=none smtp.client-ip=80.237.130.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=leemhuis.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=leemhuis.info DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=leemhuis.info; s=he214686; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From:Sender: Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:In-Reply-To: References; bh=pPlFRJ8SFuDnkXHqmbQgQnUnXyCLw1rG7kPikkOu6Os=; t=1712647855; x=1713079855; b=V/l8NogVpAGIwvDzQnLqRuqtaV/4OS4p/7xfY35YcxlwizVkYsIXvsupHB99y UnJhePk5HTmd4un3fo4jwM2biLFQzbCzXoqvVBn2cbYoh4XjumKm1CoTVIvWCVtJXB8mVl4gu1x0M DqrWsxF7S1p39nungCGJlH2z9PECr48UfpfsigAiefv780B40xAxnDG7vNc+Drtsvdwe/H6hnDPNc 6HuEF5rSbZLf8z3v9C4ZzL1px12beJpPY7ToAxpEZMWGqefUvsVgDeGT/SolBQNlB5QEBqYdxUgth uuTCUS1bY3W2me0lcRhoyynzUOnEYCCxHexhKwVKtVb/f4fS6A==; Received: from ip4d148da6.dynamic.kabel-deutschland.de ([77.20.141.166] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1ru5wR-0006Ld-Eq; Tue, 09 Apr 2024 09:30:51 +0200 From: Thorsten Leemhuis To: Jonathan Corbet Cc: regressions@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Bagas Sanjaya , =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Subject: [PATCH v2 5/6] docs: verify/bisect: describe how to use a build host Date: Tue, 9 Apr 2024 09:30:48 +0200 Message-ID: <288160cb4769e46a3280250ca71da0abc4aa002d.1712647788.git.linux@leemhuis.info> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1712647855;18e5c630; X-HE-SMSGID: 1ru5wR-0006Ld-Eq Describe how to build kernels on another system (with and without cross-compiling), as building locally can be quite painfully on some slow systems. This is done in an add-on section, as it would make the step-by-step guide to complicated if this special case would be described there. Signed-off-by: Thorsten Leemhuis --- .../verify-bugs-and-bisect-regressions.rst | 78 ++++++++++++++++++- 1 file changed, 74 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst index 1987c827211fce..6193c797642732 100644 --- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst +++ b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst @@ -276,6 +276,10 @@ Preparations: set up everything to build your own kernels The following steps lay the groundwork for all further tasks. +Note: the instructions assume you are building and testing on the same +machine; if you want to compile the kernel on another system, check +:ref:`Build kernels on a different machine ` below. + .. _backup_bissbs: * Create a fresh backup and put system repair and restore tools at hand, just @@ -2103,11 +2107,77 @@ problems will arise if the kernelrelease identifier exceeds 63 characters. [:ref:`back to step-by-step guide `]. -Additional reading material -=========================== +Additional information +====================== + +.. _buildhost_bis: + +Build kernels on a different machine +------------------------------------ + +To compile kernels on another system, slightly alter the step-by-step guide's +instructions: + +* Start following the guide on the machine where you want to install and test + the kernels later. + +* After executing ':ref:`Boot into the working kernel and briefly use the + apparently broken feature `', save the list of loaded + modules to a file using ``lsmod > ~/test-machine-lsmod``. Then locate the + build configuration for the running kernel (see ':ref:`Start defining the + build configuration for your kernel `' for hints on where + to find it) and store it as '~/test-machine-config-working'. Transfer both + files to the home directory of your build host. + +* Continue the guide on the build host (e.g. with ':ref:`Ensure to have enough + free space for building [...] `'). + +* When you reach ':ref:`Start preparing a kernel build configuration[...] + `': before running ``make olddefconfig`` for the first time, + execute the following command to base your configuration on the one from the + test machine's 'working' kernel:: + + cp ~/test-machine-config-working ~/linux/.config + +* During the next step to ':ref:`disable any apparently superfluous kernel + modules `' use the following command instead:: + + yes '' | make localmodconfig LSMOD=~/lsmod_foo-machine localmodconfig + +* Continue the guide, but ignore the instructions outlining how to compile, + install, and reboot into a kernel every time they come up. Instead build + like this:: -Further sources ---------------- + cp ~/kernel-config-working .config + make olddefconfig && + make -j $(nproc --all) targz-pkg + + This will generate a gzipped tar file whose name is printed in the last + line shown; for example, a kernel with the kernelrelease identifier + '6.0.0-rc1-local-g928a87efa423' built for x86 machines usually will + be stored as '~/linux/linux-6.0.0-rc1-local-g928a87efa423-x86.tar.gz'. + + Copy that file to your test machine's home directory. + +* Switch to the test machine to check if you have enough space to hold another + kernel. Then extract the file you transferred:: + + sudo tar -xvzf ~/linux-6.0.0-rc1-local-g928a87efa423-x86.tar.gz -C / + + Afterwards :ref:`generate the initramfs and add the kernel to your boot + loader's configuration `; on some distributions the following + command will take care of both these tasks:: + + sudo /sbin/installkernel 6.0.0-rc1-local-g928a87efa423 /boot/vmlinuz-6.0.0-rc1-local-g928a87efa423 + + Now reboot and ensure you started the intended kernel. + +This approach even works when building for another architecture: just install +cross-compilers and add the appropriate parameters to every invocation of make +(e.g. ``make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- [...]``). + +Additional reading material +--------------------------- * The `man page for 'git bisect' `_ and `fighting regressions with 'git bisect' `_ -- 2.44.0