Using a initrd

Raspberry Pi 2

Using a initrd

Postby Faerbit » Tue Apr 07, 2015 2:01 pm

Hi,

I'm trying to get my RPi2 running from an encrypted arch root. I successfully did this with two x86 arch installs, but I have no idea how to do this with alarm. I can boot from an unencrypted ext4 partition with no problems. However if I try to boot from my encrypted boot not much happens. From all I can gather it doesn't seem to use the initrd image I provided. All it does is to bring up the ethernet port and waiting for the root, which of course will never arrive if it doesn't use the initrd.
I generated the image with mkinitcpio -g. I then tried various combinations using the generated image with cmdline.txt and config.txt.
I tried putting initramfs and several ram addresses into config.txt and then reading from it with initrd=${ram_address}, also with and without a hexadecimal length added, as a kernel parameter in the cmdline.txt.
I also tried putting the file name directly in the cmdline.txt(initrd=${image}).
However nothing I did changed anything.
Is the raspberry pi 2 signigicantly different from the raspberry pi 1? Is using a initrd supported yet? If, how do I do it?

Faerbit
Faerbit
 
Posts: 4
Joined: Tue Apr 07, 2015 1:49 pm

Re: Using a initrd

Postby moonman » Tue Apr 07, 2015 8:46 pm

Don't know for sure if rpi2 is the same in this regard, but I would assume it should be. The syntax in config.txt is this
$this->bbcode_second_pass_code('', 'initramfs initrd 0x<address hex>')
Note there is no '=' sign
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 a initrd

Postby Faerbit » Tue Apr 07, 2015 8:49 pm

And in the cmdline.txt you just put $this->bbcode_second_pass_code('', 'initrd=0x<adress hex>') Is the position of the parameter important? Because I tried that and it didn't work.
Faerbit
 
Posts: 4
Joined: Tue Apr 07, 2015 1:49 pm

Re: Using a initrd

Postby moonman » Tue Apr 07, 2015 8:53 pm

Cmdline does not need to be altered
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 a initrd

Postby Faerbit » Wed Apr 08, 2015 4:59 pm

This is my setup:
$this->bbcode_second_pass_code('', 'fab@arch-fab /mnt/boot % ls
bcm2709-rpi-2-b.dtb* cmdline.txt* cmdline.txt.usb* fixup.dat* fixup_x.dat* kernel7.img* start.elf* start_x.elf*
bootcode.bin* cmdline.txt.crypt* config.txt* fixup_cd.dat* initrd* overlays/ start_cd.elf*
fab@arch-fab /mnt/boot % cat cmdline.txt
cryptdevice=/dev/mmcblk0p2:root:allow-discard root=/dev/mapper/root rw rootwait lang=de locale=de_DE.UTF-8 ip=dhcp console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop
fab@arch-fab /mnt/boot % cat config.txt
# Uncomment some or all of these to enable the optional hardware interfaces
# Params:
# i2c_arm Set to "on" to enable the ARM's i2c interface
# (default "off")
# i2c_vc Set to "on" to enable the i2c interface
# usually reserved for the VideoCore processor
# (default "off")
# i2c_arm_baudrate Set the baudrate of the ARM's i2c interface
# (default "100000")
# i2c_vc_baudrate Set the baudrate of the VideoCore i2c interface
# (default "100000")
# i2c_baudrate An alias for i2c_arm_baudrate
# i2s Set to "on" to enable the i2s interface
# (default "off")
# spi Set to "on" to enable the spi interfaces
# (default "off")
# act_led_trigger Choose which activity the LED tracks.
# Use "heartbeat" for a nice load indicator.
# (default "mmc")
# act_led_activelow Set to "on" to invert the sense of the LED
# (default "off")
# act_led_gpio Set which GPIO pin to use for the activity LED
# (in case you want to connect it to an external
# device)
# (default "16" on a non-Plus board, "47" on a
# Plus or Pi 2)
# pwr_led_trigger
# pwr_led_activelow
# pwr_led_gpio
# As for act_led_*, but using the PWR LED.
# Not available on Model A/B boards.
# N.B. It is recommended to only enable those interfaces that are needed.
# Leaving all interfaces enabled can lead to unwanted behaviour (i2c_vc
# interfering with Pi Camera, I2S and SPI hogging GPIO pins, etc.)
# Note also that i2c, i2c_arm and i2c_vc are aliases for the physical
# interfaces i2c0 and i2c1. Use of the numeric variants is still possible
# but deprecated because the ARM/VC assignments differ between board
# revisions. The same board-specific mapping applies to i2c_baudrate,
# and the other i2c baudrate parameters.

#device_tree_param=i2c_arm=on
#device_tree_param=i2c_vc=on
#device_tree_param=i2s=on
#device_tree_param=spi=on
#device_tree_param=act_led_trigger=mmc

#
# See /boot/overlays/README for a detailed list and description of additional
# overlays and their configuration options.
#

# Uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# Uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# Uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# Uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# Uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# Uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# Uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# Uncomment to set monitor mode to DMT
#hdmi_group=2

# Uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# Uncomment for composite PAL
#sdtv_mode=2

# Uncomment to overclock the ARM core. 700 MHz is the default.
#arm_freq=800

# for more options see http://elinux.org/RPi_config.txt

## Some over clocking settings, governor already set to ondemand

##None
#arm_freq=700
#core_freq=250
#sdram_freq=400
#over_voltage=0

##Modest
#arm_freq=800
#core_freq=300
#sdram_freq=400
#over_voltage=0

##Medium
#arm_freq=900
#core_freq=333
#sdram_freq=450
#over_voltage=2

##High
#arm_freq=950
#core_freq=450
#sdram_freq=450
#over_voltage=6

##Turbo
#arm_freq=1000
#core_freq=500
#sdram_freq=500
#over_voltage=6

gpu_mem=64

initramfs initrd 0x00800000
')

Did I do something stupid?
Faerbit
 
Posts: 4
Joined: Tue Apr 07, 2015 1:49 pm

Re: Using a initrd

Postby moonman » Wed Apr 08, 2015 8:04 pm

Try different address
Initramfs initrd 0x02f00000
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 a initrd

Postby Faerbit » Wed Apr 08, 2015 10:00 pm

That worked. Thanks. But it needs over a minute to boot because it first initalizes the random pool before it loads the initrd.
But now I've got another problem: I can't get the early ssh to work(dropbear and encryptssh hook). It either hangs on the net hook or if I leave that out(like some tutorials do) it hangs on the dropbear hook.
Faerbit
 
Posts: 4
Joined: Tue Apr 07, 2015 1:49 pm


Return to Broadcom

Who is online

Users browsing this forum: No registered users and 3 guests