The "commands" section of system.yaml

Just making sure I understand the role of the "commands:" section of the system.yaml: 1. I can place in there any custom commands that I need executed at system build time, right? Such as, say, "git clone," or "echo 'mask' > /sys/firmware/acpi/interrupts/gpe6E," or "flatpak install <list of flatpak packages to be installed>" etc.? Is that it? 2. What if some of these commands (such as the "git clone" above) must NOT be executed as root? Where do I place those? 3. Will these commands be executed every time the system is updated via akshara? What if I do NOT NEED these to be executed every time during update, as they may end up overwriting useful stuff that should not be overwritten?
Solution:
@autisumn, @ム丂イ乇尺ノ丂ズ: At any rate, I am tempted to conclude at this point that the commands: section of system.yaml cannot be used as a substitute for an installation/configuration/customization script unfortunately. It would have been nice to have all this in one spot, but it seems that's not possible. Looks like I will have to maintain a separate script for that. At least I can use this section to install/update flatpak apps: I know it works fine for that! Many thanks for your attention to this matter though!...
Jump to solution
17 Replies
autmnnnun
autmnnnun2mo ago
1) yes, and they'll be run last, after everything else 2) use su, like su <username> -c "echo hello" iirc 3) yes, if you don't want that then figure something out like setting a flag in a file, or just make your script work with it though i'm actually not sure if you can set a flag in a file like that not sure, but i think so, would have to check
Asterisk
Asterisk2mo ago
Since you’re modifying folders like /usr that are not copied over they need to be executed every time If you’re only modifying writeable folders you don’t need to use system.yaml
Christian
ChristianOP2mo ago
So I did some experimenting with the commands section of system.yaml (https://www.reddit.com/r/BlendOS/comments/1m87qst/comment/n50ugi2/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button), and I noticed the following: 1. it doesn't seem to be able to find files on the hard drive (No such file or directory); 2. I cannot make folders or files as a non-root user using sudo -u dad, since it complains that no such user exists (sudo: unknown user dad) 3. it doesn't seem to recognize the if ... then ... construct What am I doing wrong? Or is this expected behavior? 🤔
Reddit
Reedemer0fSouls's comment on "The "commands" section of system.yaml"
Explore this conversation and more from the BlendOS community
Asterisk
Asterisk2mo ago
The "commands" section of system.yaml
rxddit.com
u/Reedemer0fSouls on r/BlendOS
Comment by u/Reedemer0fSouls: Here below is what output I get with the commands posted above; to make it easier, I will intersperse the commands with (what looks to me to be) their output: 1. Command: - 'echo "mask" > /sys/firmware/acpi/interrupts/gpe6E' Output: bash: line 1: /sys/firmware/acpi/interrupts/gpe6E: Read-only file sy...
Asterisk
Asterisk2mo ago
your user technically doesn't exist in the chroot
autmnnnun
autmnnnun2mo ago
1. yes, as it runs in a chroot 2. i thought that stuff was copied over, i'm quite sure we've done a similar thing in the past? would have to double check but i thought it was possible 3. you're just not doing it right, did you make sure to include the semicolons for new lines?
Christian
ChristianOP2mo ago
@autisumn, @ム丂イ乇尺ノ丂ズ, thanks for the replies. Since "it" (system.yaml? akshara?) runs in a chroot, how do i interact with the hard drive? I need to do ... stuff on the hard drive as my user ("dad"): how would I do that??? How do I write commands in system.yaml that interact with the hard drive as my user?
Valkyrja
Valkyrja2mo ago
.triller_, and ム丂イ乇尺ノ丂ズ received a thank you Jao!
Asterisk
Asterisk2mo ago
from the shell, as your user, normally? /etc gets copied over to the new system as does ~
Christian
ChristianOP2mo ago
I want to know if I can do that from within system.yaml. If not, what is the use of the commands: section? What commands can you place in there if you can't interact with the hard drive?
Asterisk
Asterisk2mo ago
edits you make normally to your user folder or /etc are copied it's like trying to login as your user when installing arch from a livecd I've never known it to be possible unless you're on NixOS
Christian
ChristianOP2mo ago
@ム丂イ乇尺ノ丂ズ: so if I write a simple command in the commands section that attempts to make a folder in my user folder, that won't work, will it? Forget about switching to my user ("dad") for now. Say I place the following command: commands: - 'mkdir -p /home/dad/Git' That won't work, will it?
Asterisk
Asterisk2mo ago
Try it
Christian
ChristianOP2mo ago
Just did. It doesn't seem to work. Nothing happened. Nor, on the other hand, did I see any log message informing me that the command failed, which is a little disquieting, to be frank.
autmnnnun
autmnnnun2mo ago
why would it fail? it didn't fail it just ran it in the chroot
Christian
ChristianOP2mo ago
Well, it certainly did not make a folder on the hard drive as instructed: after reboot, I could not find a /home/dad/Git folder. (You'll have to excuse my ignorance about deeper matters such as chroot and the like: I am not sure what exactly is happening during the running of system.yaml by ashkara: I could not find any such details on the blendOS website.)
Solution
Christian
Christian2mo ago
@autisumn, @ム丂イ乇尺ノ丂ズ: At any rate, I am tempted to conclude at this point that the commands: section of system.yaml cannot be used as a substitute for an installation/configuration/customization script unfortunately. It would have been nice to have all this in one spot, but it seems that's not possible. Looks like I will have to maintain a separate script for that. At least I can use this section to install/update flatpak apps: I know it works fine for that! Many thanks for your attention to this matter though!

Did you find this page helpful?