Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initramfs out of sync after kernel update #88

Closed
ianhinder opened this issue Aug 16, 2014 · 17 comments
Closed

initramfs out of sync after kernel update #88

ianhinder opened this issue Aug 16, 2014 · 17 comments

Comments

@ianhinder
Copy link

When upgrading the kernel package (linux-image-rpi-rpfv) the initramfs in /boot will be replaced (and named after the new version), but the config.txt file will still point to the old version. This may prevent booting, as the initramfs will contain modules for the previous kernel version.

A minimal workaround would be to update the README to tell users to modify /boot/config.txt to point to the new initrd.img-X.XX-X-rpi at the same time as copying their /vmlinuz to /boot/kernel.img.

I think a better solution would be to treat the initramfs like the kernel; i.e. you would have initrd.img in config.txt, and instructions in the README to copy /initrd.img to /boot/initrd.img. [This would duplicate the initramfs (4.4 M), just as the kernel (2.1 M) is duplicated, but there seems to be plenty of space on /boot currently.]

@goranche
Copy link
Contributor

I'll have a look at this and try to figure something out...
first have to find a way to convince my raspbian to use an older version of the kernel/firmware packages 💭

@diederikdehaas
Copy link
Member

When you build a new image, change the kernel version in update.sh and build.sh to 3.10-3-rpi.
When you specify linux-image-3.10-3-rpi instead of linux-image-rpi-rpfv at https://github.com/debian-pi/raspbian-ua-netinst/blob/master/scripts/etc/init.d/rcS#L297 (on master), the resulting image will have kernel version 3.10-3-rpi. You can them force/simulate an upgrade to linux-image-3.12-1-rpi by installing that package. When you reboot, and don't change anything, you'll boot into the 3.10 kernel though.
You can then force the 3.12 kernel and/or initramfs by specifying them in /boot/config.txt like this:

kernel=vmlinuz-3.12-1-rpi
initramfs initrd.img-3.12-1-rpi followkernel

source
The linux-image-rpi-rpfv package is just a meta package which now depends on linux-image-3.12-1-rpi, whereas it depended on linux-image-3.10-3-rpi before. See also this issue.

@goranche
Copy link
Contributor

I was hoping to be able to change the version without reinstalling 👼
oh well...

@diederikdehaas
Copy link
Member

You can do that too. Install linux-image-3.10-3-rpi and copy the resulting vmlinuz file to /boot/kernel.img or (probably better) specify the kernel you want in /boot/config.txt and reboot.

@goranche
Copy link
Contributor

makes sense, now that I know that linux-image-rpi-rpfv is just a meta package...
I'll see what I can do with this later tonight

@goranche
Copy link
Contributor

what do you suggest should happen in these two scenarios:

  • a new kernel package gets installed (keep in mind it doesn't need to be a newer kernel than the one already installed)

    should the script put the newly installed kernel into config.txt no matter what or check if there is a newer kernel and rather use that... I'm kinda leaning towards "set no matter what"

  • the currently active kernel get's removed (not likely, but can happen)

    the only sensible thing to do in this case (as far as I can tell) is to find the newest remaining kernel and configure that one...

    what if there is no kernel left?

@goranche
Copy link
Contributor

well, there is also the possibility of asking the user, I guess, given that it's reasonably certain, that he's at the console, looking at the screen, right? 💭

although I don't really like this option 😊

@ianhinder
Copy link
Author

I think when a new kernel is installed, there should be a post-action which copies the kernel as kernel.img and the initramfs as initrd.img. config.txt would point to these, and wouldn't have to be changed. So the last-installed kernel would always be the active one. Would that work, or would there be some problem that I'm not seeing? The official Raspbian installation must address this somehow; the only difference is that they don't use an initramfs, but we can do whatever they do for the kernel, but with the initramfs as well.

@goranche
Copy link
Contributor

of course, that's also a possibility... and actually might be the safest/best (and easiest to implement) one...

I was trying to avoid making multiple copies and waste space
it's unfortunate that hard links are not supported on the FAT filesystem

@goranche
Copy link
Contributor

works (well, seems to, at least) like a charm
and I'm currently running a system with no kernel package installed 😎
(BTW: apt-get complains and asks if you're sure when removing the running kernel)

@diederikdehaas what branch would you like to put this in? v1.0.x?

@diederikdehaas
Copy link
Member

I haven't seen any code yet (or played) with it, but the answer is a topic branch 😉

@goranche
Copy link
Contributor

well... when I'm on a roll, I'm not waiting for replies 😁
I've created a new branch of of v1.0.x and commited the change to rcS... haven't tested a full install yet

@goranche
Copy link
Contributor

oh look... sorry, posted just as you replied 👼

also... just as a warning... don't play around with a system that has no kernel package installed...
the kernel package contains the modules needed for hardware access as well... sigh

@diederikdehaas
Copy link
Member

LOL, looks like you read my mind :-P

@goranche
Copy link
Contributor

😄 well, heading home... there I'll be able to try a full install

@goranche
Copy link
Contributor

seems to work just fine... PR waiting for review 😉

@diederikdehaas
Copy link
Member

You are on a roll 👍
Will review it soon, but already got a few beers so it won't be tonight 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants