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

Feat: A SHRINK command #59

Open
she11sh0cked opened this issue May 10, 2022 · 2 comments
Open

Feat: A SHRINK command #59

she11sh0cked opened this issue May 10, 2022 · 2 comments

Comments

@she11sh0cked
Copy link
Contributor

SHRINK [SIZE]

SHRINK decreases the size of the image to the minimum possible.
Optionally, you can specify the amount to decrease (suffixes K, M, G are allowed).

Example:

PUMP 10G # Increase the size of the image by 10G
[...] # Do some stuff
SHRINK # Decrease the size of the image to the minimum possible
@oxzi
Copy link
Member

oxzi commented May 10, 2022

Isn't there already PiShrink to do exactly this job? It is currently even linked in pimod's README.

I would see the benefit of including PiShrink into pimod as a SHRINK command which reduces the size to the minimum. However, I don't see any advantage of letting the user specify the size to be shrinked.

If you, or anyone else, wants to address this in a Pull Request, I'd be happy to merge it. Currently I don't have the time to do this by myself.

@ethanjli
Copy link

ethanjli commented May 28, 2024

It looks like this feature request is mostly a matter of making it more convenient to use pishrink's functionality in workflows involving Pimod. I'm building custom Raspberry Pi OS images exclusively in CI, and I found this feature request while exploring my options for running pishrink more easily on GitHub Actions, since I was using Pimod anyways. To simplify that use-case in a way that was easy for me to implement, I've now made a GitHub action (ethanjli/pishrink-action) which is a slightly-nicer wrapper around pishrink.sh, e.g. as in this example for running pishrink on the output of Pimod: https://github.com/ethanjli/pishrink-action?tab=readme-ov-file#pimod-usage-example .

(At least for now I'm not the right person to make a PR to add a SHRINK command, because I'm currently not relying on Pimod for my projects: my projects need to build images which require a fully-booted OS because the setup process involves doing some stuff with the Docker daemon in the image, and it was simpler for me to just use a combination of systemd-nspawn for unbooted setup steps with a QEMU VM for booted setup steps. Regardless, I think Pimod is really cool, and if/when I do use Pimod for another project then I will think about PR'ing a SHRINK command!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants