ODROID-C2 mkinitcpio problem creating LUKS on LVM initramfs

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

ODROID-C2 mkinitcpio problem creating LUKS on LVM initramfs

Postby g000444555 » Thu Jul 27, 2017 4:00 pm

Hi,

I'm having problem with creating a bootable initramfs for LUKS encrypted root partition using mkinitcpio.

I am trying to encrypt the rootfs of the ArchLinux ODROID-C2 image using LUKS on LVM

According to instructions, I edited `/etc/mkinitcpio.conf`, and added `encrypt lvm2` BEFORE `filesystems` in `HOOKS`, and `xts sha512-generic dm-crypt dm-mod` to `MODULES`, as follows

$this->bbcode_second_pass_code('', '
MODULES="xts sha512_generic dm-crypt dm-mod"
HOOKS="base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck"
')

Then generated a new initramfs image (https://wiki.archlinux.org/index.php/Mk ... ypted_root)

$this->bbcode_second_pass_code('', '
# mkinitcpio -p linux-odroid-c2
==> Building image from preset: /etc/mkinitcpio.d/linux-odroid-c2.preset: 'default'
-> -k 3.14.79-27-ARCH -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 3.14.79-27-ARCH
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [autodetect]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [encrypt]
-> Running build hook: [lvm2]
==> ERROR: module not found: `dm_cache_smq'
-> Running build hook: [filesystems]
-> Running build hook: [keyboard]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> WARNING: errors were encountered during the build. The image may not be complete.
')

And edited `boot/boot.ini` to adjust the u-boot boot loader configuration to boot from the encrypted partition:

$this->bbcode_second_pass_code('', '
setenv bootargs "root=/dev/mapper/vg-root cryptdevice=/dev/mmcblk0p2:lvm rootwait ro ${condev} no_console_suspend hdmitx=${cec} ${forcergb} hdmimode=${m} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes elevator=noop disablehpd=${hpd} ${cmode} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam} net.ifnames=0"
')

When I reboot the screen is completely blank even though the blue led keeps blinking. The system does not boot.

Could you please let me know whether I'm missing something?
g000444555
 
Posts: 7
Joined: Thu Jul 27, 2017 3:45 pm

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby WarheadsSE » Thu Jul 27, 2017 9:29 pm

Have you hooked up a serial connection to see what the console outputs?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby g000444555 » Fri Jul 28, 2017 8:33 am

No, but I have a regular HDMI monitor connected to the ODROID-C2 and I would expect to at least see a prompt for entering the LUKS password to unlock the encrypted partition to boot from. However, upon reboot the console output is completely blank. I suspect I might be missing a MODULE or a HOOK inside /etc/mkinitcpio.conf but cannot spot any based on the documentation. Also, the "==> ERROR: module not found: `dm_cache_smq'" does not seem severe enough to justify the issue.
g000444555
 
Posts: 7
Joined: Thu Jul 27, 2017 3:45 pm

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby g000444555 » Thu Aug 03, 2017 2:52 pm

Hi WarheadsSE,

You did mention it but I didn't realize the serial connection outputs more information than HDMI (wasn't obvious to me at the time).
I just received my serial connector today, here is the console output.
I don't see any obvious error or any module missing.
Also, I have summarized my entire setup in this gist.
Let me know if you have any idea or any suggestion that I could try.

Kind regards
Georgios F.
g000444555
 
Posts: 7
Joined: Thu Jul 27, 2017 3:45 pm

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby ryu » Mon Aug 28, 2017 11:38 am

It looks like the initramfs doesn't even see your "bootargs". Would it make any difference if you changed it to something nonsensical?
ryu
 
Posts: 7
Joined: Thu Oct 13, 2016 7:13 am

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby g000444555 » Mon Aug 28, 2017 5:27 pm

Yes, when I set 'setenv bootargs "nonsense"' it does not "go" as far: https://gist.github.com/g000444555/03b3 ... 7867fd0107

Therefore, I would assume it does read the "bootargs". In fact, I use the exact same boot.ini as with the successful non-encrypted boot (https://gist.github.com/g000444555/3b1b ... 2b5740311c) but only change the beginning of the bootargs from

'setenv bootargs "root=/dev/mmcblk0p1 rootwait...'
to
'setenv bootargs "root=/dev/mapper/vg-root cryptdevice=/dev/mmcblk0p2:lvm rootwait...'
(also tried but had same outcome with 'setenv bootargs "luks.uuid=ae51db2d-0890-4b1b-abc5-8c10f01da353 root=/dev/mapper/luks-ae51db2d-0890-4b1b-abc5-8c10f01da353 rootfstype=ext4 rootwait...').
g000444555
 
Posts: 7
Joined: Thu Jul 27, 2017 3:45 pm

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby ryu » Tue Aug 29, 2017 7:17 am

Well, sorry about that.

You know, I got stuck at the same place you are now when I was trying to set up my C2 with LUKS (no prompt for a password, no attempt to mount the root partition, no errors). The initramfs made by mkinitcpio didn't get the message what it should do, I thought. That's when I decided to try out a different initramfs creation tool, namely dracut. The whole system works flawlessly ever since. Maybe mkinitcpio just doesn't work with (hardkernel's) U-boot and LUKS "out of the box".
ryu
 
Posts: 7
Joined: Thu Oct 13, 2016 7:13 am

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby g000444555 » Tue Aug 29, 2017 9:46 am

How did you install dracut? It's not available in AUR for the 'aarch64' architecture. Did you compile it from source?

$this->bbcode_second_pass_code('', '
pacaur -S dracut
:: Package dracut not found in repositories, trying AUR...
:: resolving dependencies...
:: looking for inter-conflicts...

AUR Packages (1) dracut-046-1
Repo Packages (8) asciidoc-8.6.9-3 cpio-2.12-3 dash-0.5.9.1-1 docbook-xml-4.5
-6 docbook-xsl-1.79.2-3 libxml2-2.9.4+99+g27f310d4-1 libxslt-1.1.29+42+gac341
cbd-1 python2-2.7.13-4

Repo Download Size: 14.43 MiB
Repo Installed Size: 95.07 MiB

:: Proceed with installation? [Y/n]

:: Retrieving package(s)...
:: dracut build files are up-to-date -- skipping
:: Checking dracut integrity...
==> ERROR: dracut is not available for the 'aarch64' architecture.

==> ERROR: An unknown error has occurred. Exiting...
:: failed to verify dracut integrity
')
g000444555
 
Posts: 7
Joined: Thu Jul 27, 2017 3:45 pm

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby ryu » Tue Aug 29, 2017 10:00 am

I just changed this line in dracut's PKGBUILD file from:
$this->bbcode_second_pass_code('', 'arch=("i686" "x86_64")')
to:
$this->bbcode_second_pass_code('', 'arch=("aarch64")')
while following the https://wiki.archlinux.org/index.php/AUR_User_Guidelines.
ryu
 
Posts: 7
Joined: Thu Oct 13, 2016 7:13 am

Re: ODROID-C2 mkinitcpio problem creating LUKS on LVM initra

Postby g000444555 » Wed Sep 06, 2017 6:42 am

Yes, dracut does work. And comparing to mkinitcpio it seems to output more messages helping you to diagnose when there's an issue. Thank you very much for the hint to use dracut and the information on how to install it.
g000444555
 
Posts: 7
Joined: Thu Jul 27, 2017 3:45 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 7 guests