CustomPiOS
CustomPiOS copied to clipboard
Support user creation at build-time for raspbian and raspios
I am having some problems with functionality that requires a user and a home folder in my distro. I am using the base module to add the user and set the password:
export BASE_USER="myuser"
export BASE_ADD_USER="yes"
export BASE_USER_PASSWORD="mypassword"
Because the code path that updates the user for raspbian and raspios uses the /boot/userconf.txt method, the user is not created at build-time so myuser and its home folder will not exist during build. This also affects built in functionality, such as unpack which will fail with "User not found".
unpack /filesystem/home/myuser /home/"${BASE_USER}" "${BASE_USER}"
My workaround is to set the distro to something else to trigger normal user creation. This works for me only because I do not use other modules that requires the BASE_DISTRO variable.
export BASE_DISTRO="other"
Why not skip the /boot/userconf.txt method all together?
Hey, just saw this now. What base image are you using? You can use the pi user and it should let uou access the user during build time
What exactly are you trying to rum?