Using an initrd

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Using an initrd

Postby pezz » Sat Sep 15, 2012 8:02 am

Hi there,

I was wondering if anyone had some information / documentation on what's needed, or whether it's even possible, to get an initrd image to load in order to do some pre-boot stuff?

I can create an image easy enough, but not sure if the normal images generated by mkinitcpio would even work, and where or how you specify to load it like you do in grub.cfg for a regular Linux system.

Love the distro though, runs great on my Pi.

Cheers.

- Pezz
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Using an initrd

Postby pezz » Sat Sep 15, 2012 11:24 am

Just read some kernel documentation, there's actually an initrd parameter, so I just added it to cmdline.txt:

$this->bbcode_second_pass_code('', '
smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 loglevel=2 initrd=/initramfs-linux.img root=/dev/mmcblk0p2 elevator=noop rootfstype=ext4 rootwait
')
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Using an initrd

Postby pezz » Mon Sep 17, 2012 10:35 am

Well, I've had a real go at this (I think), but I can't get it working.

Best I've done is making my own initrd.img, and using some guy's start.elf to get it to load:

http://www.raspberrypi.org/phpBB3/viewt ... 63&t=10532

Using this in config.txt:

$this->bbcode_second_pass_code('', '
disable_commandline_tags
ramfsfile=initrd.img
ramfsaddr=0x00a00000
initramfs initrd.img 0x00a00000
')

I get output at least.

Is there any way to get an initramfs working, just by using mkinitcpio, so I can use the hooks available in regular Arch Linux?

I'd love a clear explanation on how this all works, compared to a normal system ARM / RPi is just black magic.
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Using an initrd

Postby pezz » Mon Sep 17, 2012 10:49 am

Also, cmdline.txt has:

$this->bbcode_second_pass_code('', '
initrd=0xa00000,0x2b020c
')

Second arg is the length of my img.
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Using an initrd

Postby pezz » Thu Sep 20, 2012 9:00 am

In case anyone's interested - I got this working. Now booting off an encrypted root with passphrase entry over SSH with the dropbear_initrd_encrypt hook.

Very happy, and I'll provide more details if anyone is interested (do an Arch Wiki page?).

Also, can I just say, as I needed to compile a kernel and enable CONFIG_BLK_DEV_INITRD=y -- the availability of the PKGBUILD etc on Github, and the x-tools for distcc'ing to another box, helped immensely. Excellent instructions.

Wonderful work guys, bloody brilliant.
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Using an initrd

Postby pinoverclock » Mon Dec 31, 2012 2:25 pm

Hi, this is my very fisrt post at this forum, I've got my Raspberry Pi few days ago and i love having my favorite dristo running on it, Must say the dd'ing process is quite straightforward.
I tried to set lvm support at boot time so i included lm_mod module and lvm2 hook at /etc/mkinitcpio.conf file and tried to generate a kernel image with mkinitcpio the archlinux way, no luck so far... so i think i must be done in a completely different way.

Any hints?

Thank you very much :)
pinoverclock
 
Posts: 15
Joined: Mon Dec 31, 2012 2:05 pm

Re: Using an initrd

Postby gfvos » Wed Apr 03, 2013 2:24 pm

pezz, I hope you're still reading the forum.

For the love of god, PLEASE share the steps of how you did that, I've been ripping my hair out over this. Setting up encrypted root and dropbear_initrd_encrypt on several of my x64/x86 PCs wasn't a problem with arch's installer and wiki instructions, but I never managed to do the same on the raspberry pi.
gfvos
 
Posts: 7
Joined: Fri Jun 22, 2012 9:47 am

Re: Using an initrd

Postby pezz » Wed Apr 03, 2013 9:38 pm

A while ago, a kernel update completely broke the setup and I haven't had a chance to get back to it and set it up again.

I'll try and make some time this weekend to re-do it and post the results. I still have my config and kernel command line settings backed up, so hopefully it shouldn't take me too long to do it.

Sorry for not getting back to you.
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Using an initrd

Postby moonman » Thu Apr 04, 2013 8:25 am

Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Using an initrd

Postby pezz » Thu Apr 04, 2013 10:25 am

$this->bbcode_second_pass_quote('moonman', 'h')ttp://www.daves-collective.co.uk/raspi/notes.shtml


Yep, the key to it is updating your initrd and making sure that value is correct. (update - not true)

I think I was being unfair when I said a kernel update blew up my setup, my initrd was fine but I didn't fix the length of the image. (update - also not true)

Nevertheless, I'm working on some full instructions right now. There's a trick to mkinitcpio as well, which I will write down when I get to it.
Last edited by pezz on Thu Apr 04, 2013 1:23 pm, edited 2 times in total.
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 28 guests

cron