Community
cancel
Showing results for 
Search instead for 
Did you mean: 
3,241 Views

How to boot Edison from an SD card (Linux)

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).

 

  1. On your desktop computer with Linux installed, using GParted (http://gparted.org/ http://gparted.org/), format your SD card using ext4 filesystem. If you only have a Windows system, then easiest approach would be to prepare a bootable USB stick with GParted Live USB image (see instructions on their website on how to do that).
  2. Download and unpack the Edison OS image from the Software Downloads section of the community (/docs/DOC-23242 Edison - Software Downloadshttp://www.intel.com/support/edison/sb/CS-035180.htm Intel® Edison Boards and Compute Modules — Software Downloads). In the unpacked directory (with the "flashall.sh" script) run the following commands to prepare the SD card. They mount the Yocto-generated .ext4 rootfs image and copy the contents onto the SD card (be sure to be root to do that). If you are using Windows machine, copy that image file to the USB stick during its preparation.

user@linux:~/Downloads/unpacked-image$ ls

dnx_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 boot

Find 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[174]: Checking was requested for "rootfs", but it is not a device.<span style="font-s...
17 Replies
Beginner
228 Views

Hi MPaye,

thanks a lot for this very usefull guide. I have a question:

at the point 1 of the "Boot the board using SD card", I don't understand verry well if I have to replace something in the command (if so, what?)

Here's what I get when I run it as well as:

I have to learn a lot of this stuff.

Novice
228 Views

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?

 

228 Views

I haven't tried that use case much. You may have better luck asking on the Emutex forums.

AlexT_Intel may have some experience with this as well.

0 Kudos
Honored Contributor II
228 Views

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.

0 Kudos
Community Manager
228 Views

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?

Honored Contributor II
228 Views

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
New Contributor I
228 Views

Hi Fiordi,

I also faced this problem may I know how you solve it.

Thank you very much

Honored Contributor II
228 Views

chewcheik, Fiordi, actually the formatting of that step is a bit broken, so the command itself is

fw_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?

0 Kudos
New Contributor I
228 Views

Hi AlexT_Intel,

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.

Thank you.

0 Kudos
Honored Contributor II
228 Views

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.

0 Kudos
New Contributor I
228 Views

Hi,

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.

 

0 Kudos
Honored Contributor II
228 Views

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.

0 Kudos
Beginner
228 Views

Hello,

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.

http://sarweshcr.blogspot.in/2015/11/Boot-Intel-Edison-from-SD-card-with-Debian-or-Ubilinux.html http://sarweshcr.blogspot.in/2015/11/Boot-Intel-Edison-from-SD-card-with-Debian-or-Ubilinux.html

Beginner
228 Views

i have boot from SD card . but i have a problem. i write : ifup wlan0 . it doesn't work.

Honored Contributor II
228 Views

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.

0 Kudos
Valued Contributor II
228 Views

Hi,

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.

it is possible to boot a kernel from an external FAT32 storage:

BR,

xbolshe

0 Kudos
Valued Contributor II
228 Views

Yeah. Below you may find some pictures how Linux kernel and rootfs boot from a SD card:

SD card has only 3 files:

BR,

xbolshe

0 Kudos