Open main menu

DAVE Developer's Wiki β

Changes

DESK-XZ7-L/Deployment/Standalone boot

2 bytes added, 12:27, 21 November 2022
Create the SD card partitions
==== Create the SD card partitions ====
* Boot the system via SD or NFS as described in the e [[(<KIT>)#Quick_start_guide|Quick start guide]]
* SD device has to be partitioned and properly formatted choosing the <code>file system</code> for each partition
* an example of SD partitioning script is the following one:
# partition size in MB
BOOTLOAD_RESERVERESERVED=8
BOOT_ROM_SIZE=128
RFS_SIZE=2048
# calculate partition sizes
boot_start=`expr ${BOOTLOAD_RESERVERESERVED} \\* 1024 \\* 1024 / 512`
boot_size=`expr ${BOOT_ROM_SIZE} \\* 1024 \\* 1024 / 512`
rfs_start=`expr ${boot_size} + ${boot_start}`
# format the SDCARD partition
echo "formatting boot"
mkfs.vfat -F 32 -n boot BOOT ${node}${part}1
echo "formatting rfs"
mkfs.ext4 -F ${node}${part}2 -Lrfs
<pre class="workstation-terminal">
rootvdk@boravagrant:~# /desk-xz-l$ sudo ./sdcard-partition.sh /dev/mmcblk2sdcSD total size: 3776KB[ 1341.905014] mmcblk2: p1 p27580KB
Checking that no-one is using this disk right now ... OK
Disk /dev/mmcblk2sdc: 37.7 41 GiB, 3959422976 7948206080 bytes, 7733248 15523840 sectorsDisk model: STORAGE DEVICE
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical):[ 1341.922729] mmcblk2: p1 p2 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa77eb3f00xd775a452
Old situation:
Device Boot Start End Sectors Size Id Type/dev/mmcblk2p1 sdc1 2048 8192 15523839 15515648 264191 7.4G 262144 128M c b W95 FAT32 >>> Created a new DOS disklabel with disk identifier 0x3f242b9b./dev/sdc1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 128 MiB./dev/mmcblk2p2 264192 4458495 4194304 2G 83 sdc2: Created a new partition 2 of type 'Linux' and of size 2 GiB.Partition #2 contains a ext4 signature./dev/sdc3: Done.
>>> Created a new DOS disklabel with disk identifier 0xcce0c36f.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 128 MiB.
/dev/mmcblk2p2: Created a new partition 2 of type 'Linux' and of size 2 GiB.
/dev/mmcblk2p3:
New situation:
Disklabel type: dos
Disk identifier: 0x3f242b9b
Device Boot Start End Sectors Size Id Type/dev/mmcblk2p1 sdc1 16384 278527 262144 128M c W95 FAT32 (LBA)/dev/mmcblk2p2 sdc2 278528 4472831 4194304 2G 83 Linux
The partition table has been altered.
Syncing disks.
formatting boot
mkfs.fat 34.0.28 1 (20152017-0501-1624)mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
formatting rfs
mke2fs 1.43-WIP 45.5 (1807-MayJan-20152020)Discarding device blocks/dev/sdc2 contains a ext4 file system labelled 'rfs' created on Mon Nov 21 13:14: done20 2022
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 9a685543cc691ca0-1af21eb4-4e394ff9-83f387cc-b8a32248c021da74f9e91685Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
rootdvdk@boravagrant:~# /desk-xz-l$
</pre>
 
Then, insert the SD card in the target and boot the system via SD or NFS as described in the e [[(<KIT>)#Quick_start_guide|Quick start guide]]
* create a mount point and mount the first partition
* copy boot image files
<pre class="workstation-terminal">root@bora:~# cp images/linux/BOOT.BIN /mnt/sdroot@bora:~# cp images/linux/image.ub /mnt/sdroot@bora:~# cp images/linux/boot.scr /mnt/sd
</pre>
8,256
edits