Re: Difference between config, menuconfig and defconfig

2016-09-19 Thread Valdis . Kletnieks
On Mon, 19 Sep 2016 16:02:11 -0400, Aruna Hewapathirane said:

> Many times I have seriously screwed up my kernel to a point where it
> suddenly refuses to boot. Every single time this has happened to me what
> saved me was make defconfig. You may not have your internet connection
> working, your sound may be kaput, the webcam not functional BUT defconfig
> has invariably *every single time* given me back a kernel I can boot into.

Of course, the *correct* answer here is to keep around the known-working
config files for several previous kernels.  And the easiest way to do that
is to:

1) keep several kernels in /boot (I have enough room for the current kernel,
3 or 4 previous, and enough slack to do 12 or 13 builds for a 'git bisect'
without having to stop and clean up).

2) Set the following two things in your .config, so you can always boot
into an older kernel and retrieve its config from /proc/config.gz:

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

3) Make sure your kernel install process copies the .config used
to /boot/config-`uname -r` so you have it handy.

And of course:

4) Take regular backups of your system.  That will protect you from lots
of screw-ups - and hardware failures as well.  A 1 or 2 tera USB hard
drive isn't that expensive.


pgp9LmmHjokeR.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Difference between config, menuconfig and defconfig

2016-09-19 Thread Aruna Hewapathirane


>> make defconfig:
>> Generates a new config with default from the ARCH supplied defconfig
file.
>> Use this option to get back the
>> default configuration file that came with the sources.
>
> Actually, that *won't* get you back "the config that came with the
sources".
> If you look in a release source tarball from kernel.org, there *isn't* a
> .config in there, you need to create one somehow (copying a distro .config
> and then running 'make localmodconfig' is a popular choice).
>
> And there's no guarantee that 'make defconfig' will re-create whatever
> your distro shipped - in fact, it probably *won't* do so, because distros
> rarely, if ever, ship a kernel that's built with a Linus-approved
defconfig.

Yes true and agreed. I should have been a bit more specific.

Many times I have seriously screwed up my kernel to a point where it
suddenly refuses to boot. Every single time this has happened to me what
saved me was make defconfig. You may not have your internet connection
working, your sound may be kaput, the webcam not functional BUT defconfig
has invariably *every single time* given me back a kernel I can boot into.

>From there takes a wee bit of meddling with make menuconfig and I am good
to go :)

I forgot to cite where I got the earlier information from so here it is:
https://wiki.gentoo.org/wiki/Kernel/Configuration

Thank's Valdis for pointing that out - Aruna
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Difference between config, menuconfig and defconfig

2016-09-19 Thread Valdis . Kletnieks
On Mon, 19 Sep 2016 10:58:35 -0400, Aruna Hewapathirane said:

> make menuconfig:
> An ncurses-based pseudo-graphical menu (only text input). Navigate through
> the menu to modify the
> desired options. Within menuconfig, use the / key to search modules by name.

Actually, / searches (in a case-insensitive manner, so feel free to
type in lower case) for CONFIG_WHATEVER variables, not modules.

The distinction is important for 2 reasons:

1) Sometimes, the config variable that controls building a module
isn't the uppercase version of the module name.  It's rare, but does
happen.  For example, a Fedora 4.3.0 kernel has 2,739 =m entries in its
.config.  Of those:

[/lib/modules/4.3.0-0.rc0.git14.1.fc24.x86_64] for i in `grep =m 
/boot/config-4.3.0-0.rc0.git14.1.fc24.x86_64 |  sed -e 's/^CONFIG_//' -e 
's/=m$//' | tr 'A-Z' 'a-z'`; do find . -name ${i}.ko.xz; done | wc -l
531
Only 531 are the lowercase of the config name.

[/lib/modules/4.3.0-0.rc0.git14.1.fc24.x86_64] for i in `grep =m 
/boot/config-4.3.0-0.rc0.git14.1.fc24.x86_64 |  sed -e 's/^CONFIG_//' -e 
's/=m$//' | tr '_A-Z' '-a-z'`; do find . -name ${i}.ko.xz; done | wc
593
And some more have underscores changed to dashes (CONFIG_FOO_BAR -> foo-bar.ko)

And the *majority* of them play games of one form or another:

obj-$(CONFIG_BATTERY_OLPC)  += olpc_battery.o
obj-$(CONFIG_BLK_DEV_LOOP) += loop.o
obj-$(CONFIG_LOOPBACK_TARGET)+= tcm_loop.o
obj-$(CONFIG_NVME_TARGET_LOOP)   += nvme-loop.o

and so on...

2) It's also good for finding yes/no variables that don't control
building a module. For example:

CONFIG_ALLOW_DEV_COREDUMP=y

> make defconfig:
> Generates a new config with default from the ARCH supplied defconfig file.
> Use this option to get back the
> default configuration file that came with the sources.

Actually, that *won't* get you back "the config that came with the sources".
If you look in a release source tarball from kernel.org, there *isn't* a
.config in there, you need to create one somehow (copying a distro .config
and then running 'make localmodconfig' is a popular choice).

And there's no guarantee that 'make defconfig' will re-create whatever
your distro shipped - in fact, it probably *won't* do so, because distros
rarely, if ever, ship a kernel that's built with a Linus-approved defconfig.


pgpZgudLCqIvE.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Difference between config, menuconfig and defconfig

2016-09-19 Thread Aruna Hewapathirane
Hi Madhu,

make config:
Is a text-based configuration. The options are prompted one after another.
All options need to be answered,
and out-of-order access to former options is not possible. Try this *once*
so you have the experience but after that stay away just too much work and
grief.

make menuconfig:
An ncurses-based pseudo-graphical menu (only text input). Navigate through
the menu to modify the
desired options. Within menuconfig, use the / key to search modules by name.

make defconfig:
Generates a new config with default from the ARCH supplied defconfig file.
Use this option to get back the
default configuration file that came with the sources.

There are lot's of other options read the section under configuration
targets: https://www.kernel.org/doc/makehelp.txt

Hope this helps.

Aruna

On Mon, Sep 19, 2016 at 1:43 AM, Madhu K  wrote:

> Hi All,
>
> I am Kernel newbie, I want to know the difference between config,
> menuconfig and defconfig.
>
> Thanks,
> Madhu
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Difference between config, menuconfig and defconfig

2016-09-19 Thread Valdis . Kletnieks
On Mon, 19 Sep 2016 16:20:12 +0530, Madhu K said:

> That means kernel maintainer will define default configuration for his
> architecture not for all architecture, I mean kernel maintainer might have
> defined configuration for x86, not for ARM, POWERPC and all, is my
> understanding correct?, if not please correct me.

There's more than one defconfig file.  Even more than one per architecture.
For many, there's a separate defconfig for each board:

[/usr/src/linux-next] for i in arch/*/configs; do echo -n "$i: "; find $i -name 
'*defconfig' | wc -l; done
arch/arc/configs: 15
arch/arm/configs: 112
arch/arm64/configs: 1
arch/avr32/configs: 15
arch/blackfin/configs: 29
arch/c6x/configs: 5
arch/cris/configs: 4
arch/h8300/configs: 3
arch/hexagon/configs: 1
arch/ia64/configs: 6
arch/m32r/configs: 12
arch/m68k/configs: 19
arch/metag/configs: 4
arch/microblaze/configs: 2
arch/mips/configs: 61
arch/mn10300/configs: 2
arch/nios2/configs: 2
arch/openrisc/configs: 1
arch/parisc/configs: 8
arch/powerpc/configs: 99
arch/s390/configs: 4
arch/score/configs: 1
arch/sh/configs: 56
arch/sparc/configs: 2
arch/tile/configs: 2
arch/um/configs: 2
arch/unicore32/configs: 1
arch/x86/configs: 2
arch/xtensa/configs: 6



pgpz5dY6LrsAJ.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Difference between config, menuconfig and defconfig

2016-09-19 Thread Madhu K
Hi,

Thanks for your response,

I have gone through "Linux Kernel in a Nutshell" by Greg Kroah-Hartman.

What he states in that book is :

Default Configuration Options:
Every kernel version comes with a “default” kernel configuration. This
configuration is loosely based on the defaults that the kernel maintainer
of that architecture feels are the best options to be used.

That means kernel maintainer will define default configuration for his
architecture not for all architecture, I mean kernel maintainer might have
defined configuration for x86, not for ARM, POWERPC and all, is my
understanding correct?, if not please correct me.

Thanks
Madhu

On Mon, Sep 19, 2016 at 12:23 PM, Andrea D'Amore 
wrote:

> On 19 September 2016 at 07:43, Madhu K  wrote:
> > I am Kernel newbie, I want to know the difference between config,
> menuconfig
> > and defconfig.
>
> Check the configuring and building chapter of book "Linux Kernel in a
> Nutshell" by Greg Kroah-Hartman who's on this list.
>
>
> --
> Andrea
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Difference between config, menuconfig and defconfig

2016-09-18 Thread Andrea D'Amore
On 19 September 2016 at 07:43, Madhu K  wrote:
> I am Kernel newbie, I want to know the difference between config, menuconfig
> and defconfig.

Check the configuring and building chapter of book "Linux Kernel in a
Nutshell" by Greg Kroah-Hartman who's on this list.


-- 
Andrea

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Difference between config, menuconfig and defconfig

2016-09-18 Thread Madhu K
Hi All,

I am Kernel newbie, I want to know the difference between config,
menuconfig and defconfig.

Thanks,
Madhu
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies