You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of the fact that this script needs to be run with sudo and runs whoami in a few places under the hood, it fails to unzip quectel-CM.zip (because sudo whoami returns root, but the default home directory on raspi os is /home/pi).
It seems this recent commit is where this was introduced: a669005
I would suggest that the /home/$(whoami)/files/... bit be removed altogether, and that the script just uses the current working directory (something like ./files/ or ./quectel-cm-files/ etc.). I'm happy to try to contribute on this, but I don't have a raspi handy for a few days so it will be tricky to test.
Here is a sample output:
pi@raspberrypi:~ $ sudo ./qmi_install.sh
Clean Old Files
Change directory to /home/root
./qmi_install.sh: 24: cd: can't cd to /home/rootDownloading source files--2020-11-20 16:54:37-- https://github.com/sixfab/Sixfab_RPi_3G-4G-LTE_Base_Shield/raw/master/tutorials/QMI_tutorial/src/quectel-CM.zipResolving github.com (github.com)... 140.82.114.4Connecting to github.com (github.com)|140.82.114.4|:443... connected.HTTP request sent, awaiting response... 302 FoundLocation: https://raw.githubusercontent.com/sixfab/Sixfab_RPi_3G-4G-LTE_Base_Shield/master/tutorials/QMI_tutorial/src/quectel-CM.zip [following]--2020-11-20 16:54:38-- https://raw.githubusercontent.com/sixfab/Sixfab_RPi_3G-4G-LTE_Base_Shield/master/tutorials/QMI_tutorial/src/quectel-CM.zipResolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.232.64.133Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.64.133|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 148627 (145K) [application/zip]Saving to: ‘quectel-CM.zip’quectel-CM.zip 100%[==================================================================================>] 145.14K --.-KB/s in 0.1s2020-11-20 16:54:38 (1.40 MB/s) - ‘quectel-CM.zip’ saved [148627/148627]Archive: quectel-CM.zipcheckdir: cannot create extraction directory: /home/root/files No such file or directoryChecking Kernel5.4.65+ based kernel contains driverInstalling udhcpcReading package lists... DoneBuilding dependency treeReading state information... DoneThe following NEW packages will be installed: udhcpc0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.Need to get 24.3 kB of archives.After this operation, 39.9 kB of additional disk space will be used.Get:1 http://raspbian.mirror.constant.com/raspbian buster/main armhf udhcpc armhf 1:1.30.1-4 [24.3 kB]Fetched 24.3 kB in 1s (25.0 kB/s)Selecting previously unselected package udhcpc.(Reading database ... 55377 files and directories currently installed.)Preparing to unpack .../udhcpc_1%3a1.30.1-4_armhf.deb ...Unpacking udhcpc (1:1.30.1-4) ...Setting up udhcpc (1:1.30.1-4) ...Processing triggers for man-db (2.8.5-2) ...Copying udhcpc default scriptcp: cannot stat '/home/root/files/quectel-CM/default.script': No such file or directorychmod: cannot access '/usr/share/udhcpc/default.script': No such file or directoryChange directory to /home/root/files/quectel-CM./qmi_install.sh: 61: cd: can't cd to /home/root/files/quectel-CM
make: *** No targets specified and no makefile found. Stop.
chmod: cannot access '/home/root/files/quectel-CM': No such file or directory
After reboot please follow commands mentioned below
go to /home/root/files/quectel-CM and run sudo ./quectel-CM -s [YOUR APN]
Press ENTER key to reboot
As a follow-up thought, executing who am i instead of whoami will get the current session user, regardless of sudo/elevation:
Something like this might work if you don't wish to change the behavior too much:
DIR=/home/$(who am i | awk '{print $1}')/files
This still relies on the home directory of the user being in /home/username/files however. Tilde expansion is probably the way to go if you wish to force this into the user's $HOME/files directory
Because of the fact that this script needs to be run with
sudo
and runswhoami
in a few places under the hood, it fails to unzip quectel-CM.zip (becausesudo whoami
returnsroot
, but the default home directory on raspi os is/home/pi
).It seems this recent commit is where this was introduced: a669005
I would suggest that the
/home/$(whoami)/files/...
bit be removed altogether, and that the script just uses the current working directory (something like./files/
or./quectel-cm-files/
etc.). I'm happy to try to contribute on this, but I don't have a raspi handy for a few days so it will be tricky to test.Here is a sample output:
Sixfab_RPi_3G-4G-LTE_Base_Shield/tutorials/QMI_tutorial/qmi_install.sh
Line 15 in a669005
The text was updated successfully, but these errors were encountered: