You are not logged in.

#1 2013-03-07 18:27:03

camarao
Member
Registered: 2013-01-29
Posts: 27

[SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

Hi, I got into an dead end. Two days ago I was trying to solve some small annoying problems (ethernet driver, dkms not compiling automatically and difference in time hwclock and software clock) with my recent arch installation. I started with the time difference problem, for which I followed some solutions which I found in the internet, but all for no avail. So I postponed this for later and started to tackle the ethernet driver problem (Atheros AR8161) [https://wiki.archlinux.org/index.php/Ne … ros_AR8161]. I followed all described steps, I also did  the mentioned hack. After all, I turned my note at work off and at home on and surprise it found the GRUB menu, I started the option for the system, the disk was checked but, no system came up. It even messed up my window8 system as well. But that is now up and working. After windows came back GRUB was loading and I can start it from GRUB, but not Arch.

I looked at the grub menu and as far as I could see and understand everything was pointing and the right direction. So I supposed that during the network driver compilation and module load, something went wrong with the images or images source (if they are important for booting). So reading around I got pointed to how to rebuild the kernel images (http://riskofruin.markmccracken.net/201 … image.html). I know the blog title is kreepy... but the procedure sounds very logic, correct and quite strait forward. So I got the latest Arch image, put it on an usb stick and chroot into my installed system.

When I started the /sbin/depmod I immediately got an error saying that two files where missing for the kernels 3.7.9-2-ARCH. Well as far as I remember my installed system has the latest kernel (3.7.10-1-ARCH). So I though to update my pendrive system and so restart an both kernels would be equal. After restarting, I repeated al chroot protocol and then I saw that I still had the wrong kernel images. I suspect why, but I am not sure, may be the system is all memory loaded when it is booted up? Also, if I saw right, even the images are quite different (pendrive and harddrive). I surfed around to see how can I, in an chroot environment, where the hardrive installed system has an different kernel from the booted system, generate new kernel images for the hardrive system, soin a hope that  I can initialize my hardrive installed system? Is there someone that could guide me through this?

PS.: Remember I suppose the problem is in the kernel, I do not not how to check for sure.

Last edited by camarao (2013-03-10 03:10:56)

Offline

#2 2013-03-07 18:41:40

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

Tl; dr.  Can you summarize your problem in a few sentences?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2013-03-07 20:39:15

camarao
Member
Registered: 2013-01-29
Posts: 27

Re: [SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

1. Installed  (Atheros AR8161) [https://wiki.archlinux.org/index.php/Ne … ros_AR8161] driver.
2. shutdown notebook - turned on notebook
3. GRUB - menu available
4. disk check runs
5. system does not come up
6. Note in dual boot with win8
7. Win8 starts fine from GRUB
8. tried through chroot recompile kernel following description in this link http://riskofruin.markmccracken.net/201 … image.html
9. /sbin/depmod returned error (see previous message) probably due to different kernels (arch-2013-03-01 = 3.7.9.2 / broken system = 3.7.10.1).
10. question how to recompile kernel images from the broken system in a chroot environment?

Is that ok?

PS.: sorry for being so extensible in my previous message.

Last edited by camarao (2013-03-07 20:45:26)

Offline

#4 2013-03-07 21:04:07

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

8. and 10. Use the Arch CD and the instruction on the beginners guide to do the compilation/recovery.

Advice - Use two kernels: one unmodified (ARCH kernel) and perhaps one from the AUR of a different name.  This way you always have a way in without booting from a CD.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2013-03-07 23:44:49

camarao
Member
Registered: 2013-01-29
Posts: 27

Re: [SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

Hei graysky,

thanks a lot. I've checked quickly and didn't find compilation/recovey in the beginners guide.

After I posted the last message, I changed my keyword search strategy and found somewhere the command;

#mkinitcpio -c /etc/mkinitcpio-custom.conf -g /boot/linux-custom.img

could it be that if I am in the chroot environment the "-c" option could be directed to the /etc/mkinitcpio.conf of the broken system and "-g" the local where the image should be saved?

can that be done with depmod as well?

well once more thanks a lot.

Offline

#6 2013-03-08 00:56:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,575
Website

Re: [SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

Are you trying to compile your own kernel, or just build and initramfs?  mkinitcpio is for the latter (and more common, more likely) process.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2013-03-08 17:37:22

camarao
Member
Registered: 2013-01-29
Posts: 27

Re: [SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

Hi Trilby,

No, just the initramfs. Because I think when I tryed to install my Atheros AR8161 drive I guess that something went wrong with the image or it could be something else.

Do you think the vmlinuz-linux should also be reconstructed?

Yesterday at night I found in the internet, someone using the "-k" option, of mkinitcpio, and pointing to the /boot/vmlinuz.linux directory. So if I understood well mkinitcpio using the options "-k", "-c" and "-g" you can point where to put the reconstructed images, vmlinuz and the initramfs, according to the "-c" pointed mkinitcpio.conf. This would allow me to reconstruct both images for the broken system which are from a different kernel version, than the one used to boot up and repair the broken system.

Two last questions:

1. Is it necessary to run /sbin/depmod before reconstructiong the images, as mentioned in the link (http://riskofruin.markmccracken.net/201 … image.html)?
2. Will the two new images be automatically replaced in /boot?

Sorry for asking this, but IT is just an hobby for me, and my IT knowledge is limited to what I read and understand. I like adventures and sometime dangerous one as well, I learn a lot. But if sometimes I can get a small help I like.

Well thanks for everything

Offline

#8 2013-03-10 03:09:29

camarao
Member
Registered: 2013-01-29
Posts: 27

Re: [SOLVED-in-PART] recompiling kernel images, boot diferent from chroot

Well just an last update,

I found out how to run depmod and mkinitcpio for a system that uses a different kernel version from that used to initialize and rescue a system.

depmod should be run (as root, obviously) like;

#depmod <kernel version you want to create dependency list>

# mkinitcpio -k </path/_to_/kernel version>

But I found also a much more simple way to do it, just reinstall the kernels. this for an newbee is much more easier just do it with pacman, yaourt or whatever package manager you use:

yaourt -S linux

you should do this after chroot. Reinstalliing the kernel will rebuild all the images listed in the mkinitcpio config file.

Don't forget to connect your booted system to the network and copy the resolv.conf to your chroot environment.

Unfortunately it does not seem that my problem booting problem has to do with broken images, because after all hassle the system still does not start.

Thanks to all that helped me.

Offline

Board footer

Powered by FluxBB