Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto expand image #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pauloserrafh
Copy link
Contributor

This patchset solves the issue of not being able to rewrite the disk using only a default image writer tool.
If I'm not mistaken, the problem was along the lines of:
genimage-raspberrypi*.cfg file was generating a partition table with a data partition of 32G. This was OK when writing at the first time because would fill up to 32G with the data partition, however when a tool tries to write to the disk again it checks the partition table against the actual SD card size and has a mismatch.

Proposed solution is to create a small (256M) data partition filled with zeros at the moment of the disk creation and on first boot (actually requires two reboots, but it's seamless to the end-user) the S51knot_resize script actually resizes the data partition and only then puts the KNoT scripts on '/etc/ini.d'.

Although naive, this approach:

  • Does not change the minimum required size of disk (image is already greater than 2G and continues smaller than 4G)
  • Improves usability fixing the re-flash issue
  • Keeps KNoT daemons from starting before setup is done (Pending improvement with a "smarter" daemon to centralize this startup)

Points to look at:

  • Test if image is fully working as before (performed only basic testing)
  • Validate which S??* init scripts should be moved. The only ones this patchset changes are the ones that are already modified in the KNoT tree. For instance, rabbitmq is not changed but mongod is.

Creating only a small (256M) data partition to be extended later after
the device boot.

Having a 32G defined partition without any input file was causing two
issues:
- Partition was of unknown type.
- Common disk creation tools such as Ubuntu 'disks' were not able to
rewrite SD cards smaller than the defined size as the device table
expected 32 GB but the sd card only had less disk space.
The data partition is created with only 256M and needs to be expanded
before the initial use of KNoT. Expanding the partition with the
remaining space of the SD card and only then initializing the KNoT
services.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant