From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA058C433C1 for ; Mon, 22 Mar 2021 12:57:21 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D7CA60C3D for ; Mon, 22 Mar 2021 12:57:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D7CA60C3D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1lOK7G-0004iT-Ll; Mon, 22 Mar 2021 08:57:06 -0400 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1lOK7E-0004iO-NF for kernelnewbies@kernelnewbies.org; Mon, 22 Mar 2021 08:57:04 -0400 Received: by mail-qt1-x834.google.com with SMTP id s2so12162333qtx.10 for ; Mon, 22 Mar 2021 05:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vt-edu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:in-reply-to:references:mime-version :content-transfer-encoding:date:message-id; bh=fVTO8AKzWzw0mMvgz1kzrTEFaPuYNbFDBhXcztjeNAM=; b=D0XRsrf2w97i0ER+94olUMaV4Xd9IpB8BFLWAhqiAK1j2zn3jZ8mmx0hSGIR12eLbu OkEiizjN46DAv7wKSf01ikPJsJiPE0SUME+8bC7mlFJDJ6iJkv8+l4QqeEE+rl9tI71h UfkE4+xxEtx3PfnGYtrbvt2QKPNyHZgwLF4Cyd/9Fz5PYm6bv/dmQs3QxLYLsgewee0b DwdvWAppVzuNFmifFjYnNZwAf98dAP3u9lHu6rtlRdHsbKavz+8OfVw4NoK53Xe6hbyZ sS3j0Ui2WWgwkYUkd0f8rDw5tG6VMjNZ+TXGsgKngyVHz2OFWpxSSIK1/M+FYJt141Ks XKyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=fVTO8AKzWzw0mMvgz1kzrTEFaPuYNbFDBhXcztjeNAM=; b=JhS1Voq3uj4dxsoA5BNUwIBJmRTWx1dXVZlbSSCcy9EliNgr5GPxfKU8/whI/meFDz f7f+ELoc+qgJnAS2DyZ/lPEPE/Z9eCFqN2IogRYeHFCENEo6eqDEjgkcnGACEb6iSul6 4Hj/7MkWXwj/APH4Rsf1R+J5O4hW0zDTdMo6IJ0y9bGBZnUVVYe6Twt0pQ65YZj5Ti/5 YtN5+nxDDeF1aUDSUheyBH3N4Ng75ejuSwzFec42mO92VFJ4/QxQKdSpY3VGw/AkQIzm VgKlsfhphpNA+RntAW80czV6GHFhoqREswqn0ulXVDk1q9XQg9/Ukj5kZ73NoazlRO/z aNpA== X-Gm-Message-State: AOAM530XiY0B+zqlbOGsPJ6Ovx4Iw5MDINQ6OfUVVb2g0aHd7477/9fh WTFyDtfe5nueN4iKFCnrMFmolA== X-Google-Smtp-Source: ABdhPJwG0mZlKbeR+iJ9eTkCL7kI57MYcj87vodOx4k/eLL7hdqldsE1/8YQf+0R/KKH02PDLOQgoA== X-Received: by 2002:aed:30a3:: with SMTP id 32mr9468190qtf.130.1616417822246; Mon, 22 Mar 2021 05:57:02 -0700 (PDT) Received: from turing-police ([2601:5c0:c380:d61::359]) by smtp.gmail.com with ESMTPSA id v4sm8930378qte.18.2021.03.22.05.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 05:57:01 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Gidi Gal Subject: Re: How to switch between installed kernel and developed kernel In-Reply-To: References: Mime-Version: 1.0 Date: Mon, 22 Mar 2021 08:57:00 -0400 Message-ID: <61165.1616417820@turing-police> Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7926740561760171555==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============7926740561760171555== Content-Type: multipart/signed; boundary="==_Exmh_1616417820_29981P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1616417820_29981P Content-Type: text/plain; charset=us-ascii On Mon, 22 Mar 2021 14:11:58 +0200, Gidi Gal said: > I am new to kernel development, currently working on > https://kernelnewbies.org/FirstKernelPatch. I reached the step "Install > your changes" in "Modifying a driver on native Linux". I would like to > separate my developed kernel and my installed kernel and to switch between > the two in order to test my changes. I am not sure that my tutorial > explains how to do that. Well... the first rule of thumb is to make sure that your kernel release name will be different one way or another. CONFIG_LOCALVERSION is a good way to ensure it, while linux-next kernels and git-bisect kernels have their own way of naming themselves. It's also what shows up in uname -r. What I have in /boot at the moment: [/boot] ls vmlinuz-* vmlinuz-5.10.0-0.rc6.20201204git34816d20f173.92.fc34.x86_64 vmlinuz-5.10.0-rc4-next-20201117-dirty vmlinuz-5.11.0-rc3-next-20210114-dirty vmlinuz-5.10.0-next-20201215 vmlinuz-5.10.0-rc6-next-20201203 vmlinuz-5.12.0-rc1-next-20210302-dirty vmlinuz-5.10.0-next-20201223-dirty vmlinuz-5.10.0-rc6-next-20201207 vmlinuz-5.12.0-rc2-next-20210309-dirty vmlinuz-5.10.0-rc1-00257-gcf9446cc8e6d-dirty vmlinuz-5.10.0-rc7-next-20201208 vmlinuz-5.8.0-next-20200807 vmlinuz-5.10.0-rc1-next-20201030 vmlinuz-5.11.0-rc2-next-20210105-dirty vmlinuz-5.8.0-rc1-next-20200616 Each has a matching config-, System.map-, and initramfs- file in /boot, a grub2 config entry in /boot/loader/entries/, and the loadable modules in subdirectories under /lib/modules/`uname -r`. So if you back up /boot and /lib/modules, you should be able to recover from any issues. Note that on many systems, /boot is ext4, but there's a /boot/efi that's vfat that kernel installs shouldn't be touching, but you want a copy in case an update of grub goes astray... This is probably a good time to back up your *entire* system, because lots of Bad Things can happen even when you're not testing a new kernel. If you want to double-check what your just-built kernel is called, you can use 'make kernelrelease' to tell you. As long as that's different from any installed kernel, you shouldn't have any issues with files getting overlaid. 'make install' will look for a script 'installkernel' that does some of the heavy lifting, like building an initramfs, adding grub entries, and the like. That usually lives in /sbin/installkernel, but if you create your own and have it before /sbin in $PATH, it will get used. --==_Exmh_1616417820_29981P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBYFiUHAdmEQWDXROgAQLCFA/+MQSwAbkQVJczmXZniKgCW6h8TvnNP7D6 sc3fEZHt/rTn2n1twQzwK6/XD/4Ir2qKszTXzViFxDypiwvtKbiZ5kcQjlXKLJ5B nJdDakAVBP98ERInJS718DK0fAP85C73osToWvFwc02hkDuso1AwQauUNZK47TS/ Gpa1Dpk9gSdK1z5H/0dQJpg6+pzBh/UGq/xCQNs5lqW59t5R1IwPizy0DqeRy3tw zYkNkiGl2UlGZZzoQhw1tQ5FE8PnpNdBrgdl0n2vcww1Km59Lt/vFzVGNZUMrkBr EwzzLpBpPXKqKa57aD4j5kSYYgcWYr1XfrKBrTBmAezrfd+YwY6HoHtZhEdHhJUe CsyFAvsoG9uAgg3eIzpwOQr7jJC0r5UERkkn8nQALJf++xbwfHhylzV/pfM6hpC1 QgF/GxGA0Msx4WIQwnyr8iaBHpOYHhmSSijC2ctCHFBVgy6uJLEWHcuIVlgRKKvV 26ucpFYhaIYDOgLgm99MBY6bL+F8ty1+KoFfpPuw5IJvuSQwArXeVXTzUnYMb4Dh ntFcihbt/ZGGdWqHq1qoFOa6jOrkj7Gy8vqXtQbMZpU0y3BHHpOvEM+31F+DcPkp Es3HRKn2UPvAJu3F2MijUepq7nJVgPliSM7CL4n7ifqhtFY5G3kNZTVjXLcYUiJ4 fr1BItOoChE= =Ey/j -----END PGP SIGNATURE----- --==_Exmh_1616417820_29981P-- --===============7926740561760171555== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============7926740561760171555==--