Is a ramdisk being re-generated by default lately?

Ask questions about Arch Linux ARM. Please search before making a new topic.

Is a ramdisk being re-generated by default lately?

Postby phovos » Sat Mar 11, 2017 1:09 am

Hello,

I have been using linuxarm on an rpi for some months now and because I need some extra modules in order to have the filesystem on an lvm disk, I have been using a ramdisk (initrd).

Now every time I update the kernel I am re-generating one using "mkinitcpio" since my understanding has been so far that auto generation is not supported on arm branch.

However I noticed a little while ago that the system has created an "initramfs-linux.img" file on "/boot".

Does this mean that the system now automatically generates the ramdisk and i don't have to do it manually anymore?

Thanks,
phovos
 
Posts: 6
Joined: Sat Mar 11, 2017 12:58 am

Re: Is a ramdisk being re-generated by default lately?

Postby graysky » Sat Mar 11, 2017 9:52 am

Yes, it generates by itself... did you not diff /boot/config.pacnew? Also when did you ever have to manually do it?
graysky
 
Posts: 356
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Is a ramdisk being re-generated by default lately?

Postby phovos » Sun Mar 12, 2017 12:30 am

The ramdisk was created by editing the "mkinitcpio.conf" and adding the relevant hooks (lvm2 etc).

Then
Code: Select all
# mkinitcpio -g /boot/initrd

Subsequently added the following line

Code: Select all
initramfs initrd 0x01f00000

to "/boot/config.txt",

and added the following

Code: Select all
root=/dev/mmcblk0p1 initrd=0x01f00000 rootfstype=ext4

to "/boot/cmdline.txt".

Just to let you know know exactly what I had done so far.

Since then in every kernel update I had been regenerating it by

Code: Select all
mkinitcpio -c /etc/mkinitcpio.conf -g /boot/initrd -k KERNEL_VERSION

and this is because I read somewhere, can't locate where exactly, that the system in arm won't do it by itself. Perhaps I misread something but I had done it diligently so far out of fear of failing to boot.

No I did not check the differences, could you elaborate?
phovos
 
Posts: 6
Joined: Sat Mar 11, 2017 12:58 am

Re: Is a ramdisk being re-generated by default lately?

Postby phovos » Wed Mar 22, 2017 2:47 pm

To follow up,

I run diff between those two files and they were not the same. However when built the hooks appear to be identical and this makes sense as they use the same mkinitcpio config file.

Since it now appears to be compiling an image by itself, how can I make sure that the machine boots with the automatically generated one?

EDIT

OK to answer my own question this seems to be determined by config.txt on /boot .

The current one looks like this:

Code: Select all
# See /boot/overlays/README for all available options

gpu_mem=16
initramfs initrd 0x01f00000

#Overclocking
arm_freq=800
arm_freq_min=400
sdram_freq=500
sdram_freq_min=250
core_freq=300
core_freq_min=150
#over_voltage=1

#raspi-config 'Medium' settings
#arm_freq=900
#core_freq=250
#sdram_freq=450
#over_overvoltage=2


There is also another file config.txt.pacnew that was created by an update I don't recall right now, but it was about the time initramfs-linux.img appeared. Its contents are the following:

Code: Select all
# See /boot/overlays/README for all available options

gpu_mem=64
initramfs initramfs-linux.img followkernel


I do remember running across "followkernel" which starts loading modules after kernel has loaded whereas "0x01f00000" explicitly instructs at which point to start loading them and which might cause trouble if the size of the kernel gets bigger at some point.

Anyway I am guessing that merging these two files is the answer to my question.
phovos
 
Posts: 6
Joined: Sat Mar 11, 2017 12:58 am

Re: Is a ramdisk being re-generated by default lately?

Postby phovos » Thu Mar 23, 2017 4:46 pm

Another question.

My "cmdline.txt" presently looks like this:

Code: Select all
root=/dev/rpistorage/root initrd=0x01f00000 rootfstype=ext4 rw rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop


If I am to switch to "initramfs-linux.img" as stated above this has to be changed as well to that:

Code: Select all
root=/dev/rpistorage/root initramfs-linux.img=followkernel rootfstype=ext4 rw rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop


Any objections to that?

In any case I kept a backup of these files and I am going to report when I do a reboot.
phovos
 
Posts: 6
Joined: Sat Mar 11, 2017 12:58 am

Re: Is a ramdisk being re-generated by default lately?

Postby phovos » Mon Apr 03, 2017 7:35 pm

Just to report for those who land on this page at some point that the above are correct.

To those who might be wondering 'followkernel' option works fine.
phovos
 
Posts: 6
Joined: Sat Mar 11, 2017 12:58 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 3 guests