I'm having a problem to boot my system, because the initramfs which should get its values from /proc/cmdline, such as the root device, isn't able to obtain any value, and that's because this file is empty. How can i fix this?

About: LFS Linux 4.19.80 Syslinux (although the same happens with Grub)

  • It might be that parameters are passed in device tree or that booting parameters are hardcoded. Does /proc/config.gz exist? – Arkadiusz Drabczyk Nov 6 '19 at 22:36
  • no, there's no /proc/config.gz, but i'm using the pre-compiled libre-linux from freesh, and in their site they give the config: linux-libre.fsfla.org/pub/linux-libre/freesh/configs/4.19/… – MayAccer Nov 6 '19 at 22:47
  • 1
    At least with grub, you would expect to end up with a line like linux /filename1 param1 param2 param3 and a second initrd /filename2 to tell grub to load a kernel from filename1 and the initial ramdisk from filename2. The param1 param2 param3 stuff would go into memory and be accessed by the /proc/cmdline file. So are you providing this information, either by the commands you are giving to grub directly or via the grub.cfg file? – icarus Nov 6 '19 at 23:41
  • I'm not using grub, but i tried with it passing the arguments in the grub shell: linux (hd0,x)/boot/vmlinuz-4.19-80 flags; initrd (hd0,x)/boot/initrd-4.19-80; boot But the flags didn't appeared inside /proc/cmdline, which was empty – MayAccer Nov 7 '19 at 0:23
  • You're within initramfs, so have you mounted the /proc filesystem yet at this point? – telcoM Nov 7 '19 at 7:08

I discovered the problem, /proc/cmdline has a size equal to zero, and the cat(1) utility was optimized to use stat/mmap instead of read/write (the last one would be able to print the content).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.