Has anyone tried using the bitbake-env utility lately? - yocto

Has anyone tried using the bitbake-env utility lately?
I do not see it installed:
[user#localhost build]$ which bitbake
~/YOCTO/oe_core_embedded/poky/bitbake/bin/bitbake
[user#localhost build]$ which bitbake-env
/usr/bin/which: no bitbake-env in (/home/user/YOCTO/oe_core_embedded/poky/scripts:/home/user/YOCTO/oe_core_embedded/poky/bitbake/bin:/usr/libexec/python2-sphinx:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/user/.local/bin:/home/user/bin)
[user#localhost build]$
As well I do not see it in the bitbake command listing:
[user#localhost poky]$ cd bitbake/bin
[user#localhost bin]$ ls -al
total 100
drwxrwxr-x. 2 user user 4096 Oct 18 12:49 .
drwxrwxr-x. 6 user user 4096 Oct 18 12:49 ..
-rwxrwxr-x. 1 user user 2072 Nov 18 11:51 bitbake
-rwxrwxr-x. 1 user user 7228 Oct 18 12:49 bitbake-diffsigs
-rwxrwxr-x. 1 user user 2894 Oct 18 12:49 bitbake-dumpsig
-rwxrwxr-x. 1 user user 4069 Oct 18 12:49 bitbake-layers
-rwxrwxr-x. 1 user user 2109 Oct 18 12:49 bitbake-prserv
-rwxrwxr-x. 1 user user 2128 Oct 18 12:49 bitbake-selftest
-rwxrwxr-x. 1 user user 17866 Oct 18 12:49 bitbake-worker
-rwxrwxr-x. 1 user user 13951 Oct 18 12:49 bitdoc
-rwxrwxr-x. 1 user user 5813 Oct 18 12:49 git-make-shallow
-rwxrwxr-x. 1 user user 8805 Oct 18 12:49 toaster
-rwxrwxr-x. 1 user user 4177 Oct 18 12:49 toaster-eventreplay
[user#localhost bin]$
It still exists/is listed in https://elinux.org/Bitbake_Cheat_Sheet from July 2016.

bitbake-env is a third party utility, and not actually a part of the OpenEmbedded Core hence why you will not see it unless you specifically install it. It is actually an 'improved' version of the bitbake -e flag for bitbake.
bash-4.3$ bitbake --help
Usage: bitbake [options] [recipename/target recipe:do_task ...]
Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
will provide the layer, BBFILES and other configuration information.
Options:
...
-e, --environment Show the global or per-recipe environment complete
with information about where variables were
set/changed.

Related

Git hook command has seriously messed with my directory listings

Got this line of code in .git/hooks/post-checkout:
exec vim +PackerCompile +"sleep 100m" +qall
The vim command ran fine from the command line. But apparently, not so well in sh.
When I switch to a branch, I get a very messy output:
Switched to branch 'clean'
Your branch is up to date with 'origin/clean'.
Vim: Warning: Input is not from a terminal
Even worse, my directory listings are all screwy:
> $ ls -la [±clean ✓]
total 4
drwxr-xr-x 6 user staff 192 Feb 26 20:59 .
drwxr-xr-x 5 user staff 160 Feb 26 16:39 ..
drwxr-xr-x 3 user staff 96 Feb 26 16:55 .compiled_packer_config
drwxr-xr-x 5 user staff 160 Feb 26 20:59 lua
drwxr-xr-x 19 user staff 608 Feb 20 16:56 templates
-rw-r--r-- 1 user staff 279 Feb 26 20:59 init.lua
It looks like I've got some whitespace characters in there. These whitespace characters are showing up in all directories in this terminal. In other terminals, things display normally. But WTF happened? And how do I fix?
OK, I stuck with what I'm more familiar with and used bash. Works just fine:
#!/bin/zsh
#exec git update-server-info
bash -c '/usr/local/bin/nvim +PackerCompile +"sleep 100m" +qall'

CentOs 7, "Tesseract couldn't load any languages!" however: "List of available languages (2): eng, spa"

this is CentOs 7
when I run tesseract --list-langs
[root#cia tessdata]# tesseract --list-langs
Error opening data file /usr/local/share/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
List of available languages (2):
eng
spa
[root#cia tessdata]#
however when I run
[root#cia tessdata]# ls -l /usr/local/share/tessdata/
total 328
drwxr-xr-x. 2 root root 4096 Nov 17 23:28 configs
-rw-r--r--. 1 root root 164228 Nov 18 06:11 eng.traineddata
-rw-r--r--. 1 root root 572 Nov 17 23:28 pdf.ttf
-rw-r--r--. 1 root root 157745 Nov 18 06:11 spa.traineddata
drwxr-xr-x. 2 root root 98 Nov 17 23:28 tessconfigs
[root#cia tessdata]#
I get eng.traineddata and spa.traineddata in this form:
cd /usr/local/share/tessdata
wget https://github.com/tesseract-ocr/tessdata/blob/main/eng.traineddata
wget https://github.com/tesseract-ocr/tessdata/blob/main/spa.traineddata
:::::::::::::::::::::::::::::::::::::::::::
allways I install languages with:
wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata
wget https://github.com/tesseract-ocr/tessdata/raw/master/spa.traineddata
then allways tesseract work fine, but now this return 404
how I can fix?

cannot compile raspberry kernel on NTFS disk

Sorry for my bad english.
I am trying to compile kernel source code of raspberry and jetson tx2 on a NTFS disk.
compile kernel source code of jetson ok, no error.
compile kernel source code of raspberry fail with bellow error message:
*** Error during update of the configuration.
make[3]: *** [/media/u2004/LINUX_SHARED/rasp/linux/scripts/kconfig/Makefile:39: silentoldconfig] Error 1
make[2]: *** [/media/u2004/LINUX_SHARED/rasp/linux/Makefile:541: silentoldconfig] Error 2
make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'. Stop.
make[1]: Leaving directory '/media/u2004/LINUX_SHARED/rasp/build_output'
make: *** [Makefile:150: sub-make] Error 2
no error when compile raspberry kernel source code in Ext4 disk.
edit: add compile environment and script
cross compile in Ubuntu 20.04 64bit. compile aarch32 with bellow script (compile ok in Ext4 partition).
ROOT_DIR=/home/u2004/Desktop/dm
KERNEL_BUILD_DIR=${ROOT_DIR}/linux/
CROSS_COMPILE=${ROOT_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
BUILD_OUTPUT=${ROOT_DIR}/build_output
INSTALL_MOD_PATH_EXT4=${ROOT_DIR}/copy_to_sdcard/ext4
INSTALL_MOD_PATH_FAT32=${ROOT_DIR}/copy_to_sdcard/fat32
ARCH=arm
DEF_CONFIG=bcm2709_defconfig
TARGET=kernel7
git clone --depth=1 -b rpi-4.9.y https://github.com/raspberrypi/linux
git clone https://github.com/raspberrypi/tools
export CROSS_COMPILE=${CROSS_COMPILE}
cd ${KERNEL_BUILD_DIR}
make mrproper
make ARCH=${ARCH} O=${BUILD_OUTPUT} ${DEF_CONFIG}
make ARCH=${ARCH} O=${BUILD_OUTPUT} -j4 zImage modules dtbs
make ARCH=${ARCH} INSTALL_MOD_PATH=${INSTALL_MOD_PATH_EXT4} modules_install
please help.
thank you
Ultimately, I would advise not to clone/build the linux kernel directly on an NTFS partition, since, from my own past experiences, this is probably a recipe for trouble.
The safest approach, if you want to clone/build it on a Windows 10 computer, would therefore be, IMHO, to either:
install/use WSL2 on your Windows system (free,fastest),
install VirtualBox (free) on your Windows 10 system and use a virtual drive formatted in EXT4 (You could import a ready-to-use (free) Linux development virtual Machine retrieved from Turnkey Linux in a breeze).
The following procedure worked flawlessly using WSL2:
start bash.ex, and, in the WSL2 bash session, enter the following commands:
user#kleronomas:/tmp$ mkdir so
user#kleronomas:/tmp$ cd so
user#kleronomas:/tmp/so$ ROOT_DIR=$(pwd)
user#kleronomas:/tmp/so$ KERNEL_BUILD_DIR=${ROOT_DIR}/linux/
user#kleronomas:/tmp/so$ CROSS_COMPILE=${ROOT_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
user#kleronomas:/tmp/so$ BUILD_OUTPUT=${ROOT_DIR}/build_output
user#kleronomas:/tmp/so$ INSTALL_MOD_PATH_EXT4=${ROOT_DIR}/copy_to_sdcard/ext4
user#kleronomas:/tmp/so$ INSTALL_MOD_PATH_FAT32=${ROOT_DIR}/copy_to_sdcard/fat32
user#kleronomas:/tmp/so$ ARCH=arm
user#kleronomas:/tmp/so$ DEF_CONFIG=bcm2709_defconfig
user#kleronomas:/tmp/so$ TARGET=kernel7
user#kleronomas:/tmp/so$ export CROSS_COMPILE=${CROSS_COMPILE}
user#kleronomas:/tmp/so$ cd ${KERNEL_BUILD_DIR}
user#kleronomas:/tmp/so$ git clone --depth=1 -b rpi-4.9.y https://github.com/raspberrypi/linux
user#kleronomas:/tmp/so$ git clone https://github.com/raspberrypi/tools
user#kleronomas:/tmp/so$ make O=${BUILD_OUTPUT} mrproper
user#kleronomas:/tmp/so$ make ARCH=${ARCH} O=${BUILD_OUTPUT} ${DEF_CONFIG}
user#kleronomas:/tmp/so$ make ARCH=${ARCH} O=${BUILD_OUTPUT} -j4 zImage modules dtbs
user#kleronomas:/tmp/so$ make ARCH=${ARCH} O=${BUILD_OUTPUT} INSTALL_MOD_PATH=${INSTALL_MOD_PATH_EXT4} modules_install
user#kleronomas:/tmp/so$ ls -l ${BUILD_OUTPUT}
total 45445
-rw-r--r-- 1 user user 586 Mar 2 10:43 Makefile
-rw-r--r-- 1 user user 730037 Mar 2 11:05 Module.symvers
-rw-r--r-- 1 user user 2244428 Mar 2 11:04 System.map
drwxr-xr-x 1 user user 512 Mar 2 10:43 arch
drwxr-xr-x 1 user user 512 Mar 2 10:46 block
drwxr-xr-x 1 user user 512 Mar 2 10:44 certs
drwxr-xr-x 1 user user 512 Mar 2 11:07 crypto
drwxr-xr-x 1 user user 512 Mar 2 11:04 drivers
drwxr-xr-x 1 user user 512 Mar 2 11:07 firmware
drwxr-xr-x 1 user user 512 Mar 2 11:07 fs
drwxr-xr-x 1 user user 512 Mar 2 10:43 include
drwxr-xr-x 1 user user 512 Mar 2 11:04 init
drwxr-xr-x 1 user user 512 Mar 2 10:45 ipc
drwxr-xr-x 1 user user 512 Mar 2 11:07 kernel
drwxr-xr-x 1 user user 512 Mar 2 11:07 lib
drwxr-xr-x 1 user user 512 Mar 2 11:07 mm
-rw-r--r-- 1 user user 4840 Mar 2 10:44 modules.builtin
-rw-r--r-- 1 user user 61793 Mar 2 11:04 modules.order
drwxr-xr-x 1 user user 512 Mar 2 11:04 net
drwxr-xr-x 1 user user 512 Mar 2 10:44 scripts
drwxr-xr-x 1 user user 512 Mar 2 10:45 security
drwxr-xr-x 1 user user 512 Mar 2 11:07 sound
lrwxrwxrwx 1 user user 13 Mar 2 10:43 source -> /tmp/so/linux
drwxr-xr-x 1 user user 512 Mar 2 10:44 usr
drwxr-xr-x 1 user user 512 Mar 2 10:50 virt
-rwxr-xr-x 1 user user 14295892 Mar 2 11:04 vmlinux
-rw-r--r-- 1 user user 17819862 Mar 2 11:04 vmlinux.o
user#kleronomas:/tmp/so$ ls -ail ${INSTALL_MOD_PATH_EXT4}/lib/modules
total 0
844424931148038 drwxr-xr-x 1 user user 512 Mar 2 11:19 .
844424931148037 drwxr-xr-x 1 user user 512 Mar 2 12:12 ..
17732923533530216 drwxr-xr-x 1 user user 512 Mar 2 12:12 4.9.80-v7+
844424931148041 lrwxrwxrwx 1 user user 13 Mar 2 11:14 build -> /tmp/so/linux
1125899907858695 drwxr-xr-x 1 user user 512 Mar 2 11:17 kernel
1125899907858696 lrwxrwxrwx 1 user user 13 Mar 2 11:17 source -> /tmp/so/linux
You would then have to copy the build artifacts into your NTFS partition, which will be accessible from WSL2 in /mnt/c for C:, /mnt/d for D:, ...

why terminal output can't be saved to file when there's core dumped

I'm running an executable and trying to save terminal output to a file:
# ll
total 132
-rw-r--r--. 1 root root 496 Jun 14 11:41 mpx-debug.h
-rw-r--r--. 1 root root 12775 Jun 14 11:41 mpx-dig.c
-rw-r--r--. 1 root root 3526 Jun 14 11:41 mpx-hw.h
-rwxr-xr-x. 1 root root 65176 Jun 14 14:28 mpx-mini-test
-rw-r--r--. 1 root root 40480 Jun 14 11:41 mpx-mini-test.c
-rw-r--r--. 1 root root 205 Jun 14 11:41 mpx-mm.h
# ./mpx-mini-test
XSAVE is supported by HW & OS
XSAVE processor supported state mask: 0x1f
XSAVE OS supported state mask: 0x1f
BNDREGS: size: 64 user: 1 supervisor: 0 aligned: 0
BNDCSR: size: 64 user: 1 supervisor: 0 aligned: 0
no MPX support
Aborted (core dumped)
#
# ./mpx-mini-test | tee -a mpx-mini-test.log
#
# cat mpx-mini-test.log
#
As you can see, there're some prints in terminal without "| tee -a **.log".
But with "| tee -a **.log", nothing is saved to file.
I suspect it has something to do with the "Abort (core dumped)", did some googling but can't figure out exactly why. Is there anyone knows why? And how could I save all terminal outputs(including the "Abort (core dumped)") to file? Thanks in advance.

custom yum repo not showing rpm

I have a yum repository I've set up where I store custom rpms.
I have no problem finding information about other packages that were built and stored in this custom repo.
#yum --disablerepo=rhui-us-east-rhel-server-1y,epel,epel-testing --enablerepo=customrepo install php53-pecl-xdebug
php53-pecl-xdebug x86_64 2.2.1-2 customrepo 132 k
No problem.
Now I drop somerpm.rpm in centos/repo/5/noarch, run createrepo --update . in this directory and try the same command, and yet it shows no results.
I tried running createrepo --update in the root of the repo as well, but that did not work either (I'm actually not sure where to run it and if it needs a repodata directory in each subdir).
[root#reposerver mnt]# ls -l /var/www/repo/
total 12
-rw-r--r-- 1 root root 203 Jun 8 00:13 REPO_README
drwxr-xr-x 3 root root 4096 Jun 10 2011 centos
drwxr-xr-x 2 root root 4096 Oct 18 20:02 repodata
[root#reposerver mnt]# ls -l /var/www/repo/centos/5/
SRPMS/ i386/ noarch/ repodata/ x86_64/
[root#reposerver mnt]# ls -l /var/www/repo/centos/5/noarch/
total 7324
-rw-r--r-- 1 root root 1622 Jun 28 2011 compat-php-5.1.6-1.noarch.rpm
drwxr-xr-x 2 root root 4096 Oct 18 19:55 repodata
-rw-r--r-- 1 root root 1066928 Oct 18 19:54 salt-0.10.3-1.noarch.rpm
-rw-r--r-- 1 root root 6363197 Oct 18 19:54 salt-0.10.3-1.src.rpm
-rw-r--r-- 1 root root 21822 Oct 18 19:54 salt-master-0.10.3-1.noarch.rpm
-rw-r--r-- 1 root root 14294 Oct 18 19:54 salt-minion-0.10.3-1.noarch.rpm
I also tried adding the exactarch=0 flag to my repo config to ignore arch restrictions and this did not work either, it was a shot in the dark, since my rpm is noarch, it should show regardless.
# cat /etc/yum.repos.d/mycompany.repo
[mycompany]
name=mycompany custom repo
baseurl=http://config/repo/centos/5/$basearch
enabled=1
exactarch=0
I'm at a loss at this point. Usually createrepo --update does the trick, but for some reason it cannot find the new rpms.
repo]# find . -type f -name "*.gz" | xargs zcat | grep salt-minion
returns results as well, so it's definitely in the repo data.
yum clean all on the server I was trying to install on worked.
Also make sure to do createrepo --update on the specific subdir instead of the root of the repo.