Re: make custom kernel

2021-07-04 Thread mick crane

On 2021-07-04 18:21, Brian wrote:


Definitely. Has gparted been mentioned?


The rest of the disk is LVM. Would I need to shrink that first before 
gparted ?

mick
--
Key ID4BFEBB31



Re: make custom kernel

2021-07-04 Thread Brian
On Sun 04 Jul 2021 at 10:26:26 -0500, David Wright wrote:

> On Sat 03 Jul 2021 at 19:53:03 (+0100), mick crane wrote:
> > I've done it before but I've forgotten and the order.
> > What's the procedure for making a custom kernel?
> > Install linux headers
> > change to a "build" directory
> > make menu-config
> > ./configure
> > make
> > make dep
> > make install
> > make clean
> > ?
> 
> There used to be a kernel-package, which I used until about 15 years
> ago when the kernels got too complex for me to bother. The last
> version I've found is jessie's, and its manpages, docs and howtos may
> be worth reading through.

I used it extensively circa the same era as you. It did the job.
My recollection (not to be relied on) was that the the kernel and
initrd were not that much smaller for me to continue its use.

Anyway it is discontinued upstream, regarded as obsolete and better
options are said to exist.
 
> That said, if customising your kernel is for fixing your room problem,
> then I would exhaust all the other courses of action first.

Definitely. Has gparted been mentioned?

> (And I would investigate why your initrd files are /so/ large.)

You me worried, but not so much I intend to do anything about it :).
On this machine: about 6.8 M; on others 2.3 M.

__ 
Brian.



Re: make custom kernel

2021-07-04 Thread mick crane

On 2021-07-04 16:26, David Wright wrote:

On Sat 03 Jul 2021 at 19:53:03 (+0100), mick crane wrote:

I've done it before but I've forgotten and the order.
What's the procedure for making a custom kernel?
Install linux headers
change to a "build" directory
make menu-config
./configure
make
make dep
make install
make clean
?


There used to be a kernel-package, which I used until about 15 years
ago when the kernels got too complex for me to bother. The last
version I've found is jessie's, and its manpages, docs and howtos may
be worth reading through.

That said, if customising your kernel is for fixing your room problem,
then I would exhaust all the other courses of action first.
(And I would investigate why your initrd files are /so/ large.)

Cheers,
David.


How would you suggest I find out why initrd files are so big and how 
make it smaller?
As I can make out the initrd image contains the modules it thinks are 
needed?

How to make it smaller without building new kernel ?

cheers
mick
--
Key ID4BFEBB31



Re: make custom kernel

2021-07-04 Thread David Wright
On Sat 03 Jul 2021 at 19:53:03 (+0100), mick crane wrote:
> I've done it before but I've forgotten and the order.
> What's the procedure for making a custom kernel?
> Install linux headers
> change to a "build" directory
> make menu-config
> ./configure
> make
> make dep
> make install
> make clean
> ?

There used to be a kernel-package, which I used until about 15 years
ago when the kernels got too complex for me to bother. The last
version I've found is jessie's, and its manpages, docs and howtos may
be worth reading through.

That said, if customising your kernel is for fixing your room problem,
then I would exhaust all the other courses of action first.
(And I would investigate why your initrd files are /so/ large.)

Cheers,
David.



Re: make custom kernel

2021-07-04 Thread deloptes
mlnl wrote:

> 10. make deb-pkg LOCALVERSION=-nameN KDEB_PKGVERSION=$(make
> kernelversion)-1 (nameN e. g. v1)

I prefer bindeb-dpkg saves some overhead in zipping the source



Re: make custom kernel

2021-07-04 Thread IL Ka
On Sun, Jul 4, 2021 at 1:26 PM The Wanderer  wrote:

> On 2021-07-04 at 06:26, IL Ka wrote:
>
> >> thank you very much. Can I somehow load the current configuration
> >> so menuconfig shows what choices were made for current kernel ?
> >
> > zcat /proc/config.gz > .config
>
> AFAIK, Debian hasn't shipped kernels with /proc/config.gz enabled for
> quite a few years now - I think over a decade.
>

ooops, sorry. You are right.
Then it should be in

cat /boot/config-$(uname -r)

 https://wiki.debian.org/KernelFAQ
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=541489


Re: make custom kernel

2021-07-04 Thread The Wanderer
On 2021-07-04 at 06:26, IL Ka wrote:

>> thank you very much. Can I somehow load the current configuration
>> so menuconfig shows what choices were made for current kernel ?
> 
> zcat /proc/config.gz > .config

AFAIK, Debian hasn't shipped kernels with /proc/config.gz enabled for
quite a few years now - I think over a decade.

I think the reason was that it's not useful enough often enough to
justify having it take up RAM on every Debian system at all times, and
most or all of the same benefit can be had from just putting the same
config on-disk under /boot.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw



signature.asc
Description: OpenPGP digital signature


Re: make custom kernel

2021-07-04 Thread IL Ka
>
> thank you very much. Can I somehow load the current configuration so
> menuconfig shows what choices were made for current kernel ?
>
>
zcat /proc/config.gz > .config


Re: make custom kernel

2021-07-04 Thread Polyna-Maude Racicot-Summerside
Hi,


On 2021-07-04 2:42 a.m., mick crane wrote:
> On 2021-07-04 06:22, mlnl wrote:
>> Hi Mick,
>>
>> mick crane  wrote:
>>
>>> I've done it before but I've forgotten and the order.
>>> What's the procedure for making a custom kernel?
>>
>> Do you mean a custom Debian or a vanilla kernel from kernel.org?
>> For a Debian kernel you can look at
>> 
>>
>> For a vanilla kernel, i use the following steps:
>> 1. download the kernel source archive of your choice
>> 2. extract the xz archive with unxz
>> 3. verify the tar archive with gpg
>> 4. untar the tar archive
>> 5. cd linux-version
>> 6. make mrproper
>> (6b) copy old config as linux-version/.config and/or certs in
>> linux-version/certs for modules signing
>> 8. make menuconfig (you need some packages, libncurses etc.)
>> 9. export CONCURRENCY_LEVEL="$(grep -c '^processor' /proc/cpuinfo)"
>> 10. make deb-pkg LOCALVERSION=-nameN KDEB_PKGVERSION=$(make
>> kernelversion)-1 (nameN e. g. v1)
>> 11. sudo dpkg -i kernel-packages (-headers, -image, -libc-dev)
> 
> thank you very much. Can I somehow load the current configuration so
> menuconfig shows what choices were made for current kernel ?
> 
The step 6b does exactly what you ask.
The .config file contain the Kernel options.
You can use the files contained inside you /boot directory.
Ex:
For myself :

ls /boot

config-4.19.0-16-amd64   initrd.img-5.10.0-0.bpo.5-amd64
config-4.19.0-9-amd64System.map-4.19.0-16-amd64
config-4.19.182  System.map-4.19.0-9-amd64
config-5.10.0-0.bpo.5-amd64  System.map-4.19.182
efi  System.map-5.10.0-0.bpo.5-amd64
grub vmlinuz-4.19.0-16-amd64
initrd.img-4.19.0-16-amd64   vmlinuz-4.19.0-9-amd64
initrd.img-4.19.0-9-amd64vmlinuz-4.19.182
initrd.img-4.19.182  vmlinuz-5.10.0-0.bpo.5-amd64

The file config-4.19-182 and config-5.10.0-0.bpo.5-and64 both contain
kernel configs.
So does the other config-* files.

If you copy this file into the base of your new kernel source it will be
used as base for building.
Depending on the differences between the config file you use as base and
the actual kernel you are compiling there may be some necessary config
missing. So it is always better to run a *make menuconfig* as a safe bet.

Also if you look into the /usr/src folder you may find some other config
files, depending if you installed kernel header or not.

For my case :

*usr/src/linux-headers-4.19.0-16-amd64*

will contain a file named .config
Here's a list of my */usr/src*

binutilslinux-headers-4.19.182
castle-game-engine-6.4  linux-headers-5.10.0-0.bpo.5-amd64
gcc-7   linux-headers-5.10.0-0.bpo.5-common
gcc-8   linux-kbuild-4.19
gdb.tar.bz2 linux-kbuild-5.10
glibc   linux-patch-4.19-rt.patch.xz
gmock   linux-patch-5.10-rt.patch.xz
googletest  linux-source-4.19.tar.xz
gtest   linux-source-5.10.tar.xz
libdvd-pkg  linux-support-4.19.0-16
liblzf  linux-support-4.19.0-9
linux-config-4.19   nvidia-current-418.181.07
linux-config-5.10   nvidia-tesla-460-460.73.01
linux-headers-4.19.0-16-amd64   nvidia-tesla-460-kernel.tar.xz
linux-headers-4.19.0-16-common  v4l2loopback-0.12.1
linux-headers-4.19.0-9-amd64v4l2loopback.tar.bz2
linux-headers-4.19.0-9-common

Everything called linux-config* and linux-headers-* will contain a
.config file.

So as a hint, I'd say to install the closest linux-headers you can get
to the version you wish to compile as your custom kernel.
For example if you plan compiling 5.19.182 then installing Debian kernel
version 4.19.0 would be a good start.
If planning to compile a custom kernel version 5.10.xxx then installing
a 5.10 backport kernel headers and using this .config as a base would be
a good start for this one.

Hope this will put you on track for your new custom kernel.

Sincerely,
PM



> mick

-- 
Polyna-Maude R.-Summerside
-Be smart, Be wise, Support opensource development



OpenPGP_signature
Description: OpenPGP digital signature


Re: make custom kernel

2021-07-04 Thread mick crane

On 2021-07-04 06:22, mlnl wrote:

Hi Mick,

mick crane  wrote:


I've done it before but I've forgotten and the order.
What's the procedure for making a custom kernel?


Do you mean a custom Debian or a vanilla kernel from kernel.org?
For a Debian kernel you can look at


For a vanilla kernel, i use the following steps:
1. download the kernel source archive of your choice
2. extract the xz archive with unxz
3. verify the tar archive with gpg
4. untar the tar archive
5. cd linux-version
6. make mrproper
(6b) copy old config as linux-version/.config and/or certs in
linux-version/certs for modules signing
8. make menuconfig (you need some packages, libncurses etc.)
9. export CONCURRENCY_LEVEL="$(grep -c '^processor' /proc/cpuinfo)"
10. make deb-pkg LOCALVERSION=-nameN KDEB_PKGVERSION=$(make
kernelversion)-1 (nameN e. g. v1)
11. sudo dpkg -i kernel-packages (-headers, -image, -libc-dev)


thank you very much. Can I somehow load the current configuration so 
menuconfig shows what choices were made for current kernel ?


mick
--
Key ID4BFEBB31



Re: make custom kernel

2021-07-03 Thread mlnl
Hi Mick,

mick crane  wrote:

>I've done it before but I've forgotten and the order.
>What's the procedure for making a custom kernel?

Do you mean a custom Debian or a vanilla kernel from kernel.org?
For a Debian kernel you can look at


For a vanilla kernel, i use the following steps:
1. download the kernel source archive of your choice
2. extract the xz archive with unxz
3. verify the tar archive with gpg
4. untar the tar archive
5. cd linux-version
6. make mrproper
(6b) copy old config as linux-version/.config and/or certs in
linux-version/certs for modules signing
8. make menuconfig (you need some packages, libncurses etc.)
9. export CONCURRENCY_LEVEL="$(grep -c '^processor' /proc/cpuinfo)"
10. make deb-pkg LOCALVERSION=-nameN KDEB_PKGVERSION=$(make
kernelversion)-1 (nameN e. g. v1)
11. sudo dpkg -i kernel-packages (-headers, -image, -libc-dev)

-- 
mlnl

GPG:1FC05426F87FA623



Re: make custom kernel

2021-07-03 Thread IL Ka
On Sun, Jul 4, 2021 at 12:20 AM Anssi Saari  wrote:

> mick crane  writes:
>
> > I've done it before but I've forgotten and the order.
> > What's the procedure for making a custom kernel?
>
> I assume there are full instructions somewhere.

Here it is
http://www.kroah.com/lkn/


``make help`` in kernel source it also worth reading


Re: make custom kernel

2021-07-03 Thread Anssi Saari
mick crane  writes:

> I've done it before but I've forgotten and the order.
> What's the procedure for making a custom kernel?
> Install linux headers
> change to a "build" directory
> make menu-config
> ./configure
> make
> make dep
> make install
> make clean

I assume there are full instructions somewhere. One cool thing to
remember is that the mainstream kernel sources still have deb-pkg target
which neatly generates deb packages for the kernel image and
headers. Last time I built kernels I made good use of that. I stopped
around when Debian 10 came out, just didn't seem worth the trouble.



make custom kernel

2021-07-03 Thread mick crane

I've done it before but I've forgotten and the order.
What's the procedure for making a custom kernel?
Install linux headers
change to a "build" directory
make menu-config
./configure
make
make dep
make install
make clean
?
mick
--
Key ID4BFEBB31