[meta-selinux][PATCH 1/3] sysklogd: sync the initscript to latest oe-core version
Yi Zhao
The sysklogd has been updated to 2.1.1 in oe-core and the klogd was
removed from this version since syslogd performs logging of kernel messages. So we update the initscript to adapt it. Signed-off-by: Yi Zhao <yi.zhao@...> --- recipes-extended/sysklogd/files/sysklogd | 47 +++++++++++++++--------- 1 file changed, 29 insertions(+), 18 deletions(-) mode change 100755 => 100644 recipes-extended/sysklogd/files/sysklogd diff --git a/recipes-extended/sysklogd/files/sysklogd b/recipes-extended/sysklogd/files/sysklogd old mode 100755 new mode 100644 index 8c6eeb5..e49c2da --- a/recipes-extended/sysklogd/files/sysklogd +++ b/recipes-extended/sysklogd/files/sysklogd @@ -12,12 +12,13 @@ # Short-Description: System logger ### END INIT INFO +# Source function library. +. /etc/init.d/functions + PATH=/bin:/usr/bin:/sbin:/usr/sbin pidfile_syslogd=/var/run/syslogd.pid -pidfile_klogd=/var/run/klogd.pid -binpath_syslogd=/sbin/syslogd -binpath_klogd=/sbin/klogd +binpath_syslogd=/usr/sbin/syslogd test -x $binpath || exit 0 @@ -87,6 +88,22 @@ running() return 0 } +waitpid () +{ + pid=$1 + # Give pid a chance to exit before we restart with a 5s timeout in 1s intervals + if [ -z "$pid" ]; then + return + fi + timeout=5; + while [ $timeout -gt 0 ] + do + timeout=$(( $timeout-1 )) + kill -0 $pid 2> /dev/null || break + sleep 1 + done +} + case "$1" in start) log_begin_msg "Starting system log daemon..." @@ -94,36 +111,24 @@ case "$1" in start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD test ! -x /sbin/restorecon || /sbin/restorecon -RF /dev/log /var/log/ log_end_msg $? - log_begin_msg "Starting kernel log daemon..." - start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD - log_end_msg $? ;; stop) log_begin_msg "Stopping system log daemon..." start-stop-daemon --stop --quiet --pidfile $pidfile_syslogd --name syslogd log_end_msg $? - log_begin_msg "Stopping kernel log daemon..." - start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd - log_end_msg $? ;; reload|force-reload) log_begin_msg "Reloading system log daemon..." start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile_syslogd --name syslogd log_end_msg $? - log_begin_msg "Reloading kernel log daemon..." - start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd - start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD - log_end_msg $? ;; restart) log_begin_msg "Restarting system log daemon..." + pid=`cat $pidfile_syslogd 2> /dev/null` start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile_syslogd --name syslogd + waitpid $pid start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD log_end_msg $? - log_begin_msg "Reloading kernel log daemon..." - start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd - start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD - log_end_msg $? ;; reload-or-restart) if running @@ -133,8 +138,14 @@ case "$1" in $0 start fi ;; + status) + status syslogd + RETVAL=$? + [ $RETVAL -eq 0 ] && exit $rval + exit $RETVAL + ;; *) - log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}" + log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart|status}" exit 1 esac -- 2.17.1
|
|
[meta-selinux][PATCH 3/3] bind: install volatiles file with correct name
Yi Zhao
Install volatiles file as 04_bind rather than volatiles.04_bind.
Signed-off-by: Yi Zhao <yi.zhao@...> --- recipes-connectivity/bind/bind_selinux.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-connectivity/bind/bind_selinux.inc b/recipes-connectivity/bind/bind_selinux.inc index 1dfef8a..1be9260 100644 --- a/recipes-connectivity/bind/bind_selinux.inc +++ b/recipes-connectivity/bind/bind_selinux.inc @@ -4,7 +4,7 @@ SRC_URI += "file://volatiles.04_bind" do_install_append() { install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/volatiles.04_bind ${D}${sysconfdir}/default/volatiles/volatiles.04_bind + install -m 0644 ${WORKDIR}/volatiles.04_bind ${D}${sysconfdir}/default/volatiles/04_bind sed -i '/^\s*\/usr\/sbin\/rndc-confgen/a\ [ -x /sbin/restorecon ] && /sbin/restorecon -F /etc/bind/rndc.key' ${D}${sysconfdir}/init.d/bind -- 2.17.1
|
|
[meta-selinux][PATCH 2/3] eudev: remove udev-cache and sync the initscript to latest oe-core version
Yi Zhao
The udev-cache has been remove in oe-core commit
048f4149b8438c521e8b65a3c96d850a9b4a3e5b. So we can also remove it. Also sync the initscript to latest oe-core version. Signed-off-by: Yi Zhao <yi.zhao@...> --- recipes-core/eudev/files/init | 66 +++++------------------------ recipes-core/eudev/files/udev-cache | 32 -------------- 2 files changed, 11 insertions(+), 87 deletions(-) delete mode 100644 recipes-core/eudev/files/udev-cache diff --git a/recipes-core/eudev/files/init b/recipes-core/eudev/files/init index ee64f86..daa4079 100644 --- a/recipes-core/eudev/files/init +++ b/recipes-core/eudev/files/init @@ -3,7 +3,7 @@ ### BEGIN INIT INFO # Provides: udev # Required-Start: mountvirtfs -# Required-Stop: +# Required-Stop: # Default-Start: S # Default-Stop: # Short-Description: Start udevd, populate /dev and load drivers. @@ -14,23 +14,10 @@ export TZ=/etc/localtime [ -d /sys/class ] || exit 1 [ -r /proc/mounts ] || exit 1 [ -x @UDEVD@ ] || exit 1 -if [ "$use_udev_cache" != "" ]; then - [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache -fi + [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf [ -f /etc/default/rcS ] && . /etc/default/rcS -readfiles () { - READDATA="" - for filename in $@; do - if [ -r $filename ]; then - while read line; do - READDATA="$READDATA$line" - done < $filename - fi - done -} - kill_udevd () { pid=`pidof -x udevd` [ -n "$pid" ] && kill $pid @@ -59,58 +46,27 @@ case "$1" in # the automount rule for udev needs /tmp directory available, as /tmp is a symlink # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure # /var/volatile/tmp directory to be available. - mkdir -p /var/volatile/tmp + mkdir -m 1777 -p /var/volatile/tmp # restorecon /run early to allow mdadm creating dir /run/mdadm test ! -x /sbin/restorecon || /sbin/restorecon -F /run - # Cache handling. - # A list of files which are used as a criteria to judge whether the udev cache could be reused. - CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" - if [ "$use_udev_cache" != "" ]; then - if [ "$DEVCACHE" != "" ]; then - if [ -e $DEVCACHE ]; then - readfiles $CMP_FILE_LIST - NEWDATA="$READDATA" - readfiles /etc/udev/cache.data - OLDDATA="$READDATA" - if [ "$OLDDATA" = "$NEWDATA" ]; then - tar --directory=/ -xf $DEVCACHE > /dev/null 2>&1 - not_first_boot=1 - [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" - [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache - else - # Output detailed reason why the cached /dev is not used - if [ "$VERBOSE" != "no" ]; then - echo "udev: udev cache not used" - echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" - echo "udev: olddata: $OLDDATA" - echo "udev: newdata: $NEWDATA" - fi - echo "$NEWDATA" > /dev/shm/udev.cache - fi - else - if [ "$ROOTFS_READ_ONLY" != "yes" ]; then - # If rootfs is not read-only, it's possible that a new udev cache would be generated; - # otherwise, we do not bother to read files. - readfiles $CMP_FILE_LIST - echo "$READDATA" > /dev/shm/udev.cache - fi - fi - fi - fi - # make_extra_nodes kill_udevd > "/dev/null" 2>&1 # trigger the sorted events - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + [ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug @UDEVD@ -d udevadm control --env=STARTUP=1 if [ "$not_first_boot" != "" ];then - udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform - (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& + if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then + PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" + else + PLATFORM_BUS_NOMATCH="" + fi + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH + (udevadm settle --timeout=3; udevadm control --env=STARTUP=)& else udevadm trigger --action=add udevadm settle diff --git a/recipes-core/eudev/files/udev-cache b/recipes-core/eudev/files/udev-cache deleted file mode 100644 index 6898577..0000000 --- a/recipes-core/eudev/files/udev-cache +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -e - -### BEGIN INIT INFO -# Provides: udev-cache -# Required-Start: mountall -# Required-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: cache /dev to speedup the udev next boot -### END INIT INFO - -export TZ=/etc/localtime - -[ -r /proc/mounts ] || exit 1 -[ -x @UDEVD@ ] || exit 1 -[ -d /sys/class ] || exit 1 - -[ -f /etc/default/rcS ] && . /etc/default/rcS -[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache - -if [ "$ROOTFS_READ_ONLY" = "yes" ]; then - [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache" - exit 0 -fi - -if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then - echo "Populating dev cache" - tar --directory=/ --selinux --xattrs -cf "$DEVCACHE" dev - mv /dev/shm/udev.cache /etc/udev/cache.data -fi - -exit 0 -- 2.17.1
|
|
Zeus - Post Build folder corruption
#yocto
Joel Winarske
Has anyone seen this post build? Where there are folders created of random items? Some folders have a path deep of 5+. joel@hammer:/media/joel/SolidState/rpi/rpi4-64$ ls '!=' 'os.path.join('\''' bitbake-cookerdaemon.log 'os.path.normpath(d.getVar('\''S'\''))' cache 'os.path.normpath(d.getVar('\''WORKDIR'\''))' conf ''\''patches'\'')}' '${@d.getVar('\''S'\'')' sstate-cache else tmp if
|
|
Tim Orling
On Fri, Apr 3, 2020 at 8:29 PM <zidouhzakaria@...> wrote: Hello, Numpy is already part of oe-core: Why not just use the existing recipe?
|
|
zidouhzakaria@...
Hello,
I am trying to install numpy module in my image using "pipoe". When i bitbake my recipe i got this : Log data follows: | DEBUG: Executing shell function do_compile | ERROR: python3 setup.py build_ext execution failed. | numpy/random/_bounded_integers.pxd.in has not changed | Processing numpy/random/_mt19937.pyx | Traceback (most recent call last): | File "path/to/build/work/aarch64-poky-linux/python3-numpy/1.18.2-r0/numpy-1.18.2/tools/cythonize.py", line 61, in process_pyx | from Cython.Compiler.Version import version as cython_version | ImportError: No module named 'Cython' I installed Cython also with pipoe and added : RDEPENDS_${PN} = "${PYTHON_PN}-cython" to numpy recipe but nothing changed. Any idea ? Thank you
|
|
Re: JFFS2 no udef, all char/block devices hardlinked to /dev/console
Andreas Dröscher <yocto@...>
Am 03.04.20 um 19:26 schrieb Khem Raj:
I hope so. Steps I took for debugging.are you running same mkfs.jffs2 utility in and outside yocto experiment ? if not then lets fix that first, it could be a problem in the native package that yocto build system produces. I changed EXTRA_IMAGECMD_jffs2: EXTRA_IMAGECMD_jffs2="-p -l -e 0x20000 -D /data/my-device-table.txt -v; exit 1" This on one hand enables verbose mkfs.jffs2 and on other hand breaks the step. Therefore the root-fs folder is not cleaned up and I can reraun the comand from the run.do_image script. Trimmed verbose output of: $ bitbake core-image-minimal ERROR: core-image-minimal-1.0-r0 do_image_jffs2: Execution of '/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/temp/run.do_image_jffs2.24583' failed with exit code 1: / d 0755 0 0:0 bin d 0755 0 0:0 boot d 0755 0 0:0 dev d 0755 0 0:0 etc d 0755 0 0:0 home d 0755 0 0:0 lib d 0755 0 0:0 media d 0755 0 0:0 mnt d 0555 0 0:0 proc d 0755 0 0:0 run d 0755 0 0:0 sbin d 0555 0 0:0 sys d 1777 0 0:0 tmp d 0755 0 0:0 usr d 0755 0 0:0 var /bin l 0777 19 0:0 ash -> /bin/busybox.nosuid l 0777 14 0:0 busybox -> busybox.nosuid f 0755 914688 ( 551963) 0:0 busybox.nosuid f 4755 68204 ( 39081) 0:0 busybox.suid l 0777 19 0:0 cat -> /bin/busybox.nosuid l 0777 19 0:0 chattr -> /bin/busybox.nosuid ... /boot /dev c 0640 5, 1 0:0 console L 0640 81 0:0 full L 0640 81 0:0 mtd0 L 0640 81 0:0 mtd1 L 0640 81 0:0 mtd2 L 0640 81 0:0 mtd3 L 0640 81 0:0 mtd4 L 0640 81 0:0 mtd5 L 0640 81 0:0 mtd6 L 0640 81 0:0 mtd7 L 0640 81 0:0 mtdblock0 L 0640 81 0:0 mtdblock1 L 0640 81 0:0 mtdblock2 L 0640 81 0:0 mtdblock3 L 0640 81 0:0 mtdblock4 L 0640 81 0:0 mtdblock5 grep "PATH=" run.do_image_jffs2 returns: export PATH="/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot/usr/bin/crossscripts:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot/opt/poky/3.0.2/sysroots/x86_64-pokysdk-linux/usr/bin/crossscripts:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot/usr/bin/crossscripts:/data/oe-core/poky/build-au1100-hw/tmp/sysroots-uninative/x86_64-linux/usr/bin:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin/python3-native:/data/oe-core/poky/scripts:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin/mipsel-poky-linux-musl:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot/usr/bin/crossscripts:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/sbin:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot-native/sbin:/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/recipe-sysroot-native/bin:/data/oe-core/poky/bitbake/bin:/data/oe-core/poky/build-au1100-hw/tmp/hosttools" So I do export the PATH above, result: $ mkfs.jffs2 --version mkfs.jffs2 (mtd-utils) 2.1.1 Note my Ubuntu has: $ mkfs.jffs2 --version mkfs.jffs2 (mtd-utils) 2.0.1 Finaly I run: $ mkfs.jffs2 --root=/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/rootfs --faketime --output=/data/oe-core/poky/build-au1100-hw/tmp/work/au1100_hw-poky-linux-musl/core-image-minimal/1.0-r0/deploy-core-image-minimal-image-complete/core-image-minimal-au1100-hw-20200403193756.rootfs.jffs2 -p -l -e 0x20000 -D /data/my-device-table.txt -v; Output: / d 0755 0 1000:1000 bin d 0755 0 1000:1000 boot d 0755 0 1000:1000 dev d 0755 0 1000:1000 etc d 0755 0 1000:1000 home d 0755 0 1000:1000 lib d 0755 0 1000:1000 media d 0755 0 1000:1000 mnt d 0755 0 1000:1000 proc d 0755 0 1000:1000 run d 0755 0 1000:1000 sbin d 0755 0 1000:1000 sys d 1755 0 1000:1000 tmp d 0755 0 1000:1000 usr d 0755 0 1000:1000 var /bin l 0777 19 0:0 ash -> /bin/busybox.nosuid l 0777 14 0:0 busybox -> busybox.nosuid f 0755 914688 ( 551963) 0:0 busybox.nosuid f 4755 68204 ( 39081) 0:0 busybox.suid l 0777 19 0:0 cat -> /bin/busybox.nosuid l 0777 19 0:0 chattr -> /bin/busybox.nosuid ... /boot /dev c 0640 5, 1 0:0 console c 0640 1, 7 0:0 full c 0640 90, 0 0:0 mtd0 c 0640 90, 2 0:0 mtd1 c 0640 90, 4 0:0 mtd2 c 0640 90, 6 0:0 mtd3 c 0640 90, 8 0:0 mtd4 c 0640 90, 10 0:0 mtd5 c 0640 90, 12 0:0 mtd6 c 0640 90, 14 0:0 mtd7 b 0640 31, 0 0:0 mtdblock0 b 0640 31, 1 0:0 mtdblock1 b 0640 31, 2 0:0 mtdblock2 b 0640 31, 3 0:0 mtdblock3 b 0640 31, 4 0:0 mtdblock4 b 0640 31, 5 0:0 mtdblock5 b 0640 31, 6 0:0 mtdblock6 b 0640 31, 7 0:0 mtdblock7
|
|
Re: Files get sporadically lost for native packages
On 2020-04-02 4:44 a.m., Konrad
Weihmann wrote:
Hi Konrad, Thanks for the detailed and complete replies. I don't think I've seen this error and we do 100s of builds My first *wild* guess is that the problem might go away on the
Azure I've also BCCed someone who might know someone who It would also be helpful if you created a defect in: https://bugzilla.yoctoproject.org/ and hopefully add a patch in that defect including the -native
recipes that Thanks, ../Randy
-- # Randy MacLeod # Wind River Linux
|
|
Re: JFFS2 no udef, all char/block devices hardlinked to /dev/console
On 4/3/20 1:45 AM, Andreas Dröscher wrote:
Hiare you running same mkfs.jffs2 utility in and outside yocto experiment ? if not then lets fix that first, it could be a problem in the native package that yocto build system produces. Example Output of ls /dev/*:the fact that it works outside yocto, I think it might be premature to disable it, we should see if we can find the real cause for the issue, it could be fixed rightly then ---
|
|
[meta-selinux][PATCH] clean up getVar() usage
Joe MacDonald
83eac4de updated the usage of getVar() in classes/selinux.bbclass to
leave out the default expand parameter. This is consistent with the usage in the core layers. Bring all other calls to getVar() in the layer into alignment with this approach. Signed-off-by: Joe MacDonald <joe_macdonald@...> --- recipes-core/busybox/busybox_selinux.inc | 8 ++++---- recipes-security/refpolicy/refpolicy_common.inc | 2 +- recipes-security/selinux/libselinux-python.inc | 2 +- recipes-security/selinux/libselinux.inc | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes-core/busybox/busybox_selinux.inc b/recipes-core/busybox/busybox_selinux.inc index cc83b01..6e491ce 100644 --- a/recipes-core/busybox/busybox_selinux.inc +++ b/recipes-core/busybox/busybox_selinux.inc @@ -8,9 +8,9 @@ python create_sh_wrapper_reset_alternative_vars () { # We need to load the full set of busybox provides from the /etc/busybox.links # Use this to see the update-alternatives with the right information - dvar = d.getVar('D', True) - pn = d.getVar('PN', True) - base_bindir = d.getVar('base_bindir', True) + dvar = d.getVar('D') + pn = d.getVar('PN') + base_bindir = d.getVar('base_bindir') def create_sh_alternative_vars(links, target, mode): import shutil @@ -20,7 +20,7 @@ python create_sh_wrapper_reset_alternative_vars () { os.fchmod(fwp.fileno(), mode) fwp.close() # Install the sh wrappers and alternatives reset to link to them - wpdir = os.path.join(d.getVar('libdir', True), pn) + wpdir = os.path.join(d.getVar('libdir'), pn) wpdir_dest = '%s%s' % (dvar, wpdir) if not os.path.exists(wpdir_dest): os.makedirs(wpdir_dest) diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc index 2083a37..1d9ca93 100644 --- a/recipes-security/refpolicy/refpolicy_common.inc +++ b/recipes-security/refpolicy/refpolicy_common.inc @@ -117,7 +117,7 @@ python __anonymous () { # make sure DEFAULT_ENFORCING is something sane if not re.match('^(enforcing|permissive|disabled)$', - d.getVar('DEFAULT_ENFORCING', True), + d.getVar('DEFAULT_ENFORCING'), flags=0): d.setVar('DEFAULT_ENFORCING', 'permissive') } diff --git a/recipes-security/selinux/libselinux-python.inc b/recipes-security/selinux/libselinux-python.inc index 24407e8..6a64473 100644 --- a/recipes-security/selinux/libselinux-python.inc +++ b/recipes-security/selinux/libselinux-python.inc @@ -14,7 +14,7 @@ RDEPENDS_${PN} += "libselinux python3-core python3-shell" def get_policyconfigarch(d): import re - target = d.getVar('TARGET_ARCH', True) + target = d.getVar('TARGET_ARCH') p = re.compile('i.86') target = p.sub('i386',target) return "ARCH=%s" % (target) diff --git a/recipes-security/selinux/libselinux.inc b/recipes-security/selinux/libselinux.inc index 8d381de..fe8c087 100644 --- a/recipes-security/selinux/libselinux.inc +++ b/recipes-security/selinux/libselinux.inc @@ -12,7 +12,7 @@ DEPENDS_append_libc-musl = " fts" def get_policyconfigarch(d): import re - target = d.getVar('TARGET_ARCH', True) + target = d.getVar('TARGET_ARCH') p = re.compile('i.86') target = p.sub('i386',target) return "ARCH=%s" % (target) -- 2.20.1
|
|
Re: Inappropriate error handling
On Fri, 03 Apr 2020 02:50:56 -0700
Thomas Köller <thomas@...> wrote: Hi,This has been discussed last month: https://lists.yoctoproject.org/g/yocto/topic/71426351. I ended up using Joshua Watt's suggestion to run the setscene tasks in a separate bitbake process and ignore failure: bitbake --setscene-only <target> || true bitbake --skip-setscene <target> I'd like to come up with something better but I don't have the bandwidth to look into it further right now. Thanks, -- Paul Barker Konsulko Group
|
|
Inappropriate error handling
Thomas Köller
Hi,
here is an excerpt from a log of a failed build: WARNING: icu-60.2-r0 do_populate_sysroot_setscene: Failed to fetch URL file://bd/sstate:icu:aarch64-poky-linux:60.2:r0:aarch64:3:bd6b12b7f20a46d35ce4d9382c306075_populate_sysroot.tgz;downloadfilename=bd/sstate:icu:aarch64-poky-linux:60.2:r0:aarch64:3:bd6b12b7f20a46d35ce4d9382c306075_populate_sysroot.tgz, attempting MIRRORS if available ERROR: icu-60.2-r0 do_populate_sysroot_setscene: Fetcher failure: Unable to find file file://bd/sstate:icu:aarch64-poky-linux:60.2:r0:aarch64:3:bd6b12b7f20a46d35ce4d9382c306075_populate_sysroot.tgz;downloadfilename=bd/sstate:icu:aarch64-poky-linux:60.2:r0:aarch64:3:bd6b12b7f20a46d35ce4d9382c306075_populate_sysroot.tgz anywhere. The paths that were searched were: /mnt/data/jenkins/workspace/imx-manifest_warrior/sstate /mnt/data/jenkins/workspace/imx-manifest_warrior/sstate ERROR: icu-60.2-r0 do_populate_sysroot_setscene: No suitable staging package found WARNING: Logfile for failed setscene task is /mnt/data/jenkins/workspace/imx-manifest_warrior/buildroot/imx8mqevk-basler/imx-4.14.98-2.0.0_ga_basler/basler-dart-bcon-mipi-dev/build/tmp/work/aarch64-poky-linux/icu/60.2-r0/temp/log.do_populate_sysroot_setscene.44028 WARNING: Setscene task (/mnt/data/jenkins/workspace/imx-manifest_warrior/buildroot/imx8mqevk-basler/imx-4.14.98-2.0.0_ga_basler/basler-dart-bcon-mipi-dev/sources/poky/meta/recipes-support/icu/icu_60.2.bb:do_populate_sysroot_setscene) failed with exit code '1' - real task will be run instead As can be seen, a setscene task failed. I do not (yet) know why this happened, but that is not what this message is about. What matters is that the real task will be executed later, which works just fine, and the entire build runs to completion without any further errors. However, at the very end I get the following output: Summary: There were 2 WARNING messages shown. Summary: There were 2 ERROR messages shown, returning a non-zero exit code. And then the non-zero exit code that is returned causes my script to take the error exit, even though the build products are all fine and perfectly usable. This really should not happen.
|
|
JFFS2 no udef, all char/block devices hardlinked to /dev/console
Andreas Dröscher <yocto@...>
Hi
I'm doing a Yocto Zeus build for a very old Linux Kernel (The Kernel is built outside of Yocto). Since my target CPU, based on mips32 little endian, was removed from Linux mainline I've opted to use musl to keep at least the user space up to date. I'm building a JFFS2 root fs using --devtable= since my kernel does not have devfs/udev. The file looks like: /dev/console c 640 0 0 5 1 - - - /dev/full c 640 0 0 1 7 - - - /dev/mtd c 640 0 0 90 0 0 2 8 /dev/mtdblock b 640 0 0 31 0 0 1 8 /dev/null c 666 0 0 1 3 - - - ... Running mkfs.jffs2 outside Yocto works. Running mkfs.jffs2 as part of the default image build step breaks my char/block devices. All device files are hard linked to the first one. Moreover the permissions are also reset. Example Output of ls /dev/*: crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/console crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/full crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtd0 crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtd1 ... crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtdblock0 crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtdblock1 .. crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtdchar crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/null It looks like add_host_filesystem_entry calls lstat for all files added to the JFFS2 including files that do not exist. For some reason I do not yet understand lstat returns garbage instead of just failing on my system (Ubuntu 18.04). This in turn leads to the hard linking and permisson issues described above. I suggest to disable lstat for device files to counter this issue: --- jffsX-utils/mkfs.jffs2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c index 9afd920..2779706 100644 --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c @@ -219,14 +219,18 @@ static struct filesystem_entry *add_host_filesystem_entry(const char *name, const char *path, unsigned long uid, unsigned long gid, unsigned long mode, dev_t rdev, struct filesystem_entry *parent) { - int status; + int status = -1; char *tmp; struct stat sb; time_t timestamp = time(NULL); struct filesystem_entry *entry; memset(&sb, 0, sizeof(struct stat)); - status = lstat(path, &sb); + + //Do not call lstat for char- and block-devices + if (major(rdev) == 0) { + status = lstat(path, &sb); + } if (status >= 0) { /* It is ok for some types of files to not exit on disk (such as -- 2.17.1 Andreas
|
|
JFFS2 no udef, all char/block devices hardlinked to /dev/console
yocto@...
Hi
I'm doing a Yocto Zeus build for a very old Linux Kernel (The Kernel is built outside of Yocto). Since my target CPU, based on mips32 little endian, was removed from Linux mainline I've opted to use musl to keep at least the user space up to date. I'm building a JFFS2 root fs using --devtable= since my kernel does not have devfs/udev. The file looks like: /dev/console c 640 0 0 5 1 - - - /dev/full c 640 0 0 1 7 - - - /dev/mtd c 640 0 0 90 0 0 2 8 /dev/mtdblock b 640 0 0 31 0 0 1 8 /dev/null c 666 0 0 1 3 - - - ... Running mkfs.jffs2 outside Yocto works. Running mkfs.jffs2 as part of the default image build step breaks my char/block devices. All device files are hard linked to the first one. Moreover the permissions are also reset. Example Output of ls /dev/*: crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/console crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/full crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtd0 crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtd1 ... crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtdblock0 crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtdblock1 .. crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/mtdchar crw-r----- 16 root root 5, 1, Jan 1 1970 /dev/null It looks like add_host_filesystem_entry calls lstat for all files added to the JFFS2 including files that do not exist. For some reason I do not yet understand lstat returns garbage instead of just failing on my system (Ubuntu 18.04). This in turn leads to the hard linking and permisson issues described above. I suggest to disable lstat for device files to counter this issue: --- jffsX-utils/mkfs.jffs2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c index 9afd920..2779706 100644 --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c @@ -219,14 +219,18 @@ static struct filesystem_entry *add_host_filesystem_entry(const char *name, const char *path, unsigned long uid, unsigned long gid, unsigned long mode, dev_t rdev, struct filesystem_entry *parent) { - int status; + int status = -1; char *tmp; struct stat sb; time_t timestamp = time(NULL); struct filesystem_entry *entry; memset(&sb, 0, sizeof(struct stat)); - status = lstat(path, &sb); + + //Do not call lstat for char- and block-devices + if (major(rdev) == 0) { + status = lstat(path, &sb); + } if (status >= 0) { /* It is ok for some types of files to not exit on disk (such as -- 2.17.1 Andreas
|
|
Re: Building dependencies in yocto for GO language project
salman.isd@...
Solved... I had to add the following to the recipe and then it works.
DEPENDS += "go-dep-native" do_compile_prepend() {
cd ${WORKDIR}/build/src/${GO_
dep init
dep ensure
}
|
|
Building dependencies in yocto for GO language project
salman.isd@...
I am trying to build a GO project using yocto using the following recipe DESCRIPTION = "An Identity Provider for ORY Hydra over LDAP" SECTION = "examples" HOMEPAGE = "https://github.com/i-core/werther" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=c22a4ad704abf6e006791a40249a18cb" GO_IMPORT = "github.com/i-core/werther" SRC_URI = "git://${GO_IMPORT}" SRCREV = "${AUTOREV}" FILES_${PN} += "${GOBIN_FINAL}/*" inherit go DEPENDS += "go-dep"
ERROR: werther-1.1.1-r0 do_compile: Function failed: do_compile (log file is located at /tmp/tala/tmp/work/cortexa9-neon-tala-linux-gnueabi/werther/1.1.1-r0/temp/log.do_compile.10723) ERROR: Logfile of failure stored in: /tmp/tala/tmp/work/cortexa9-neon-tala-linux-gnueabi/werther/1.1.1-r0/temp/log.do_compile.10723 Log data follows: | DEBUG: Executing shell function do_compile | src/github.com/i-core/werther/internal/ldapclient/ldapclient.go:20:2: cannot find package "github.com/coocood/freecache" in any of: | /tmp/tala/tmp/work/cortexa9-neon-tala-linux-gnueabi/werther/1.1.1-r0/recipe-sysroot/usr/lib/go/src/github.com/coocood/freecache (from $GOROOT)
| /tmp/tala/tmp/work/cortexa9-neon-tala-linux-gnueabi/werther/1.1.1-r0/build/src/github.com/coocood/freecache (from $GOPATH)
|
|
Re: [meta-spdxscanner][PATCH V2] Remove redundant code.
Joshua Watt
On 4/2/20 11:45 AM, Li, Xiaoming wrote:
FOLDER_ID has already been assigned a defalut value "1", so there is no need add 'or "1"' here. Signed-off-by: Li Xiaoming <lixm.fnst@...> --- classes/fossology-rest.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/fossology-rest.bbclass b/classes/fossology-rest.bbclass index 5c5ef70..69f4998 100644 --- a/classes/fossology-rest.bbclass +++ b/classes/fossology-rest.bbclass @@ -230,7 +230,7 @@ def get_folder_id(d): folder_name = d.getVar('FOLDER_NAME') folder_id = create_folder(d, folder_name) else: - folder_id = (d.getVar('FOLDER_ID', True) or "1") + folder_id = d.getVar('FOLDER_ID', False) You probably shouldn't be disabling variable expansion here (i.e.
passing False as the second argument)? bb.note("Folder Id = " + str(folder_id)) return str(folder_id)
|
|
stefan.wenninger@...
Thank you for your quick clarifications. Sadly we are limited by our hardware to use Yocto for now.
I consider this thread closed. Thanks again, Stefan
|
|
initramfs with mdev: No match for argument: busybox-mdev
y1dekel@...
I am new to yocto. I have read some messages on this forum which suggest ways to build an image with initramfs and mdev.
I have added an mdev include fragment as follows: I also implemented a receipt for our image as follows: Any idea what I might be missing here?
|
|
Josef Holzmayr <holzmayr@...>
Howdy!
On Thu, Apr 02, 2020 at 02:31:44AM -0700, stefan.wenninger@... wrote: So basically our problem is trying to install .deb packages meant for debian-apt with yocto-apt?Exactly. Would it be possible to install the debian-apt on our system (outside of yocto) and then use the debian.org packages?Nope. Whats the reason of using Yocto anyways if you are then jumping through all kinds of hoops to just make it behave like a Debian? If you want a Debian, you should probably be using a Debian :) Having said that, there are buliding tools for ingesting the debian repositories and spitting out an image, like Linutronix' ELBE or the ISAR project. Maybe thats what fits your needs? Greetz
-- ——————————————— Josef Holzmayr Software Developer Embedded Systems Tel: +49 8444 9204-48 Fax: +49 8444 9204-50 R-S-I Elektrotechnik GmbH & Co. KG Woelkestrasse 11 D-85301 Schweitenkirchen www.rsi-elektrotechnik.de ——————————————— Amtsgericht Ingolstadt – GmbH: HRB 191328 – KG: HRA 170393 Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg Ust-IdNr: DE 128592548 _____________________________________________________________ Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363 Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg USt-IdNr.: DE 128592548
|
|