Hi,
I'm sorry but I don't understand this patch.
> error: cannot open Packages index using db5 - Permission denied (13)
> error: cannot open Packages database in /var/lib/rpm
I think these two error messages is just because invoking nativesdk-rpm without
"--root=":
-------------------------------------------------
$ /opt/poky/3.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/rpm -qplv
attr-2.4.48-r0.core2_64.rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in
/opt/poky/3.1+snapshot/sysroots/x86_64-pokysdk-linux/var/lib/rpm
drwxr-xr-x 2 root root 0 Jun 19 2018 /etc
-rw-r--r-- 1 root root 642 Jun 19 2018
/etc/xattr.conf
...
Same as nativesdk-gcc adding "--sysroot=", nativesdk-rpm should be invoked with
"--root=":
--------------------------------------------------
$ /opt/poky/3.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/rpm -qplv
attr-2.4.48-r0.core2_64.rpm --root=/home/leimh/test-rootfs/
drwxr-xr-x 2 root root 0 Jun 19 2018 /etc
-rw-r--r-- 1 root root 642 Jun 19 2018
/etc/xattr.conf
......
But now with this patch, "--root=" doesn't work for nativesdk-rpm. Even I use
nativesdk-rpm with "--root=", the database of nativesdk-rpm still is written to
${SDK_INTALL_DIR}/var/lib/rpm/, not the directory that I set by "--root=".
Best regards
Lei
> -----Original Message-----
> From: [email protected] <openembedded-
> [email protected]> On Behalf Of Chen Qi
> Sent: Thursday, July 16, 2020 2:57 PM
> To: [email protected]
> Subject: [OE-core][PATCH] rpm: fix nativesdk's default var location
>
> For now, the nativesdk-rpm's %_var in /usr/lib/rpm/macros is '/var'. This is
> causing error when running `rpm -qplv A.rpm'.
>
> error: cannot open Packages index using db5 - Permission denied (13)
> error: cannot open Packages database in /var/lib/rpm
>
> The rpm in SDK should be using its own database. So we should remove this
> configure option, letting the SDK's native sysroot prefix to be there in
> %_var. In
> fact, '%_usr' in macros has already got the prefix.
> After this change, we have in the macros file lines like below.
>
> """
> %_usr
> /opt/windriver/wrlinux/20.29/sysroots/x86_64-wrlinuxsdk-
> linux/usr
> %_usrsrc %{_usr}/src
> %_var
> /opt/windriver/wrlinux/20.29/sysroots/x86_64-wrlinuxsdk-
> linux/var
> """
>
> Signed-off-by: Chen Qi <[email protected]>
> ---
> meta/recipes-devtools/rpm/rpm_4.15.1.bb | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/rpm/rpm_4.15.1.bb b/meta/recipes-
> devtools/rpm/rpm_4.15.1.bb
> index cbe1acffe2..b5a0ac9382 100644
> --- a/meta/recipes-devtools/rpm/rpm_4.15.1.bb
> +++ b/meta/recipes-devtools/rpm/rpm_4.15.1.bb
> @@ -67,7 +67,7 @@ EXTRA_OECONF_append_libc-musl = " --disable-nls --
> disable-openmp"
> # Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown
> via
> session dbus even when plugins support is enabled.
> # Also disable plugins by default for native.
> EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --
> localstatedir=/var --disable-plugins"
> -EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --
> localstatedir=/var --disable-plugins"
> +EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-
> plugins"
>
> BBCLASSEXTEND = "native nativesdk"
>
> --
> 2.17.1
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#142155):
https://lists.openembedded.org/g/openembedded-core/message/142155
Mute This Topic: https://lists.openembedded.org/mt/75536801/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-