Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
@ 2020-06-02 19:09 Gregor Zatko
  2020-06-02 19:27 ` [OE-core] " Denys Dmytriyenko
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gregor Zatko @ 2020-06-02 19:09 UTC (permalink / raw)
  To: openembedded-core

In some cases there is a need for update-alternatives script which gets built
within opkg-utils recipe into a standalone package. However, this causes to
many unnecessary dependencies, including Python, bc, OpenSSL etc. to be built.

In this commit a standalone lightweight recipe for update-alternatives that
shouldn't be dependent on nothing other than bash.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=8879

Signed-off-by: Gregor Zatko <gzatko@gmail.com>
---
 .../conf/distro/include/default-providers.inc |  6 +--
 meta/conf/layer.conf                          |  3 +-
 .../packagegroups/packagegroup-self-hosted.bb |  1 +
 .../opkg-utils/opkg-utils_0.4.2.bb            | 25 +---------
 .../update-alternatives_0.4.2.bb              | 49 +++++++++++++++++++
 5 files changed, 56 insertions(+), 28 deletions(-)
 create mode 100644 meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb

diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index ea88bd4876..035877af59 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -10,8 +10,8 @@ PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "nativesdk-mesa"
 PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
 PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
 PREFERRED_PROVIDER_virtual/mesa ?= "mesa"
-PREFERRED_PROVIDER_virtual/update-alternatives ?= "opkg-utils"
-PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-utils-native"
+PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives"
+PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "update-alternatives-native"
 PREFERRED_PROVIDER_virtual/libx11 ?= "libx11"
 PREFERRED_PROVIDER_virtual/base-utils ?= "busybox"
 PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
@@ -21,7 +21,7 @@ PREFERRED_PROVIDER_virtual/make-native ?= "make-native"
 #
 # Default virtual runtime providers
 #
-VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-opkg"
+VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives"
 VIRTUAL-RUNTIME_apm ?= "apm"
 VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
 VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index da93d64e0a..85fb945f11 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -19,7 +19,6 @@ BBLAYERS_LAYERINDEX_NAME_core = "openembedded-core"
 # Set a variable to get to the top of the metadata location
 COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}'
 
-# opkg-utils is for update-alternatives :(
 SIGGEN_EXCLUDERECIPES_ABISAFE += " \
   sysvinit-inittab \
   busybox-inittab \
@@ -40,7 +39,7 @@ SIGGEN_EXCLUDERECIPES_ABISAFE += " \
   shadow \
   shadow-sysroot \
   base-passwd \
-  opkg-utils \
+  update-alternatives \
   gstreamer1.0-meta-base \
   ca-certificates \
   shared-mime-info \
diff --git a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
index 9a70b189a4..4a494f1578 100644
--- a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -166,6 +166,7 @@ RDEPENDS_packagegroup-self-hosted-extended = "\
     tcl \
     texinfo \
     unzip \
+    update-alternatives \
     usbutils \
     watchdog \
     wget \
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
index 9315240190..5ebe3d8e60 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
@@ -1,13 +1,11 @@
 SUMMARY = "Additional utilities for the opkg package manager"
-SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
 SECTION = "base"
 HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
                     file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986"
-PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
 
-SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ 
+SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \
            file://fix-reproducibility.patch \
 "
 UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
@@ -25,42 +23,23 @@ inherit perlnative
 PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold"
 PYTHONRDEPS_class-native = ""
 
-PACKAGECONFIG = "python update-alternatives"
+PACKAGECONFIG = "python"
 PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
-PACKAGECONFIG[update-alternatives] = ",,,"
 
 do_install() {
 	oe_runmake PREFIX=${prefix} DESTDIR=${D} install
-	if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
-		rm -f "${D}${bindir}/update-alternatives"
-	fi
 }
 
 do_install_append_class-target() {
 	if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
 		grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm
 	fi
-
-	if [ -e "${D}${bindir}/update-alternatives" ]; then
-		sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
-	fi
 }
 
 # These are empty and will pull python3-dev into images where it wouldn't
 # have been otherwise, so don't generate them.
 PACKAGES_remove = "${PN}-dev ${PN}-staticdev"
 
-PACKAGES =+ "update-alternatives-opkg"
-FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
-RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
-RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
-RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
-
-pkg_postrm_update-alternatives-opkg() {
-	rm -rf $D${nonarch_libdir}/opkg/alternatives
-	rmdir $D${nonarch_libdir}/opkg || true
-}
-
 BBCLASSEXTEND = "native nativesdk"
 
 CLEANBROKEN = "1"
diff --git a/meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb b/meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb
new file mode 100644
index 0000000000..8cbf8c4889
--- /dev/null
+++ b/meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Utility for managing the alternatives system"
+DESCRIPTION = "This program was inspired by the Debian update-alternatives program which is Copyright (C) 1995 Ian Jackson. This version of update-alternatives is command-line compatible with Debian's for a subset of the options, (only --install, --remove, and --help)"
+SECTION = "base"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986"
+
+SRC_ARCHIVE_NAME = "opkg-utils"
+SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${SRC_ARCHIVE_NAME}/snapshot/${SRC_ARCHIVE_NAME}-${PV}.tar.gz"
+UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
+S = "${WORKDIR}/${SRC_ARCHIVE_NAME}-${PV}"
+
+SRC_URI[md5sum] = "cc210650644fcb9bba06ad5ec95a63ec"
+SRC_URI[sha256sum] = "5929ad87d541789e0b82d626db01a1201ac48df6f49f2262fcfb86cf815e5d6c"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+RDEPENDS_${PN} += "bash"
+
+do_compile[noexec] = "1"
+
+do_install() {
+
+    install -D -m 755 ${S}/update-alternatives ${D}${bindir}/update-alternatives
+}
+
+do_install_append_class-target() {
+
+    sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
+}
+
+FILES_${PN} = "${bindir}/update-alternatives"
+RPROVIDES_${PN} = "${PN} update-alternatives-cworth"
+RREPLACES_${PN} = "update-alternatives-cworth"
+RCONFLICTS_${PN} = "update-alternatives-cworth"
+
+PROVIDES_class-target += "virtual/update-alternatives"
+RPROVIDES_${PN}_class-target += "update-alternatives"
+PROVIDES_class-native += "virtual/update-alternatives-native"
+RPROVIDES_${PN}_class-native += "update-alternatives-native"
+
+pkg_postrm_${PN}() {
+
+    rm -rf $D${nonarch_libdir}/opkg/alternatives
+    rmdir $D${nonarch_libdir}/opkg || true
+}
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:09 [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off Gregor Zatko
@ 2020-06-02 19:27 ` Denys Dmytriyenko
  2020-06-02 19:43   ` Gregor Zatko
  2020-06-02 19:32 ` Phil Blundell
  2020-06-02 19:43 ` Andreas Oberritter
  2 siblings, 1 reply; 9+ messages in thread
From: Denys Dmytriyenko @ 2020-06-02 19:27 UTC (permalink / raw)
  To: Gregor Zatko; +Cc: openembedded-core

On Tue, Jun 02, 2020 at 09:09:25PM +0200, Gregor Zatko wrote:
> In some cases there is a need for update-alternatives script which gets built
> within opkg-utils recipe into a standalone package. However, this causes to
> many unnecessary dependencies, including Python, bc, OpenSSL etc. to be built.
> 
> In this commit a standalone lightweight recipe for update-alternatives that
> shouldn't be dependent on nothing other than bash.

(R)Depending on bash doesn't make it lightweight anymore. This means you 
cannot do tiny bash-less images with alternatives?


> https://bugzilla.yoctoproject.org/show_bug.cgi?id=8879
> 
> Signed-off-by: Gregor Zatko <gzatko@gmail.com>
> ---
>  .../conf/distro/include/default-providers.inc |  6 +--
>  meta/conf/layer.conf                          |  3 +-
>  .../packagegroups/packagegroup-self-hosted.bb |  1 +
>  .../opkg-utils/opkg-utils_0.4.2.bb            | 25 +---------
>  .../update-alternatives_0.4.2.bb              | 49 +++++++++++++++++++
>  5 files changed, 56 insertions(+), 28 deletions(-)
>  create mode 100644 meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb
> 
> diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
> index ea88bd4876..035877af59 100644
> --- a/meta/conf/distro/include/default-providers.inc
> +++ b/meta/conf/distro/include/default-providers.inc
> @@ -10,8 +10,8 @@ PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "nativesdk-mesa"
>  PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
>  PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
>  PREFERRED_PROVIDER_virtual/mesa ?= "mesa"
> -PREFERRED_PROVIDER_virtual/update-alternatives ?= "opkg-utils"
> -PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-utils-native"
> +PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives"
> +PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "update-alternatives-native"
>  PREFERRED_PROVIDER_virtual/libx11 ?= "libx11"
>  PREFERRED_PROVIDER_virtual/base-utils ?= "busybox"
>  PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
> @@ -21,7 +21,7 @@ PREFERRED_PROVIDER_virtual/make-native ?= "make-native"
>  #
>  # Default virtual runtime providers
>  #
> -VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-opkg"
> +VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives"
>  VIRTUAL-RUNTIME_apm ?= "apm"
>  VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
>  VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
> diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
> index da93d64e0a..85fb945f11 100644
> --- a/meta/conf/layer.conf
> +++ b/meta/conf/layer.conf
> @@ -19,7 +19,6 @@ BBLAYERS_LAYERINDEX_NAME_core = "openembedded-core"
>  # Set a variable to get to the top of the metadata location
>  COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}'
>  
> -# opkg-utils is for update-alternatives :(
>  SIGGEN_EXCLUDERECIPES_ABISAFE += " \
>    sysvinit-inittab \
>    busybox-inittab \
> @@ -40,7 +39,7 @@ SIGGEN_EXCLUDERECIPES_ABISAFE += " \
>    shadow \
>    shadow-sysroot \
>    base-passwd \
> -  opkg-utils \
> +  update-alternatives \
>    gstreamer1.0-meta-base \
>    ca-certificates \
>    shared-mime-info \
> diff --git a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
> index 9a70b189a4..4a494f1578 100644
> --- a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
> +++ b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
> @@ -166,6 +166,7 @@ RDEPENDS_packagegroup-self-hosted-extended = "\
>      tcl \
>      texinfo \
>      unzip \
> +    update-alternatives \
>      usbutils \
>      watchdog \
>      wget \
> diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
> index 9315240190..5ebe3d8e60 100644
> --- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
> +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
> @@ -1,13 +1,11 @@
>  SUMMARY = "Additional utilities for the opkg package manager"
> -SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
>  SECTION = "base"
>  HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils"
>  LICENSE = "GPLv2+"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
>                      file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986"
> -PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
>  
> -SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ 
> +SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \
>             file://fix-reproducibility.patch \
>  "
>  UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
> @@ -25,42 +23,23 @@ inherit perlnative
>  PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold"
>  PYTHONRDEPS_class-native = ""
>  
> -PACKAGECONFIG = "python update-alternatives"
> +PACKAGECONFIG = "python"
>  PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
> -PACKAGECONFIG[update-alternatives] = ",,,"
>  
>  do_install() {
>  	oe_runmake PREFIX=${prefix} DESTDIR=${D} install
> -	if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
> -		rm -f "${D}${bindir}/update-alternatives"
> -	fi
>  }
>  
>  do_install_append_class-target() {
>  	if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
>  		grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm
>  	fi
> -
> -	if [ -e "${D}${bindir}/update-alternatives" ]; then
> -		sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
> -	fi
>  }
>  
>  # These are empty and will pull python3-dev into images where it wouldn't
>  # have been otherwise, so don't generate them.
>  PACKAGES_remove = "${PN}-dev ${PN}-staticdev"
>  
> -PACKAGES =+ "update-alternatives-opkg"
> -FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
> -RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
> -RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
> -RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
> -
> -pkg_postrm_update-alternatives-opkg() {
> -	rm -rf $D${nonarch_libdir}/opkg/alternatives
> -	rmdir $D${nonarch_libdir}/opkg || true
> -}
> -
>  BBCLASSEXTEND = "native nativesdk"
>  
>  CLEANBROKEN = "1"
> diff --git a/meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb b/meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb
> new file mode 100644
> index 0000000000..8cbf8c4889
> --- /dev/null
> +++ b/meta/recipes-devtools/update-alternatives/update-alternatives_0.4.2.bb
> @@ -0,0 +1,49 @@
> +SUMMARY = "Utility for managing the alternatives system"
> +DESCRIPTION = "This program was inspired by the Debian update-alternatives program which is Copyright (C) 1995 Ian Jackson. This version of update-alternatives is command-line compatible with Debian's for a subset of the options, (only --install, --remove, and --help)"
> +SECTION = "base"
> +HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils"
> +LICENSE = "GPLv2+"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
> +                    file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986"
> +
> +SRC_ARCHIVE_NAME = "opkg-utils"
> +SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${SRC_ARCHIVE_NAME}/snapshot/${SRC_ARCHIVE_NAME}-${PV}.tar.gz"
> +UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
> +S = "${WORKDIR}/${SRC_ARCHIVE_NAME}-${PV}"
> +
> +SRC_URI[md5sum] = "cc210650644fcb9bba06ad5ec95a63ec"
> +SRC_URI[sha256sum] = "5929ad87d541789e0b82d626db01a1201ac48df6f49f2262fcfb86cf815e5d6c"
> +
> +TARGET_CC_ARCH += "${LDFLAGS}"
> +
> +RDEPENDS_${PN} += "bash"
> +
> +do_compile[noexec] = "1"
> +
> +do_install() {
> +
> +    install -D -m 755 ${S}/update-alternatives ${D}${bindir}/update-alternatives
> +}
> +
> +do_install_append_class-target() {
> +
> +    sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
> +}
> +
> +FILES_${PN} = "${bindir}/update-alternatives"
> +RPROVIDES_${PN} = "${PN} update-alternatives-cworth"
> +RREPLACES_${PN} = "update-alternatives-cworth"
> +RCONFLICTS_${PN} = "update-alternatives-cworth"
> +
> +PROVIDES_class-target += "virtual/update-alternatives"
> +RPROVIDES_${PN}_class-target += "update-alternatives"
> +PROVIDES_class-native += "virtual/update-alternatives-native"
> +RPROVIDES_${PN}_class-native += "update-alternatives-native"
> +
> +pkg_postrm_${PN}() {
> +
> +    rm -rf $D${nonarch_libdir}/opkg/alternatives
> +    rmdir $D${nonarch_libdir}/opkg || true
> +}
> +
> +BBCLASSEXTEND = "native nativesdk"
> -- 
> 2.26.2
> 

> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:09 [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off Gregor Zatko
  2020-06-02 19:27 ` [OE-core] " Denys Dmytriyenko
@ 2020-06-02 19:32 ` Phil Blundell
  2020-06-02 19:43 ` Andreas Oberritter
  2 siblings, 0 replies; 9+ messages in thread
From: Phil Blundell @ 2020-06-02 19:32 UTC (permalink / raw)
  To: Gregor Zatko; +Cc: openembedded-core

On Tue, Jun 02, 2020 at 09:09:25PM +0200, Gregor Zatko wrote:
> In some cases there is a need for update-alternatives script which gets built
> within opkg-utils recipe into a standalone package. However, this causes to
> many unnecessary dependencies, including Python, bc, OpenSSL etc. to be built.

Funny, it's almost as if 44b538eedab7c255051fa3375f9f2439cd2db3dd never
happened... :-)

p.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:09 [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off Gregor Zatko
  2020-06-02 19:27 ` [OE-core] " Denys Dmytriyenko
  2020-06-02 19:32 ` Phil Blundell
@ 2020-06-02 19:43 ` Andreas Oberritter
  2020-06-02 19:45   ` Gregor Zatko
  2 siblings, 1 reply; 9+ messages in thread
From: Andreas Oberritter @ 2020-06-02 19:43 UTC (permalink / raw)
  To: Gregor Zatko; +Cc: openembedded-core

Hello Gregor,

On Tue,  2 Jun 2020 21:09:25 +0200
"Gregor Zatko" <gzatko@gmail.com> wrote:

> In some cases there is a need for update-alternatives script which gets built
> within opkg-utils recipe into a standalone package. However, this causes to
> many unnecessary dependencies, including Python, bc, OpenSSL etc. to be built.
> 
> In this commit a standalone lightweight recipe for update-alternatives that
> shouldn't be dependent on nothing other than bash.
> 
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=8879
> 
> Signed-off-by: Gregor Zatko <gzatko@gmail.com>
> ---
>  .../conf/distro/include/default-providers.inc |  6 +--
>  meta/conf/layer.conf                          |  3 +-
>  .../packagegroups/packagegroup-self-hosted.bb |  1 +
>  .../opkg-utils/opkg-utils_0.4.2.bb            | 25 +---------
>  .../update-alternatives_0.4.2.bb              | 49 +++++++++++++++++++

why did you change the name from update-alternatives-opkg to update-alternatives? I would prefer to keep the suffix in order to be able to distinguish it more easily from other implementations, e.g. dpkg's.

Best regards,
Andreas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:27 ` [OE-core] " Denys Dmytriyenko
@ 2020-06-02 19:43   ` Gregor Zatko
  2020-06-02 19:49     ` Phil Blundell
  0 siblings, 1 reply; 9+ messages in thread
From: Gregor Zatko @ 2020-06-02 19:43 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

On Tue, 2020-06-02 at 15:27 -0400, Denys Dmytriyenko wrote:
> On Tue, Jun 02, 2020 at 09:09:25PM +0200, Gregor Zatko wrote:
> > In some cases there is a need for update-alternatives script which gets built
> > within opkg-utils recipe into a standalone package. However, this causes to
> > many unnecessary dependencies, including Python, bc, OpenSSL etc. to be built.
> > 
> > In this commit a standalone lightweight recipe for update-alternatives that
> > shouldn't be dependent on nothing other than bash.
> 
> (R)Depending on bash doesn't make it lightweight anymore. This means you 
> cannot do tiny bash-less images with alternatives?

Well, if I understand everyting correct then yes, it's not possible.
However, I've
mostly been a user of Yocto so please check my reasoning:

- first, I made a comment here
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8879#c4

- if you take a look at 
http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/tree/update-alternatives
you'll simply see it's a shellscript; if we wanted to have it without
bash we'd need a C++
implementation, am I right?

[-- Attachment #2: Type: text/html, Size: 1775 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:43 ` Andreas Oberritter
@ 2020-06-02 19:45   ` Gregor Zatko
  2020-06-02 20:06     ` Denys Dmytriyenko
  0 siblings, 1 reply; 9+ messages in thread
From: Gregor Zatko @ 2020-06-02 19:45 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

On Tue, 2020-06-02 at 21:43 +0200, Andreas Oberritter wrote:
> Hello Gregor,
> On Tue,  2 Jun 2020 21:09:25 +0200"Gregor Zatko" <gzatko@gmail.com>
> wrote:
> > In some cases there is a need for update-alternatives script which
> > gets builtwithin opkg-utils recipe into a standalone package.
> > However, this causes tomany unnecessary dependencies, including
> > Python, bc, OpenSSL etc. to be built.
> > In this commit a standalone lightweight recipe for update-
> > alternatives thatshouldn't be dependent on nothing other than bash.
> > https://bugzilla.yoctoproject.org/show_bug.cgi?id=8879
> > 
> > Signed-off-by: Gregor Zatko <gzatko@gmail.com>---
> > .../conf/distro/include/default-providers.inc |  6 +--
> > meta/conf/layer.conf                          |  3 +-
> > .../packagegroups/packagegroup-self-hosted.bb |  1 + .../opkg-
> > utils/opkg-utils_0.4.2.bb            | 25 +--------- .../update-
> > alternatives_0.4.2.bb              | 49 +++++++++++++++++++
> 
> why did you change the name from update-alternatives-opkg to update-
> alternatives? I would prefer to keep the suffix in order to be able
> to distinguish it more easily from other implementations, e.g.
> dpkg's.
> Best regards,Andreas

I have no problem to revert the name back to original. However, I'm not
sure whether this patch will be accepted because it seems to solve only
a minimal part of the problem or nothing at all :-)

[-- Attachment #2: Type: text/html, Size: 2201 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:43   ` Gregor Zatko
@ 2020-06-02 19:49     ` Phil Blundell
  2020-06-02 19:54       ` Denys Dmytriyenko
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Blundell @ 2020-06-02 19:49 UTC (permalink / raw)
  To: Gregor Zatko; +Cc: Denys Dmytriyenko, openembedded-core

On Tue, Jun 02, 2020 at 09:43:45PM +0200, Gregor Zatko wrote:
> - if you take a look at 
> http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/tree/update-alternatives
> you'll simply see it's a shellscript; if we wanted to have it without
> bash we'd need a C++
> implementation, am I right?

No, I think the point is that the shell script only needs /bin/sh.  If it
required bash specifically then it would have #!/bin/bash at the top.

But, isn't rpmdeps supposed to sort that out automatically in any case?

p.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:49     ` Phil Blundell
@ 2020-06-02 19:54       ` Denys Dmytriyenko
  0 siblings, 0 replies; 9+ messages in thread
From: Denys Dmytriyenko @ 2020-06-02 19:54 UTC (permalink / raw)
  To: pb; +Cc: Gregor Zatko, openembedded-core

On Tue, Jun 02, 2020 at 09:49:40PM +0200, Phil Blundell via lists.openembedded.org wrote:
> On Tue, Jun 02, 2020 at 09:43:45PM +0200, Gregor Zatko wrote:
> > - if you take a look at 
> > http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/tree/update-alternatives
> > you'll simply see it's a shellscript; if we wanted to have it without
> > bash we'd need a C++
> > implementation, am I right?
> 
> No, I think the point is that the shell script only needs /bin/sh.  If it
> required bash specifically then it would have #!/bin/bash at the top.

The original opkg-utils recipe has this:
RDEPENDS_${PN} += "bash"

Note that update-alternatives goes into own package and doesn't have such 
RDEPS.


> But, isn't rpmdeps supposed to sort that out automatically in any case?
> 
> p.
> 

> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [OE-core] [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off
  2020-06-02 19:45   ` Gregor Zatko
@ 2020-06-02 20:06     ` Denys Dmytriyenko
  0 siblings, 0 replies; 9+ messages in thread
From: Denys Dmytriyenko @ 2020-06-02 20:06 UTC (permalink / raw)
  To: Gregor Zatko; +Cc: Andreas Oberritter, openembedded-core

On Tue, Jun 02, 2020 at 09:45:28PM +0200, Gregor Zatko wrote:
> On Tue, 2020-06-02 at 21:43 +0200, Andreas Oberritter wrote:
> > Hello Gregor,
> > On Tue,  2 Jun 2020 21:09:25 +0200"Gregor Zatko" <gzatko@gmail.com>
> > wrote:
> > > In some cases there is a need for update-alternatives script which
> > > gets builtwithin opkg-utils recipe into a standalone package.
> > > However, this causes tomany unnecessary dependencies, including
> > > Python, bc, OpenSSL etc. to be built.
> > > In this commit a standalone lightweight recipe for update-
> > > alternatives thatshouldn't be dependent on nothing other than bash.
> > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=8879
> > > 
> > > Signed-off-by: Gregor Zatko <gzatko@gmail.com>---
> > > .../conf/distro/include/default-providers.inc |  6 +--
> > > meta/conf/layer.conf                          |  3 +-
> > > .../packagegroups/packagegroup-self-hosted.bb |  1 + .../opkg-
> > > utils/opkg-utils_0.4.2.bb            | 25 +--------- .../update-
> > > alternatives_0.4.2.bb              | 49 +++++++++++++++++++
> > 
> > why did you change the name from update-alternatives-opkg to update-
> > alternatives? I would prefer to keep the suffix in order to be able
> > to distinguish it more easily from other implementations, e.g.
> > dpkg's.
> > Best regards,Andreas
> 
> I have no problem to revert the name back to original. However, I'm not
> sure whether this patch will be accepted because it seems to solve only
> a minimal part of the problem or nothing at all :-)

And what exactly are you trying to solve then?

It seems you are more concerned with build-time dependencies than you are with 
run-time ones. Building opkg-utils is a drop in the bucket (it is quite small) 
and can usually be ignored, as long as it's not installed when you don't need 
it. The resulting update-alternatives-opkg package is a tiny one with no extra 
RDEPENDS and that's what matters.

If your concern is that it builds opkg-utils and its dependencies even though 
you may be using rpm, then it is also true in the other direction - rpm gets 
built when IPK/opkg is the default package manager...

-- 
Denys

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-02 20:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-02 19:09 [PATCH] update-alternatives: introduce new package as a opkg-utils spin-off Gregor Zatko
2020-06-02 19:27 ` [OE-core] " Denys Dmytriyenko
2020-06-02 19:43   ` Gregor Zatko
2020-06-02 19:49     ` Phil Blundell
2020-06-02 19:54       ` Denys Dmytriyenko
2020-06-02 19:32 ` Phil Blundell
2020-06-02 19:43 ` Andreas Oberritter
2020-06-02 19:45   ` Gregor Zatko
2020-06-02 20:06     ` Denys Dmytriyenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox