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

Porting persistent-storage.sh to Golang? #250

Open
s3rj1k opened this issue Nov 22, 2024 · 3 comments
Open

Porting persistent-storage.sh to Golang? #250

s3rj1k opened this issue Nov 22, 2024 · 3 comments

Comments

@s3rj1k
Copy link

s3rj1k commented Nov 22, 2024

Was wondering if in case someone proposes a PR with a port of hook-mdev/persistent-storage.sh to Golang, will it be considered?

@rpardini
Copy link
Contributor

Hey @s3rj1k, I wrote that, trying to emulate systemd udev, so in a good day, one could use a by-id entry obtained on a systemd-based OS in HookOS (Alpine).

I wouldn't be against porting it, but I do have to warn that the reference implementation should be systemd udev, not this bash script. Also, what is to be gained from the port?

Thanks

@s3rj1k
Copy link
Author

s3rj1k commented Nov 22, 2024

reference implementation should be systemd udev

udev is very shifty, rules change a lot and there are a lot of cases that are out of scope for general plain disk discovery

what is to be gained from the port?

to establish baseline code that can be extendable and covered by unit-tests

by-id

Is also an udev construct that does not really relate to real serial number of device (I agree that it should be emulated)

@rpardini
Copy link
Contributor

by-id

Is also an udev construct that does not really relate to real serial number of device (I agree that it should be emulated)

HW makers have some very creative (and dubious) ideas when setting their serial numbers. Eg embedding nulls, or worse, embedding literal backslash-zero's in serial numbers; systemd-udev handles those specially.

My use-case here is getting my hands on a machine running some systemd OS, looking into /dev/disk/by-id there and being able to use that to provision one specific disk with Tinkerbell while being 100% sure the other disks won't be touched.

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

2 participants