Changes

Jump to: navigation, search

MISC-TN-004: Running Debian (armbian) on SBCSPG

1,726 bytes added, 14:17, 29 July 2019
Deploying the root file system onto the target
==Deploying the root file system onto the target==
This procedure consists of the following steps:
*Mount the <code>.img</code> file
*Copy the root file system to a microSD card
*Move the microSD card to the target
*Configure the target in order to mount the ''armbian'' root file system from the microSD card.
 
It is assumed that there is an ext4 partition on the microSD card large enough to cointain the ''armbian'' root file system, which is about 900MB.
 
To mount the <code>.img</code> file, issue the following commands.
<pre class="board-terminal">
sudo kpartx -v -a Armbian_5.91_Sbcspg_Debian_stretch_default_.img
</pre>
If this operation is completed succesfully, you'll see something like this:
<pre class="board-terminal">
# ll /dev/mapper/
total 0
drwxr-xr-x 2 root root 80 lug 29 11:52 ./
drwxr-xr-x 21 root root 4440 lug 29 15:50 ../
crw------- 1 root root 10, 236 lug 29 11:41 control
lrwxrwxrwx 1 root root 7 lug 29 11:52 loop18p1 -> ../dm-0
</pre>
And then:
<pre class="board-terminal">
sudo mkdir /mnt/tmp
sudo mount /dev/mapper/loop18p1 /mnt/tmp/ -o ro
</pre>
As <code>root</code>, copy the files from <code>/mnt/tmp/</code> to the desired partition into the microSD card.
 
After copy operation is finished, unmount the microSD card and move it to the target.
 
To configure the SBCSPG to mount the root file system from this partition, several options are available. The following example shows how the U-Boot environment variables were set to retrieve the Linux kernel image and the device tree blob (DTB) via Ethernet, while the file system is mounted from the microSD card. In practice, an ad hoc variable⁠—named <code>net_mmc</code> was added:
<pre class="board-terminal">
=> print net_mmc
net_mmc=run loadk loadfdt mmcargs addip addcons addmisc; if run configid_fixupfdt; then bootm ${loadaddr} - ${fdtaddr}; fi
=> edit mmcroot
edit: /dev/mmcblk0p4 rootwait rw
</pre>
 
The following section shows the full boot process.
===log===
<pre class="board-terminal mw-collapsible mw-collapsed">
U-Boot 2016.03-rialto-1.1.2 (Jan 17 2019 - 15:10:28 +0100), Build: jenkins-Rialto_U-Boot-10
Normal Boot
Hit any key to stop autoboot: 0
=> print net_mmc
net_mmc=run loadk loadfdt mmcargs addip addcons addmisc; if run configid_fixupfdt; then bootm ${loadaddr} - ${fdtaddr}; fi
=> edit mmcroot
edit: /dev/mmcblk0p4 rootwait rw
=> run net_mmc
FEC0 Waiting for PHY auto negotiation to complete...... done
4,650
edits

Navigation menu