Re: [OE-core] [PATCH 1/2] initscripts: Fix various shellcheck warnings in populate-volatile.sh

2020-07-24 Thread Khem Raj
What all shells has it been tested for ?

On Fri, Jul 24, 2020 at 10:12 AM Andrei Gherzan  wrote:

> Signed-off-by: Andrei Gherzan 
> ---
>  .../initscripts-1.0/populate-volatile.sh  | 58 +--
>  1 file changed, 29 insertions(+), 29 deletions(-)
>
> diff --git
> a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
> b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
> index 1c525b71bd..3a265329f0 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
> @@ -9,10 +9,10 @@
>  ### END INIT INFO
>
>  # Get ROOT_DIR
> -DIRNAME=`dirname $0`
> -ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
> +DIRNAME="$(dirname "$0")"
> +ROOT_DIR="$(echo "$DIRNAME" | sed -ne 's:/etc/.*::p')"
>
> -[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS
> +[ -e "${ROOT_DIR}/etc/default/rcS" ] && . "${ROOT_DIR}/etc/default/rcS"
>  # When running populate-volatile.sh at rootfs time, disable cache.
>  [ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no
>  # If rootfs is read-only, disable cache.
> @@ -46,13 +46,13 @@ create_file() {
> [ "${VERBOSE}" != "no" ] && echo "Target already exists.
> Skipping."
> } || {
> if [ -z "$ROOT_DIR" ]; then
> -   eval $EXEC
> +   eval "$EXEC"
> else
> # Creating some files at rootfs time may fail and
> should fail,
> # but these failures should not be logged to make
> sure the do_rootfs
> # process doesn't fail. This does no harm, as this
> script will
> # run on target to set up the correct files and
> directories.
> -   eval $EXEC > /dev/null 2>&1
> +   eval "$EXEC" > /dev/null 2>&1
> fi
> }
>  }
> @@ -68,11 +68,11 @@ mk_dir() {
> [ "${VERBOSE}" != "no" ] && echo "Target already exists.
> Skipping."
> } || {
> if [ -z "$ROOT_DIR" ]; then
> -   eval $EXEC
> +   eval "$EXEC"
> else
> # For the same reason with create_file(), failures
> should
> # not be logged.
> -   eval $EXEC > /dev/null 2>&1
> +   eval "$EXEC" > /dev/null 2>&1
> fi
> }
>  }
> @@ -96,11 +96,11 @@ link_file() {
> test "$VOLATILE_ENABLE_CACHE" = yes && echo "   $EXEC" >>
> /etc/volatile.cache.build
>
> if [ -z "$ROOT_DIR" ]; then
> -   eval $EXEC
> +   eval "$EXEC"
> else
> # For the same reason with create_file(), failures should
> # not be logged.
> -   eval $EXEC > /dev/null 2>&1
> +   eval "$EXEC" > /dev/null 2>&1
> fi
>  }
>
> @@ -117,11 +117,11 @@ check_requirements() {
> TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
> TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
>
> -   sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/passwd | sort | uniq >
> "${TMP_DEFINED}"
> -   cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 >
> "${TMP_INTERMED}"
> +   sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/passwd" | sort | uniq >
> "${TMP_DEFINED}"
> +   grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
> cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq >
> "${TMP_COMBINED}"
> -   NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
> -   NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
> +   NR_DEFINED_USERS="$(wc -l < "${TMP_DEFINED}")"
> +   NR_COMBINED_USERS="$(wc -l < "${TMP_COMBINED}")"
>
> [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
> echo "Undefined users:"
> @@ -131,12 +131,12 @@ check_requirements() {
> }
>
>
> -   sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/group | sort | uniq >
> "${TMP_DEFINED}"
> -   cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 >
> "${TMP_INTERMED}"
> +   sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/group" | sort | uniq >
> "${TMP_DEFINED}"
> +   grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
> cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq >
> "${TMP_COMBINED}"
>
> -   NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
> -   NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
> +   NR_DEFINED_GROUPS="$(wc -l < "${TMP_DEFINED}")"
> +   NR_COMBINED_GROUPS="$(wc -l < "${TMP_COMBINED}")"
>
> [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
> echo "Undefined groups:"
> @@ -157,13 +157,13 @@ apply_cfgfile() {
>
> [ "${VERBOSE}" != "no" ] && echo "Applying ${CFGFILE}"
>
> -   [ "${SKIP_REQUIREMENTS}" == "yes" ] || check_requirements
> "${CFGFILE}" || {
> +   [ "${SKIP_REQUIREMENTS}" = 

[v1 resend][oe-core][PATCH 1/1] gconf: use python3

2020-07-24 Thread Joe Slater
Modify gsettings-schema-convert to use python3.  Also
add RDEPEND on python3-xml.

Signed-off-by: Joe Slater 
---
 meta/recipes-gnome/gnome/gconf/python3.patch | 60 
 meta/recipes-gnome/gnome/gconf_3.2.6.bb  |  3 ++
 2 files changed, 63 insertions(+)
 create mode 100644 meta/recipes-gnome/gnome/gconf/python3.patch

diff --git a/meta/recipes-gnome/gnome/gconf/python3.patch 
b/meta/recipes-gnome/gnome/gconf/python3.patch
new file mode 100644
index 000..7c022a2
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gconf/python3.patch
@@ -0,0 +1,60 @@
+gconf: use python3
+
+Convert gsettings-schema-convert to use python3.
+
+Upstream-Status: Inappropriate [gconf is deprecated]
+
+Signed-off-by: Joe Slater 
+
+
+--- a/gsettings/gsettings-schema-convert
 b/gsettings/gsettings-schema-convert
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # vim: set ts=4 sw=4 et: coding=UTF-8
+ #
+ # Copyright (c) 2010, Novell, Inc.
+@@ -603,7 +603,7 @@ class SimpleSchemaParser:
+ for line in lines:
+ current_line_nb += 1
+ self.parse_line(line)
+-except GSettingsSchemaConvertException, e:
++except GSettingsSchemaConvertException as e:
+ raise GSettingsSchemaConvertException('%s:%s: %s' % 
(os.path.basename(self.file), current_line_nb, e))
+ 
+ return self.root
+@@ -1095,7 +1095,7 @@ def main(args):
+ try:
+ parser = GConfSchemaParser(argfile, options.gettext_domain, 
options.schema_id, options.keep_underscores)
+ schema_root = parser.parse()
+-except SyntaxError, e:
++except SyntaxError as e:
+ raise GSettingsSchemaConvertException('\'%s\' does not look 
like a valid gconf schema file: %s' % (argfile, e))
+ else:
+ # autodetect if file is XML or not
+@@ -1104,7 +1104,7 @@ def main(args):
+ schema_root = parser.parse()
+ if not options.simple and not options.xml:
+ options.simple = True
+-except SyntaxError, e:
++except SyntaxError as e:
+ parser = SimpleSchemaParser(argfile)
+ schema_root = parser.parse()
+ if not options.simple and not options.xml:
+@@ -1127,13 +1127,13 @@ def main(args):
+ fout = open(options.output, 'w')
+ fout.write(output)
+ fout.close()
+-except GSettingsSchemaConvertException, e:
++except GSettingsSchemaConvertException as e:
+ fout.close()
+ if os.path.exists(options.output):
+ os.unlink(options.output)
+ raise e
+ 
+-except GSettingsSchemaConvertException, e:
++except GSettingsSchemaConvertException as e:
+ print >> sys.stderr, '%s' % e
+ return 1
+ 
diff --git a/meta/recipes-gnome/gnome/gconf_3.2.6.bb 
b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
index b8466d4..ff36555 100644
--- a/meta/recipes-gnome/gnome/gconf_3.2.6.bb
+++ b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
@@ -15,6 +15,7 @@ SRC_URI = 
"${GNOME_MIRROR}/GConf/${@gnome_verdir("${PV}")}/GConf-${PV}.tar.xz;na
file://remove_plus_from_invalid_characters_list.patch \
file://unable-connect-dbus.patch \
file://create_config_directory.patch \
+   file://python3.patch \
 "
 
 SRC_URI[archive.md5sum] = "2b16996d0e4b112856ee5c59130e822c"
@@ -52,6 +53,8 @@ FILES_${PN} += "${libdir}/GConf/* \
 ${datadir}/dbus-1/services/*.service \
 ${datadir}/dbus-1/system-services/*.service \
"
+RDEPENDS_${PN} = "python3-xml"
+
 FILES_${PN}-dev += "${datadir}/sgml/gconf/gconf-1.0.dtd"
 
 BBCLASSEXTEND = "native"
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140938): 
https://lists.openembedded.org/g/openembedded-core/message/140938
Mute This Topic: https://lists.openembedded.org/mt/75776521/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH 1/2] initscripts: Fix various shellcheck warnings in populate-volatile.sh

2020-07-24 Thread Andrei Gherzan
Signed-off-by: Andrei Gherzan 
---
 .../initscripts-1.0/populate-volatile.sh  | 58 +--
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh 
b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index 1c525b71bd..3a265329f0 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -9,10 +9,10 @@
 ### END INIT INFO
 
 # Get ROOT_DIR
-DIRNAME=`dirname $0`
-ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
+DIRNAME="$(dirname "$0")"
+ROOT_DIR="$(echo "$DIRNAME" | sed -ne 's:/etc/.*::p')"
 
-[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS
+[ -e "${ROOT_DIR}/etc/default/rcS" ] && . "${ROOT_DIR}/etc/default/rcS"
 # When running populate-volatile.sh at rootfs time, disable cache.
 [ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no
 # If rootfs is read-only, disable cache.
@@ -46,13 +46,13 @@ create_file() {
[ "${VERBOSE}" != "no" ] && echo "Target already exists. 
Skipping."
} || {
if [ -z "$ROOT_DIR" ]; then
-   eval $EXEC
+   eval "$EXEC"
else
# Creating some files at rootfs time may fail and 
should fail,
# but these failures should not be logged to make sure 
the do_rootfs
# process doesn't fail. This does no harm, as this 
script will
# run on target to set up the correct files and 
directories.
-   eval $EXEC > /dev/null 2>&1
+   eval "$EXEC" > /dev/null 2>&1
fi
}
 }
@@ -68,11 +68,11 @@ mk_dir() {
[ "${VERBOSE}" != "no" ] && echo "Target already exists. 
Skipping."
} || {
if [ -z "$ROOT_DIR" ]; then
-   eval $EXEC
+   eval "$EXEC"
else
# For the same reason with create_file(), failures 
should
# not be logged.
-   eval $EXEC > /dev/null 2>&1
+   eval "$EXEC" > /dev/null 2>&1
fi
}
 }
@@ -96,11 +96,11 @@ link_file() {
test "$VOLATILE_ENABLE_CACHE" = yes && echo "   $EXEC" >> 
/etc/volatile.cache.build
 
if [ -z "$ROOT_DIR" ]; then
-   eval $EXEC
+   eval "$EXEC"
else
# For the same reason with create_file(), failures should
# not be logged.
-   eval $EXEC > /dev/null 2>&1
+   eval "$EXEC" > /dev/null 2>&1
fi
 }
 
@@ -117,11 +117,11 @@ check_requirements() {
TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
 
-   sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/passwd | sort | uniq > 
"${TMP_DEFINED}"
-   cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
+   sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/passwd" | sort | uniq > 
"${TMP_DEFINED}"
+   grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
-   NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
-   NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
+   NR_DEFINED_USERS="$(wc -l < "${TMP_DEFINED}")"
+   NR_COMBINED_USERS="$(wc -l < "${TMP_COMBINED}")"
 
[ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
echo "Undefined users:"
@@ -131,12 +131,12 @@ check_requirements() {
}
 
 
-   sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/group | sort | uniq > 
"${TMP_DEFINED}"
-   cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
+   sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/group" | sort | uniq > 
"${TMP_DEFINED}"
+   grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
 
-   NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
-   NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
+   NR_DEFINED_GROUPS="$(wc -l < "${TMP_DEFINED}")"
+   NR_COMBINED_GROUPS="$(wc -l < "${TMP_COMBINED}")"
 
[ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
echo "Undefined groups:"
@@ -157,13 +157,13 @@ apply_cfgfile() {
 
[ "${VERBOSE}" != "no" ] && echo "Applying ${CFGFILE}"
 
-   [ "${SKIP_REQUIREMENTS}" == "yes" ] || check_requirements "${CFGFILE}" 
|| {
+   [ "${SKIP_REQUIREMENTS}" = "yes" ] || check_requirements "${CFGFILE}" 
|| {
echo "Skipping ${CFGFILE}"
return 1
}
 
-   cat ${CFGFILE} | sed 's/#.*//' | \
-   while read TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do
+   sed 's/#.*//' "${CFGFILE}" | \
+   while read -r TTYPE TUSER 

[OE-core] [PATCH 2/2] initscripts: Fix populate-volatile.sh bug when file/dir exists

2020-07-24 Thread Andrei Gherzan
The blocks which test for entry exitence (file or directory) use a
`A && B || C` syntax. This form is not behaving as a if-then-else block
even the code logic assumes that. C may run when A is true which breaks
the case where VERBOSE is 'no' but the file/directory exists.

Along with fixing these specific issues, this patch fixes the other
instances where blocks of form `A && B || C` are used as if-then-else.

Signed-off-by: Andrei Gherzan 
---
 .../initscripts-1.0/populate-volatile.sh  | 24 +--
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh 
b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index 3a265329f0..f21f48dd30 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -26,15 +26,15 @@ COREDEF="00_core"
 
 create_file() {
EXEC=""
-   [ -z "$2" ] && {
+   if [ -z "$2" ]; then
EXEC="
touch \"$1\";
"
-   } || {
+   else
EXEC="
cp \"$2\" \"$1\";
"
-   }
+   fi
EXEC="
${EXEC}
chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- 
for -$1-.\" >/dev/tty0 2>&1;
@@ -42,9 +42,9 @@ create_file() {
 
test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> 
/etc/volatile.cache.build
 
-   [ -e "$1" ] && {
+   if [ -e "$1" ]; then
[ "${VERBOSE}" != "no" ] && echo "Target already exists. 
Skipping."
-   } || {
+   else
if [ -z "$ROOT_DIR" ]; then
eval "$EXEC"
else
@@ -54,7 +54,7 @@ create_file() {
# run on target to set up the correct files and 
directories.
eval "$EXEC" > /dev/null 2>&1
fi
-   }
+   fi
 }
 
 mk_dir() {
@@ -64,9 +64,9 @@ mk_dir() {
chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" 
>/dev/tty0 2>&1 "
 
test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> 
/etc/volatile.cache.build
-   [ -e "$1" ] && {
+   if [ -e "$1" ]; then
[ "${VERBOSE}" != "no" ] && echo "Target already exists. 
Skipping."
-   } || {
+   else
if [ -z "$ROOT_DIR" ]; then
eval "$EXEC"
else
@@ -74,7 +74,7 @@ mk_dir() {
# not be logged.
eval "$EXEC" > /dev/null 2>&1
fi
-   }
+   fi
 }
 
 link_file() {
@@ -188,13 +188,13 @@ apply_cfgfile() {
[ -L "${TNAME}" ] && {
[ "${VERBOSE}" != "no" ] && echo "Found link."
NEWNAME=$(ls -l "${TNAME}" | sed -e 's/^.*-> 
\(.*\)$/\1/')
-   echo "${NEWNAME}" | grep -v "^/" >/dev/null && {
+   if echo "${NEWNAME}" | grep -v "^/" >/dev/null; then
TNAME="$(echo "${TNAME}" | sed -e 
's@\(.*\)/.*@\1@')/${NEWNAME}"
[ "${VERBOSE}" != "no" ] && echo "Converted 
relative linktarget to absolute path -${TNAME}-."
-   } || {
+   else
TNAME="${NEWNAME}"
[ "${VERBOSE}" != "no" ] && echo "Using 
absolute link target -${TNAME}-."
-   }
+   fi
}
 
case "${TTYPE}" in
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140937): 
https://lists.openembedded.org/g/openembedded-core/message/140937
Mute This Topic: https://lists.openembedded.org/mt/75770574/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] ltp.py: compare dmesg before and after test

2020-07-24 Thread Matthew
Hi,

I'm working on bugzilla 13802 by removing OOM killer test execution.

Randy was suggesting before running ltp, we should clear the dmesg ring buffer, 
run the test, and then collect dmesg ring buffer again afterwards.

Initially we would only print out the log, we could decide that a non-empty 
string indicating an error. Does this make sense for ltp and does it make sense 
to do it for each oeqa test?

This is entirely a proof-of-concept draft patch, any tips on where to insert 
dmesg clear and collect code would be greatly appreciated.

FYI: we've also considered adding a configure option (ie. --without-oom) to ltp 
that prevents the OOM tests (ltp/testcases/kernel/mem/oom) from compiling 
entirely. I talked with the upstream, and they suggested just skipping these 
tests using:
runltp -S SKIPFILE Skip tests specified in SKIPFILE

Signed-off-by: Mingde (Matthew) Zeng 
---
 meta/lib/oeqa/runtime/cases/ltp.py | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/meta/lib/oeqa/runtime/cases/ltp.py 
b/meta/lib/oeqa/runtime/cases/ltp.py
index 6dc5ef22ad..1e90df2086 100644
--- a/meta/lib/oeqa/runtime/cases/ltp.py
+++ b/meta/lib/oeqa/runtime/cases/ltp.py
@@ -65,11 +65,22 @@ class LtpTest(LtpTestBase):
 ltp_groups += ltp_fs

 def runltp(self, ltp_group):
+(status, dmesg_c_output) = self.target.run("dmesg -c")
+print("dmesg -c output:")
+print(dmesg_c_output)
+
 cmd = '/opt/ltp/runltp -f %s -p -q -r /opt/ltp -l 
/opt/ltp/results/%s -I 1 -d /opt/ltp' % (ltp_group, ltp_group)
 starttime = time.time()
 (status, output) = self.target.run(cmd)
 endtime = time.time()

+(status, output) = self.target.run("stat /proc/sysrq-trigger && 
echo f > /proc/sysrq-trigger || echo '/proc/sysrq-trigger does not exist'")
+if output != '/proc/sysrq-trigger does not exist':
+(status, dmesg_output) = self.target.run("dmesg")
+print("dmesg output:")
+print(dmesg_output)
+self.assertEqual(dmesg_c_output, dmesg_output)
+
 with open(os.path.join(self.ltptest_log_dir, "%s-raw.log" % 
ltp_group), 'w') as f:
 f.write(output)

--
2.27.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140935): 
https://lists.openembedded.org/g/openembedded-core/message/140935
Mute This Topic: https://lists.openembedded.org/mt/75770422/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [yocto] error about cve_check after a 'do_populate_sdk: Succeeded' on poky master since 20 july on ubuntu18.04/Debian 10/Debian 9.12

2020-07-24 Thread akuster
This error has been reported earlier.

I am working on a fix .

-armin

On 7/24/20 5:25 AM, vygu via lists.yoctoproject.org wrote:
> Hello,
>
> We observe this following error about cve_check after a populate_sdk:
>
> ERROR: Execution of event handler 'cve_save_summary_handler' failed
> Traceback (most recent call last):
>   File "/home/user/poky/meta/classes/cve-check.bbclass", line 65, in
> cve_save_summary_handler(e= 0x7ff6d41af0b8>):
> 
>     >    shutil.copyfile(cve_tmp_file, cve_summary_file)
> 
>   File "/usr/lib/python3.6/shutil.py", line 120, in
> copyfile(src='/home/user/poky/build/tmp/cve_check',
> dst='/home/user/poky/build/tmp/log/cve/cve-summary-20200724111814.txt',
> follow_symlinks=True):
>  else:
>     >    with open(src, 'rb') as fsrc:
>  with open(dst, 'wb') as fdst:
> FileNotFoundError: [Errno 2] No such file or directory:
> '/home/user/poky/build/tmp/cve_check'
>
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140934): 
https://lists.openembedded.org/g/openembedded-core/message/140934
Mute This Topic: https://lists.openembedded.org/mt/75770228/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH v6 05/13] rpm: Move rootfs to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/rpm/rootfs.py | 148 ++
 meta/lib/oe/rootfs.py | 142 +
 2 files changed, 150 insertions(+), 140 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/rpm/rootfs.py

diff --git a/meta/lib/oe/package_manager/rpm/rootfs.py 
b/meta/lib/oe/package_manager/rpm/rootfs.py
new file mode 100644
index 00..3d9eb95528
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/rootfs.py
@@ -0,0 +1,148 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.rootfs import Rootfs
+from oe.package_manager import RpmPM
+from oe.manifest import Manifest
+from oe.utils import execute_pre_post_process
+from oe.package_manager.rpm.manifest import RpmManifest
+
+class RpmRootfs(Rootfs):
+def __init__(self, d, manifest_dir, progress_reporter=None, 
logcatcher=None):
+super(RpmRootfs, self).__init__(d, progress_reporter, logcatcher)
+self.log_check_regex = r'(unpacking of archive failed|Cannot find 
package'\
+   r'|exit 1|ERROR: |Error: |Error |ERROR '\
+   r'|Failed |Failed: |Failed$|Failed\(\d+\):)'
+
+self.manifest = RpmManifest(d, manifest_dir)
+
+self.pm = RpmPM(d,
+d.getVar('IMAGE_ROOTFS'),
+self.d.getVar('TARGET_VENDOR')
+)
+
+self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN')
+if self.inc_rpm_image_gen != "1":
+bb.utils.remove(self.image_rootfs, True)
+else:
+self.pm.recovery_packaging_data()
+bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
+
+self.pm.create_configs()
+
+'''
+While rpm incremental image generation is enabled, it will remove the
+unneeded pkgs by comparing the new install solution manifest and the
+old installed manifest.
+'''
+def _create_incremental(self, pkgs_initial_install):
+if self.inc_rpm_image_gen == "1":
+
+pkgs_to_install = list()
+for pkg_type in pkgs_initial_install:
+pkgs_to_install += pkgs_initial_install[pkg_type]
+
+installed_manifest = self.pm.load_old_install_solution()
+solution_manifest = self.pm.dump_install_solution(pkgs_to_install)
+
+pkg_to_remove = list()
+for pkg in installed_manifest:
+if pkg not in solution_manifest:
+pkg_to_remove.append(pkg)
+
+self.pm.update()
+
+bb.note('incremental update -- upgrade packages in place ')
+self.pm.upgrade()
+if pkg_to_remove != []:
+bb.note('incremental removed: %s' % ' '.join(pkg_to_remove))
+self.pm.remove(pkg_to_remove)
+
+self.pm.autoremove()
+
+def _create(self):
+pkgs_to_install = self.manifest.parse_initial_manifest()
+rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS')
+rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS')
+
+# update PM index files
+self.pm.write_index()
+
+execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+if self.inc_rpm_image_gen == "1":
+self._create_incremental(pkgs_to_install)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.update()
+
+pkgs = []
+pkgs_attempt = []
+for pkg_type in pkgs_to_install:
+if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+pkgs_attempt += pkgs_to_install[pkg_type]
+else:
+pkgs += pkgs_to_install[pkg_type]
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.install(pkgs)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.install(pkgs_attempt, True)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.install_complementary()
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self._setup_dbg_rootfs(['/etc', '/var/lib/rpm', '/var/cache/dnf', 
'/var/lib/dnf'])
+
+execute_pre_post_process(self.d, rpm_post_process_cmds)
+
+if self.inc_rpm_image_gen == "1":
+self.pm.backup_packaging_data()
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+
+@staticmethod
+def _depends_list():
+return ['DEPLOY_DIR_RPM', 'INC_RPM_IMAGE_GEN', 
'RPM_PREPROCESS_COMMANDS',
+'RPM_POSTPROCESS_COMMANDS', 'RPM_PREFER_ELF_ARCH']
+
+

[OE-core] [PATCH v6 08/13] rpm: Move sdk to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/rpm/sdk.py | 114 +
 meta/lib/oe/sdk.py | 106 +--
 2 files changed, 115 insertions(+), 105 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/rpm/sdk.py

diff --git a/meta/lib/oe/package_manager/rpm/sdk.py 
b/meta/lib/oe/package_manager/rpm/sdk.py
new file mode 100644
index 00..ab816f43df
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/sdk.py
@@ -0,0 +1,114 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.utils import execute_pre_post_process
+from oe.sdk import Sdk
+from oe.manifest import Manifest
+from oe.package_manager import RpmPM
+import glob
+
+class RpmSdk(Sdk):
+def __init__(self, d, manifest_dir=None, rpm_workdir="oe-sdk-repo"):
+super(RpmSdk, self).__init__(d, manifest_dir)
+
+from oe.package_manager.rpm.manifest import RpmManifest
+self.target_manifest = RpmManifest(d, self.manifest_dir,
+   Manifest.MANIFEST_TYPE_SDK_TARGET)
+self.host_manifest = RpmManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_HOST)
+
+rpm_repo_workdir = "oe-sdk-repo"
+if "sdk_ext" in d.getVar("BB_RUNTASK"):
+rpm_repo_workdir = "oe-sdk-ext-repo"
+
+self.target_pm = RpmPM(d,
+   self.sdk_target_sysroot,
+   self.d.getVar('TARGET_VENDOR'),
+   'target',
+   rpm_repo_workdir=rpm_repo_workdir
+   )
+
+self.host_pm = RpmPM(d,
+ self.sdk_host_sysroot,
+ self.d.getVar('SDK_VENDOR'),
+ 'host',
+ "SDK_PACKAGE_ARCHS",
+ "SDK_OS",
+ rpm_repo_workdir=rpm_repo_workdir
+ )
+
+def _populate_sysroot(self, pm, manifest):
+pkgs_to_install = manifest.parse_initial_manifest()
+
+pm.create_configs()
+pm.write_index()
+pm.update()
+
+pkgs = []
+pkgs_attempt = []
+for pkg_type in pkgs_to_install:
+if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+pkgs_attempt += pkgs_to_install[pkg_type]
+else:
+pkgs += pkgs_to_install[pkg_type]
+
+pm.install(pkgs)
+
+pm.install(pkgs_attempt, True)
+
+def _populate(self):
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+bb.note("Installing TARGET packages")
+self._populate_sysroot(self.target_pm, self.target_manifest)
+
+
self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+self.target_pm.run_intercepts(populate_sdk='target')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.target_pm.remove_packaging_data()
+
+bb.note("Installing NATIVESDK packages")
+self._populate_sysroot(self.host_pm, self.host_manifest)
+self.install_locales(self.host_pm)
+
+self.host_pm.run_intercepts(populate_sdk='host')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.host_pm.remove_packaging_data()
+
+# Move host RPM library data
+native_rpm_state_dir = os.path.join(self.sdk_output,
+self.sdk_native_path,
+
self.d.getVar('localstatedir_nativesdk').strip('/'),
+"lib",
+"rpm"
+)
+self.mkdirhier(native_rpm_state_dir)
+for f in glob.glob(os.path.join(self.sdk_output,
+"var",
+"lib",
+"rpm",
+"*")):
+self.movefile(f, native_rpm_state_dir)
+
+self.remove(os.path.join(self.sdk_output, "var"), True)
+
+# Move host sysconfig data
+native_sysconf_dir = os.path.join(self.sdk_output,
+  self.sdk_native_path,
+  self.d.getVar('sysconfdir',
+True).strip('/'),
+  

[OE-core] [PATCH v6 04/13] deb: Move deb manifest to its own subdir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/manifest.py | 21 +
 meta/lib/oe/package_manager/deb/__init__.py |  3 +++
 meta/lib/oe/package_manager/deb/manifest.py | 26 +
 meta/lib/oe/rootfs.py   |  1 +
 4 files changed, 31 insertions(+), 20 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/deb/__init__.py
 create mode 100644 meta/lib/oe/package_manager/deb/manifest.py

diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index f87c150d33..47bd622412 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -187,32 +187,13 @@ class Manifest(object, metaclass=ABCMeta):
 
 return installed_pkgs
 
-class DpkgManifest(Manifest):
-def create_initial(self):
-with open(self.initial_manifest, "w+") as manifest:
-manifest.write(self.initial_manifest_file_header)
-
-for var in self.var_maps[self.manifest_type]:
-pkg_list = self.d.getVar(var)
-
-if pkg_list is None:
-continue
-
-for pkg in pkg_list.split():
-manifest.write("%s,%s\n" %
-   (self.var_maps[self.manifest_type][var], 
pkg))
-
-def create_final(self):
-pass
-
-def create_full(self, pm):
-pass
 
 
 def create_manifest(d, final_manifest=False, manifest_dir=None,
 manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
 from oe.package_manager.rpm.manifest import RpmManifest
 from oe.package_manager.ipk.manifest import OpkgManifest
+from oe.package_manager.deb.manifest import DpkgManifest
 manifest_map = {'rpm': RpmManifest,
 'ipk': OpkgManifest,
 'deb': DpkgManifest}
diff --git a/meta/lib/oe/package_manager/deb/__init__.py 
b/meta/lib/oe/package_manager/deb/__init__.py
new file mode 100644
index 00..a2094304c9
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/__init__.py
@@ -0,0 +1,3 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
diff --git a/meta/lib/oe/package_manager/deb/manifest.py 
b/meta/lib/oe/package_manager/deb/manifest.py
new file mode 100644
index 00..0b12036644
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/manifest.py
@@ -0,0 +1,26 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.manifest import Manifest
+
+class DpkgManifest(Manifest):
+def create_initial(self):
+with open(self.initial_manifest, "w+") as manifest:
+manifest.write(self.initial_manifest_file_header)
+
+for var in self.var_maps[self.manifest_type]:
+pkg_list = self.d.getVar(var)
+
+if pkg_list is None:
+continue
+
+for pkg in pkg_list.split():
+manifest.write("%s,%s\n" %
+   (self.var_maps[self.manifest_type][var], 
pkg))
+
+def create_final(self):
+pass
+
+def create_full(self, pm):
+pass
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 1ba0a71253..876e13079c 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -13,6 +13,7 @@ import subprocess
 import re
 from oe.package_manager.rpm.manifest import RpmManifest
 from oe.package_manager.ipk.manifest import OpkgManifest
+from oe.package_manager.deb.manifest import DpkgManifest
 
 class Rootfs(object, metaclass=ABCMeta):
 """
-- 
2.20.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140917): 
https://lists.openembedded.org/g/openembedded-core/message/140917
Mute This Topic: https://lists.openembedded.org/mt/75767457/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH] mesa: enable freedreno Vulkan driver if freedreno is enabled

2020-07-24 Thread Dmitry Baryshkov
From: Dmitry Baryshkov 

If freedreno is enabled in PACKAGECONFIG, enable respective Vulkan
driver.

Signed-off-by: Dmitry Baryshkov 
---
 meta/recipes-graphics/mesa/mesa.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-graphics/mesa/mesa.inc 
b/meta/recipes-graphics/mesa/mesa.inc
index 4fe5f025ebbb..6fd92035f02a 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -121,6 +121,7 @@ PACKAGECONFIG[dri3] = "-Ddri3=true, -Ddri3=false, xorgproto 
libxshmfence"
 VULKAN_DRIVERS = ""
 VULKAN_DRIVERS_append_x86_class-target = ",intel"
 VULKAN_DRIVERS_append_x86-64_class-target = ",intel"
+VULKAN_DRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', 
',freedreno', '', d)}"
 PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${VULKAN_DRIVERS}, 
-Dvulkan-drivers='',"
 
 PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
-- 
2.27.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140931): 
https://lists.openembedded.org/g/openembedded-core/message/140931
Mute This Topic: https://lists.openembedded.org/mt/75767480/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH v6 07/13] deb: Move rootfs to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/deb/rootfs.py | 209 ++
 meta/lib/oe/rootfs.py | 201 +
 2 files changed, 211 insertions(+), 199 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/deb/rootfs.py

diff --git a/meta/lib/oe/package_manager/deb/rootfs.py 
b/meta/lib/oe/package_manager/deb/rootfs.py
new file mode 100644
index 00..0661ee7c5b
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/rootfs.py
@@ -0,0 +1,209 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.rootfs import Rootfs
+from oe.package_manager import DpkgPM
+from oe.manifest import Manifest
+from oe.utils import execute_pre_post_process
+from oe.package_manager.deb.manifest import DpkgManifest
+import re
+
+class DpkgOpkgRootfs(Rootfs):
+def __init__(self, d, progress_reporter=None, logcatcher=None):
+super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
+
+def _get_pkgs_postinsts(self, status_file):
+def _get_pkg_depends_list(pkg_depends):
+pkg_depends_list = []
+# filter version requirements like libc (>= 1.1)
+for dep in pkg_depends.split(', '):
+m_dep = re.match(r"^(.*) \(.*\)$", dep)
+if m_dep:
+dep = m_dep.group(1)
+pkg_depends_list.append(dep)
+
+return pkg_depends_list
+
+pkgs = {}
+pkg_name = ""
+pkg_status_match = False
+pkg_depends = ""
+
+with open(status_file) as status:
+data = status.read()
+status.close()
+for line in data.split('\n'):
+m_pkg = re.match(r"^Package: (.*)", line)
+m_status = re.match(r"^Status:.*unpacked", line)
+m_depends = re.match(r"^Depends: (.*)", line)
+
+#Only one of m_pkg, m_status or m_depends is not None at time
+#If m_pkg is not None, we started a new package
+if m_pkg is not None:
+#Get Package name
+pkg_name = m_pkg.group(1)
+#Make sure we reset other variables
+pkg_status_match = False
+pkg_depends = ""
+elif m_status is not None:
+#New status matched
+pkg_status_match = True
+elif m_depends is not None:
+#New depends macthed
+pkg_depends = m_depends.group(1)
+else:
+pass
+
+#Now check if we can process package depends and postinst
+if "" != pkg_name and pkg_status_match:
+pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)
+else:
+#Not enough information
+pass
+
+# remove package dependencies not in postinsts
+pkg_names = list(pkgs.keys())
+for pkg_name in pkg_names:
+deps = pkgs[pkg_name][:]
+
+for d in deps:
+if d not in pkg_names:
+pkgs[pkg_name].remove(d)
+
+return pkgs
+
+def _get_delayed_postinsts_common(self, status_file):
+def _dep_resolve(graph, node, resolved, seen):
+seen.append(node)
+
+for edge in graph[node]:
+if edge not in resolved:
+if edge in seen:
+raise RuntimeError("Packages %s and %s have " \
+"a circular dependency in postinsts scripts." \
+% (node, edge))
+_dep_resolve(graph, edge, resolved, seen)
+
+resolved.append(node)
+
+pkg_list = []
+
+pkgs = None
+if not self.d.getVar('PACKAGE_INSTALL').strip():
+bb.note("Building empty image")
+else:
+pkgs = self._get_pkgs_postinsts(status_file)
+if pkgs:
+root = "__packagegroup_postinst__"
+pkgs[root] = list(pkgs.keys())
+_dep_resolve(pkgs, root, pkg_list, [])
+pkg_list.remove(root)
+
+if len(pkg_list) == 0:
+return None
+
+return pkg_list
+
+def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
+if bb.utils.contains("IMAGE_FEATURES", "package-management",
+ True, False, self.d):
+return
+num = 0
+for p in self._get_delayed_postinsts():
+bb.utils.mkdirhier(dst_postinst_dir)
+
+if os.path.exists(os.path.join(src_postinst_dir, p + ".postinst")):
+shutil.copy(os.path.join(src_postinst_dir, p + ".postinst"),
+os.path.join(dst_postinst_dir, 

[OE-core] [PATCH 2/2] tune-cortexa55.inc: switch to using armv8.2a include file

2020-07-24 Thread Dmitry Baryshkov
From: Dmitry Baryshkov 

Since Cortex-A55 is an ARMv8.2 core, switch to using arch-armv8-2a.inc
file.

Signed-off-by: Dmitry Baryshkov 
---
 meta/conf/machine/include/tune-cortexa55.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/machine/include/tune-cortexa55.inc 
b/meta/conf/machine/include/tune-cortexa55.inc
index 89032b59ecdc..b383eb733b72 100644
--- a/meta/conf/machine/include/tune-cortexa55.inc
+++ b/meta/conf/machine/include/tune-cortexa55.inc
@@ -3,7 +3,7 @@ DEFAULTTUNE ?= "cortexa55"
 TUNEVALID[cortexa55] = "Enable Cortex-A55 specific processor optimizations"
 TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa55', ' 
-mcpu=cortex-a55', '', d)}"
 
-require conf/machine/include/arm/arch-armv8a.inc
+require conf/machine/include/arm/arch-armv8-2a.inc
 
 # Little Endian base configs
 AVAILTUNES += "cortexa55"
-- 
2.27.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140933): 
https://lists.openembedded.org/g/openembedded-core/message/140933
Mute This Topic: https://lists.openembedded.org/mt/75767486/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH v6 13/13] deb: Move package manager to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/__init__.py | 487 
 meta/lib/oe/package_manager/deb/__init__.py | 487 
 meta/lib/oe/package_manager/deb/rootfs.py   |   2 +-
 meta/lib/oe/package_manager/deb/sdk.py  |   2 +-
 meta/lib/oe/rootfs.py   |   1 +
 meta/lib/oe/sdk.py  |   1 +
 6 files changed, 491 insertions(+), 489 deletions(-)

diff --git a/meta/lib/oe/package_manager/__init__.py 
b/meta/lib/oe/package_manager/__init__.py
index af254fcf6e..538da3a14c 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -149,81 +149,6 @@ class Indexer(object, metaclass=ABCMeta):
 def write_index(self):
 pass
 
-class DpkgIndexer(Indexer):
-def _create_configs(self):
-bb.utils.mkdirhier(self.apt_conf_dir)
-bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "lists", "partial"))
-bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "apt.conf.d"))
-bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "preferences.d"))
-
-with open(os.path.join(self.apt_conf_dir, "preferences"),
-"w") as prefs_file:
-pass
-with open(os.path.join(self.apt_conf_dir, "sources.list"),
-"w+") as sources_file:
-pass
-
-with open(self.apt_conf_file, "w") as apt_conf:
-with open(os.path.join(self.d.expand("${STAGING_ETCDIR_NATIVE}"),
-"apt", "apt.conf.sample")) as apt_conf_sample:
-for line in apt_conf_sample.read().split("\n"):
-line = re.sub(r"#ROOTFS#", "/dev/null", line)
-line = re.sub(r"#APTCONF#", self.apt_conf_dir, line)
-apt_conf.write(line + "\n")
-
-def write_index(self):
-self.apt_conf_dir = os.path.join(self.d.expand("${APTCONF_TARGET}"),
-"apt-ftparchive")
-self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf")
-self._create_configs()
-
-os.environ['APT_CONFIG'] = self.apt_conf_file
-
-pkg_archs = self.d.getVar('PACKAGE_ARCHS')
-if pkg_archs is not None:
-arch_list = pkg_archs.split()
-sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS')
-if sdk_pkg_archs is not None:
-for a in sdk_pkg_archs.split():
-if a not in pkg_archs:
-arch_list.append(a)
-
-all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') 
or "").split()
-arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in 
arch_list)
-
-apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive")
-gzip = bb.utils.which(os.getenv('PATH'), "gzip")
-
-index_cmds = []
-deb_dirs_found = False
-for arch in arch_list:
-arch_dir = os.path.join(self.deploy_dir, arch)
-if not os.path.isdir(arch_dir):
-continue
-
-cmd = "cd %s; PSEUDO_UNLOAD=1 %s packages . > Packages;" % 
(arch_dir, apt_ftparchive)
-
-cmd += "%s -fcn Packages > Packages.gz;" % gzip
-
-with open(os.path.join(arch_dir, "Release"), "w+") as release:
-release.write("Label: %s\n" % arch)
-
-cmd += "PSEUDO_UNLOAD=1 %s release . >> Release" % apt_ftparchive
-
-index_cmds.append(cmd)
-
-deb_dirs_found = True
-
-if not deb_dirs_found:
-bb.note("There are no packages in %s" % self.deploy_dir)
-return
-
-oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
-if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-raise NotImplementedError('Package feed signing not implementd for 
dpkg')
-
-
-
 class PkgsList(object, metaclass=ABCMeta):
 def __init__(self, d, rootfs_dir):
 self.d = d
@@ -233,24 +158,6 @@ class PkgsList(object, metaclass=ABCMeta):
 def list_pkgs(self):
 pass
 
-class DpkgPkgsList(PkgsList):
-
-def list_pkgs(self):
-cmd = [bb.utils.which(os.getenv('PATH'), "dpkg-query"),
-   "--admindir=%s/var/lib/dpkg" % self.rootfs_dir,
-   "-W"]
-
-cmd.append("-f=Package: ${Package}\nArchitecture: 
${PackageArch}\nVersion: ${Version}\nFile: 
${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: 
${Recommends}\nProvides: ${Provides}\n\n")
-
-try:
-cmd_output = subprocess.check_output(cmd, 
stderr=subprocess.STDOUT).strip().decode("utf-8")
-except subprocess.CalledProcessError as e:
-bb.fatal("Cannot get the installed packages list. Command '%s' "
- "returned %d:\n%s" % (' '.join(cmd), e.returncode, 
e.output.decode("utf-8")))
-
-return 

[OE-core] [PATCH v6 12/13] ipk: Move package manager to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/__init__.py | 432 -
 meta/lib/oe/package_manager/ipk/__init__.py | 501 
 meta/lib/oe/package_manager/ipk/rootfs.py   |   2 +-
 meta/lib/oe/package_manager/ipk/sdk.py  |   2 +-
 meta/lib/oe/sdk.py  |   1 +
 5 files changed, 504 insertions(+), 434 deletions(-)

diff --git a/meta/lib/oe/package_manager/__init__.py 
b/meta/lib/oe/package_manager/__init__.py
index 2ca47e5109..af254fcf6e 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -149,59 +149,6 @@ class Indexer(object, metaclass=ABCMeta):
 def write_index(self):
 pass
 
-class OpkgIndexer(Indexer):
-def write_index(self):
-arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
- "SDK_PACKAGE_ARCHS",
- ]
-
-opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
-if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-signer = get_signer(self.d, 
self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
-else:
-signer = None
-
-if not os.path.exists(os.path.join(self.deploy_dir, "Packages")):
-open(os.path.join(self.deploy_dir, "Packages"), "w").close()
-
-index_cmds = set()
-index_sign_files = set()
-for arch_var in arch_vars:
-archs = self.d.getVar(arch_var)
-if archs is None:
-continue
-
-for arch in archs.split():
-pkgs_dir = os.path.join(self.deploy_dir, arch)
-pkgs_file = os.path.join(pkgs_dir, "Packages")
-
-if not os.path.isdir(pkgs_dir):
-continue
-
-if not os.path.exists(pkgs_file):
-open(pkgs_file, "w").close()
-
-index_cmds.add('%s --checksum md5 --checksum sha256 -r %s -p 
%s -m %s' %
-  (opkg_index_cmd, pkgs_file, pkgs_file, 
pkgs_dir))
-
-index_sign_files.add(pkgs_file)
-
-if len(index_cmds) == 0:
-bb.note("There are no packages in %s!" % self.deploy_dir)
-return
-
-oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
-
-if signer:
-feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
-is_ascii_sig = (feed_sig_type.upper() != "BIN")
-for f in index_sign_files:
-signer.detach_sign(f,
-   self.d.getVar('PACKAGE_FEED_GPG_NAME'),
-   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
-   armor=is_ascii_sig)
-
-
 class DpkgIndexer(Indexer):
 def _create_configs(self):
 bb.utils.mkdirhier(self.apt_conf_dir)
@@ -286,33 +233,6 @@ class PkgsList(object, metaclass=ABCMeta):
 def list_pkgs(self):
 pass
 
-class OpkgPkgsList(PkgsList):
-def __init__(self, d, rootfs_dir, config_file):
-super(OpkgPkgsList, self).__init__(d, rootfs_dir)
-
-self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
-self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir)
-self.opkg_args += self.d.getVar("OPKG_ARGS")
-
-def list_pkgs(self, format=None):
-cmd = "%s %s status" % (self.opkg_cmd, self.opkg_args)
-
-# opkg returns success even when it printed some
-# "Collected errors:" report to stderr. Mixing stderr into
-# stdout then leads to random failures later on when
-# parsing the output. To avoid this we need to collect both
-# output streams separately and check for empty stderr.
-p = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, shell=True)
-cmd_output, cmd_stderr = p.communicate()
-cmd_output = cmd_output.decode("utf-8")
-cmd_stderr = cmd_stderr.decode("utf-8")
-if p.returncode or cmd_stderr:
-bb.fatal("Cannot get the installed packages list. Command '%s' "
- "returned %d and stderr:\n%s" % (cmd, p.returncode, 
cmd_stderr))
-
-return opkg_query(cmd_output)
-
-
 class DpkgPkgsList(PkgsList):
 
 def list_pkgs(self):
@@ -763,358 +683,6 @@ class OpkgDpkgPM(PackageManager):
 def _handle_intercept_failure(self, registered_pkgs):
 self.mark_packages("unpacked", registered_pkgs.split())
 
-class OpkgPM(OpkgDpkgPM):
-def __init__(self, d, target_rootfs, config_file, archs, 
task_name='target', ipk_repo_workdir="oe-rootfs-repo", 
filterbydependencies=True, prepare_index=True):
-super(OpkgPM, self).__init__(d, target_rootfs)
-
-self.config_file = config_file
-self.pkg_archs = archs
-self.task_name = task_name
-
-

[OE-core] [PATCH v6 03/13] ipk: Move ipk manifest to its own subdir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/manifest.py | 72 +---
 meta/lib/oe/package_manager/ipk/__init__.py |  3 +
 meta/lib/oe/package_manager/ipk/manifest.py | 73 +
 meta/lib/oe/rootfs.py   |  1 +
 4 files changed, 78 insertions(+), 71 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/ipk/__init__.py
 create mode 100644 meta/lib/oe/package_manager/ipk/manifest.py

diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index 17461cda64..f87c150d33 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -187,76 +187,6 @@ class Manifest(object, metaclass=ABCMeta):
 
 return installed_pkgs
 
-
-class OpkgManifest(Manifest):
-"""
-Returns a dictionary object with mip and mlp packages.
-"""
-def _split_multilib(self, pkg_list):
-pkgs = dict()
-
-for pkg in pkg_list.split():
-pkg_type = self.PKG_TYPE_MUST_INSTALL
-
-ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
-
-for ml_variant in ml_variants:
-if pkg.startswith(ml_variant + '-'):
-pkg_type = self.PKG_TYPE_MULTILIB
-
-if not pkg_type in pkgs:
-pkgs[pkg_type] = pkg
-else:
-pkgs[pkg_type] += " " + pkg
-
-return pkgs
-
-def create_initial(self):
-pkgs = dict()
-
-with open(self.initial_manifest, "w+") as manifest:
-manifest.write(self.initial_manifest_file_header)
-
-for var in self.var_maps[self.manifest_type]:
-if var in self.vars_to_split:
-split_pkgs = self._split_multilib(self.d.getVar(var))
-if split_pkgs is not None:
-pkgs = dict(list(pkgs.items()) + 
list(split_pkgs.items()))
-else:
-pkg_list = self.d.getVar(var)
-if pkg_list is not None:
-pkgs[self.var_maps[self.manifest_type][var]] = 
self.d.getVar(var)
-
-for pkg_type in sorted(pkgs):
-for pkg in sorted(pkgs[pkg_type].split()):
-manifest.write("%s,%s\n" % (pkg_type, pkg))
-
-def create_final(self):
-pass
-
-def create_full(self, pm):
-if not os.path.exists(self.initial_manifest):
-self.create_initial()
-
-initial_manifest = self.parse_initial_manifest()
-pkgs_to_install = list()
-for pkg_type in initial_manifest:
-pkgs_to_install += initial_manifest[pkg_type]
-if len(pkgs_to_install) == 0:
-return
-
-output = pm.dummy_install(pkgs_to_install)
-
-with open(self.full_manifest, 'w+') as manifest:
-pkg_re = re.compile('^Installing ([^ ]+) [^ ].*')
-for line in set(output.split('\n')):
-m = pkg_re.match(line)
-if m:
-manifest.write(m.group(1) + '\n')
-
-return
-
-
 class DpkgManifest(Manifest):
 def create_initial(self):
 with open(self.initial_manifest, "w+") as manifest:
@@ -281,8 +211,8 @@ class DpkgManifest(Manifest):
 
 def create_manifest(d, final_manifest=False, manifest_dir=None,
 manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
-
 from oe.package_manager.rpm.manifest import RpmManifest
+from oe.package_manager.ipk.manifest import OpkgManifest
 manifest_map = {'rpm': RpmManifest,
 'ipk': OpkgManifest,
 'deb': DpkgManifest}
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py 
b/meta/lib/oe/package_manager/ipk/__init__.py
new file mode 100644
index 00..a2094304c9
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/__init__.py
@@ -0,0 +1,3 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
diff --git a/meta/lib/oe/package_manager/ipk/manifest.py 
b/meta/lib/oe/package_manager/ipk/manifest.py
new file mode 100644
index 00..69676903ab
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/manifest.py
@@ -0,0 +1,73 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.manifest import Manifest
+
+class OpkgManifest(Manifest):
+"""
+Returns a dictionary object with mip and mlp packages.
+"""
+def _split_multilib(self, pkg_list):
+pkgs = dict()
+
+for pkg in pkg_list.split():
+pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
+
+for ml_variant in ml_variants:
+if pkg.startswith(ml_variant + '-'):
+pkg_type = self.PKG_TYPE_MULTILIB
+
+if not pkg_type in pkgs:
+pkgs[pkg_type] = pkg
+else:
+pkgs[pkg_type] += " " + pkg
+
+

[OE-core] [PATCH v6 10/13] deb: Move sdk to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/deb/sdk.py | 95 ++
 meta/lib/oe/sdk.py | 87 +--
 2 files changed, 96 insertions(+), 86 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/deb/sdk.py

diff --git a/meta/lib/oe/package_manager/deb/sdk.py 
b/meta/lib/oe/package_manager/deb/sdk.py
new file mode 100644
index 00..aafcd259e5
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/sdk.py
@@ -0,0 +1,95 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.utils import execute_pre_post_process
+from oe.sdk import Sdk
+from oe.manifest import Manifest
+from oe.package_manager import DpkgPM
+import shutil
+
+class DpkgSdk(Sdk):
+def __init__(self, d, manifest_dir=None):
+super(DpkgSdk, self).__init__(d, manifest_dir)
+
+self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), 
"apt")
+self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), 
"apt-sdk")
+
+from oe.package_manager.deb.manifest import DpkgManifest
+
+self.target_manifest = DpkgManifest(d, self.manifest_dir,
+Manifest.MANIFEST_TYPE_SDK_TARGET)
+self.host_manifest = DpkgManifest(d, self.manifest_dir,
+  Manifest.MANIFEST_TYPE_SDK_HOST)
+
+deb_repo_workdir = "oe-sdk-repo"
+if "sdk_ext" in d.getVar("BB_RUNTASK"):
+deb_repo_workdir = "oe-sdk-ext-repo"
+
+self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
+self.d.getVar("PACKAGE_ARCHS"),
+self.d.getVar("DPKG_ARCH"),
+self.target_conf_dir,
+deb_repo_workdir=deb_repo_workdir)
+
+self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
+  self.d.getVar("SDK_PACKAGE_ARCHS"),
+  self.d.getVar("DEB_SDK_ARCH"),
+  self.host_conf_dir,
+  deb_repo_workdir=deb_repo_workdir)
+
+def _copy_apt_dir_to(self, dst_dir):
+staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE")
+
+self.remove(dst_dir, True)
+
+shutil.copytree(os.path.join(staging_etcdir_native, "apt"), dst_dir)
+
+def _populate_sysroot(self, pm, manifest):
+pkgs_to_install = manifest.parse_initial_manifest()
+
+pm.write_index()
+pm.update()
+
+for pkg_type in self.install_order:
+if pkg_type in pkgs_to_install:
+pm.install(pkgs_to_install[pkg_type],
+   [False, True][pkg_type == 
Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+def _populate(self):
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+bb.note("Installing TARGET packages")
+self._populate_sysroot(self.target_pm, self.target_manifest)
+
+
self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+self.target_pm.run_intercepts(populate_sdk='target')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", 
"apt"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.target_pm.remove_packaging_data()
+
+bb.note("Installing NATIVESDK packages")
+self._populate_sysroot(self.host_pm, self.host_manifest)
+self.install_locales(self.host_pm)
+
+self.host_pm.run_intercepts(populate_sdk='host')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+self._copy_apt_dir_to(os.path.join(self.sdk_output, 
self.sdk_native_path,
+   "etc", "apt"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.host_pm.remove_packaging_data()
+
+native_dpkg_state_dir = os.path.join(self.sdk_output, 
self.sdk_native_path,
+ "var", "lib", "dpkg")
+self.mkdirhier(native_dpkg_state_dir)
+for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "dpkg", 
"*")):
+self.movefile(f, native_dpkg_state_dir)
+self.remove(os.path.join(self.sdk_output, "var"), True)
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 8b97f05a29..2f8cbd03d7 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -110,92 +110,6 @@ class Sdk(object, metaclass=ABCMeta):
 pass
 
 
-class DpkgSdk(Sdk):
-def __init__(self, d, manifest_dir=None):
-super(DpkgSdk, 

[OE-core] [PATCH v6 01/13] package_manager: Move to package_manager/__init__.py

2020-07-24 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/{package_manager.py => package_manager/__init__.py} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename meta/lib/oe/{package_manager.py => package_manager/__init__.py} (100%)

diff --git a/meta/lib/oe/package_manager.py 
b/meta/lib/oe/package_manager/__init__.py
similarity index 100%
rename from meta/lib/oe/package_manager.py
rename to meta/lib/oe/package_manager/__init__.py
-- 
2.20.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140920): 
https://lists.openembedded.org/g/openembedded-core/message/140920
Mute This Topic: https://lists.openembedded.org/mt/75767466/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH v6 09/13] ipk: Move sdk to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/ipk/sdk.py | 96 ++
 meta/lib/oe/sdk.py | 87 +--
 2 files changed, 97 insertions(+), 86 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/ipk/sdk.py

diff --git a/meta/lib/oe/package_manager/ipk/sdk.py 
b/meta/lib/oe/package_manager/ipk/sdk.py
new file mode 100644
index 00..3d59f7a517
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/sdk.py
@@ -0,0 +1,96 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.utils import execute_pre_post_process
+from oe.sdk import Sdk
+from oe.manifest import Manifest
+from oe.package_manager import OpkgPM
+import shutil
+import glob
+
+class OpkgSdk(Sdk):
+def __init__(self, d, manifest_dir=None):
+super(OpkgSdk, self).__init__(d, manifest_dir)
+
+self.target_conf = self.d.getVar("IPKGCONF_TARGET")
+self.host_conf = self.d.getVar("IPKGCONF_SDK")
+
+from oe.package_manager.ipk.manifest import OpkgManifest
+self.target_manifest = OpkgManifest(d, self.manifest_dir,
+Manifest.MANIFEST_TYPE_SDK_TARGET)
+self.host_manifest = OpkgManifest(d, self.manifest_dir,
+  Manifest.MANIFEST_TYPE_SDK_HOST)
+
+ipk_repo_workdir = "oe-sdk-repo"
+if "sdk_ext" in d.getVar("BB_RUNTASK"):
+ipk_repo_workdir = "oe-sdk-ext-repo"
+
+self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf,
+self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"),
+ipk_repo_workdir=ipk_repo_workdir)
+
+self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
+  self.d.getVar("SDK_PACKAGE_ARCHS"),
+ipk_repo_workdir=ipk_repo_workdir)
+
+def _populate_sysroot(self, pm, manifest):
+pkgs_to_install = manifest.parse_initial_manifest()
+
+if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
+pm.write_index()
+
+pm.update()
+
+for pkg_type in self.install_order:
+if pkg_type in pkgs_to_install:
+pm.install(pkgs_to_install[pkg_type],
+   [False, True][pkg_type == 
Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+def _populate(self):
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+bb.note("Installing TARGET packages")
+self._populate_sysroot(self.target_pm, self.target_manifest)
+
+
self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+self.target_pm.run_intercepts(populate_sdk='target')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.target_pm.remove_packaging_data()
+
+bb.note("Installing NATIVESDK packages")
+self._populate_sysroot(self.host_pm, self.host_manifest)
+self.install_locales(self.host_pm)
+
+self.host_pm.run_intercepts(populate_sdk='host')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.host_pm.remove_packaging_data()
+
+target_sysconfdir = os.path.join(self.sdk_target_sysroot, 
self.sysconfdir)
+host_sysconfdir = os.path.join(self.sdk_host_sysroot, self.sysconfdir)
+
+self.mkdirhier(target_sysconfdir)
+shutil.copy(self.target_conf, target_sysconfdir)
+os.chmod(os.path.join(target_sysconfdir,
+  os.path.basename(self.target_conf)), 0o644)
+
+self.mkdirhier(host_sysconfdir)
+shutil.copy(self.host_conf, host_sysconfdir)
+os.chmod(os.path.join(host_sysconfdir,
+  os.path.basename(self.host_conf)), 0o644)
+
+native_opkg_state_dir = os.path.join(self.sdk_output, 
self.sdk_native_path,
+ 
self.d.getVar('localstatedir_nativesdk').strip('/'),
+ "lib", "opkg")
+self.mkdirhier(native_opkg_state_dir)
+for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "opkg", 
"*")):
+self.movefile(f, native_opkg_state_dir)
+
+self.remove(os.path.join(self.sdk_output, "var"), True)
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index b675b6549c..8b97f05a29 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -110,92 +110,6 @@ class Sdk(object, metaclass=ABCMeta):
 pass
 
 
-class 

[OE-core] [PATCH v6] Add package managers as a plugin

2020-07-24 Thread Fredrik Gustafsson
OE-core today has three different package managers, the well-known formats deb
and rpm is supported as well as ipkg that is good for embedded devices.

When building and having a good cache hit, a significant amount of time is
spent in the phase of generating a rootfs, which is really about the
performance of the package manager. To save build time and also get a
package manager that is suitanle for use on targets where flash memory is a
concern, support for apk is suggested.

However, it might or might not be what's wanted for OE-core since it increases
the test matrix. Therefore I will refactor the package management code to
allow a layer to add a new package manager without editing the meta layer.

This refactor will be divided into multiple patch series to be easier to review,
this series will only move code but keep existing functionality.

Changes since v5:
* Moved code in package_manager/rpm/package_manager.py to 
package_manager/rpm/__init__.py
* Fixed places that used package_managers instead of package_manager
* Added missing imports in a function.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140918): 
https://lists.openembedded.org/g/openembedded-core/message/140918
Mute This Topic: https://lists.openembedded.org/mt/75767459/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH v6 02/13] rpm: Move manifest to its own subdir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/manifest.py | 53 +---
 meta/lib/oe/package_manager/rpm/__init__.py |  3 ++
 meta/lib/oe/package_manager/rpm/manifest.py | 54 +
 meta/lib/oe/rootfs.py   |  3 +-
 4 files changed, 61 insertions(+), 52 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/rpm/__init__.py
 create mode 100644 meta/lib/oe/package_manager/rpm/manifest.py

diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index f7c88f9a09..17461cda64 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -7,7 +7,6 @@ import os
 import re
 import bb
 
-
 class Manifest(object, metaclass=ABCMeta):
 """
 This is an abstract class. Do not instantiate this directly.
@@ -189,56 +188,6 @@ class Manifest(object, metaclass=ABCMeta):
 return installed_pkgs
 
 
-class RpmManifest(Manifest):
-"""
-Returns a dictionary object with mip and mlp packages.
-"""
-def _split_multilib(self, pkg_list):
-pkgs = dict()
-
-for pkg in pkg_list.split():
-pkg_type = self.PKG_TYPE_MUST_INSTALL
-
-ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
-
-for ml_variant in ml_variants:
-if pkg.startswith(ml_variant + '-'):
-pkg_type = self.PKG_TYPE_MULTILIB
-
-if not pkg_type in pkgs:
-pkgs[pkg_type] = pkg
-else:
-pkgs[pkg_type] += " " + pkg
-
-return pkgs
-
-def create_initial(self):
-pkgs = dict()
-
-with open(self.initial_manifest, "w+") as manifest:
-manifest.write(self.initial_manifest_file_header)
-
-for var in self.var_maps[self.manifest_type]:
-if var in self.vars_to_split:
-split_pkgs = self._split_multilib(self.d.getVar(var))
-if split_pkgs is not None:
-pkgs = dict(list(pkgs.items()) + 
list(split_pkgs.items()))
-else:
-pkg_list = self.d.getVar(var)
-if pkg_list is not None:
-pkgs[self.var_maps[self.manifest_type][var]] = 
self.d.getVar(var)
-
-for pkg_type in pkgs:
-for pkg in pkgs[pkg_type].split():
-manifest.write("%s,%s\n" % (pkg_type, pkg))
-
-def create_final(self):
-pass
-
-def create_full(self, pm):
-pass
-
-
 class OpkgManifest(Manifest):
 """
 Returns a dictionary object with mip and mlp packages.
@@ -332,6 +281,8 @@ class DpkgManifest(Manifest):
 
 def create_manifest(d, final_manifest=False, manifest_dir=None,
 manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
+
+from oe.package_manager.rpm.manifest import RpmManifest
 manifest_map = {'rpm': RpmManifest,
 'ipk': OpkgManifest,
 'deb': DpkgManifest}
diff --git a/meta/lib/oe/package_manager/rpm/__init__.py 
b/meta/lib/oe/package_manager/rpm/__init__.py
new file mode 100644
index 00..a2094304c9
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/__init__.py
@@ -0,0 +1,3 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
diff --git a/meta/lib/oe/package_manager/rpm/manifest.py 
b/meta/lib/oe/package_manager/rpm/manifest.py
new file mode 100644
index 00..a75f6bdabf
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/manifest.py
@@ -0,0 +1,54 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.manifest import Manifest
+
+class RpmManifest(Manifest):
+"""
+Returns a dictionary object with mip and mlp packages.
+"""
+def _split_multilib(self, pkg_list):
+pkgs = dict()
+
+for pkg in pkg_list.split():
+pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
+
+for ml_variant in ml_variants:
+if pkg.startswith(ml_variant + '-'):
+pkg_type = self.PKG_TYPE_MULTILIB
+
+if not pkg_type in pkgs:
+pkgs[pkg_type] = pkg
+else:
+pkgs[pkg_type] += " " + pkg
+
+return pkgs
+
+def create_initial(self):
+pkgs = dict()
+
+with open(self.initial_manifest, "w+") as manifest:
+manifest.write(self.initial_manifest_file_header)
+
+for var in self.var_maps[self.manifest_type]:
+if var in self.vars_to_split:
+split_pkgs = self._split_multilib(self.d.getVar(var))
+if split_pkgs is not None:
+pkgs = dict(list(pkgs.items()) + 
list(split_pkgs.items()))
+else:
+pkg_list = self.d.getVar(var)
+if pkg_list is not 

[OE-core] [PATCH v6 11/13] rpm: Move package manager to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/__init__.py | 398 ---
 meta/lib/oe/package_manager/rpm/__init__.py | 399 
 meta/lib/oe/package_manager/rpm/rootfs.py   |   2 +-
 meta/lib/oe/package_manager/rpm/sdk.py  |   2 +-
 meta/lib/oe/rootfs.py   |   2 +
 meta/lib/oe/sdk.py  |   1 +
 6 files changed, 404 insertions(+), 400 deletions(-)

diff --git a/meta/lib/oe/package_manager/__init__.py 
b/meta/lib/oe/package_manager/__init__.py
index 35e5cff073..2ca47e5109 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -149,43 +149,6 @@ class Indexer(object, metaclass=ABCMeta):
 def write_index(self):
 pass
 
-
-class RpmIndexer(Indexer):
-def write_index(self):
-self.do_write_index(self.deploy_dir)
-
-def do_write_index(self, deploy_dir):
-if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-signer = get_signer(self.d, 
self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
-else:
-signer = None
-
-createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
-result = create_index("%s --update -q %s" % (createrepo_c, deploy_dir))
-if result:
-bb.fatal(result)
-
-# Sign repomd
-if signer:
-sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
-is_ascii_sig = (sig_type.upper() != "BIN")
-signer.detach_sign(os.path.join(deploy_dir, 'repodata', 
'repomd.xml'),
-   self.d.getVar('PACKAGE_FEED_GPG_NAME'),
-   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
-   armor=is_ascii_sig)
-
-class RpmSubdirIndexer(RpmIndexer):
-def write_index(self):
-bb.note("Generating package index for %s" %(self.deploy_dir))
-self.do_write_index(self.deploy_dir)
-for entry in os.walk(self.deploy_dir):
-if os.path.samefile(self.deploy_dir, entry[0]):
-for dir in entry[1]:
-if dir != 'repodata':
-dir_path = oe.path.join(self.deploy_dir, dir)
-bb.note("Generating package index for %s" %(dir_path))
-self.do_write_index(dir_path)
-
 class OpkgIndexer(Indexer):
 def write_index(self):
 arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
@@ -323,10 +286,6 @@ class PkgsList(object, metaclass=ABCMeta):
 def list_pkgs(self):
 pass
 
-class RpmPkgsList(PkgsList):
-def list_pkgs(self):
-return RpmPM(self.d, self.rootfs_dir, self.d.getVar('TARGET_VENDOR'), 
needfeed=False).list_installed()
-
 class OpkgPkgsList(PkgsList):
 def __init__(self, d, rootfs_dir, config_file):
 super(OpkgPkgsList, self).__init__(d, rootfs_dir)
@@ -737,363 +696,6 @@ def create_packages_dir(d, subrepo_dir, deploydir, 
taskname, filterbydependencie
 else:
 raise
 
-class RpmPM(PackageManager):
-def __init__(self,
- d,
- target_rootfs,
- target_vendor,
- task_name='target',
- arch_var=None,
- os_var=None,
- rpm_repo_workdir="oe-rootfs-repo",
- filterbydependencies=True,
- needfeed=True):
-super(RpmPM, self).__init__(d, target_rootfs)
-self.target_vendor = target_vendor
-self.task_name = task_name
-if arch_var == None:
-self.archs = 
self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-","_")
-else:
-self.archs = self.d.getVar(arch_var).replace("-","_")
-if task_name == "host":
-self.primary_arch = self.d.getVar('SDK_ARCH')
-else:
-self.primary_arch = self.d.getVar('MACHINE_ARCH')
-
-if needfeed:
-self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), 
rpm_repo_workdir)
-create_packages_dir(self.d, oe.path.join(self.rpm_repo_dir, 
"rpm"), d.getVar("DEPLOY_DIR_RPM"), "package_write_rpm", filterbydependencies)
-
-self.saved_packaging_data = 
self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
-if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):
-bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data'))
-self.packaging_data_dirs = ['etc/rpm', 'etc/rpmrc', 'etc/dnf', 
'var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf']
-self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
-   self.task_name)
-if not os.path.exists(self.d.expand('${T}/saved')):
-bb.utils.mkdirhier(self.d.expand('${T}/saved'))
-
-def 

[OE-core] [PATCH v6 06/13] ipk: Move rootfs to its own dir

2020-07-24 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/ipk/rootfs.py | 385 ++
 meta/lib/oe/rootfs.py | 268 +--
 2 files changed, 387 insertions(+), 266 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/ipk/rootfs.py

diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py 
b/meta/lib/oe/package_manager/ipk/rootfs.py
new file mode 100644
index 00..067831be00
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/rootfs.py
@@ -0,0 +1,385 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.rootfs import Rootfs
+from oe.package_manager import OpkgPM
+from oe.manifest import Manifest
+from oe.utils import execute_pre_post_process
+import re
+from oe.package_manager.ipk.manifest import OpkgManifest
+
+class DpkgOpkgRootfs(Rootfs):
+def __init__(self, d, progress_reporter=None, logcatcher=None):
+super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
+
+def _get_pkgs_postinsts(self, status_file):
+def _get_pkg_depends_list(pkg_depends):
+pkg_depends_list = []
+# filter version requirements like libc (>= 1.1)
+for dep in pkg_depends.split(', '):
+m_dep = re.match(r"^(.*) \(.*\)$", dep)
+if m_dep:
+dep = m_dep.group(1)
+pkg_depends_list.append(dep)
+
+return pkg_depends_list
+
+pkgs = {}
+pkg_name = ""
+pkg_status_match = False
+pkg_depends = ""
+
+with open(status_file) as status:
+data = status.read()
+status.close()
+for line in data.split('\n'):
+m_pkg = re.match(r"^Package: (.*)", line)
+m_status = re.match(r"^Status:.*unpacked", line)
+m_depends = re.match(r"^Depends: (.*)", line)
+
+#Only one of m_pkg, m_status or m_depends is not None at time
+#If m_pkg is not None, we started a new package
+if m_pkg is not None:
+#Get Package name
+pkg_name = m_pkg.group(1)
+#Make sure we reset other variables
+pkg_status_match = False
+pkg_depends = ""
+elif m_status is not None:
+#New status matched
+pkg_status_match = True
+elif m_depends is not None:
+#New depends macthed
+pkg_depends = m_depends.group(1)
+else:
+pass
+
+#Now check if we can process package depends and postinst
+if "" != pkg_name and pkg_status_match:
+pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)
+else:
+#Not enough information
+pass
+
+# remove package dependencies not in postinsts
+pkg_names = list(pkgs.keys())
+for pkg_name in pkg_names:
+deps = pkgs[pkg_name][:]
+
+for d in deps:
+if d not in pkg_names:
+pkgs[pkg_name].remove(d)
+
+return pkgs
+
+def _get_delayed_postinsts_common(self, status_file):
+def _dep_resolve(graph, node, resolved, seen):
+seen.append(node)
+
+for edge in graph[node]:
+if edge not in resolved:
+if edge in seen:
+raise RuntimeError("Packages %s and %s have " \
+"a circular dependency in postinsts scripts." \
+% (node, edge))
+_dep_resolve(graph, edge, resolved, seen)
+
+resolved.append(node)
+
+pkg_list = []
+
+pkgs = None
+if not self.d.getVar('PACKAGE_INSTALL').strip():
+bb.note("Building empty image")
+else:
+pkgs = self._get_pkgs_postinsts(status_file)
+if pkgs:
+root = "__packagegroup_postinst__"
+pkgs[root] = list(pkgs.keys())
+_dep_resolve(pkgs, root, pkg_list, [])
+pkg_list.remove(root)
+
+if len(pkg_list) == 0:
+return None
+
+return pkg_list
+
+def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
+if bb.utils.contains("IMAGE_FEATURES", "package-management",
+ True, False, self.d):
+return
+num = 0
+for p in self._get_delayed_postinsts():
+bb.utils.mkdirhier(dst_postinst_dir)
+
+if os.path.exists(os.path.join(src_postinst_dir, p + ".postinst")):
+shutil.copy(os.path.join(src_postinst_dir, p + ".postinst"),
+os.path.join(dst_postinst_dir, "%03d-%s" % 

[OE-core] [PATCH 1/2] arch-armv8-2a.inc: add tune include for armv8.2a

2020-07-24 Thread Dmitry Baryshkov
From: Dmitry Baryshkov 

Add tune include for armv8.2a. This adds support only for bare armv8.2a
(and for crypto extension). There is no support for additional
instructions added by architecture extensions (except the main crypto
extension support).

Signed-off-by: Dmitry Baryshkov 
---
 .../machine/include/arm/arch-armv8-2a.inc | 19 +++
 1 file changed, 19 insertions(+)
 create mode 100644 meta/conf/machine/include/arm/arch-armv8-2a.inc

diff --git a/meta/conf/machine/include/arm/arch-armv8-2a.inc 
b/meta/conf/machine/include/arm/arch-armv8-2a.inc
new file mode 100644
index ..1c095256d185
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-armv8-2a.inc
@@ -0,0 +1,19 @@
+DEFAULTTUNE ?= "armv8-2a"
+
+TUNEVALID[armv8-2a] = "Enable instructions for ARMv8-a"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-2a', ' 
-march=armv8.2-a', '', d)}"
+# TUNE crypto will be handled by arch-armv8a.inc below
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-2a', 
'armv8-2a:', '' ,d)}"
+
+require conf/machine/include/arm/arch-armv8a.inc
+
+# Little Endian base configs
+AVAILTUNES += "armv8-2a armv8-2a-crypto"
+ARMPKGARCH_tune-armv8-2a?= "armv8-2a"
+ARMPKGARCH_tune-armv8-2a-crypto ?= "armv8-2a"
+TUNE_FEATURES_tune-armv8-2a  = "aarch64 armv8-2a"
+TUNE_FEATURES_tune-armv8-2a-crypto   = "${TUNE_FEATURES_tune-armv8-2a} 
crypto"
+PACKAGE_EXTRA_ARCHS_tune-armv8-2a= 
"${PACKAGE_EXTRA_ARCHS_tune-armv8a} armv8-2a"
+PACKAGE_EXTRA_ARCHS_tune-armv8-2a-crypto = 
"${PACKAGE_EXTRA_ARCHS_tune-armv8-2a} armv8-2a-crypto"
+BASE_LIB_tune-armv8-2a   = "lib64"
+BASE_LIB_tune-armv8-2a-crypto= "lib64"
-- 
2.27.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140932): 
https://lists.openembedded.org/g/openembedded-core/message/140932
Mute This Topic: https://lists.openembedded.org/mt/75767485/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] error about cve_check after a 'do_populate_sdk: Succeeded' on poky master since 20 july on ubuntu18.04/Debian 10/Debian 9.12

2020-07-24 Thread vygu via lists.openembedded.org
Hello,

We observe this following error about cve_check after a populate_sdk:

ERROR: Execution of event handler 'cve_save_summary_handler' failed
Traceback (most recent call last):
File "/home/user/poky/meta/classes/cve-check.bbclass", line 65, in 
cve_save_summary_handler(e=):

> shutil.copyfile(cve_tmp_file, cve_summary_file)

File "/usr/lib/python3.6/shutil.py", line 120, in 
copyfile(src='/home/user/poky/build/tmp/cve_check', 
dst='/home/user/poky/build/tmp/log/cve/cve-summary-20200724111814.txt', 
follow_symlinks=True):
else:
> with open(src, 'rb') as fsrc:
with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 
'/home/user/poky/build/tmp/cve_check'-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140916): 
https://lists.openembedded.org/g/openembedded-core/message/140916
Mute This Topic: https://lists.openembedded.org/mt/75764992/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: Fw: [OE-core] [PATCH] wic/bootimg-efi: Add support for IMAGE_BOOT_FILES

2020-07-24 Thread Khasim Mohammed
Hi Lee,

On Fri, 2020-07-24 at 12:12 +0530, Khasim Mohammed wrote:
>
> 
> From: openembedded-core@lists.openembedded.org <
> openembedded-core@lists.openembedded.org> on behalf of Lee Chee Yang
> via lists.openembedded.org <
> chee.yang.lee=intel@lists.openembedded.org>
> Sent: Friday, July 24, 2020 6:28 AM
> To: Khasim Mohammed; openembedded-core@lists.openembedded.org
> Cc: nd
> Subject: Re: [OE-core] [PATCH] wic/bootimg-efi: Add support for
> IMAGE_BOOT_FILES
>
> Hi,
> I think currently IMAGE_BOOT_FILES test run on bootimg-partition
> only.
yes.

> Could you add test cases for bootimg-efi too?
>

I posted a separate patch to test IMAGE_BOOT_FILES for bootimg-efi.

Thanks.

Regards,
Khasim

> -Original Message-
> From: openembedded-core@lists.openembedded.org <
> openembedded-core@lists.openembedded.org> On Behalf Of Khasim
> Mohammed
> Sent: Thursday, 23 July, 2020 5:52 PM
> To: openembedded-core@lists.openembedded.org
> Cc: n...@arm.com; Khasim Syed Mohammed 
> Subject: [OE-core] [PATCH] wic/bootimg-efi: Add support for
> IMAGE_BOOT_FILES
>
> List of files defined using IMAGE_BOOT_FILES are installed into the
> boot partition when preparing an image using the wic tool with the
> bootimg-efi source plugin.
>
> The code snippet introduced is taken as is from bootimg-partition.py
>
> Change-Id: I8dbb6b4e7c24870f587a6f31e6ae4a87d7033782
> Issue-Id: PLATFORMS-3134
> Signed-off-by: Khasim Syed Mohammed 
> ---
>  scripts/lib/wic/plugins/source/bootimg-efi.py | 60
> +++
>  1 file changed, 60 insertions(+)
>
> diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py
> b/scripts/lib/wic/plugins/source/bootimg-efi.py
> index 2cfdc10ecd..14c1723577 100644
> --- a/scripts/lib/wic/plugins/source/bootimg-efi.py
> +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
> @@ -13,6 +13,9 @@
>  import logging
>  import os
>  import shutil
> +import re
> +
> +from glob import glob
>
>  from wic import WicError
>  from wic.engine import get_custom_config @@ -209,6 +212,57 @@ class
> BootimgEFIPlugin(SourcePlugin):
>  except KeyError:
>  raise WicError("bootimg-efi requires a loader, none
> specified")
>
> +if get_bitbake_var("IMAGE_BOOT_FILES") is None:
> +logger.debug('No boot files defined in
> IMAGE_BOOT_FILES')
> +else:
> +boot_files = None
> +for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s",
> part.label), (None, None)):
> +if fmt:
> +var = fmt % id
> +else:
> +var = ""
> +
> +boot_files = get_bitbake_var("IMAGE_BOOT_FILES" +
> var)
> +if boot_files:
> +break
> +
> +logger.debug('Boot files: %s', boot_files)
> +
> +# list of tuples (src_name, dst_name)
> +deploy_files = []
> +for src_entry in re.findall(r'[\w;\-\./\*]+',
> boot_files):
> +if ';' in src_entry:
> +dst_entry = tuple(src_entry.split(';'))
> +if not dst_entry[0] or not dst_entry[1]:
> +raise WicError('Malformed boot file entry:
> %s' % src_entry)
> +else:
> +dst_entry = (src_entry, src_entry)
> +
> +logger.debug('Destination entry: %r', dst_entry)
> +deploy_files.append(dst_entry)
> +
> +cls.install_task = [];
> +for deploy_entry in deploy_files:
> +src, dst = deploy_entry
> +if '*' in src:
> +# by default install files under their basename
> +entry_name_fn = os.path.basename
> +if dst != src:
> +# unless a target name was given, then treat
> name
> +# as a directory and append a basename
> +entry_name_fn = lambda name: \
> +os.path.join(dst,
> +
> + os.path.basename(name))
> +
> +srcs = glob(os.path.join(kernel_dir, src))
> +
> +logger.debug('Globbed sources: %s', ',
> '.join(srcs))
> +for entry in srcs:
> +src = os.path.relpath(entry, kernel_dir)
> +entry_dst_name = entry_name_fn(entry)
> +cls.install_task.append((src,
> entry_dst_name))
> +else:
> +cls.install_task.append((src, dst))
>
>  @classmethod
>  def do_prepare_partition(cls, part, source_params, creator,
> cr_workdir, @@ -238,6 +292,12 @@ class
> BootimgEFIPlugin(SourcePlugin):
>  (staging_kernel_dir, kernel, hdddir, kernel)
>  exec_cmd(install_cmd)
>
> +if get_bitbake_var("IMAGE_BOOT_FILES"):
> +for src_path, dst_path in cls.install_task:
> +install_cmd = "install -m 0644 -D %s %s" \
> 

[OE-core] [PATCH] selftest: wic: IMAGE_BOOT_FILES test to run on bootimg-efi

2020-07-24 Thread Khasim Mohammed
bootimg-efi is updated to install files listed in IMAGE_BOOT_FILES
into the boot partition. The test_mkefidisk in oeqa selftest is
updated to run IMAGE_BOOT_FILES test for bootimg-efi.

Change-Id: Id577e853fecc5fe58531c7afa33db3b1c00c8319
Signed-off-by: Khasim Syed Mohammed 
---
 meta/lib/oeqa/selftest/cases/wic.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py 
b/meta/lib/oeqa/selftest/cases/wic.py
index 8b58285c32..41b15f6323 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -210,6 +210,8 @@ class Wic(WicTestCase):
 def test_mkefidisk(self):
 """Test creation of mkefidisk image"""
 cmd = "wic create mkefidisk -e core-image-minimal -o %s" % 
self.resultdir
+kimgtype = get_bb_var('KERNEL_IMAGETYPE', 'core-image-minimal')
+self.write_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
 runCmd(cmd)
 self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct")))
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140914): 
https://lists.openembedded.org/g/openembedded-core/message/140914
Mute This Topic: https://lists.openembedded.org/mt/75761675/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-