Project

General

Profile

Actions

Feature #879

closed

Investigate ability to auto-generate compressed SD card image for each system build.

Added by Hammel 7 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
05 - Releases
Target version:
Start date:
24 Jan 2022
Due date:
% Done:

100%

Estimated time:
Severity:
02 - High

Description

This could use what I've learned from Pine64 and at work in how the image can be generated locally without having an SD card.
This is already partly done (generate to file) but probably needs improvement.

Actions #1

Updated by Hammel 6 months ago

  • Severity changed from 05 - Very Low to 02 - High
Actions #2

Updated by Hammel 6 months ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10
Basic process is:
  1. Do 3 times: dd if=/dev/zero of=file1.img bs=512 count=<partition size>
  2. mkfs.ext4/vfat image file
  3. e2cp <files> fileX.img
    1. See man page
  4. export MTOOLS_SKIP_CHECK=1 && mcopy -i fileX.img files(s) ::/<location>
  5. cat fileX.img fileY.img fileZ.img > fileAll.img
  6. sgdisk fileAll.img (to create partition table)

Then the whole thing can be gzip'd. This whole process should replace mkinstall -f option and remove the -f option in mksd. Or I could just split these up so the process is still the same, just to a file instead of a real SD card.

Actions #3

Updated by Hammel 6 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 10 to 100

While this method is good and doesn't require mounting a filesystem (which requires sudo and kpartx), I already have this working in the mksd and mkinstall scripts. It required a little cleanup, but not much. Also, e2cp doesn't quite work as I'd like so it really isn't that much better that what I already implemented.

I also added image compression, though the final image is still over 1G.

Tested, committed and pushed.

Actions

Also available in: Atom PDF