# Kernel wont boot

## Blind_Sniper

HI.

I accidentally deleted my beloved .config which I saved for a 8 last years, and now I have to restore it.

Unfortunately /proc/config.gz doesn't exist so I can't get it back in a simple way. If there is a way to restore it without /proc/config.gz please let me know.

Right now I have compiled and running 4.9.95 kernel.

Meanwhile I tried to restore it from scratches. I downloaded and installed previous kernel 4.9.76-r1 (just to prevent a mess with current 4.9.95 kernel), navigated to sources directory and run 

```
make tinyconfig
```

It gave me a start point config, which I loaded with make menuconfig and tweaked it (added drivers, changed some settings etc).

I saved changes, exited and compiled kernel:

```
make && make install && make modules_install
```

I added grub menu entry

```
menuentry 'Gentoo GNU/Linux' {

   load_video

   insmod gzio

   insmod part_msdos

   insmod ext2

   set root='hd0,msdos2'

   linux   /boot/vmlinuz-4.9.76-gentoo-r1 root=/dev/sda2 ro 

}
```

and rebooted. When I selecting this menuitem and pressing enter key nothing happenes. Kernel doesn't load, just black screen without any warnings or errors. Only blinking white cursor on a black screen

What am I missed? It's not a grub menu issue, menuentry identical to 4.9.95 kernel which works fine. It's a kernel issue.

Here is my new config: https://pastebin.com/dfR5uJw7

New config is noticeably smaller then old one: 56 kB vs 86 kB. As well as new kernel is smaller then old 4.9.95: 1.9 MB vs 3.5 Mb

----------

## NeddySeagoon

Blind_Sniper,

We need the output from lspci so we can see your hardware.

the output from lsusb, with all your USB devices attached

and the output of 

```
df -Th
```

so we can see your filesystems.

Does your system use BIOS or UEFI to boot?

If you want to have a go on your own, search the forums for Pappys Preconfigs.

-- edit --

You don't have any console drivers set in your kernel. That's not a problem for booting but your console is limited to black text on a black background.  I've done that too. Its rather hard to read. :)

----------

## Blind_Sniper

NeddySeagoon, thanks for your input.

My system uses legasy BIOS, new kernel I trying to build is located at the same /boot directory as my current bootable 4.9.95 kernel.

```
# df -Th

Filesystem     Type      Size  Used Avail Use% Mounted on

/dev/sda2      ext4       24G   19G  3.9G  84% /

devtmpfs       devtmpfs   10M     0   10M   0% /dev

tmpfs          tmpfs     796M  740K  796M   1% /run

shm            tmpfs     3.9G  2.8M  3.9G   1% /dev/shm

cgroup_root    tmpfs      10M     0   10M   0% /sys/fs/cgroup

tmpfs          tmpfs     6.0G     0  6.0G   0% /var/tmp/portage

none           tmpfs     3.9G  4.0K  3.9G   1% /run/user/1000
```

```
# lsusb

Bus 001 Device 004: ID 046e:6000 Behavior Tech. Computer Corp. 

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 003: ID 0000:0538  

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
```

I have only USB keyboard and USB mouse attached at the moment, no any other sticks or HDDs which could interfere to boot. 

 *Quote:*   

> You don't have any console drivers set in your kernel. That's not a problem for booting but your console is limited to black text on a black background.  I've done that too. Its rather hard to read. 

 

Thanks, I added CONFIG_VGA_CONSOLE option and rebuild kernel. Going to try it.

Added:

VGA_CONSOLE made no difference. The same black screen with a blinking white text cursor.

----------

## NeddySeagoon

Blind_Sniper,

Post the rest of the information I asked for and I'll look at it tomorrow.

----------

## mir3x

There is chance you have old configs stored in /boot 

( I dont know on what it depends )

----------

## mir3x

At quick look you miss SCSI disk support probably ( in device drivers, scsi dev support)

----------

## Blind_Sniper

Thanks for reply, mir3x

I tried to enable SCSI disk support but it doesn't help.

But now I have it bootable: I enabled CONFIG_PRINTK to be able to see what is going on. 

And added Intel ICH LPC support.

Now system boots but stops at login prompt. When I typing user name and password it just ignores it and asks for login over and over. Can't login neither as user nor as root.

But I can login as root in single user mode.

During the boot I see only one error message: "Call to flock failed"

Have no any Idea what it is. And how it's related to login problem

My current config : https://pastebin.com/AhcAaTqY

----------

## mir3x

You have kernel seeds to use as base for your kernel config eg. there https://forums.gentoo.org/viewtopic-p-8122476-highlight-.html#8122476

You are missing something from device drivers -> character devices -> ( CONFIG_VT , CONFIG_UNIX98_PTYS, VT_CONSOLE maybe?)

EDIT: NVM, I see you have it enabled, maybe it's CONFIG_DEVMEM=y, try just those seeds,as a base, it will be easier.

----------

## Hu

 *Blind_Sniper wrote:*   

> I accidentally deleted my beloved .config which I saved for a 8 last years, and now I have to restore it. If there is a way to restore it without /proc/config.gz please let me know.

 Restore it from a backup?

----------

## bammbamm808

Start with the config from the sysrescuecd, then use lspci, and so forth to tweak it?

----------

## Blind_Sniper

NeddySeagoon, it's a lspci output:

```
lspci -v

00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)

        Subsystem: ASUSTeK Computer Inc. 3rd Gen Core processor DRAM Controller

        Flags: bus master, fast devsel, latency 0

        Capabilities: [e0] Vendor Specific Information: Len=0c <?>

        Kernel driver in use: ivb_uncore

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])

        Subsystem: ASUSTeK Computer Inc. 3rd Gen Core processor Graphics Controller

        Flags: bus master, fast devsel, latency 0, IRQ 28

        Memory at f7800000 (64-bit, non-prefetchable) [size=4M]

        Memory at e0000000 (64-bit, prefetchable) [size=256M]

        I/O ports at f000 [size=64]

        [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]

        Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-

        Capabilities: [d0] Power Management version 2

        Capabilities: [a4] PCI Advanced Features

        Kernel driver in use: i915

        Kernel modules: i915

00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) (prog-if 30 [XHCI])

        Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family USB xHCI Host Controller

        Flags: bus master, medium devsel, latency 0, IRQ 24

        Memory at f7e00000 (64-bit, non-prefetchable) [size=64K]

        Capabilities: [70] Power Management version 2

        Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+

        Kernel driver in use: xhci_hcd

00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)

        Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family MEI Controller

        Flags: bus master, fast devsel, latency 0, IRQ 29

        Memory at f7e1a000 (64-bit, non-prefetchable) [size=16]

        Capabilities: [50] Power Management version 3

        Capabilities: [8c] MSI: Enable+ Count=1/1 Maskable- 64bit+

        Kernel driver in use: mei_me

        Kernel modules: mei_me

00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) (prog-if 20 [EHCI])

        Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family USB Enhanced Host Controller

        Flags: bus master, medium devsel, latency 0, IRQ 16

        Memory at f7e18000 (32-bit, non-prefetchable) [size=1K]

        Capabilities: [50] Power Management version 2

        Capabilities: [58] Debug port: BAR=1 offset=00a0

        Capabilities: [98] PCI Advanced Features

        Kernel driver in use: ehci-pci

00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)

        Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family High Definition Audio Controller

        Flags: bus master, fast devsel, latency 0, IRQ 30

        Memory at f7e10000 (64-bit, non-prefetchable) [size=16K]

        Capabilities: [50] Power Management version 2

        Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+

        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00

        Capabilities: [100] Virtual Channel

        Capabilities: [130] Root Complex Link

        Kernel driver in use: snd_hda_intel

        Kernel modules: snd_hda_intel

00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) (prog-if 00 [Normal decode])

        Flags: bus master, fast devsel, latency 0, IRQ 16

        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0

        Capabilities: [40] Express Root Port (Slot+), MSI 00

        Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-

        Capabilities: [90] Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family PCI Express Root Port 1

        Capabilities: [a0] Power Management version 2

        Kernel driver in use: pcieport

        Kernel modules: shpchp

00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) (prog-if 00 [Normal decode])

        Flags: bus master, fast devsel, latency 0, IRQ 17

        Bus: primary=00, secondary=02, subordinate=02, sec-latency=0

        Memory behind bridge: f7d00000-f7dfffff

        Capabilities: [40] Express Root Port (Slot+), MSI 00

        Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-

        Capabilities: [90] Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family PCI Express Root Port 2

        Capabilities: [a0] Power Management version 2

        Kernel driver in use: pcieport

        Kernel modules: shpchp

00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4) (prog-if 00 [Normal decode])

        Flags: bus master, fast devsel, latency 0, IRQ 19

        Bus: primary=00, secondary=03, subordinate=03, sec-latency=0

        I/O behind bridge: 0000e000-0000efff

        Memory behind bridge: f7c00000-f7cfffff

        Prefetchable memory behind bridge: 00000000f0000000-00000000f00fffff

        Capabilities: [40] Express Root Port (Slot+), MSI 00

        Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-

        Capabilities: [90] Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family PCI Express Root Port 4

        Capabilities: [a0] Power Management version 2

        Kernel driver in use: pcieport

        Kernel modules: shpchp

00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) (prog-if 20 [EHCI])

        Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family USB Enhanced Host Controller

        Flags: bus master, medium devsel, latency 0, IRQ 23

        Memory at f7e17000 (32-bit, non-prefetchable) [size=1K]

        Capabilities: [50] Power Management version 2

        Capabilities: [58] Debug port: BAR=1 offset=00a0

        Capabilities: [98] PCI Advanced Features

        Kernel driver in use: ehci-pci

00:1f.0 ISA bridge: Intel Corporation 7 Series Chipset Family LPC Controller (rev 04)

        Subsystem: ASUSTeK Computer Inc. 7 Series Chipset Family LPC Controller

        Flags: bus master, medium devsel, latency 0

        Capabilities: [e0] Vendor Specific Information: Len=0c <?>

        Kernel driver in use: lpc_ich

        Kernel modules: lpc_ich

00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) (prog-if 01 [AHCI 1.0])

        Subsystem: ASUSTeK Computer Inc. 7 Series Chipset Family 6-port SATA Controller [AHCI mode]

        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 26

        I/O ports at f0b0 [size=8]

        I/O ports at f0a0 [size=4]

        I/O ports at f090 [size=8]

        I/O ports at f080 [size=4]

        I/O ports at f060 [size=32]

        Memory at f7e16000 (32-bit, non-prefetchable) [size=2K]

        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-

        Capabilities: [70] Power Management version 3

        Capabilities: [a8] SATA HBA v1.0

        Capabilities: [b0] PCI Advanced Features

        Kernel driver in use: ahci

        Kernel modules: ahci

00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)

        Subsystem: ASUSTeK Computer Inc. 7 Series/C210 Series Chipset Family SMBus Controller

        Flags: medium devsel, IRQ 10

        Memory at f7e15000 (64-bit, non-prefetchable) [size=256]

        I/O ports at f040 [size=32]

        Kernel modules: i2c_i801

02:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01)

        Subsystem: AzureWave QCA9565 / AR9565 Wireless Network Adapter

        Flags: bus master, fast devsel, latency 0, IRQ 17

        Memory at f7d00000 (64-bit, non-prefetchable) [size=512K]

        Expansion ROM at f7d80000 [disabled] [size=64K]

        Capabilities: [40] Power Management version 2

        Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+

        Capabilities: [70] Express Endpoint, MSI 00

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [140] Virtual Channel

        Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00

        Kernel driver in use: ath9k

        Kernel modules: ath9k

03:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller (rev 06)

        Subsystem: ASUSTeK Computer Inc. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller

        Flags: bus master, fast devsel, latency 0, IRQ 25

        I/O ports at e000 [size=256]

        Memory at f0004000 (64-bit, prefetchable) [size=4K]

        Memory at f0000000 (64-bit, prefetchable) [size=16K]

        Capabilities: [40] Power Management version 3

        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+

        Capabilities: [70] Express Endpoint, MSI 01

        Capabilities: [b0] MSI-X: Enable- Count=4 Masked-

        Capabilities: [d0] Vital Product Data

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [160] Device Serial Number 48-17-38-25-68-4c-e0-00

        Kernel driver in use: r8169

        Kernel modules: r8169
```

I have all above kernel drivers built-in. I think it's no more relevant because I can boot now.

 *Hu wrote:*   

> Restore it from a backup?

 

If I'd have such a backup I wouldn't post my question here.

 *bammbamm808 wrote:*   

> 
> 
> Start with the config from the sysrescuecd, then use lspci, and so forth to tweak it?
> 
> 

 

I can do it as well as run genkernel all, but I'd like to have a bit optimized non-generic kernel

 *mir3x wrote:*   

> 
> 
> You have kernel seeds to use as base for your kernel config
> 
> 

 

This config (Pappys Config) doesn't boot at all (just kernel panic), I tried to use it "as is" and tried to combine with mine (Device drivers section) - no luck.

So right now my config at least boots. Seems it needs one or two options to be enabled.

Right now I'm getting some messages while booting, may be they are relevant to the login problem:

```
The futex facility returned an unexpected error code./lib64/rc/sh/init.sh: line 97: 

100 aborted grep -Eq "[[ :space: ]]+xents $" /proc/filesystems

The futex facility returned an unexpected error code./etc/init.d/dmcrypt: line 5: 

131 aborted grep -qs ^swap="${conf_file}"

The futex facility returned an unexpected error code./etc/init.d/lvm: line 14: 

168 broken pipe $ {lvm_path} dumpconfig global 2> /dev/null 

169 aborted: | grep -q 'use_lvmetad=1' 

Call to flock failed: Function not implemented
```

----------

## mir3x

OK i quickly googled flock and found right answer

Its FILE_LOCKING (Enable File POSIX Locking API)

No idea about failed logins, lets hope its the same issue.

----------

## Blind_Sniper

FILE_LOCKING doesn't help as well.

I scrolled kernel boot messages up (Shift+PageUp) and found some strange strings there:

```
This kernel doesn't have devtmpfs or tmpfs support, and there is no entry for /dev in fstab. This means /dev will not be mounted.

To avoid this message set CONFIG_DEVTMPFS or CONFIG_TMPFS to y in your kernel configuration.

...

...

...

...

CONFIG_DEVTMPFS=y is required in your kernel configuration file for this version of udev to run successfully
```

How can it be true, if I ran immediateley 

cat .config |grep TMPFS 

and got this output:

```
CONFIG_DEVTMPFS=y

CONFIG_DEVTMPFS_MOUNT=y

CONFIG_TMPFS=y

# CONFIG_TMPFS_POSIX_ACL is not set

# CONFIG_TMPFS_XATTR is not set
```

what's wrong with DEVTMPFS?

Or is it udev issue?

----------

## OldTango

 *Blind_Sniper wrote:*   

> FILE_LOCKING doesn't help as well.
> 
> I scrolled kernel boot messages up (Shift+PageUp) and found some strange strings there:
> 
> ```
> ...

 I haven't looked over your entire config but did notice several items you may need to enable depending on what packages you are or will be using. You should enable

```
# CONFIG_TMPFS_POSIX_ACL is not set
```

"POSIX Access Control Lists (ACLs) support additional access rights for users and groups beyond the standard owner/group/world scheme, and this option selects support for ACLs specifically for tmpfs filesystems.

If you've selected TMPFS, it's possible that you'll also need this option as there are a number of Linux distros that require POSIX ACL support under /dev for certain features to work properly. For example, some distros need this feature for ALSA-related /dev files for sound to work properly. In short, if you're not sure, say Y."

You may also need

```
# CONFIG_TMPFS_XATTR is not set
```

Do you use pulseaudio? If so

```
CONFIG_SND_HDA_PREALLOC_SIZE=64
```

 should be set to

```
CONFIG_SND_HDA_PREALLOC_SIZE=2048
```

----------

## ct85711

One thing to keep in mind when checking the kernel's config for stuff, the .config file in the kernel's sources is NOT necessarily the same as the running kernel's config.  This is especially easy to mix up, as you could very well be running a old kernel (often the /boot partition is not mounted by default), so it is easy to forget to make sure you mount that partition before you install the kernel.  You should always check the output of uname -a and make sure you are running the intended kernel.  That output will also tell you how many times the kernel was recompiled.

If you have the option set in the kernel (don't remember which one exactly right off hand), but you will have a config.gz file in your /proc which is the running kernel's config (very useful to know what the kernel is actual configured for).

----------

## Blind_Sniper

I enabled CONFIG_TMPFS_XATTR and CONFIG_TMPFS_POSIX_ACL but it doesn't help

I have no separate /boot partition, and I build kernel named "vmlinuz" to be sure that there is no any mix up with other kernels (they has names like kernel-X.XX.XX-gentoo).

I start checking for config options via zcat /proc/config.gz, so I checking it on a running kernel.

Every time I boot I check kernel creation date and time (uname -a) as well as I check it when I copy compiled kernel to /boot directory.

So there is no any mix up.

----------

## OldTango

 *Blind_Sniper wrote:*   

> I enabled CONFIG_TMPFS_XATTR and CONFIG_TMPFS_POSIX_ACL but it doesn't help
> 
> I have no separate /boot partition, and I build kernel named "vmlinuz" to be sure that there is no any mix up with other kernels (they has names like kernel-X.XX.XX-gentoo).
> 
> I start checking for config options via zcat /proc/config.gz, so I checking it on a running kernel.
> ...

 I am reasonably sure you will need "CONFIG_TMPFS_POSIX_ACL". Also you have several items turned off that I generally have enabled, some of which I believe are related to some of your errors during boot. I suggest enabling them or at least read the documentation before you decide to enable or disable any kernel settings. Sometimes the docs don't say much that's when you enlist the help of google or additional documentation. 

```
CONFIG_MULTIUSER is not set

CONFIG_SGETMASK_SYSCALL is not set

CONFIG_SYSFS_SYSCALL is not set

CONFIG_BASE_FULL is not set

CONFIG_FUTEX is not set

CONFIG_EPOLL is not set

CONFIG_SIGNALFD is not set

CONFIG_TIMERFD is not set

CONFIG_EVENTFD is not set

CONFIG_ADVISE_SYSCALLS is not set
```

 *Blind_Sniper wrote:*   

> This config (Pappys Config) doesn't boot at all (just kernel panic)

 

That would be very rare as I know he tests every seed before he releases them. They won't boot on your hardware until you configure them to do so. You would need to copy them into your kernel directory (if there is a .config there already remove it first) run

```
make silentoldconfig
```

 after that is done run

```
make menuconfig
```

Then make sure all your hardware is set up, save the config, then run your make commands.

I would advise you read the Kernel Upgrade Guide and pay close attention to the section Solving Build Problems first before trying any of the options I have offered.

----------

## Hu

 *Blind_Sniper wrote:*   

>  *Hu wrote:*   Restore it from a backup? If I'd have such a backup I wouldn't post my question here.

 You might if your backups were inconvenient to access (on tape, or stored off-site, ...) and you were hoping we had a more convenient method.  :Wink: 

----------

## Blind_Sniper

Finally I recreated config by running make defconfig and using it as a base.

After a sequence of tweaks I got a kernel 4.5 Mb of size. It's a good start point to deal with kernel in future

Thanks all for your efforts, really appreciate it.

----------

