From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B120B1381F3 for ; Sun, 1 Sep 2013 17:31:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86180E0F03; Sun, 1 Sep 2013 17:31:02 +0000 (UTC) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3C1EFE0D7F for ; Sun, 1 Sep 2013 17:31:00 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id er20so2888456lab.21 for ; Sun, 01 Sep 2013 10:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9EbLRf/iuN4SdtFwSQgR+ds7gi2a+FtVMco6PPISPTA=; b=oHErGw7g0uuQrGIGASgsJHmEUN6WkhpdqzhbuYRTpai0Skk0xJooSUowqOULS5d8Cn UqVwughmLvnZ4A0NevSDYcoueh5JY42gtOMV3HD0OFfCV/3qq35zJ0yhhXqHOCTyuUaj FWAftpa3714gk6+6lnKZ7ERlfF6QW6hJ7by7K5JM+xogRbIJWkjP4BaroVu5BlpX+wI6 z/hXh31nKU1CocNsTN+PtEudPKz4uIgsEQQ0CzyokBoK0r/XK517vfcGXhH4XxEivbOF Rf1qKPK86QXhonHEdYzntYDaurTKjoxSQn9Fr0oSHDIwO1Lijdy6yVVStNgDEZMZBpKY d0Ww== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.112.167.230 with SMTP id zr6mr797459lbb.35.1378056659469; Sun, 01 Sep 2013 10:30:59 -0700 (PDT) Received: by 10.114.96.2 with HTTP; Sun, 1 Sep 2013 10:30:59 -0700 (PDT) Date: Sun, 1 Sep 2013 12:30:59 -0500 Message-ID: Subject: [gentoo-user] kerninst (was Optional /usr merge in Gentoo) From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 110bdc0d-72af-4a68-8973-bf7a502a62d6 X-Archives-Hash: 830a8c93bb462dd3671c41c041fac6dc I am following vanilla-sources in all my machines, which is what people like Greg Kroah-Hartman actually recommends [1][2]. Since they are now never stabilized [3], this means that I need to update them pretty regularly to keep them safe. This implies that I have to change the /usr/src/linux symbolic link, configure the kernel using make oldconfig, compile it, install it, install its modules, reemerge any package that provides kernel modules (if any), regenerate its initramfs, regenerate the GRUB2 config file OR adding a new entry in GRUB. None of this steps are particularly difficult, but any mistake in one of them can result in an unbootable system. So I wrote a little script that takes care of each of this steps automagically: https://github.com/canek-pelaez/kerninst So now everytime I need to use a new kernel version, I only do: # eselect kernel set # kerninst Everything is done by the script. The script is 167 lines of Bash, and I think is pretty easy to follow what it does. Any of the steps can be called individually, and I have been using it in all of my machines without any problem. It works with both GRUB and GRUB2, generating a very simple GRUB config file for every image available in /boot, with corresponding inird line if availabe. WARNINGS =E2=80=A2 If /usr/src/linux points to /usr/src/linux-3.10.10, then the scri= pt deletes /boot vmlinuz-3.10.10, /boot/initrd-3.10.10 *and* /lib/modules/3.10.10. =E2=80=A2 The script *WILL* overwrite your GRUB/GRUB2 configuration file, s= o make a copy before trying it. =E2=80=A2 The script requires a valid kernel .config file which will be cop= ied into /usrc/src/linux, and then used to configure the kernel with: yes "" | make oldconfig Some people recommend not doing this, and it can stall if a new option for the kernel requires an answer with no default value. =E2=80=A2 The script only supports dracut, but adding genkernel (or any oth= er initramfs maker) should be easy. Patches accepted. Dracut should be already configured. =E2=80=A2 I have only tested it with vanilla-sources, but probably will wor= k with other *-sources packages. I have been using it in all of my machines for some days now, and it works for me; but I take no responsibility if it breaks your machine, or if it kills your dog. Regards. [1] http://article.gmane.org/gmane.linux.gentoo.devel/86496 [2] http://article.gmane.org/gmane.linux.gentoo.devel/86506 [3] http://article.gmane.org/gmane.linux.gentoo.devel/87015 --=20 Canek Pel=C3=A1ez Vald=C3=A9s Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n Universidad Nacional Aut=C3=B3noma de M=C3=A9xico