The following is a guide that was written by AlexT_Intel during the time we were working on release 2 at Intel. It was adapted from some internal projects we were playing around with, and we'd like to share it with the community. Let me know if there are any typos or technical issues; it has been gone through pretty extensively, but there's always a chance an error still lives. Thank you Aleksandr for adapting this guide, and I hope those of you who are interested find it useful as well.
Boot with rootfs on external storage
This article describes a way to boot an Edison board with the Root Filesystem on an external storage (SD card or USB stick). The kernel and bootloader remain on the local eMMC. For now, we are not able to boot a kernel from an external storage. The article assumes certain level of familiarity with Linux and file systems.
Prepare External Storage
You need to have a SD card or USB stick formatted with ext4 file system to store your root file system (do not use FAT/FAT32 for that).
user@linux:~/Downloads/unpacked-image$ lsdnx_fwr_saltbay_pr2.bin edison_ifwi-dbg-02-dfu.bin edison-image-edison.ext4 package-list.txtdnx_osr_saltbay_pr2.bin edison_ifwi-dbg-03.bin edison-image-edison.hddimg pft-config-edison.xmledison_dnx_fwr.bin edison_ifwi-dbg-03-dfu.bin filter-dfu-out.js pft-config-mcg_sku.xmledison_dnx_osr.bin edison_ifwi-dbg-04.bin flashall.bat u-boot-edison.binedison_ifwi-dbg-00.bin edison_ifwi-dbg-04-dfu.bin flashall.sh u-boot-edison.imgedison_ifwi-dbg-00-dfu.bin edison_ifwi-dbg-05.bin flash.log u-boot-envsedison_ifwi-dbg-01.bin edison_ifwi-dbg-05-dfu.bin ifwi_saltbay_pr2.binedison_ifwi-dbg-01-dfu.bin edison_ifwi-dbg-06.bin ifwi_saltbay_pr2-dfu.binedison_ifwi-dbg-02.bin edison_ifwi-dbg-06-dfu.bin ota_update.scr user@linux:~/Downloads/unpacked-image$ mkdir Rootfs user@linux:~/Downloads/unpacked-image$ sudo mount ./edison-image-edison.ext4 Rootfs[sudo] password for user:
user@linux:~/Downloads/unpacked-image$ sudo cp -a Rootfs/* /media/8f88dd49-95ac-4d0c-8c3a-abd445f87fa1/
3. Your SD card is now ready to bootFind out the SD card device name
On a running Edison board, plug your formatted SD card and get the device name:root@edison:~# dmesg |tail -n 10[ 6.387683] g_multi gadget: high-speed config # 2: Multifunction with CDC ECM[ 6.522733] EXT4-fs (mmcblk0p5): mounted filesystem without journal. Opts: discard,barrier=1,data=ordered,noauto_da_ac[ 7.375959] systemd-fstab-generator: Checking was requested for "rootfs", but it is not a device.<span style="font-s...
I've followed these directions, but I put the edison-image-edison.ext4 from ubilinux on the sdcard instead of the one from yocto. Now eMMC contains the latest yocto image, sdcard contains ubilinux. I'm getting stuck at "Starting kernel" and have the following output:
Starting kernel ...
[ 1.667678] pmic_ccsm pmic_ccsm: Error reading battery profile from battid frmwrk
[ 1.676164] pmic_ccsm pmic_ccsm: Battery Over heat exception
/bin/sh: 0: can't access tty; job control turned off
Any clues as to what might be going wrong?
Well, you're trying to use Debian's rootfs with vanilla Yocto-produced kernel - that won't work that easily (and shouldn't )
If your goal is to run Ubilinux from SD card at will - you better go through the Ubilinux' install guide and modify it appropriately (I haven't used it myself to be able to advice meaningfully, sorry).
Or just ask in the Ubilinux thread as MPayne suggested, the adjustment should be fairly trivial in this case.
I am new to the Edison board and this might be a stupid question, how can i go back to the eMMc boot mode? I don't think we can just unplug the sd card because in the environment variables it is set to boot from sd card, right?
If you want it back permanently, run the below (double-check the UUID to match the one for your case):root@edison:~# fw_setenv myrootfs 'PARTUUID=012b3303-34ac-284d-99b4-34e03a2335f4'
If you want to switch to eMMC just occassionally, during the boot, on the serial console, when it prompts to press a key to stop booting, press that any key and then run the below command in the U-Boot command prompt that appears:run do_boot_emmc
If you switch to booting from eMMC as the default (per the first part of the above), then you can occassionally boot from SD card by running the below from the U-Boot command prompt:run do_boot_sdcard
chewcheik, Fiordi, actually the formatting of that step is a bit broken, so the command itself isfw_printenv |grep mmc-bootargs=
and the rest is the output you should see. The " the below is a single line" comment was added because in the original place (can't recall right now whether that was an internal wiki page or a WOrd document) even such a short one was split between two lines, so I had to denote that. In this forum the formatting engine is different and it's not splitting lines.
Try with that correction and it should be ok for you. MPayne, could you please correct that in the post?
Can you point me how to using the Gparted in window?
Today I try using Yumi multi-boot run Goparted and I format my SD card to .ext4 but I do not know how to insert my edison-image-edison.ext4 into this SD card.
I try to put my .ext4 file into the SD card before I change the SD card format. Since, when changing the SD card format it will format my SD card. Hence, my file is gone.
I not good in linux based but need my Edison stand-alone with upload arduino coding.
I don't think there's a Windows version of GParted. I just put it onto the bootable USB stick according to GParted instructions on preparing a liveUSB and booted my [usually Windows-driven] laptop using the USB stick, did the formatting and rebooted back into Windows.
Now my computer in dual boot environment windows and ubuntu.
I have a problem, I already format my SD card to .ext4 but I cannot copy or paste any file into it (inside Ubuntu).
When I format back the SD card to fat32 both environments also can copy or paste the file.
Therefore, I cannot complete the user@linux:~/Downloads/unpacked-image$ sudo cp -a Rootfs/* /media/MINE SD CARD UUID/
Do you face this problem before?
Thank you and have a nice day.
Nope, that would actually be strange - if you're on Linux and it sees your SD card and it's formatted to ext4, you should be able to copy files there. If you get any errors while trying to do that - posting a screenshot, log or even short video would be helpful for the community to help you.
If you wanna boot Edison from sdcard with ubilinux or debian os in it, you have to modify the u-boot variables at boot command prompt.
To modify, U-Boot env variables, u-boot and u-boot-tools packages are available in Debian repo. The tools fw_printenv/fw_setenv in u-boot source tree normally work with MTD partitions but they don't support MMC. For more info, please follow the below post.
Well, that's a ubilinux-specific thing and this thread is dedicated to a completely different matter.
So please just start a new thread, but generally I think it's just because ubilinux names interfaces differently - try running "ifconfig -a" to see what is there.