You are not logged in.
I try to compile a kernel myself and boot into it, and I use virtualbox to test it. (arch guest inside my arch host) I first copy /proc/config.gz of my guest system to the linux source code directory, rename it to .config, and just compile it. After that I copy the image under arch/x86/bzImage to /boot directory, then I follow the instruction given by the arch wiki to create an entry in grub. Here is my /etc/grub.d/40-custom:
#!/bin/sh
exec tail -n +3 $0
menuentry 'Custom Entry' {
set root=(hd0,msdos1)
echo 'Loading Modified Linux'
linux /boot/vmlinuz-modified
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
}following is this command:
grub-mkconfig -o /boot/grub/grub.cfgBut after reboot I cannot boot into the new kernel, it shows "unable to mount root fs on unknown-block(0,0):
https://img.vim-cn.com/e5/5227d8d4cc07c … ce81ee.png (choose "Advanced Option for Archlinux-> With Linux Modified")
https://img.vim-cn.com/a9/12869edfbbca1 … 649380.png (choose "Custom Entry" on the first page directly)
I have searched for a while but didn't find a solution. Is there anything I'm doing wrong, please?
Last edited by Frefreak (2015-05-07 10:48:05)
Offline
that panic (not syncing: VFS: blabla) on boot means it can't mount your root fs for some reason.
Usually this happens if you're missing modules for your disk device, or filesystem.
Did you check that they got built and added to the initramfs?
Offline
I first copy /proc/config.gz of my guest system to the linux source code directory, rename it to .config, and just compile it.
You did decompress the .gz file first, right?
The ArchWiki advises using:
zcat /proc/config.gz > .confighttps://wiki.archlinux.org/index.php/Ke … rst-timers
Why not just use `make localmodconfig`?
Jin, Jîyan, Azadî
Offline
that panic (not syncing: VFS: blabla) on boot means it can't mount your root fs for some reason.
Usually this happens if you're missing modules for your disk device, or filesystem.
Did you check that they got built and added to the initramfs?
Do I need to use mkinitcpio to make a new initramfs for my own kernel image? I use the one generated when I newly install the system. I didn't modify the source code and the tutorial I read didn't mention it...
Offline
Do I need to use mkinitcpio to make a new initramfs for my own kernel image?
Yes.
https://wiki.archlinux.org/index.php/Ke … l_RAM_disk
Or you could compile a kernel that doesn't need an initramfs.
EDIT: If you do that, remove the "initrd" section from your boot loader/manager configuration.
Last edited by Head_on_a_Stick (2015-05-07 10:00:10)
Jin, Jîyan, Azadî
Offline
Frefreak wrote:I first copy /proc/config.gz of my guest system to the linux source code directory, rename it to .config, and just compile it.
Why not just use `make localmodconfig`?
It's because I'm compiling on my host system, not in the guest's(too slow).
I think I did decompress it, if I remember correctly. (I actually built it several times)
Last edited by Frefreak (2015-05-07 12:05:46)
Offline
Frefreak wrote:Do I need to use mkinitcpio to make a new initramfs for my own kernel image?
Yes.
https://wiki.archlinux.org/index.php/Ke … l_RAM_diskOr you could compile a kernel that doesn't need an initramfs.
EDIT: If you do that, remove the "initrd" section from your boot loader/manager configuration.
Ok, I'll rebuild everything from the beginning later.
Offline
I think I did compress it, if I remember correctly. (I actually built it several times)
I am referring to /proc/config.gz -- this is a gzip archive and needs to be decompressed before you can use it to compile your kernel image.
Jin, Jîyan, Azadî
Offline
Frefreak wrote:I think I did compress it, if I remember correctly. (I actually built it several times)
I am referring to /proc/config.gz -- this is a gzip archive and needs to be decompressed before you can use it to compile your kernel image.
Yep, I checked again in my source code directory, and it's a ASCII text file.
Offline
Frefreak wrote:I think I did compress it, if I remember correctly. (I actually built it several times)
I am referring to /proc/config.gz -- this is a gzip archive and needs to be decompressed before you can use it to compile your kernel image.
This isn't strictly true, it just makes the process easier because you're starting with a sane .config (assuming you're booted into one of Arch's official kernels at least). You can start from scratch, but you need to know what you're doing.
Ok, I'll rebuild everything from the beginning later.
No need to rebuild everything, just generate an initramfs for the custom kernel. The initramfs contains modules that are specific to a the kernel image that they were generated for; this is probably why /boot/initramfs-linux.img isn't working for you.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Although there's an error about fail to load_modules something when booting( related to vbox guest modules ), it can now boot into the system successfully!
In fact I missed two things:
1. "make install_modules", I totally forgot this...
2. generate an initramfs image for the new kernel, if I don't do the first one, this will also fail (invalid module directory blablabla)
Thanks for all you guys timely help!
Last edited by Frefreak (2015-05-07 16:50:55)
Offline