Sometimes, your device has limited access (no keyboard, network, etc … ), and we need to update eMMC storage content automatically. What did we need? Just prepare a special removable disk
These features can work from SD / USB removable disk
BOARD.*.emmc.img.zst
put into root on 2n SD
partition with label dump
Stored into rescue/config/autoinstall
on 1st SD
partition with label rescue
BOARD.image_name[.BYTES-bytes].img.[zst|gz] [-sBYTES] [-r] # BOARD board name [ VIM1 | VIM2 | VIM3 | VIM3L | Edge | Edge2 | VIM1S | VIM4 ] # .BYTES-bytes write size limitation tag # -sBYTES write size limitation parameter # -r resize fs parameter
VIM3.hg_1.0.emmc.img.zst
VIM3.hg_1.0.emmc.img.zst -s15634268160
VIM3.hg_1.0.emmc.img.zst -s15634268160 -r
VIM3.hg_1.0.15634268160-bytes.emmc.img.zst -r
~$ echo VIM3.hg_1.0.emmc.img.zst -s15634268160 > /config/autoinstall ~$ krescue.configs -s
~$ krescue.configs -p | grep autoinstall
config_autoinstall="VIM3.hg_1.0.emmc.img.zst -s15634268160"
~$ cat /config/autoinstall
VIM3.hg_1.0.emmc.img.zst -s15634268160
~$ rm /config/autoinstall && krescue.config -s
Also can setup write size by image filename *.SIZE-bytes.*
Dump images created automatically with bytes tag, and better continue use this tag as is
can write only 11100000000 bytes for example
tail -c+11100000000 VIM3.hg_1.0.emmc.img | hexdump -C
root@localhost:~# df / Filesystem 1K-blocks Used Available Use% Mounted on /dev/rootfs 14779408 5847484 8741216 41% / root@localhost:~# resize2fs /dev/rootfs resize2fs 1.45.5 (07-Jan-2020) Filesystem at /dev/rootfs is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 2 The filesystem on /dev/rootfs is now 7587840 (4k) blocks long. root@localhost:~# df / Filesystem 1K-blocks Used Available Use% Mounted on /dev/rootfs 29808700 5848092 23618452 20% /
This way for installation-disk preparation on user host PC
Another way to create installation disk by script /khadas/oowow-scripts-collection