:: Re: [DNG] Giving Devuan sans-initra…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Karl Hammar
Datum:  
To: Adam Borowski
CC: dng, Karl Hammar
Betreff: Re: [DNG] Giving Devuan sans-initramfs capabilities
Adam Borowski:
> On Sat, Jan 02, 2016 at 08:15:39PM +0100, karl@??? wrote:
> > Steve Litt:
> > > Where can I find documentation on how to do this? The last time I
> > > compiled a kernel was probably in the 20th century, so I imagine things
> > > have changed.
> >
> > It should be something like:
> >
> > download your kernel from your favourite site, e.g.
> > ftp:ftp.sunet.se/pub/Linux/kernels/
>
> Boo! Do you live in 20th century? It's a crime to not use git, especially
> when patches are involved. Even if they're not, you save time unpacking /
> downloading updates / switching to other releases.
>
> git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git


Do you see any difference between the git repo and the tar file ?

$ du -s linux-2.6
3009716 linux-2.6

$ ls -l /Net/ftp/ftp.sunet.se/pub/Linux/kernels/v4.x/linux-4.0.tar.xz
-rw-r--r-- 1 karl users 82313052 Apr 13 2015 /Net/ftp/ftp.sunet.se/pub/Linux/kernels/v4.x/linux-4.0.tar.xz

So for someone who has not compiled the kernel from source, I don't
start with the git clone, especially since I don't know anything about
their network connection. You might not believe it, but there are still
people out there with (plain old telefon system) modems.

> > make
> > make install
> > make modules_install
>
> This won't let you uninstall cleanly, or deploy to other machines.


That lets me deploy to machines without apt or dpkg.
I don't uninstall kernels that ofthen so I don't mind the manual way.

> make-kpkg --rootcmd fakeroot --initrd -j6 linux-image
> (no --initrd if you don't want initrd, replace 6 with the number of cores in
> your box)
> dpkg -i ~you/linux-image-*.deb
>
> > ch. bootloader to load your kernal
>
> make-kpkg will handle grub/lilo config automatically.


I don't want that automation so I do:

# cat /etc/kernel-img.conf
do_symlinks = no
do_bootloader = no
silent_modules = yes
warn_initrd = no

///

Yes, I used to use something similar:

fakeroot make-kpkg --append-to-version -anne.k6 --revision 1 kernel_image > log 2>&1

but I got:

$ cat /var/lib/dpkg/info/kernel-package.list
/etc
/etc/bash_completion.d
/etc/bash_completion.d/make_kpkg
/etc/kernel-pkg.conf
$

and then I found I could just as easily do it by myself.

If you want to use make-kpkg, it nice to set it up, like:

# fgrep := /etc/kernel-pkg.conf
maintainer := Karl Hammar
email := karl@???
priority := Low

///

If you want to do it the debian way, read:

https://www.debian.org/doc/manuals/debian-handbook/sect.kernel-compilation.en.html

Btw, there you'll find:

CULTURE The good old days of kernel-package
Before the Linux build system gained the ability to build proper Debian
packages, the recommended way to build such packages was to use make-kpkg
from the kernel-package package.

> > > Do you re-recompile? If so, do
> > > you have some sort of file containing all your choices so it's easy?
> >
> > I think make menuconfig et al. pulls in the current kernels config,
> > just make sure you have it in /boot:
> >
> > # ls -l /boot/*3.12.8*
> > -rw-r--r-- 1 root root 118268 Aug 1 15:36 /boot/config-3.12.8-rt11-i3
> > -rw-r--r-- 1 root root 1581413 Aug 1 15:36 /boot/System.map-3.12.8-rt11-i3
> > -rw-r--r-- 1 root root 3458016 Aug 1 15:36 /boot/vmlinuz-3.12.8-rt11-i3
>
> The first time you need to copy it by hand as .config to your linux source
> directory -- if you want to start with the distribution kernel, that has
> every obscure driver as module. You can trim that to only those present
> on the compilation box with "make localmodconfig". Another target of note
> is "localyesconfig" which converts modules to built-ins, something you want
> in a non-initrd kernel.


Good to know.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57