Clearfog Boot from M.2 SSD

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

Clearfog Boot from M.2 SSD

Postby Toxcity » Mon Oct 19, 2020 8:34 pm

Hey all,
Does anyone know what modifications are required to the installation instructions to allow a Clearfog A388 to boot Arch from an M.2 SSD rather than the SD card?

I've followed the instructions found here: https://archlinuxarm.org/platforms/armv ... l/clearfog

Using those instructions I've been able to boot from an SD card but doing the same to an M.2 SSD and it fails, most likely because the u-boot loader is for MMC and there is a separate one for "SATA". I've downloaded the latest u-boot and flashed that but boot fails. I don't fully understand the boot process but it looks like the sd_fusing script also flashes an environment file. It's hard to read in it's current format.

Any ideas on how to make better use of the storage options this mini computer provides? It's a shame that the instructions only take into account SD Cards. Would be ace be able to boot from M.2 and update the instructions with the option.

Thanks!
Nic
Toxcity
 
Posts: 5
Joined: Mon Oct 19, 2020 8:26 pm

Re: Clearfog Boot from M.2 SSD

Postby moonman » Tue Oct 20, 2020 4:39 am

There is a newer U-Boot available from solidrun https://images.solid-build.xyz/A38X/U-Boot/ and instructions here https://developer.solid-run.com/knowled ... d-binaries

I wasn't able to boot from sata with only version 2013.01 available at the time, but it is possible 2018 will work.
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: Clearfog Boot from M.2 SSD

Postby Toxcity » Tue Oct 20, 2020 8:15 am

Thanks for the reply!
Yep, I've tried the latest u-boot binary and manually dd it to the the start of the SSD but that's where I got stuck. I don't fully understand how to get the Clearfog to then boot Arch.

The Clearfog boots into the new u-boot version and gets stuck.
Toxcity
 
Posts: 5
Joined: Mon Oct 19, 2020 8:26 pm

Re: Clearfog Boot from M.2 SSD

Postby moonman » Wed Oct 21, 2020 3:04 am

I haven't looked at 2018 version yet, but you should be able to change the uboot environemnt or uboot script to get archlinux arm to boot up if the defaults don't work with our fs layout/kernel naming.
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: Clearfog Boot from M.2 SSD

Postby Toxcity » Wed Oct 21, 2020 9:35 am

Is it as simple as getting u-boot to load the zimage file?
Sorry for the stupid questions, I honestly don't understand the u-boot boot process and am struggling to find the default process documented anywhere.
Toxcity
 
Posts: 5
Joined: Mon Oct 19, 2020 8:26 pm

Re: Clearfog Boot from M.2 SSD

Postby Toxcity » Wed Oct 21, 2020 8:39 pm

Been having a play and so far this is what I've got:

$this->bbcode_second_pass_code('', 'setenv bootcmd "run loaduenv; run startboot"
setenv bootdir "/boot"
setenv bootfilez "zImage"
setenv console "ttyS0,115200"
setenv loadaddr "0x2000000"
setenv fdtaddr "0x5F00000"
setenv fdt_high "0x07a12000"
setenv fdtdir "/boot/dtbs"
setenv fdtfile "armada-388-clearfog-base.dtb"
setenv root "/dev/sda1"
setenv genbootargs 'setenv bootargs console=\${console} root=\${root} rw rootwait \${optargs}'
setenv loadkernel ext4load scsi 0:1 \${loadaddr} \${bootdir}/\${bootfilez}
setenv loadfdt ext4load scsi 0:1 \${fdtaddr} \${fdtdir}/\${fdtfile}
setenv loaduenv 'echo Checking for: \${bootdir}/uEnv.txt ...; if test -e scsi 0:1 \${bootdir}/uEnv.txt; then ext4load scsi 0:1 \${loadaddr} \${bootdir}/uEnv.txt; env import -t \${loadaddr} \${filesize}; echo Loaded environment from \${bootdir}/uEnv.txt; echo Checking if uenvcmd is set ...; if test -n \${uenvcmd}; then echo Running uenvcmd ...; run uenvcmd; fi; fi;'
setenv startboot 'date reset; run genbootargs; run loadkernel; run loadfdt; bootz \${loadaddr} - \${fdtaddr}'
saveenv
reset
')

This amazingly boots the kernel but then the kernel panics with the following error:
Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.

Why is this kernel option required all of a sudden? How does the original mmc boot commands not have the same issue?
Last edited by Toxcity on Thu Oct 22, 2020 7:16 pm, edited 2 times in total.
Toxcity
 
Posts: 5
Joined: Mon Oct 19, 2020 8:26 pm

Re: Clearfog Boot from M.2 SSD

Postby Toxcity » Wed Oct 21, 2020 10:09 pm

I think I spotted the issue. Looks like the root file system is missing symlinks.

Yep, with the root filesystem sorted I was able boot into Arch. Now to make the boot commands "nicer" and call it a day. :)

Done!
I've updated the code snippet with my final boot commands. So to summarise:

Copy the latest bootloader to the start of the SSD:
$this->bbcode_second_pass_code('', '
dd if=./u-boot-clearfog-base-sata.kwb of=/dev/sda bs=512 seek=1
')

Set the dip switches to:
1 - ON
2 - ON
3 - ON
4 - OFF
5 - OFF

Connect up a USB Console and interrupt the automatic boot.
Run the script in the code snippet from my earlier post.

Tada!
Toxcity
 
Posts: 5
Joined: Mon Oct 19, 2020 8:26 pm


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 8 guests