LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   mkinitrd problem with kernel 4.19.0 (https://www.linuxquestions.org/questions/slackware-14/mkinitrd-problem-with-kernel-4-19-0-a-4175640974/)

pchristy 10-23-2018 09:26 AM

mkinitrd problem with kernel 4.19.0
 
I have two machines running -current (64 bit) with Eric's KDE5. The old machine in my workshop, I use as a test hack before upgrading my main machine in case of any "gotchas". The old machine uses Lilo to boot, and the new machine, being UEFI, uses elilo.

I upgraded the old machine to the new 4.19.0 kernel without problems. However, on the EFI machine, when I run mkinitrd, I get the following:

Code:

root@MyMachine:/boot/efi/EFI/Slackware# mkinitrd -c -k 4.19.0 -m ext4
OK: /lib/modules/4.19.0/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/4.19.0/kernel/fs/mbcache.ko added.
OK: /lib/modules/4.19.0/kernel/fs/ext4/ext4.ko added.
cp: cannot stat '/lib/udev/rules.d/root@MyMachine.1275': No such file or directory
48433 blocks
/boot/initrd.gz created.

The machine fails to boot, with what seems like a failure to mount the root (ext4) partition.

What is that "root@MyMachine.1275" file? there is nothing like that in the rules.d folder on either machine!

I normally roll my own kernels with ext4 built in, and therefore don't need an initrd, but I can't see why one machine works fine, but not the other!

All suggestions gratefully received!

--
Pete

brobr 10-23-2018 09:45 AM

Hi, I normally run mkinitrd in /boot and then copy the initrd.gz to the efi partition. It looks like you ran it in the efi partition where there is no initrd-tree that is normally used to make the image. Maybe it's using your old initrd on the efi partition as a source and then finds something that's normally not there...

hth

rob

chrisVV 10-23-2018 09:52 AM

What kernel do you have in /boot/efi/EFI/Slackware, and in particular is it the same as the vmlinuz image in /boot (it should be)? If it isn't, you may have got an old kernel image installed in /boot/efi/EFI/Slackware - see https://www.linuxquestions.org/quest...nt-4175640970/. (Equally, it may be nothing to do with that.)

pchristy 10-23-2018 10:14 AM

I've definitely got the same kernel in both /boot/ and /boot/efi/EFI/Slackware. When the system boots, when elilo runs, the second line appears to say that it can't find /boot/initrd.gz. The message is so subliminal that I've had to reboot a few times to make it out!

I thought maybe it needed the vfat module loading as well as ext4 (the efi partition needs to be vfat), so I made a new initrd with both modules, but that hasn't worked either. I've put the initrd.gz in both /boot (which is where mkinitrd places it) and /boot/efi/EFI/Slackware, to no avail.

The file is definitely there - not a symlink - but for some reason, the system can't read it when booting!

Luckily, I've got my old kernel, so I can still run that. I'm sure its something to do with that strange "cannot stat" message I get when running mkinitrd, but I have no idea what is causing it!

--
Pete

phenixia2003 10-23-2018 10:51 AM

Hello,

can you post the output of :
Code:

$ bash -x mkinitrd -c -k 4.19.0 -m ext4
--
SeB

pchristy 10-23-2018 12:33 PM

1 Attachment(s)
Hi SeB,

That command produces a LOT of output. It falls outside the scroll-back of the window! I tried redirecting it to a file, which only produces the following lines:

Code:

OK: /lib/modules/4.19.0/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/4.19.0/kernel/fs/mbcache.ko added.
OK: /lib/modules/4.19.0/kernel/fs/ext4/ext4.ko added.
/boot/initrd.gz created.
Be sure to run lilo again if you use it.

I've attached the long version as a txt file. It doesn't go right back to the command, I'm afraid. Too long, and redirecting it to a text file only produces the short version for some reason (I'm not a programmer!).

Using your command seems to stop it producing the error for some reason, but it still doesn't work!

If you have any suggestions how to capture the entire output, I'll try again. I just appended > mkinitrd_long.txt to your command.

Cheers,

--
Pete

pchristy 10-23-2018 01:20 PM

Cracked it! I had set
Code:

initrd=/boot/initrd.gz
in elilo.conf as per the mkinitrd instructions. As soon as I set it to
Code:

initrd=initrd.gz
(I had initrd.gz in both locations) it all started to work!

It appears ELILO doesn't like the initrd.gz file being anywhere other than in the same folder as the kernel!

A lesson learned, and thanks for the suggestions!

Still don't know what that "cannot stat" statement was about, but it looks like it was a red herring!

Cheers,

--
Pete

phenixia2003 10-23-2018 01:20 PM

Hello,

Quote:

Originally Posted by pchristy (Post 5918382)
Hi SeB,

That command produces a LOT of output. It falls outside the scroll-back of the window! I tried redirecting it to a file, which only produces the following lines:

Code:

OK: /lib/modules/4.19.0/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/4.19.0/kernel/fs/mbcache.ko added.
OK: /lib/modules/4.19.0/kernel/fs/ext4/ext4.ko added.
/boot/initrd.gz created.
Be sure to run lilo again if you use it.


the message(s) printed on stderr are missing. Run the command below, then attach the produced file (ie. /tmp/mkinitrd.log) :

Code:

$ bash -x mkinitrd -c -k 4.19.0 -m ext4 &>/tmp/mkinitrd.log
With that, the message "cp: cannot stat '...'" should be present in /tmp/mkinitrd.log which could help to figure out why mkinitrd try to copy a file that does not exist.


--
SeB

pchristy 10-23-2018 01:42 PM

1 Attachment(s)
Here you go (see attached file). The error show up around line 1108. But I seem to have solved the problem now, anyway.

Thanks for your help!

--
Pete


All times are GMT -5. The time now is 11:52 AM.