Can't use opkg on pre-configured embedded machine - opkg

I want to add a feature to a pre-configured embedded machine with uname -a output:
Linux asdf 3.1.10 #1 SMP PREEMPT Fri Nov 11 02:05:03 CET 2016 armv7l GNU/Linux
It uses busybox for a lot of its terminal commands and has a lot of stuff that doesn't work. It uses opkg as its package manager. I wanted to update systemd the other day and so I typed opkg update, which gave
Downloading http://www.website-of-manufacturer.com/ipk2/all/Packages.gz.
wget: bad address 'website-of-manufacturer.com:8008'
So I wanted to update the list of repositories, which should be done by editing /etc/opkg.conf if I understand correctly. But there is no such file. So after reading this I simply created it and pasted the example from the link.
But after running opkg update again, it still looks for http://www.website-of-manufacturer.com/ipk2/all/Packages.gz! What can I do to remove this repo and add others?
Edit: I also tried grep -Ril website-of-manufacturer in rootdir, but the installed version of grep doesn't support those flags so I don't even know where the configuration file is located :D
Edit: Ok find ./ -type f | xargs grep "website-of-manufacturer" actually located the file I was looking for. I guess I'll answer my own question if this works.

Since grep -r was not working, I could not find the config file. But then I tried
find ./ -type f | xargs grep "website-of-manufacturer"
which located the file containing the repository list. Neat trick for environments where grep isn't working like it should.

Related

How do I rebuild Coral mendel with a devicetree modification?

I'm trying to modify the devicetree on my Coral SoM to support a different DSI display, and could use some pointers.
I edited arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts
then used 'm' to make all
Question:
What is the correct way to modify the devicetree, build and load it to the board!?
Thanks!
can you give a little more details on the changes?
You can definitely do it that way, and I believe you don't need to rebuilt the entire OS, just the kernel is fine:
$ m docker-linux-imx
$ cd ./out/product/packages/bsp
$ scp ./linux-image-4.14.98-imx_11–4_arm64.deb mendel#board-ip
$ ssh mendel#board-ip
$ sudo dpkg -i ./linux-image-4.14.98-imx_11–4_arm64.deb
Another way is to create a device tree overlays. For instance here is a dts for disabling the hdmi: https://gist.github.com/Namburger/f700eb6b18bd1e3697638088d5995c8b
You can then compile it and move it to /boot:
$ dtc -# -I dts -O dtb -o disable-hdmi.dtbo disable_hdmi.dts
$ sudo mv disable-hdmi.dtbo /boot
Then add the file to /boot/overlays.txt to apply it:
$ cat /boot/overlays.txt
# List of device tree overlays to load. Format: overlay=<dtbo name, no extenstion> <dtbo2> ...
overlay= disable-hdmi
Thank you very much Nam.
The first option I think was already working, but I was not sure how to check. It appears that the devicetree can be examined by looking in /proc/device-tree/ for example cat hdmi#32c00000/status gives 'disabled' after doing the modification above, and the HDMI can be verified not working.

Folder is in $INC but module loads from other location

I need to test my project with new module version.
But for some reason Perl can not load it.
docker-compose run -v /data/projects/My-Module:/perl5lib project-container perl -I/perl5lib -MMy::Module -e 'print $INC{"My/Module.pm"}'
It must print
/perl5lib
But in fact it prints
/usr/local/share/perl/5.26.1/My/Module.pm
Same result with
docker-compose run -e PERL5LIB=/perl5lib -v /data/projects/My-Module:/perl5lib project-container perl -MMy::Module -e 'print $INC{"My/Module.pm"}'
Please help me to find what could be the issue.
$ perl --version
This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi
$ docker-compose --version
docker-compose version 1.24.1, build 4667896
With this command (which should be more-or-less equivalent to what you are doing)
docker run perl:5.28 perl -I/xyz -V
Regardless /xyz exists or not within the container instance, I can visually confirm that /xyz is the first entry of #INC:
...
Compiled at Aug 15 2019 02:34:38
#INC:
/xyz
/usr/local/lib/perl5/site_perl/5.28.2/x86_64-linux-gnu
/usr/local/lib/perl5/site_perl/5.28.2
/usr/local/lib/perl5/vendor_perl/5.28.2/x86_64-linux-gnu
/usr/local/lib/perl5/vendor_perl/5.28.2
/usr/local/lib/perl5/5.28.2/x86_64-linux-gnu
/usr/local/lib/perl5/5.28.2
Given by your message that My/Module.pm got required from an alternative place, I'd guess that your /perl5lib is empty, or simply does not contain My/Module.pm -- or somehow that alternative path comes first then your /perl5lib. Not sure how that would be the case, but I'm trying to enumerate some possibilities.
Anyway, you should be able to inspect the content of /perl5lib by running
docker-compose run -v /data/projects/My-Module:/perl5lib project-container find /perl5lib
(I guess find command is available in your container, but if not, try ls -R or something similar...)
Last... in case you are using Docker on macOS -- which I cannot tell from the information you provided -- you need to verify that the /data/projects/My-Module is in the list of "File Sharing" preference. Otherwise that folder cannot be mounted.

ubuntu 16 install gstreamer but gstreamer-plugins-base-1.0.pc file is not found anywhere

(Using ubuntu 16 0n my mac pro.)
To integrate gstreamer and pocketsphinx, I need three .pc files as the offical website says:
gstreamer-1.0.pc
gstreamer-base-1.0.pc
gstreamer-plugins-base-1.0.pc
I start a new empty ubuntu 18.
install the gstreamer through
$ sudo apt-get install libgstreamer1.0-dev
But only two of the three important .pc files exist after the previous command.
If I cd to /usr/ and run :
sudo find . -print | grep -i 'gstreamer-plugins-base-1.0'
the terminal returns empty( not found).
At the same time,
sudo find . -print | grep -i 'gstreamer-base-1.0'
and
sudo find . -print | grep -i 'gstreamer-1.0'
will give me correct paths.
Where is the missing gstreamer-plugins-base-1.0.pc file? Thank you.
If there are only two but not three of the .pc files, the configuration of pocketsphinx will not work.
**sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev**
helped me generate the missing gstreamer-plugins-base-1.0.pc file.
Those two are needed.

How to send data to command line after calling .sh file?

I want to install Anaconda through EasyBuild. EasyBuild is a software to manage software installation on clusters. Anaconda can be installed with sh Anaconda.sh.
However, after running I have to accept the License agreement and give the installation location on the command line by entering <Enter>, yes <Enter>, path/where/to/install/ <Enter>.
Because this has to be installed automatically I want to do the accepting of terms and giving the install location in one line. I tried to do it like this:
sh Anaconda.sh < <(echo) >/dev/null < <(echo yes) >/dev/null \
< <(echo /apps/software/Anaconda/1.8.0-Linux-x86_64/) > test.txt
From the test.txt I can read that the first echo works as <Enter>, but I can't figure out how to accept the License agreement, as it sees it now as not sending yes:
Do you approve the license terms? [yes|no]
[no] >>> The license agreement wasn't approved, aborting installation.
How can I send the yes correctly to the script input?
Edit: Sorry, I missed the part about having to enter more then one thing. You can take a look at writing expect scripts. thegeekstuff.com/2010/10/expect-examples. You may need to install it however.
You could try piping with the following command: yes yes | sh Anaconda.sh. Read the man pages for more information man yes.
Expect is a great way to go and probably the most error proof way. If you know all the questions I think you could do this by just writing a file with the answers in the correct order, one per line and piping it in.
That install script is huge so as long as you can verify you know all the questions you could give this a try.
In my simple tests it works.
I have a test script that looks like this:
#!/bin/sh
echo -n "Do you accept "
read ANS
echo $ANS
echo -n "Install path: "
read ANS
echo $ANS
and an answers file that looks like this:
Y
/usr
Running it like so works... perhaps it will work for your monster install file as well.
cat answers | ./test.sh
Do you accept Y
Install path: /usr
If that doesn't work then the script is likely flushing and you will have to use expect or pexpect.
Good luck!
Actually, I downloaded and looked at the anaconda install script. Looks like it takes command line arguments.
/bin/bash Anaconda-2.2.0-Linux-x86_64.sh -h
usage: Anaconda-2.2.0-Linux-x86_64.sh [options]
Installs Anaconda 2.2.0
-b run install in batch mode (without manual intervention),
it is expected the license terms are agreed upon
-f no error if install prefix already exists
-h print this help message and exit
-p PREFIX install prefix, defaults to /home/cody.stevens/anaconda
Use the -b and -p options...
so use it like so:
/bin/bash Anaconda-2.2.0-Linux-x86_64.sh -b -p /usr
Also of note.. that script explicitly says not to run with '.' or 'sh' but 'bash' so they must have some dependency on a feature of bash.
--
Cody

ubuntu server PS, ifocnfig, command not working

i am working on ubuntu server from past few months
and now suddenly ps, ifconfing commnad stop working with below error.
user1#Fb1:/usr/bin$ ps
-bash: /bin/ps: No such file or directory
any suggestions to get this command working back.
What's the output of which ps and ls /usr/bin -al (which are both in /bin also)? Does it work if you gain root privileges, either using sudo ifconfig or sudo su, then ifconfig?
This is possibly an issue with file permissions but it's hard to say without more information.
First use locate to find your ps or ifconfig program:
$ locate ps | grep bin
Also you may try whereis command:
$ whereis ps
If you don't find them, try to search as root user.
i have tried to put all the outputs of different commnads as below
root#Fb1:/usr/bin# whereis ps
ps: /bin/ps /usr/share/man/man1/ps.1.gz
root#Fb1:/usr/bin# ls -lsa ps
16 -rwxr-xr-x 1 root root 15859 2010-05-26 12:21 ps
Something wrong with your $PATH I suspect it doesn't have /sbin .. maybe new software overwrite your $PATH..
normal path should be include this (mebada is my user name)
mebada#T430:~$ echo $PATH
/home/mebada/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin