# menuconfig - can you reset to default?

## Thaidog

I have a lot of things selected to be built in to my kernel and I would like to be able to reset them back to whatever is "default". Is there a way to do that?

----------

## timeBandit

Delete /usr/src/linux/.config and re-run menuconfig. You might want to make sure you have a backup.  :Wink: 

----------

## Jaglover

/usr/src/linux/README

make defconfig

Reading README files saves lots of time.

----------

## timeBandit

 *Jaglover wrote:*   

> /usr/src/linux/README
> 
> make defconfig
> 
> Reading README files saves lots of time.

 

Remembering read READMEs saves even more.   :Wink: 

Nice one, thanks.

----------

## Thaidog

 *timeBandit wrote:*   

>  *Jaglover wrote:*   /usr/src/linux/README
> 
> make defconfig
> 
> Reading README files saves lots of time. 
> ...

 

I'm getting this error after following what you said...

tylerm@Station-LV426 /usr/src/linux $ make menuconfig

scripts/kconfig/mconf arch/i386/Kconfig

Error during writing of the kernel configuration.

Your kernel configuration changes were NOT saved.

make[1]: *** [menuconfig] Error 1

make: *** [menuconfig] Error 2

tylerm@Station-LV426 /usr/src/linux $

Any ideas?

----------

## Rad

Try again as root.

----------

## Thaidog

 *Rad wrote:*   

> Try again as root.

 

Whoops thanks!

----------

## wynn

The kernel developers recommend that you do not uncompress the kernel source, configure the kernel or compile it as root. From Greg Kroah-Hartman's "Linux Kernel in a Nutshell" Chapter 1 "Using the Book" *Quote:*   

>  Do not configure or build your kernel with superuser permissions enabled!
> 
> This warning is the most important thing to remember while working through the steps in this book. Everything in this book â downloading the kernel source code, uncompressing it, configuring the kernel, and building it â should be done as a normal user on the machine. Only the two or three commands it takes to install a new kernel should be done as the superuser (root).
> 
> There have been bugs in the kernel build process in the past, causing some special files in the /dev directory to be deleted if the user had superuser permissions while building the Linux kernel. There are also issues that can easily arise when uncompressing the Linux kernel with superuser rights, as some of the files in the kernel source package will not end up with the proper permissions and will cause build errors later.

 He also notes that "none of the primary kernel developers build kernels as root" which led to the dev bug taking quite a while to fix as none of them suffered from it.

Of course, we can't stop the kernel source being uncompressed as root (or being put in /usr/src which he also advises against) but, once uncompressed, the kernel tree can be changed to <user> ownership and then everything except module and kernel installation can be done as a normal user.

----------

## nixnut

Moved from Installing Gentoo to Kernel & Hardware.

Kernel question, so moved here.

----------

## d2_racing

You can use theses commands :

```

# cd /usr/src/linux

# make clean

# make proper

# make menuconfig

```

----------

## kernelOfTruth

 *wynn wrote:*   

> The kernel developers recommend that you do not uncompress the kernel source, configure the kernel or compile it as root. From Greg Kroah-Hartman's "Linux Kernel in a Nutshell" Chapter 1 "Using the Book" *Quote:*    Do not configure or build your kernel with superuser permissions enabled!
> 
> This warning is the most important thing to remember while working through the steps in this book. Everything in this book â downloading the kernel source code, uncompressing it, configuring the kernel, and building it â should be done as a normal user on the machine. Only the two or three commands it takes to install a new kernel should be done as the superuser (root).
> 
> There have been bugs in the kernel build process in the past, causing some special files in the /dev directory to be deleted if the user had superuser permissions while building the Linux kernel. There are also issues that can easily arise when uncompressing the Linux kernel with superuser rights, as some of the files in the kernel source package will not end up with the proper permissions and will cause build errors later. He also notes that "none of the primary kernel developers build kernels as root" which led to the dev bug taking quite a while to fix as none of them suffered from it.
> ...

 

good to know !   :Surprised: 

thanks, wynn   :Smile: 

----------

## wynn

kernelOfTruth: encouraged by that, here's something else Updating KC11 â kernel compiling for the beginner has a section "Creating a kernel configuration from scratch" which might interest Thaidog too.

All comments welcomed   :Very Happy: 

P.S. I have eaten my own dogfood  :Wink: 

----------

## timeBandit

 *wynn wrote that Greg Kroah-Hartman wrote:*   

> There have been bugs in the kernel build process in the past, causing some special files in the /dev directory to be deleted if the user had superuser permissions while building the Linux kernel.

 

So that's why!   :Shocked: 

Thanks wynn, that's the first time I've seen a reason other than, "you shouldn't." (Parents, friends and a few nuns could attest my uniform response to that is, "why?"   :Laughing:  )

----------

## wynn

timeBandit: But then I've been uncompressing, configuring and compiling the kernel for years as root and never noticed a thing!

Perhaps your "Why?" may still be valid ...   :Shocked: 

However, I've changed now (BAKC?) and the kernel source trees in /usr/src are all user-owned.

----------

## Corona688

 *wynn wrote:*   

> timeBandit: But then I've been uncompressing, configuring and compiling the kernel for years as root and never noticed a thing!
> 
> Perhaps your "Why?" may still be valid ...   

  It's the general idea.  It always could have done things you didn't expect;  that a kernel build script has done things like delete /dev nodes is just a nice demonstration.

----------

