Infrastructure of automatic install OS

Which Khadas SBC do you use?

VIM3 series

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Khadas official images, self built images, or others?

Khadas official images(customized)

Please describe your issue below:

`We want to build an infrastructure that can automatically install the OS on VIM3.

However, the OS image I want to install is customized from the one provided by KHADAS.
Currently, I install it one by one with burn-tool, so it is time-consuming.
In the case of a UEFI-based desktop, I know that you can use a PXE server. In the case of VIM3 with a different bootloader, it was difficult to find a guide on this.

In brief, I want to automatically install OS on dozens of VIM3 simultaneously on a network base. It is expected that KHADAS knows the most appropriate way for this.

  • Q1.
    Krescue seems to provide the function I want. Is it possible to set up an internal archive server such as https://dl.khadas.com and access it?

  • Q2.
    Is there any other way to recommend it?`

Please help @hyphop

P.S. I checked this link already but not helpful.

yes ! we can provide many ways for mass installing and automation

  1. Auto-Install SD cards > krescue/docs/README-custom-images.md at master · khadas/krescue · GitHub
  2. network API > krescue/docs/README_how_to_write_os_images_to_emmc_sd.md at master · khadas/krescue · GitHub
  3. another way is replace common images source https://dl.khadas.com to your custom source this feature works for oowow ( krescue system migrate to oowow very soon - which have many additional features )

I’ve checked your answers and links.
I tried dumping the customized eMMC into the image and, restoring it automatically from the SD card. It works fine. Thank you for your hard work and the ones of KHADAS.

But I still have problems and questions.

Q1. curl error
As mentioned above, this time I tried to dump & restore the image based on the network instead of using the automatic SD card.
I commanded the following on the host pc for dumps and I got the files named VIM3***.img.zst

wget –content-disposition http://krescue.lan/api/disk/read/mmc.zst

and then, for restore

curl another_krescue.lan/shell/write | sh -s - VIM3x.img.zst

However, I faced this error.

So, I even tried this in the chrome browser(using HTTP protocol) to get the image file, dump step works but curl didn’t. The same error occurred.

Q2. Nickname of image files
I could get files in the following format.

VIM3.<maybeTIME>.<BYTES>.emmc.img.zst

I want to rename the files to distinguish, but which form should I keep?

Q3. ‘optimize eMMC byte content’ step in this link mandatory?
Could it be related to Q1?

Dump images

  • wget --content-disposition http://krescue.lan/api/disk/read/mmc.zst dump image to BOARD.XXXX.XXXXX-bytes.emmc.img.zst
  • same can dump to any other image name file curl http://krescue.lan/api/disk/read/mmc.zst > YOU_IMAGE.img.zst

Restore image

NOTES:

  • -mmc option not necessary works by default , and must be as last option (follow after filename only, not before )
  • can use any image filename but only one rule filename extension mast be .(zst|gz|xz|raw)
curl krescue.lan/shell/write | sh -s - YOU_IMAGE.img.zst
# or with destination option (same action)
curl krescue.lan/shell/write | sh -s - YOU_IMAGE.img.zst -mmc

if still have problems please provide me more detail like curl -V etc …

curl write log example

curl krescue.local/shell/write | sh -s - VIM3L.1653977602.15634268160-bytes.emmc.img.zst
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2173    0  2173    0     0  51738      0 --:--:-- --:--:-- --:--:-- 51738
[i] VIM3L.1653977602.15634268160-bytes.emmc.img.zst (.zst) write => 192.168.30.189 // mmc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  216M    0   191  100  216M      0   603k  0:06:07  0:06:07 --:--:--    45
[i] tail logfile:  /tmp/kwrite_http.3307256.log

# IMAGE WAS WRITED

to       : /dev/mmcblk1
bytes    : 227009833
format   : zstd
duration : 363
status   : 0

parts    : label: dos
label-id: 0x00000000
device: /dev/mmcblk1
unit: sectors

No its optional, if u need dump and write emmc whole content as is

But if u need optimize content before mass cloning, this step recommended

Thank you reply

Sorry, I will try to curl -V later and feedback on this.
I have more priority than that.

My VIM3 configuration is

  • eMMC for installing OS
  • NVMe as additional storage.
    • mount /dev/nvme0n1p1 at /usr/local/my_dir

Q. Is there a way to dump & restore to NVMe like eMMC(utilize Krescue)?

(editied)
I followed up Krescue >> Readme Docs >> disk-read-by-http.md
I tried the way to download using wget, curl but not working as expected
e.g.

wget http://xxx.xxx.xxx.xxx/api/disk/read/dev/nvme0n1p1.zst

I connected with SSH as root and looked for /dev/nvme0n1p1, but there was only /dev/nvme-fabrics.
The port mode is set to PCIe in KBI and is assembled with M2X Extension.