3 3
Tido

Le Potato - writing armbian to eMMC

Recommended Posts

Yep, thanks for the reminder. I'm familiar with creating those scr files.

 

I've been waiting for a loooooong time for the nand-sata-install command on the stock download you mentioned, I think it's stuck or something. Just sitting at "Counting files.....few seconds" for, oh maybe two hours now. I'm pretty sure it's not supposed to take that long. About to abort and see what command line options that command has to see if I can get a log file or something. 

 

I was originally using an older armbian image and had a similar experience with it, which was why I had tried balbes images, which worked great for that command. Not really sure what's going on with the stock Armbian command. Doing more investigating. 

Share this post


Link to post
Share on other sites

Hmm ok.  I have not been tracking the development/maintenance of the nand-sata-install, it took about 45 minutes for mine to get to the "reboot now" screen.  I was using a 4.18 Stretch build.

Share this post


Link to post
Share on other sites

I found a log in /var/log/nand-sata-install.log, it looks like it was looking for open files still when I aborted? I'm not sure what files might be missing.

 

Tue Sep 18 17:28:10 UTC 2018: Start nand-sata-install.


Old UUID:  UUID=763b6c65-4dfe-4e7b-8180-426b7298fddf
SD UUID:   UUID=dc031793-8691-4641-96a0-9520084fe3b0
UUID=763b6c65-4dfe-4e7b-8180-426b7298fddf
SATA UUID: UUID=dc031793-8691-4641-96a0-9520084fe3b0
eMMC UUID: UUID=dc031793-8691-4641-96a0-9520084fe3b0 ext4
Boot: $1 /dev/mmcblk0p1 ext4
Root: $2 /dev/mmcblk0p1 
Usage: 1007
Dest: 6781

/etc/fstab:
UUID=763b6c65-4dfe-4e7b-8180-426b7298fddf / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,nosuid 0 0

/etc/mtab:
/dev/mmcblk0p1 /mnt/nand-sata-install.jY1gTX/bootfs ext4 rw,relatime,data=ordered 0 0
/dev/mmcblk0p1 /mnt/nand-sata-install.jY1gTX/rootfs ext4 rw,relatime,data=ordered 0 0
/dev/mmcblk1p1 / ext4 rw,noatime,nodiratime,errors=remount-ro,commit=600 0 0
/dev/mmcblk1p1 /var/log.hdd ext4 rw,noatime,nodiratime,errors=remount-ro,commit=600 0 0
/dev/zram0 /var/log ext4 rw,relatime,block_validity,discard,delalloc,nojournal_checksum,barrier,user_xattr,acl 0 0

Files currently open for writing:

Trying to stop running services to minimize open files:

Checking again for open files:

Copying 37009 files to /dev/mmcblk0p1. Finishing full install to eMMC.

Checking again for open files:

Tue Sep 18 18:34:28 UTC 2018: Finished

 

This stock image appears to be using kernel 4.14, that was one difference with the balbes images in that they used the 4.19rc kernel. I'm not finding any man page nor any options calling the nand-sata-install command via -h, so I don't know if there's any way to turn up the debugging on it. 

 

I'm going to try getting internet to the device and doing apt upgrades on the sd card that I'm installing with, then re-running the nand-sata-install command, and seeing if that helps. 

Share this post


Link to post
Share on other sites

Yes, the Next images are 4.18, I will be turning my attention to 4.19 and it will eventually become the default image. I don't mess with the building if official images (honestly don't know if I can/how), so that will be Igor's decision.

Sent from my Pixel using Tapatalk

Share this post


Link to post
Share on other sites

Okay, so I left it running for a while, almost 4 hours. It was stuck in the same "checking for open files" spot. I think at this point I'm going to look up some docs and build a newer kernel for this before I proceed any further, that was one factor that seemed to have success at least with this. Also, my USB wifi dongle is an ath9k_htc device and there doesn't appear to be a driver pre-built with these images (I enabled non-free and installed the firmware-atheros package and there's still no kernel module for the device), so I'm going to try building that as a module as well.  

 

 

Side note, these emmc modules appear to have two extra 4MB devices glued on, showing in lsblk. I copied them off with DD to inspect with a hex editor to try to figure out what they are, but does anyone happen to know? I didn't see that in any docs. 

Share this post


Link to post
Share on other sites
4 minutes ago, sbc_chrisb said:

Also, my USB wifi dongle is an ath9k_htc device and there doesn't appear to be a driver pre-built with these images

Hmm, I see it is not enabled.  I will enable as module/build it to test for future, our other kernels have it.

 

5 minutes ago, sbc_chrisb said:

Side note, these emmc modules appear to have two extra 4MB devices glued on, showing in lsblk. I copied them off with DD to inspect with a hex editor to try to figure out what they are, but does anyone happen to know? I didn't see that in any docs. 

eMMC has a partition format unlike SD, so there is a boot and an environment partition, if I remember correctly.

Share this post


Link to post
Share on other sites

Whew. Okay, so that was a fun ride. 

 

My suspicions about the kernel were correct. I followed the docs to do a new kernel build for armbian, 4.18.19. I hadn't built a kernel or anything large like that in a while, really stress tested my AMD 8350. Either way, I got the new packages over onto the Potato, installed them (with a --force-all to get uboot to update, since it refuses initially). Then after another reboot, nand-sata-install completed successfully.

 

First boot without an SD card failed hard. Went back in with the SD card, mounted the emmc and mv'd the boot.cmd and scr files out of the way and put in the one Tony provided me above. Rebuilt the scr with mkimage. That did the trick, I'm now running on emmc now. Thanks for the help, Tony. 

 

To recap, the stock image is fine to install to emmc *if* you:

 

1. build a new 4.18 kernel, hopefully the next armbian release will be fine

2. run nand-sata-install

3. mount the emmc and modify the boot.cmd command *in the emmc boot dir* with the updated file linked above, then rebuild the scr with mkimage. NOTE: don't use the command in the bottom of the file directly, as it gives absolute paths for the files and since you're on the SD card the path is different. Use the following while in the boot dir of the emmc:

mkimage -C none -A arm -T script -d boot.cmd boot.scr

 

 

Share this post


Link to post
Share on other sites

Follow up post, in case anyone ends up here in searches on this topic. 

 

Once i had this working, I then repeated it using my original SD card install with what started out as an older version of Armbian, upgraded via apt. I had a few minor bumps I'm going to explain here.

 

1. The new kernel is a must. The stock kernel did not work, I had to reuse the 4.18.19 kernel packages I built before.

2. The updated boot script I keep mentioning has to be tweaked. It will try to use mmcblk1p1 for the root device, but on my board the mmc is mmcblk0. The device would not boot from mmc until I modified the boot.cmd to set the rootdev and rebuilt the scr.  I'm not sure if this is expected behaviour or not.

  

Share this post


Link to post
Share on other sites

Just a quick note here. Nand-sata-install utility works if you don't mess up with a system. On official images and on supported boards. For 3rd party I don't know and on Lepotato AFAIK we didn't get this far yet? (I could easily miss this)

 

@TonyMac32 Shell I rebuild all Lepotato images? Or later when bumped to 4.19.y?

Share this post


Link to post
Share on other sites

I think wait until 4.19, I was working with @sbc_chrisb to get an image with the typical Armbian package support (kernel/etc).  The updated boot script and a fresh 4.18 build can identify and install armbian to the eMMC without boot issues.  I assume the issue being seen by Chris has to do with the older image being updated, as you mentioned.

 

Just for sanity I booted my Le Potato up with only the eMMC present again to make sure.  ;-)  Rebuilt images should work, if you would want to test (assuming you have an eMMC...)

Share this post


Link to post
Share on other sites
58 minutes ago, TonyMac32 said:

Not expected, root dev should be modified in the armbianEnv.txt file.

Sent from my Pixel using Tapatalk
 

 

Okay, I might have goofed on something here. I'll fire it back up in a bit, revert my boot.cmd modification, and retest. 

 

I can confirm, with both an older armbian image that was upgraded via apt, and with a brand new image downloaded from the main site, that nand-sata-install does not work. The only way I got past that was rebuilding a newer 4.18.19 kernel, and uboot. After that, I required the use of Tony's updated boot.cmd in order to boot from it, it would not boot by default at all. 

Share this post


Link to post
Share on other sites
2 minutes ago, sbc_chrisb said:

After that, I required the use of Tony's updated boot.cmd in order to boot from it, it would not boot by default at all.  

 

Wouldn't boot from eMMC or from SD?  It should still work from SD with old boot script, just not from eMMC.

Share this post


Link to post
Share on other sites
1 minute ago, TonyMac32 said:

 

Wouldn't boot from eMMC or from SD?  It should still work from SD with old boot script, just not from eMMC.

 

Yes, sorry that statement is correct, it would still boot from SD which allowed me to go back in and fix it. I don't have the exact logs of that point but I believe that was when it was hanging at trying to remount the rootfs and failing, so it just sat there hung until I inserted the SD card. 

Share this post


Link to post
Share on other sites

OK, so, for you/anyone doing this before it's officially baked in:

 

Download 4.18 image

Build newest 4.18 kernel/u-boot

update boot script with the one currently in our repo

reboot (because of superstition)

run nand-sata-install

 

I would recommend being on the moderately advanced side before attempting it, unless you really want to experiment.

 

 

Share this post


Link to post
Share on other sites
1 hour ago, TonyMac32 said:

Not expected, root dev should be modified in the armbianEnv.txt file.

Sent from my Pixel using Tapatalk
 

 

 

Okay, so I reverted boot.cmd to your version, ie put the rootdev back to /dev/mmcblk1p1, then created armbianEnv.txt with the following line:

 

setenv rootdev "/dev/mmcblk0p1"

 

 

Rebuilt the scr. Rebooted. Fails to boot, this is the captured output:

Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for suspend/resume device
done.
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext4 (1) -- /dev/mmcblk1p1] fsck.ext4 -a -C0 /dev/mmcblk1p1 
LPotato_SD: clean, 13/1954064 files, 166731/7814912 blocks
done.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: No such file or directory
mount: invalid option --
done.
mount: No such file or directory
run-init: opening console: No such file or directory
Target filesystem doesn't have requested /sbin/init.
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
run-init: opening console: No such file or directory
No init found. Try passing init= bootarg.
(initramfs) 

 

So, while on a fresh Armbian image the boot.cmd you posted works completely 100% as is, when using an older image that was updated via apt and etc seems to require me to directly change the cmd and rebuild scr. 

 

Unless I'm doing something wrong with the ArmbianEnv.txt, which is entirely possible. I'm not really familiar with that file. 

Share this post


Link to post
Share on other sites

No worries, I just wanted to confirm what you asked. I have it working with the tweak so I'm happy at this point. I'm also working on restoring an old TRS-80 Color 1 right now so I understand the distraction :) 

Share this post


Link to post
Share on other sites

I was trying to use this eMMC today (SD cards boots 4.14.y and 4.19.y OOB) and I am getting a bit confused ... Is DDing from X to Y prevent starting Android and we can boot this way from SD card ... and then installing Armbian to eMMC? Is that not working or what?

Share this post


Link to post
Share on other sites

Ah, I did "the wrong thing" very early on and dd'd garbage over the boot sector to kill Android.  Then you can boot SD.  There is also an Amlogic download tool I've never used...

Share this post


Link to post
Share on other sites

Agreed, I was pulling my hair out trying to install to mmc with any image as it would not flush the partitions, until I finally just tried dd'ing an armbian image directly to the mmc module, which flushed out the Android stuff, and then from there I did the stuff I mentioned in my posts. I could not get any installation to work while the Android stuff was present. Even with balbes' instructions, none of it worked until I used dd.

Share this post


Link to post
Share on other sites

The Amlogic flash tools will be relevant when discussing La Frite as well, should we support it (I think the S805X is to the S905X what the H2+ is to the H3). I'll need to review their function (I actually plugged the eMMC in during boot of the SD to get it in a position where I could work with it the first time, not a fun task)

Sent from my Pixel using Tapatalk

Share this post


Link to post
Share on other sites

I do not follow this topic, so I just saw that there are problems. Because LePotato does not have a default u-boot on the eMMC, it is sufficient to use the u-boot-2018 installation mode (described in the instructions) to install my images on the eMMC.

 

Forgot to add, since LePotato has its own version of u-boot-2018, you need to use the file from it. I know that's the file @Neil Armstrong has.

Share this post


Link to post
Share on other sites

I've read the whole thread and only understand about 50% of it.  To summarize is there a relatively easy way to get the current stable Armbian Stretch (4.14y) to boot from eMMC on the Le Potato?

 

I have it working on a Tinkerboard S but the darn thing only goes about two minutes at 100% before throttling in the Pi-Top V2 case I'm using.  The Le Potato I've stressed for several hours in the same case and it remained full speed but I'd rather it run off of the eMMC if possible.  If not I'll just run off of SD for now since it sounds like the next bump will have a way to do it that doesn't require super kernel kung fu powers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
3 3