[Jessie] Separating policy from binaries
Posted: 19 May 2017, 20:02
Hello,
I've already tested the Jessie packages on an existing image, and I noticed a small detail here: the piserial package contains both the binary piSerial for extracting the serial number of the device, as well as a hook into /etc/profile.d that does some automatic things (disallow any user to start an interactive shell except pi and automatically calls revpi-factory-reset unless a dotfile in pi's home directory exists).
May I suggest splitting the package up into two binary packages? (You could still build them from the same source package.) One containing both binaries (revpi-factory-reset and piSerial), and the other containing /etc/profile.d/revpi-factory-reset.sh? Because if I create a custom image, I might not necessarily want to have the same policy in place that you have on your default images (I consider the file in /etc/profile.d to be configuration policy), but I might want to have the piSerial command available.
Thanks!
Regards,
Christian
PS: By the way, the username check in that file disables "sudo -i" - without printing an error message, and without an error exit code, which left me wondering what just happened on the system. This might be intentional on your part, but I wanted to mention the effect.
I've already tested the Jessie packages on an existing image, and I noticed a small detail here: the piserial package contains both the binary piSerial for extracting the serial number of the device, as well as a hook into /etc/profile.d that does some automatic things (disallow any user to start an interactive shell except pi and automatically calls revpi-factory-reset unless a dotfile in pi's home directory exists).
May I suggest splitting the package up into two binary packages? (You could still build them from the same source package.) One containing both binaries (revpi-factory-reset and piSerial), and the other containing /etc/profile.d/revpi-factory-reset.sh? Because if I create a custom image, I might not necessarily want to have the same policy in place that you have on your default images (I consider the file in /etc/profile.d to be configuration policy), but I might want to have the piSerial command available.
Thanks!
Regards,
Christian
PS: By the way, the username check in that file disables "sudo -i" - without printing an error message, and without an error exit code, which left me wondering what just happened on the system. This might be intentional on your part, but I wanted to mention the effect.