Could someone show me what an /etc/uci-defaults script would have to look like, to set the owner of a directory and a file (as below) to user and group bobby (supposing bobby was the only non-root user I added and had uid 1000)?
Would I name the script any file name ending in .sh and place it in files/etc/uci-defaults/ (within the image builder directory)`?
What would be great is if someone showed me the whole script if there are not too many lines. Thanks.
LATER ADDED
My question assumes this situation.
I have manually added a non-root user bobby to the router, made it a superuser, replaced Dropbear with OpenSSH, and added public keys to bobby's authorized_keys.
Extracted the resulting configs (e.g. /etc/group, /etc/passwd, /etc/shadow, /etc/sudoers, /etc/sudoers.d, /home/bobby/.ssh/authorized_keys, /etc/ssh/sshd_config) from the router to Ubuntu, made them bobby owned in Ubuntu, and included them in the 'make image' command as FILES=
Therefore, all that a /etc/uci-defaults script has to do is to make certain files bobby owned
The script need not create any user etc.
One minor advantage of this method is that I get to preserve authorized_keys from 'make image` version to version.
The major advantage is that I might actually understand the script (much simpler than one that would first create bobby).
STILL LATER ADDED
My mad idea, based on vgaetera's (sane) reply, worked!
All I had to do was to include in the /etc/uci-defaults folder (of the make image files folder) a file called "xx_custom" consisting of this single line:
chmod -R 777 /etc/dump
so as to change the permissions of that folder and all contents (yes, different from the stated object, but for testing).
I need to know what that translates to, in terms of the script that I would put in files/etc/uci-defaults/. Thanks.
On a mad inspiration, I entered all the lines of your linked box into Terminal, and it actually gave me a file called xx_custom that's got all the lines I entered (but no #!/bin/sh to start off the file).
So it looks to me that all my script needs to have would be just the chown lines I want! I'll try that.
Thank you again. Is there any significance to file name "xx_custom"? Can it be any other "regular" expression (not to include space, special symbols, etc.)?