How do I edit a script in /usr/bin on Silverblue?

I’ve a script that is /usr/bin that has a minor error and needs an edit.
It has to be in /usr/bin because it has relative paths

Easy on Fedora Workstation 35, 'cos I just done it to check my diagnosis!

But how do I do same on Silverblue??

Is only way to make a rpm package for it?

Thx
John

You should put it in /var/usr/bin and symlink to it as /usr/bin

I tried to symlink a file to directory in usr from /var/usr/bin and on terminal I am getting “Read-only file system”. :frowning:

Absent getting a fixed RPM, one solution is to apply a “hotfix” layer that will persist across reboots.

The command you want is ostree admin unlock --hotfix

For example, I modified /usr/bin/alias to have another line of comment text using this method:

$ head /usr/bin/alias
#!/usr/bin/sh
builtin alias "$@"

$ sudo ostree admin unlock
Development mode enabled.  A writable overlayfs is now mounted on /usr.
All changes there will be discarded on reboot.

# sudo vi /usr/bin/alias
<edits happen>

$ head /usr/bin/alias
#!/usr/bin/sh
# foobar
builtin alias "$@"

I skipped the use of the --hotfix option for the example, but the whole process should be the same otherwise.

I should have known, but I am still on Work Station since I seem to have a difficult layout for the Silverblue installer to use. Is there a way that you know of to start with WS and create an rpm-ostree image from it, I mean there should be no?

Have you looked at those UBlue tools, You might find a way through. Maybe if @castrojo is around he can give you some tips.

Yeah I would be open to it. ATM, I cannot login to discourse since
id.fp.o is down (for me anyway).

As @hamrheadcorvette points out, I think the Universal Blue tooling is the best way to approach this problem.

Just to be clear, I don’t believe there is an automated way to take an Fedora Workstation install and create an ostree image from it. You’d likely need to enumerate things like packages installed, repo files, GPG keys, config file changes, etc and translate it. The Universal Blue tooling may make this easier, but I think it would still be a significant effort.

Yeah thats sort of what I was thinking would be the case.
Thanks for the suggestion of Universal Blue. I will look it over.