scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Can't Run Script on Arch Linux

Open joseyskindaweird opened this issue 1 year ago • 19 comments

MrChromebox Firmware Utility Script starting up firmware-util.sh: line 63: /home/strange/sources.sh: No such file or directory firmware-util.sh: line 64: /home/strange/firmware.sh: No such file or directory firmware-util.sh: line 65: /home/strange/functions.sh: No such file or directory firmware-util.sh: line 71: prelim_setup: command not found firmware-util.sh: line 75: diagnostic_report_save: command not found MrChromebox Firmware Utility setup was unsuccessful

  • diagnosics report has been saved to /tmp/mrchromebox_diag.txt
  • go to https://forum.chrultrabook.com/ for help

this the output, any fixes/help?

joseyskindaweird avatar Jul 25 '24 20:07 joseyskindaweird

don't use snap-based curl? That's the only thing I can think of that would cause it to try and download the files to your home dir instead of /tmp

MrChromebox avatar Jul 25 '24 20:07 MrChromebox

don't use snap-based curl? That's the only thing I can think of that would cause it to try and download the files to your home dir instead of /tmp

i'm not using the snap version, i'm using the one from arch's repo.

joseyskindaweird avatar Jul 25 '24 23:07 joseyskindaweird

i'm not using the snap version, i'm using the one from arch's repo.

well I don't use Arch and haven't heard of anyone else having this issue.

How exactly are you running the script? following directions on my site?

MrChromebox avatar Jul 26 '24 01:07 MrChromebox

i'm not using the snap version, i'm using the one from arch's repo.

well I don't use Arch and haven't heard of anyone else having this issue.

How exactly are you running the script? following directions on my site?

mhm, i'm using the 'cd; curl -LO mrchromebox.tech/firmware-util.sh && sudo bash firmware-util.sh' command

joseyskindaweird avatar Jul 26 '24 05:07 joseyskindaweird

it's something with curl as installed by Arch then? IDK. I'd say boot another Live USB that's know to work (ie, Ubuntu 2404) or try getting help on the Arch forums.

MrChromebox avatar Jul 26 '24 13:07 MrChromebox

it's something with curl as installed by Arch then? IDK. I'd say boot another Live USB that's know to work (ie, Ubuntu 2404) or try getting help on the Arch forums.

ill boot a live ubuntu install once my main rig comes back.

joseyskindaweird avatar Jul 26 '24 20:07 joseyskindaweird

I haven't had this problem, and on a fully updated arch system the utility script runs fine

cmdada avatar Aug 29 '24 21:08 cmdada

Can confirm I am also having this issue on Linux Mint 22

MrChromebox Firmware Utility Script starting up
firmware-util.sh: line 63: /home/lzeugirdor/sources.sh: No such file or directory
firmware-util.sh: line 64: /home/lzeugirdor/firmware.sh: No such file or directory
firmware-util.sh: line 65: /home/lzeugirdor/functions.sh: No such file or directory
firmware-util.sh: line 71: prelim_setup: command not found
firmware-util.sh: line 75: diagnostic_report_save: command not found
MrChromebox Firmware Utility setup was unsuccessful
 * diagnosics report has been saved to /tmp/mrchromebox_diag.txt
 * go to https://forum.chrultrabook.com/ for help

LZeugirdor avatar Sep 20 '24 23:09 LZeugirdor

Also there is no log under /tmp/mrchromebox_diag.txt I was monitoring the directory and it seems like nothing is being written to /tmp,

LZeugirdor avatar Sep 20 '24 23:09 LZeugirdor

One last thing, I know this is taboo but entering root via sudo su allows the script to run normally, not sure what else to do otherwise.

LZeugirdor avatar Sep 21 '24 00:09 LZeugirdor

Can confirm I am also having this issue on Linux Mint 22

MrChromebox Firmware Utility Script starting up
firmware-util.sh: line 63: /home/lzeugirdor/sources.sh: No such file or directory
firmware-util.sh: line 64: /home/lzeugirdor/firmware.sh: No such file or directory
firmware-util.sh: line 65: /home/lzeugirdor/functions.sh: No such file or directory
firmware-util.sh: line 71: prelim_setup: command not found
firmware-util.sh: line 75: diagnostic_report_save: command not found
MrChromebox Firmware Utility setup was unsuccessful
 * diagnosics report has been saved to /tmp/mrchromebox_diag.txt
 * go to https://forum.chrultrabook.com/ for help

that's because your distro's curl app is sandboxed and is not downloading the files where the script is telling it to

MrChromebox avatar Sep 21 '24 00:09 MrChromebox

Can confirm I am also having this issue on Linux Mint 22

MrChromebox Firmware Utility Script starting up
firmware-util.sh: line 63: /home/lzeugirdor/sources.sh: No such file or directory
firmware-util.sh: line 64: /home/lzeugirdor/firmware.sh: No such file or directory
firmware-util.sh: line 65: /home/lzeugirdor/functions.sh: No such file or directory
firmware-util.sh: line 71: prelim_setup: command not found
firmware-util.sh: line 75: diagnostic_report_save: command not found
MrChromebox Firmware Utility setup was unsuccessful
 * diagnosics report has been saved to /tmp/mrchromebox_diag.txt
 * go to https://forum.chrultrabook.com/ for help

that's because your distro's curl app is sandboxed and is not downloading the files where the script is telling it to

Interesting. Is this an apparmor issue?

LZeugirdor avatar Sep 22 '24 11:09 LZeugirdor

that's because your distro's curl app is sandboxed and is not downloading the files where the script is telling it to

Interesting. Is this an apparmor issue?

no idea, don't use AA and don't use Arch. I've only seen this behavior before on Ubuntu-based distros which use snap-installed curl (vs apt-installed) since Snap sandboxes things

MrChromebox avatar Sep 22 '24 17:09 MrChromebox

I promise I don't use snap installed stuff, Mint disables snap explicitly unless they've changed something recently. The only thing I can think of is apparmor which I think most mainline distros install.

LZeugirdor avatar Sep 29 '24 21:09 LZeugirdor

Experienced the same issue on Debian 12 using curl from the Debian repo.

I ran the firmware-util.sh and the error through Claude, and the issue appears to be related to whether the user has a .git file or not. I just wiped my chrultrabook and so git isn't populated yet, and I believe this line does it: if [ ! -d "$script_dir/.git" ]; then script_dir="."

This temporary workaround did the trick:

cd /tmp && curl -LO https://mrchromebox.tech/firmware-util.sh && \
curl -LO https://raw.githubusercontent.com/MrChromebox/scripts/main/sources.sh && \
curl -LO https://raw.githubusercontent.com/MrChromebox/scripts/main/functions.sh && \
curl -LO https://raw.githubusercontent.com/MrChromebox/scripts/main/firmware.sh && \
sudo bash firmware-util.sh

cameronj86 avatar Oct 29 '24 15:10 cameronj86

@cameronj86 sounds like curl is broken then, maybe I should use wget instead

MrChromebox avatar Oct 29 '24 16:10 MrChromebox

@cameronj86 sounds like curl is broken then, maybe I should use wget instead

Whoops, I think I worded things poorly or I don't fully comprehend.

Looking at the bash, my understanding is that the script looks for a .git file in $script_dir, and failing that, tries to write locally. Users that don't have a .git in $script_dir (/usr/bin/ for me when I step through the code) will get the error code. AFAICT, it seems to be outside of curl, but I might be misreading things.

cameronj86 avatar Oct 29 '24 18:10 cameronj86

Looking at the bash, my understanding is that the script looks for a .git file in $script_dir, and failing that, tries to write locally.

that's not correct. The script looks for a .git directory in the directory that firmware-util.sh was run from, to determine if it's being run from a cloned repo. If so, it doesn't download the additional .sh files, but uses the ones in $script_dir. If it's not being run from a repo, then it downloads those files to /tmp.

If curl is doing naughty things and sandboxing downloads, then the files don't actually end up in /tmp/, and then firmware-util.sh is unable to source them

MrChromebox avatar Oct 29 '24 20:10 MrChromebox

Appreciate the additional context, thanks for explaining and good documentation in general

cameronj86 avatar Oct 29 '24 23:10 cameronj86

The script does not work if the user has a .git directory in their home dir. I use git for dotfiles backup so I had to temporarily move that folder in order for the script to run properly.

rehhouari avatar Nov 12 '25 09:11 rehhouari

The script does not work if the user has a .git directory in their home dir. I use git for dotfiles backup so I had to temporarily move that folder in order for the script to run properly.

this is by design, so if the repo is cloned for testing/debugging purposes that local changes are not overridden. I'm open to a better way to handle this if you have one

You could have simply run the script from your downloads or some other dir without a .git dir in it :)

MrChromebox avatar Nov 12 '25 14:11 MrChromebox