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

-c option to clean up image before shrinking #51

Closed
wants to merge 3 commits into from

Conversation

harbaum
Copy link

@harbaum harbaum commented Feb 12, 2018

The -c option is intended to remove private information as well as cached data from the image. It's intended to be used when using the image on a different pi or when distributing the image.

@dalmago
Copy link

dalmago commented Jul 17, 2018

Doesn't the regenerate_ssh_host_keys.service file already exist on the system? Couldn't you use it instead?

@harbaum
Copy link
Author

harbaum commented Jul 17, 2018

It exists after installation but is deleted once it has been run to prevent it from running again. Thus i don't need any extra magic to run my script. Once i restore it it's run automatically by the system on next boot.

@dalmago
Copy link

dalmago commented Jul 17, 2018

My system still has the script under /lib/systemd/system/ even though it was run already.

When I enable it with systemctl, Raspbian creates a symbolic link to /etc/systemd/system/multi-user.target.wants/. After the script ran, it calls systemctl disable to delete the symlink, but the script remains on disk.

@harbaum
Copy link
Author

harbaum commented Jul 17, 2018

Hmm. Maybe that changed one day. If it was the link that was missing then my approach wouldn't work at all. Bit it did ... so i guess i should check for the script and the link and should restore whatever is missing.

@graywolf336
Copy link

Just to add my two cents, I just verified that the regenerate_ssh_host_keys.service does not exist on the Raspbian 10 (buster). So, this would be a nice addition to the script. :)

@kindofausername
Copy link

I would like to see this option!

@cpascual cpascual mentioned this pull request Oct 20, 2022
@Drewsif
Copy link
Owner

Drewsif commented Feb 14, 2023

Im going to consider this out of scope. Any attempts to clean up images has resulted in unintended errors for users. See #256 for more details

@Drewsif Drewsif closed this Feb 14, 2023
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

Successfully merging this pull request may close these issues.

5 participants