Skip to contentSkip to conversation

Update the way we control the construction of filesystems

PATCH In review Mark Hatle 8 participants 30 messages Aug 14, 2013 – Oct 7, 2013

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

cover Update the way we control the construction of filesystems

As part of the work for the Yocto Project bug # 4079, we need a way to exclude various packages from being installed into the image. There are three mechanisms in place after these patches BAD_RECOMMENDATIONS, NO_RECOMMENDATIONS, and PACKAGE_EXCLUDE>

There was an existing mechanism called "BAD_RECOMMENDATIONS" that has previous been extended for rpm(smart). Debian(apt-get) does not appear to be capable of BAD_RECOMEMNDATIONS, so a warning was added that it will be ignored.

NO_RECOMMENDATIONS allows for the package manager to completely ignore recommended packages during install. This has a side effect of NOT installing kernel modules in many cases, as the kernel modules are listed as recommended packages. If the user uses NO_RECOMMENDATIONS, they are responsible for adding packages to the IMAGE_INSTALL as needed. (Works in all three package types.)

PACKAGE_EXCLUDE is a mechanism for preventing packages from being installed at all. If the package is in the PACKAGE_INSTALL or PACKAGE_INSTALL_ATTEMPTONLY it will be filtered out, and a warning issued. During filesystem construction if a required package was excluded an error will be generated explaining to the end user the image couldn't be generated and which package had the dependency on the excluded component. (Works in all three package types.)

The patches are available at:
git://git.yoctoproject.org/poky-contrib mhatle/oe-core-remove

Mark Hatle (11):
image.bbclass: Add basic support for PACKAGE_EXCLUDE
python-smartpm: Add support for excluding package from the install package_rpm.bbclass: Add support for PACKAGE_EXCLUDE to RPM installs
python-smartpm: Add support to disable installing recommends package_rpm.bbclass: NO_RECOMMENDATIONS support package_deb.bbclass: Use the WORKDIR not SYSROOT for temp files
package_deb: Add support for NO_RECOMMENDATIONS and PACKAGE_EXCLUDE
opkg: Add --no-install-recommends option.
package_ipk: Add support for NO_RECOMMENDATIONS
opkg: Add support for excluding packages from the install
package_ipk: Add support for PACKAGE_EXCLUDE

 meta/classes/image.bbclass                         | 39 ++++++---
 meta/classes/package_deb.bbclass                   | 34 +++++---
 meta/classes/package_ipk.bbclass                   |  2 +
 meta/classes/package_rpm.bbclass                   |  8 ++
 meta/classes/rootfs_deb.bbclass                    |  8 +-
 meta/conf/bitbake.conf                             |  1 +
 meta/conf/documentation.conf                       |  9 ++
 meta/recipes-devtools/opkg/opkg/add-exclude.patch  | 99 ++++++++++++++++++++++
 .../opkg/opkg/no-install-recommends.patch          | 78 +++++++++++++++++
 meta/recipes-devtools/opkg/opkg_svn.bb             |  5 +-
 .../smart-config-ignore-all-recommends.patch       | 24 ++++++
 .../smart-flag-exclude-packages.patch              | 70 +++++++++++++++
 .../python/python-smartpm_1.4.1.bb                 |  2 +
 13 files changed, 354 insertions(+), 25 deletions(-)
 create mode 100644 meta/recipes-devtools/opkg/opkg/add-exclude.patch
 create mode 100644 meta/recipes-devtools/opkg/opkg/no-install-recommends.patch
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#1 lore raw

PATCH 1/11 image.bbclass: Add basic support for PACKAGE_EXCLUDE

Add the foundation for the PACKAGE_EXCLUDE support.

As part of this work, it was noticed that the PACKAGE_INSTALL and PACKAGE_INSTALL_ATTEMPTONLY were still using he 'normal' version for dependencies. This should no longer be necessary as of the change in the way the complementary package groups (dev, dbg, ptest and others) are defined. By making this change the dependency tree is more correct than before, and gives the ability for manipulating PACKAGE_INSTALL and PACKAGE_INSTALL_ATTEMPTONLY, while adjusting the dependencies at the same time.

Warning messages will be generated if the user is trying to exclude a package that was previously in the PACKAGE_INSTALL or PACKAGE_INSTALL_ATTEMPTONLY variables.

(See additional commits for package manager specific support.)

Add documentation on PACKAGE_EXCLUDE and related variables.

---
 meta/classes/image.bbclass   | 39 +++++++++++++++++++++++++++------------
 meta/conf/documentation.conf |  6 ++++++
 2 files changed, 33 insertions(+), 12 deletions(-)
meta/classes/image.bbclass +27 -12
index 4aae3a7..fb6fcef 100644
@@ -11,8 +11,8 @@ inherit gzipnative
 LICENSE = "MIT"
 PACKAGES = ""
 DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross"
-RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${NORMAL_FEATURE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL}"
-RRECOMMENDS += "${NORMAL_FEATURE_INSTALL_OPTIONAL}"
+RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
+RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
@@ -28,16 +28,6 @@ ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-manageme
 FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 
-# packages to install from features, excluding dev/dbg/doc/ptest
-NORMAL_FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(normal_groups(d), d))}"
-NORMAL_FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(normal_groups(d), d))}"
-
-def normal_groups(d):
-    """Return all the IMAGE_FEATURES, with the exception of our special package groups"""
-    extras = set(d.getVarFlags('COMPLEMENTARY_GLOB').keys())
-    features = set(oe.data.typed_value('IMAGE_FEATURES', d))
-    return features.difference(extras)
-
 # Define some very basic feature package groups
 SPLASH ?= "psplash"
 PACKAGE_GROUP_splash = "${SPLASH}"
@@ -265,6 +255,31 @@ read_only_rootfs_hook () {
 	fi
 }
 
+PACKAGE_EXCLUDE ??= ""
+PACKAGE_EXCLUDE[type] = "list"
+
+python rootfs_process_ignore() {
+    excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split()
+    inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
+    inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY", True).split()
+
+    d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs))
+    d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs))
+
+    for pkg in excl_pkgs:
+        if pkg in inst_pkgs:
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s).  It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
+            inst_pkgs.remove(pkg)
+
+        if pkg in inst_attempt_pkgs:
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s).  It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
+            inst_attempt_pkgs.remove(pkg)
+
+    d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
+    d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs))
+}
+do_rootfs[prefuncs] += "rootfs_process_ignore"
+
 # We have to delay the runtime_mapping_rename until just before rootfs runs
 # otherwise, the multilib renaming could step in and squash any fixups that
 # may have occurred.
meta/conf/documentation.conf +6 -0
index 2c4b8af..b930611 100644
@@ -114,6 +114,12 @@ SYSVINIT_ENABLED_GETTYS[doc] = "Specify which VTs should be running a getty, the
 IPK_FEED_URIS[doc] = "List of ipkg feed records to put into generated image."
 FEED_DEPLOYDIR_BASE_URI[doc] = "Allow to serve ipk deploy dir as an adhoc feed (bogofeed). Set to base URL of the dir as exported by HTTP. Set of adhoc feed configs will be generated in image."
 
+IMAGE_INSTALL[doc] = "Used by an image recipe to list the packages to be installed.  See PACKAGE_INSTALL."
+
+PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation, if required an error will be generated."
+PACKAGE_INSTALL[doc] = "Generally not user defined.  List of the packages to be installed into the image, uses IMAGE_INSTALL as part of the list."
+PACKAGE_INSTALL_ATTEMPTONLY[doc] = "Generally not user defined.  List of packages that will be attempted to be installed, but no error will generate if any of them fail to install."
+
 # palmtop build class
 PALMTOP_USE_MULTITHREADED_QT[doc] = "Set to yes, if you want to build qt apps with CONFIG+=thread"
 
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#2 lore raw

PATCH 2/11 python-smartpm: Add support for excluding package from the install

In reply to Mark Hatle

Update smart to support a mechanism for excluding specific packages from the install process. An error will be generated if this package is required.

---
 .../smart-flag-exclude-packages.patch              | 70 ++++++++++++++++++++++
 .../python/python-smartpm_1.4.1.bb                 |  1 +
 2 files changed, 71 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch
meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch new file +70 -0
new file mode 100644
index 0000000..21a2874
@@ -0,0 +1,70 @@
+Add exclude-packages flag support
+
+Allow configuring specific packages to be excluded.  This will allow
+users to specify things NOT to install, and if they are attempted an
+error will be generated.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+Index: smart-1.4.1/smart/const.py
+===================================================================
+--- smart-1.4.1.orig/smart/const.py
++++ smart-1.4.1/smart/const.py
+@@ -70,6 +70,7 @@ DATADIR     = "/var/lib/smart/"
+ USERDATADIR = "~/.smart/"
+ CONFFILE    = "config"
+ 
++LOCKED_EXCLUDE     = Enum('LOCKED_EXCLUDE')
+ LOCKED_INSTALL     = Enum('LOCKED_INSTALL')
+ LOCKED_REMOVE      = Enum('LOCKED_REMOVE')
+ LOCKED_CONFLICT    = Enum('LOCKED_CONFLICT')
+Index: smart-1.4.1/smart/transaction.py
+===================================================================
+--- smart-1.4.1.orig/smart/transaction.py
++++ smart-1.4.1/smart/transaction.py
+@@ -19,7 +19,7 @@
+ # along with Smart Package Manager; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ #
+-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
++from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_EXCLUDE, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
+ from smart.cache import PreRequires, Package
+ from smart import *
+ 
+@@ -29,7 +29,9 @@ def lock_reason(pkg, lockvalue):
+     except TypeError:
+         reason = None
+         lockvalue = None
+-    if reason == LOCKED_INSTALL:
++    if reason == LOCKED_EXCLUDE:
++        return _("%s is to be excluded") % pkg
++    elif reason == LOCKED_INSTALL:
+         return _("%s is to be installed") % pkg
+     elif reason == LOCKED_CONFLICT:
+         return _("%s conflicts with %s") % (pkg, otherpkg)
+@@ -210,6 +212,10 @@ class Policy(object):
+                 self._sysconflocked.append(pkg)
+                 self._locked[pkg] = (LOCKED_SYSCONF, None)
+ 
++        for pkg in pkgconf.filterByFlag("exclude-packages", cache.getPackages()):
++            if pkg not in self._locked:
++                self._locked[pkg] = (LOCKED_EXCLUDE, None)
++
+     def runFinished(self):
+         self._priorities.clear()
+         for pkg in self._sysconflocked:
+Index: smart-1.4.1/smart/commands/flag.py
+===================================================================
+--- smart-1.4.1.orig/smart/commands/flag.py
++++ smart-1.4.1/smart/commands/flag.py
+@@ -47,6 +47,8 @@ Currently known flags are:
+   multi-version - Flagged packages may have more than one version
+                   installed in the system at the same time
+                   (backend dependent).
++  exclude-packages - Flagged packages will be excluded, if they are
++                  required, an error will be generated.
+   ignore-recommends - Flagged packages will not be installed, if
+                   they are only recommended by a package to be
+                   installed rather than required.
meta/recipes-devtools/python/python-smartpm_1.4.1.bb +1 -0
index 70ac8bf..b3b471a 100644
@@ -28,6 +28,7 @@ SRC_URI = "\
           file://smart-channelsdir.patch \
           file://smart-conflict-provider.patch \
           file://smart-flag-ignore-recommends.patch \
+          file://smart-flag-exclude-packages.patch \
           "
 
 SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#3 lore raw

PATCH 3/11 package_rpm.bbclass: Add support for PACKAGE_EXCLUDE to RPM installs

In reply to Mark Hatle

Using the new smart exclude mechanism an error will be generated in the excluded package is required for the image to be generated.

---
 meta/classes/package_rpm.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes/package_rpm.bbclass +5 -0
index 324d83f..74ae0ed 100644
@@ -356,6 +356,11 @@ EOF
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._var=${localstatedir}
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp
 		package_write_smart_config ${target_rootfs}
+		# Do the following configurations here, to avoid them being saved for field upgrade
+		for i in ${PACKAGE_EXCLUDE}; do
+			smart --data-dir=$1/var/lib/smart flag --set exclude-packages $i
+		done
+
 		# Optional debugging
 		#smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-level=debug
 		#smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-file=/tmp/smart-debug-logfile
Signature · 1 line
1.8.1.2.545.g2f19ada
#4 lore raw

Re: [PATCH 03/11] package_rpm.bbclass: Add support for PACKAGE_EXCLUDE to RPM installs

Quoted 20 lines · On Wednesday 14 August 2013 15:30:01 Mark Hatle wrote:

Using the new smart exclude mechanism an error will be generated in the excluded package is required for the image to be generated.

---
 meta/classes/package_rpm.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
(quoted diff) +0 -0

b/meta/classes/package_rpm.bbclass index 324d83f..74ae0ed 100644

meta/classes/package_rpm.bbclass +0 -0
@@ -356,6 +356,11 @@ EOF
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set

rpm-extra-macros._var=${localstatedir} smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp package_write_smart_config ${target_rootfs}

meta/classes/package_rpm.bbclass +1 -0
+		# Do the following configurations here, to avoid them being saved for

field upgrade

meta/classes/package_rpm.bbclass EOF · line 362

Quoted 3 lines
meta/classes/package_rpm.bbclass +3 -0
+		for i in ${PACKAGE_EXCLUDE}; do
+			smart --data-dir=$1/var/lib/smart flag --set exclude-packages $i
+		done

IMO, it would be correct to persist these exclusions into the runtime configuration. Not doing so is inconsistent with the behaviour of BAD_RECOMMENDATIONS, and it means that if you do an upgrade or an install on the target, these excluded packages can sneak back in which I would think would not be desirable unless the user explicitly turns off the exclusion. Clearing the flag if it were persisted is easy to do with smart.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
author
#5 lore raw

Re: [PATCH 03/11] package_rpm.bbclass: Add support for PACKAGE_EXCLUDE to RPM installs

Quoted 23 lines · Paul Eggleton
Quoted 22 lines · On Wednesday 14 August 2013 15:30:01 Mark Hatle wrote:

Using the new smart exclude mechanism an error will be generated in the excluded package is required for the image to be generated.

---
  meta/classes/package_rpm.bbclass | 5 +++++
  1 file changed, 5 insertions(+)
(quoted diff) +0 -0

b/meta/classes/package_rpm.bbclass index 324d83f..74ae0ed 100644

meta/classes/package_rpm.bbclass +0 -0
@@ -356,6 +356,11 @@ EOF
  		smart --data-dir=${target_rootfs}/var/lib/smart config --set

rpm-extra-macros._var=${localstatedir} smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp package_write_smart_config ${target_rootfs}

meta/classes/package_rpm.bbclass +1 -0
+		# Do the following configurations here, to avoid them being saved for

field upgrade

meta/classes/package_rpm.bbclass +2 -0
+		for i in ${PACKAGE_EXCLUDE}; do
+			smart --data-dir=$1/var/lib/smart flag --set exclude-packages $i
Quoted 8 lines

meta/classes/package_rpm.bbclass EOF · line 362

Quoted 1 line
meta/classes/package_rpm.bbclass +1 -0
+		done

IMO, it would be correct to persist these exclusions into the runtime configuration. Not doing so is inconsistent with the behaviour of BAD_RECOMMENDATIONS, and it means that if you do an upgrade or an install on the target, these excluded packages can sneak back in which I would think would not be desirable unless the user explicitly turns off the exclusion. Clearing the flag if it were persisted is easy to do with smart.

(I spoke w/ Paul on IRC about this briefly yesterday.. so this is more a recap for the mailing list.)

The deb and ipk implementation of the exclude packages makes them transient. If we want consistent behavior, we'll likely need to change the deb/apt-get pin file to make them persistent... and for ipk, I'm not exactly sure how to do this. We're not saving the list of excluded files anywhere.

If a difference in behavior between the packaging systems is acceptable, then moving the rpm(smart) exclude code should be fairly easy to make persistent.

HOWEVER, I'm not sure we really want it to be persistent. Just because the initial image generation may have skipped specific files, doesn't necessarily mean they should be skipped on the target (field/user upgrade scenario). If we do persist them, we need to somehow make it clear to the end user how to clear the setting(s) as well, and that isn't always very obvious.

Both positions may be negated by the fact these are embedded systems, and in many cases simply don't end up with a package database on the target. So it doesn't really matter in those cases. It's more the specialized case where field upgrade / additional field software install could happen.

Does anyone else have opinions on this? I can certainly see reasons for both, but I'm not sure if one is more appropriate then the other at this point.

--Mark

Quoted 3 lines

Cheers,
Paul

author
#6 lore raw

PATCH 4/11 python-smartpm: Add support to disable installing recommends

In reply to Mark Hatle

In order to attempt to reduce image sizes by skipping recommended packages, a new mode was added to smart that only evaluates required packaged.

---
 .../smart-config-ignore-all-recommends.patch       | 24 ++++++++++++++++++++++
 .../python/python-smartpm_1.4.1.bb                 |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch
meta/recipes-devtools/python/python-smartpm/smart-config-ignore-all-recommends.patch new file +24 -0
new file mode 100644
index 0000000..a1dec2d
@@ -0,0 +1,24 @@
+Add a simple method to disable the install of recommended packages
+
+Upstream-status: Pending
+
+Usage:
+   smart config --set ignore-all-recommends=1
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+Index: smart-1.4.1/smart/transaction.py
+===================================================================
+--- smart-1.4.1.orig/smart/transaction.py
++++ smart-1.4.1/smart/transaction.py
+@@ -611,7 +611,9 @@ class Transaction(object):
+             for prv in req.providedby:
+                 for prvpkg in prv.packages:
+                     if not reqrequired:
+-                        if pkgconf.testFlag("ignore-recommends", prvpkg):
++                        if sysconf.get("ignore-all-recommends", 0) == 1:
++                            continue
++                        elif pkgconf.testFlag("ignore-recommends", prvpkg):
+                             continue
+                     if isinst(prvpkg):
+                         found = True
meta/recipes-devtools/python/python-smartpm_1.4.1.bb +1 -0
index b3b471a..5d673b9 100644
@@ -29,6 +29,7 @@ SRC_URI = "\
           file://smart-conflict-provider.patch \
           file://smart-flag-ignore-recommends.patch \
           file://smart-flag-exclude-packages.patch \
+          file://smart-config-ignore-all-recommends.patch \
           "
 
 SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#7 lore raw

PATCH 5/11 package_rpm.bbclass: NO_RECOMMENDATIONS support

In reply to Mark Hatle

Add NO_RECOMMENDATIONS support. A way to disable all recommended packages from being installed. This will help shrink the size of the resulting filesystem.

Add documentation on NO_RECOMMENDATIONS and BAD_RECOMMENDATIONS.

Note, using NO_RECOMMENDATIONS has side effects such that kernel-modules may not have been installed. A user will need to manually add to their image any kernel-modules required to be on the image for functionality.

---
 meta/classes/package_rpm.bbclass | 3 +++
 meta/conf/bitbake.conf           | 1 +
 meta/conf/documentation.conf     | 3 +++
 3 files changed, 7 insertions(+)
meta/classes/package_rpm.bbclass +3 -0
index 74ae0ed..ee01aab 100644
@@ -357,6 +357,9 @@ EOF
 		smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp
 		package_write_smart_config ${target_rootfs}
 		# Do the following configurations here, to avoid them being saved for field upgrade
+		if [ "x${NO_RECOMMENDATIONS}" = "x1" ]; then
+			smart --data-dir=$1/var/lib/smart config --set ignore-all-recommends=1
+		fi
 		for i in ${PACKAGE_EXCLUDE}; do
 			smart --data-dir=$1/var/lib/smart flag --set exclude-packages $i
 		done
meta/conf/bitbake.conf +1 -0
index 07eb473..43acc07 100644
@@ -753,6 +753,7 @@ COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
 SERIAL_CONSOLE ??= ""
 SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}"
 
+NO_RECOMMENDATIONS ?= ""
 BAD_RECOMMENDATIONS ?= ""
 
 # Make sure MACHINE isn't exported
meta/conf/documentation.conf +3 -0
index b930611..e83981c 100644
@@ -114,6 +114,9 @@ SYSVINIT_ENABLED_GETTYS[doc] = "Specify which VTs should be running a getty, the
 IPK_FEED_URIS[doc] = "List of ipkg feed records to put into generated image."
 FEED_DEPLOYDIR_BASE_URI[doc] = "Allow to serve ipk deploy dir as an adhoc feed (bogofeed). Set to base URL of the dir as exported by HTTP. Set of adhoc feed configs will be generated in image."
 
+BAD_RECOMMENDATIONS[doc] = "List of packages to not install if recommended.  These will still be installed if required."
+NO_RECOMMENDATIONS[doc] = "When set to 1, no recommended packages will be installed.  Note: some recommended packages may be required for certain system functionality, such as kernel-modules.  It is up to the user to add packages to IMAGE_INSTALL as needed."
+
 IMAGE_INSTALL[doc] = "Used by an image recipe to list the packages to be installed.  See PACKAGE_INSTALL."
 
 PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation, if required an error will be generated."
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#8 lore raw

PATCH 6/11 package_deb.bbclass: Use the WORKDIR not SYSROOT for temp files

In reply to Mark Hatle

Previous debian APT configuration was using the sysroot directory. This not only polluted the sysroot, but violates the expectation that the sysroot is not modified by the rootfs installation.

---
 meta/classes/package_deb.bbclass | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
meta/classes/package_deb.bbclass +10 -7
index 663f646..4980555 100644
@@ -10,6 +10,8 @@ DPKG_ARCH ?= "${TARGET_ARCH}"
 
 PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
 
+APTCONF_TARGET = "${WORKDIR}"
+
 #
 # Update the Packages index files in ${DEPLOY_DIR_DEB}
 #
@@ -63,8 +65,9 @@ package_install_internal_deb () {
 	local package_linguas="${INSTALL_PACKAGES_LINGUAS_DEB}"
 	local task="${INSTALL_TASK_DEB}"
 
-	rm -f ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
-	rm -f ${STAGING_ETCDIR_NATIVE}/apt/preferences
+	mkdir -p ${APTCONF_TARGET}/apt
+	rm -f ${APTCONF_TARGET}/apt/sources.list.rev
+	rm -f ${APTCONF_TARGET}/apt/preferences
 
 	priority=1
 	for arch in $archs; do
@@ -72,15 +75,15 @@ package_install_internal_deb () {
 			continue;
 		fi
 
-		echo "deb file:${DEPLOY_DIR_DEB}/$arch/ ./" >> ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev
+		echo "deb file:${DEPLOY_DIR_DEB}/$arch/ ./" >> ${APTCONF_TARGET}/apt/sources.list.rev
 		(echo "Package: *"
 		echo "Pin: release l=$arch"
 		echo "Pin-Priority: $(expr 800 + $priority)"
-		echo) >> ${STAGING_ETCDIR_NATIVE}/apt/preferences
+		echo) >> ${APTCONF_TARGET}/apt/preferences
 		priority=$(expr $priority + 5)
 	done
 
-	tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_ETCDIR_NATIVE}/apt/sources.list
+	tac ${APTCONF_TARGET}/apt/sources.list.rev > ${APTCONF_TARGET}/apt/sources.list
 
 	# The params in deb package control don't allow character `_', so
 	# change the arch's `_' to `-' in it.
@@ -88,9 +91,9 @@ package_install_internal_deb () {
 	cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \
 		| sed -e "s#Architecture \".*\";#Architecture \"${dpkg_arch}\";#" \
 		| sed -e "s:#ROOTFS#:${target_rootfs}:g" \
-		> "${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf"
+		> "${APTCONF_TARGET}/apt/apt.conf"
 
-	export APT_CONFIG="${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf"
+	export APT_CONFIG="${APTCONF_TARGET}/apt/apt.conf"
 
 	mkdir -p ${target_rootfs}/var/lib/dpkg/info
 	mkdir -p ${target_rootfs}/var/lib/dpkg/updates
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#9 lore raw

PATCH 7/11 package_deb: Add support for NO_RECOMMENDATIONS and PACKAGE_EXCLUDE

In reply to Mark Hatle

Add support for NO_RECOMMENDATIONS and PACKAGE_EXCLUDE. Also add a warning that ensures users know that BAD_RECOMMENDATIONS support is not implemented in the debian package/rootfs classes.

---
 meta/classes/package_deb.bbclass | 17 +++++++++++++----
 meta/classes/rootfs_deb.bbclass  |  8 +++++++-
 2 files changed, 20 insertions(+), 5 deletions(-)
meta/classes/package_deb.bbclass +13 -4
index 4980555..068c11a 100644
@@ -12,6 +12,8 @@ PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
 
 APTCONF_TARGET = "${WORKDIR}"
 
+APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+
 #
 # Update the Packages index files in ${DEPLOY_DIR_DEB}
 #
@@ -83,6 +85,13 @@ package_install_internal_deb () {
 		priority=$(expr $priority + 5)
 	done
 
+	for pkg in ${PACKAGE_EXCLUDE}; do
+		(echo "Package: $pkg"
+		echo "Pin: release *"
+		echo "Pin-Priority: -1"
+		echo) >> ${APTCONF_TARGET}/apt/preferences
+	done
+
 	tac ${APTCONF_TARGET}/apt/sources.list.rev > ${APTCONF_TARGET}/apt/sources.list
 
 	# The params in deb package control don't allow character `_', so
@@ -105,7 +114,7 @@ package_install_internal_deb () {
 
 	if [ ! -z "${package_linguas}" ]; then
 		for i in ${package_linguas}; do
-			apt-get install $i --force-yes --allow-unauthenticated
+			apt-get ${APT_ARGS} install $i --force-yes --allow-unauthenticated
 			if [ $? -ne 0 ]; then
 				exit 1
 			fi
@@ -114,13 +123,13 @@ package_install_internal_deb () {
 
 	# normal install
 	if [ ! -z "${package_to_install}" ]; then
-		apt-get install ${package_to_install} --force-yes --allow-unauthenticated
+		apt-get ${APT_ARGS} install ${package_to_install} --force-yes --allow-unauthenticated
 		if [ $? -ne 0 ]; then
 			exit 1
 		fi
 
 		# Attempt to correct the probable broken dependencies in place.
-		apt-get -f install
+		apt-get ${APT_ARGS} -f install
 		if [ $? -ne 0 ]; then
 			exit 1
 		fi
@@ -129,7 +138,7 @@ package_install_internal_deb () {
 	rm -f `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID}
 	if [ ! -z "${package_attemptonly}" ]; then
 		for i in ${package_attemptonly}; do
-			apt-get install $i --force-yes --allow-unauthenticated >> `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} 2>&1 || true
+			apt-get ${APT_ARGS} install $i --force-yes --allow-unauthenticated >> `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID} 2>&1 || true
 		done
 	fi
 
meta/classes/rootfs_deb.bbclass +7 -1
index edd1037..dcfe786 100644
@@ -11,6 +11,12 @@ rootfs_deb_do_rootfs[vardepsexclude] += "BUILDNAME"
 
 do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
 
+python rootfs_deb_bad_recommendations() {
+    if d.getVar("BAD_RECOMMENDATIONS", True):
+	bb.warn("Debian package install does not support BAD_RECOMMENDATIONS")
+}
+do_rootfs[prefuncs] += "rootfs_deb_bad_recommendations"
+
 DEB_POSTPROCESS_COMMANDS = ""
 
 opkglibdir = "${localstatedir}/lib/opkg"
@@ -113,7 +119,7 @@ remove_packaging_data_files() {
 }
 
 rootfs_install_packages() {
-	${STAGING_BINDIR_NATIVE}/apt-get install `cat $1` --force-yes --allow-unauthenticated
+	${STAGING_BINDIR_NATIVE}/apt-get ${APT_ARGS} install `cat $1` --force-yes --allow-unauthenticated
 
 	# Mark all packages installed
 	sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" $INSTALL_ROOTFS_DEB/var/lib/dpkg/status
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#10 lore raw

PATCH 8/11 opkg: Add --no-install-recommends option.

In reply to Mark Hatle

The new --no-install-recommends option is similar to the behavior of apt-get's --no-install-recommedns. Only required packages will be installed.

---
 .../opkg/opkg/no-install-recommends.patch          | 78 ++++++++++++++++++++++
 meta/recipes-devtools/opkg/opkg_svn.bb             |  4 +-
 2 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/opkg/opkg/no-install-recommends.patch
meta/recipes-devtools/opkg/opkg/no-install-recommends.patch new file +78 -0
new file mode 100644
index 0000000..f71b027
@@ -0,0 +1,78 @@
+Add the ability to not install ANY recommended packages.
+
+Upstream-status: Pending
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+Index: trunk/libopkg/opkg_conf.h
+===================================================================
+--- trunk.orig/libopkg/opkg_conf.h
++++ trunk/libopkg/opkg_conf.h
+@@ -80,6 +80,7 @@ struct opkg_conf
+      int prefer_arch_to_version;
+      int check_signature;
+      int nodeps; /* do not follow dependencies */
++     int noinstall_recommends;
+      char *offline_root;
+      char *overlay_root;
+      int query_all;
+Index: trunk/libopkg/pkg_depends.c
+===================================================================
+--- trunk.orig/libopkg/pkg_depends.c
++++ trunk/libopkg/pkg_depends.c
+@@ -19,6 +19,7 @@
+ #include <ctype.h>
+ 
+ #include "pkg.h"
++#include "opkg_conf.h"
+ #include "opkg_utils.h"
+ #include "pkg_hash.h"
+ #include "opkg_message.h"
+@@ -204,7 +205,7 @@ pkg_hash_fetch_unsatisfied_dependencies(
+ 		    /* user request overrides package recommendation */
+ 		    if (satisfying_pkg != NULL
+ 			&& (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST)
+-			&& (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) {
++			&& (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE || conf->noinstall_recommends)) {
+ 			 opkg_msg(NOTICE, "%s: ignoring recommendation for "
+ 					"%s at user request\n",
+ 					pkg->name, satisfying_pkg->name);
+Index: trunk/src/opkg-cl.c
+===================================================================
+--- trunk.orig/src/opkg-cl.c
++++ trunk/src/opkg-cl.c
+@@ -50,6 +50,7 @@ enum {
+ 	ARGS_OPT_NODEPS,
+ 	ARGS_OPT_AUTOREMOVE,
+ 	ARGS_OPT_CACHE,
++	ARGS_OPT_NOINSTALL_RECOMMENDS,
+ };
+ 
+ static struct option long_options[] = {
+@@ -89,6 +90,7 @@ static struct option long_options[] = {
+ 	{"noaction", 0, 0, ARGS_OPT_NOACTION},
+ 	{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
+ 	{"nodeps", 0, 0, ARGS_OPT_NODEPS},
++	{"no-install-recommends", 0, 0, ARGS_OPT_NOINSTALL_RECOMMENDS},
+ 	{"offline", 1, 0, 'o'},
+ 	{"offline-root", 1, 0, 'o'},
+ 	{"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
+@@ -199,6 +201,9 @@ args_parse(int argc, char *argv[])
+ 		case ARGS_OPT_NOACTION:
+ 			conf->noaction = 1;
+ 			break;
++		case ARGS_OPT_NOINSTALL_RECOMMENDS:
++			conf->noinstall_recommends = 1;
++			break;
+         case ARGS_OPT_DOWNLOAD_ONLY:
+ 			conf->download_only = 1;
+ 			break;
+@@ -293,6 +298,8 @@ usage()
+ 	printf("\t--noaction		No action -- test only\n");
+ 	printf("\t--download-only	No action -- download only\n");
+ 	printf("\t--nodeps		Do not follow dependencies\n");
++	printf("\t--no-install-recommends\n");
++	printf("\t                      Do not install any recommended packages\n");
+ 	printf("\t--force-removal-of-dependent-packages\n");
+ 	printf("\t			Remove package and all dependencies\n");
+ 	printf("\t--autoremove		Remove packages that were installed\n");
meta/recipes-devtools/opkg/opkg_svn.bb +3 -1
index 032578d..dbfca0f 100644
@@ -1,6 +1,8 @@
 require opkg.inc
 
-SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http"
+SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
+           file://no-install-recommends.patch \
+"
 
 S = "${WORKDIR}/trunk"
 
Signature · 1 line
1.8.1.2.545.g2f19ada
#11 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 17 lines · Mark Hatle

The new --no-install-recommends option is similar to the behavior of apt-get's --no-install-recommedns. Only required packages will be installed.

---
  .../opkg/opkg/no-install-recommends.patch          | 78 ++++++++++++++++++++++
  meta/recipes-devtools/opkg/opkg_svn.bb             |  4 +-
  2 files changed, 81 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-devtools/opkg/opkg/no-install-recommends.patch

meta/recipes-devtools/opkg/opkg/no-install-recommends.patch new file +0 -0
new file mode 100644
index 0000000..f71b027

meta/recipes-devtools/opkg/opkg/no-install-recommends.patch line 3

Quoted 3 lines
meta/recipes-devtools/opkg/opkg/no-install-recommends.patch new file +3 -0
@@ -0,0 +1,78 @@
+Add the ability to not install ANY recommended packages.
+
+Upstream-status: Pending

Upstream-Status: here, in add-exclude.patch and smart-config-ignore-all-recommends.patch

Thanks
Sau!

Quoted 90 lines
meta/recipes-devtools/opkg/opkg/no-install-recommends.patch new file +75 -0
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+Index: trunk/libopkg/opkg_conf.h
+===================================================================
+--- trunk.orig/libopkg/opkg_conf.h
++++ trunk/libopkg/opkg_conf.h
+@@ -80,6 +80,7 @@ struct opkg_conf
+      int prefer_arch_to_version;
+      int check_signature;
+      int nodeps; /* do not follow dependencies */
++     int noinstall_recommends;
+      char *offline_root;
+      char *overlay_root;
+      int query_all;
+Index: trunk/libopkg/pkg_depends.c
+===================================================================
+--- trunk.orig/libopkg/pkg_depends.c
++++ trunk/libopkg/pkg_depends.c
+@@ -19,6 +19,7 @@
+ #include <ctype.h>
+
+ #include "pkg.h"
++#include "opkg_conf.h"
+ #include "opkg_utils.h"
+ #include "pkg_hash.h"
+ #include "opkg_message.h"
+@@ -204,7 +205,7 @@ pkg_hash_fetch_unsatisfied_dependencies(
+ 		    /* user request overrides package recommendation */
+ 		    if (satisfying_pkg != NULL
+ 			&& (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST)
+-			&& (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) {
++			&& (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE || conf->noinstall_recommends)) {
+ 			 opkg_msg(NOTICE, "%s: ignoring recommendation for "
+ 					"%s at user request\n",
+ 					pkg->name, satisfying_pkg->name);
+Index: trunk/src/opkg-cl.c
+===================================================================
+--- trunk.orig/src/opkg-cl.c
++++ trunk/src/opkg-cl.c
+@@ -50,6 +50,7 @@ enum {
+ 	ARGS_OPT_NODEPS,
+ 	ARGS_OPT_AUTOREMOVE,
+ 	ARGS_OPT_CACHE,
++	ARGS_OPT_NOINSTALL_RECOMMENDS,
+ };
+
+ static struct option long_options[] = {
+@@ -89,6 +90,7 @@ static struct option long_options[] = {
+ 	{"noaction", 0, 0, ARGS_OPT_NOACTION},
+ 	{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
+ 	{"nodeps", 0, 0, ARGS_OPT_NODEPS},
++	{"no-install-recommends", 0, 0, ARGS_OPT_NOINSTALL_RECOMMENDS},
+ 	{"offline", 1, 0, 'o'},
+ 	{"offline-root", 1, 0, 'o'},
+ 	{"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
+@@ -199,6 +201,9 @@ args_parse(int argc, char *argv[])
+ 		case ARGS_OPT_NOACTION:
+ 			conf->noaction = 1;
+ 			break;
++		case ARGS_OPT_NOINSTALL_RECOMMENDS:
++			conf->noinstall_recommends = 1;
++			break;
+         case ARGS_OPT_DOWNLOAD_ONLY:
+ 			conf->download_only = 1;
+ 			break;
+@@ -293,6 +298,8 @@ usage()
+ 	printf("\t--noaction		No action -- test only\n");
+ 	printf("\t--download-only	No action -- download only\n");
+ 	printf("\t--nodeps		Do not follow dependencies\n");
++	printf("\t--no-install-recommends\n");
++	printf("\t                      Do not install any recommended packages\n");
+ 	printf("\t--force-removal-of-dependent-packages\n");
+ 	printf("\t			Remove package and all dependencies\n");
+ 	printf("\t--autoremove		Remove packages that were installed\n");
meta/recipes-devtools/opkg/opkg_svn.bb +3 -1
index 032578d..dbfca0f 100644
@@ -1,6 +1,8 @@
  require opkg.inc
 
-SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http"
+SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
+           file://no-install-recommends.patch \
+"
 
  S = "${WORKDIR}/trunk"
 
author
#12 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 12 lines · Saul Wold
Quoted 11 lines · Mark Hatle

The new --no-install-recommends option is similar to the behavior of apt-get's --no-install-recommedns. Only required packages will be installed.

---
   .../opkg/opkg/no-install-recommends.patch          | 78 ++++++++++++++++++++++
   meta/recipes-devtools/opkg/opkg_svn.bb             |  4 +-
   2 files changed, 81 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-devtools/opkg/opkg/no-install-recommends.patch

Quoted 12 lines

meta/recipes-devtools/opkg/opkg/no-install-recommends.patch line 3

Quoted 9 lines
meta/recipes-devtools/opkg/opkg/no-install-recommends.patch new file +3 -0
new file mode 100644
index 0000000..f71b027
@@ -0,0 +1,78 @@
+Add the ability to not install ANY recommended packages.
+
+Upstream-status: Pending

Upstream-Status: here, in add-exclude.patch and
smart-config-ignore-all-recommends.patch

I've updated these three and pushed to poky-contrib mhatle/oe-core-remove (note, there are a few patches there that are NOT part of this set. So be sure to take only the top 11.)

--Mark

Quoted 93 lines

Thanks
Sau!

Quoted 90 lines
meta/recipes-devtools/opkg/opkg/no-install-recommends.patch new file +75 -0
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+Index: trunk/libopkg/opkg_conf.h
+===================================================================
+--- trunk.orig/libopkg/opkg_conf.h
++++ trunk/libopkg/opkg_conf.h
+@@ -80,6 +80,7 @@ struct opkg_conf
+      int prefer_arch_to_version;
+      int check_signature;
+      int nodeps; /* do not follow dependencies */
++     int noinstall_recommends;
+      char *offline_root;
+      char *overlay_root;
+      int query_all;
+Index: trunk/libopkg/pkg_depends.c
+===================================================================
+--- trunk.orig/libopkg/pkg_depends.c
++++ trunk/libopkg/pkg_depends.c
+@@ -19,6 +19,7 @@
+ #include <ctype.h>
+
+ #include "pkg.h"
++#include "opkg_conf.h"
+ #include "opkg_utils.h"
+ #include "pkg_hash.h"
+ #include "opkg_message.h"
+@@ -204,7 +205,7 @@ pkg_hash_fetch_unsatisfied_dependencies(
+ 		    /* user request overrides package recommendation */
+ 		    if (satisfying_pkg != NULL
+ 			&& (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST)
+-			&& (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) {
++			&& (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE || conf->noinstall_recommends)) {
+ 			 opkg_msg(NOTICE, "%s: ignoring recommendation for "
+ 					"%s at user request\n",
+ 					pkg->name, satisfying_pkg->name);
+Index: trunk/src/opkg-cl.c
+===================================================================
+--- trunk.orig/src/opkg-cl.c
++++ trunk/src/opkg-cl.c
+@@ -50,6 +50,7 @@ enum {
+ 	ARGS_OPT_NODEPS,
+ 	ARGS_OPT_AUTOREMOVE,
+ 	ARGS_OPT_CACHE,
++	ARGS_OPT_NOINSTALL_RECOMMENDS,
+ };
+
+ static struct option long_options[] = {
+@@ -89,6 +90,7 @@ static struct option long_options[] = {
+ 	{"noaction", 0, 0, ARGS_OPT_NOACTION},
+ 	{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
+ 	{"nodeps", 0, 0, ARGS_OPT_NODEPS},
++	{"no-install-recommends", 0, 0, ARGS_OPT_NOINSTALL_RECOMMENDS},
+ 	{"offline", 1, 0, 'o'},
+ 	{"offline-root", 1, 0, 'o'},
+ 	{"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
+@@ -199,6 +201,9 @@ args_parse(int argc, char *argv[])
+ 		case ARGS_OPT_NOACTION:
+ 			conf->noaction = 1;
+ 			break;
++		case ARGS_OPT_NOINSTALL_RECOMMENDS:
++			conf->noinstall_recommends = 1;
++			break;
+         case ARGS_OPT_DOWNLOAD_ONLY:
+ 			conf->download_only = 1;
+ 			break;
+@@ -293,6 +298,8 @@ usage()
+ 	printf("\t--noaction		No action -- test only\n");
+ 	printf("\t--download-only	No action -- download only\n");
+ 	printf("\t--nodeps		Do not follow dependencies\n");
++	printf("\t--no-install-recommends\n");
++	printf("\t                      Do not install any recommended packages\n");
+ 	printf("\t--force-removal-of-dependent-packages\n");
+ 	printf("\t			Remove package and all dependencies\n");
+ 	printf("\t--autoremove		Remove packages that were installed\n");
meta/recipes-devtools/opkg/opkg_svn.bb +3 -1
index 032578d..dbfca0f 100644
@@ -1,6 +1,8 @@
   require opkg.inc
 
-SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http"
+SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
+           file://no-install-recommends.patch \
+"
 
   S = "${WORKDIR}/trunk"
 
#13 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 5 lines · Mark Hatle
Quoted 4 lines · Saul Wold
Quoted 1 line · Mark Hatle

+Upstream-status: Pending

I'm the new maintainer for opkg, I'd be happy to look at this patch and any others if you could send them to [email protected] via git send-email. I like the idea of both '--no-install-recommends' and '--add-exclude'.

I stumbled on these as I'm looking at upgrading the opkg recipe to use the newly released opkg-0.2.0 rather than pulling from subversion.

Cheers,

Signature · 4 lines
Paul Barker

Email: [email protected]
http://www.paulbarker.me.uk
#14 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 8 lines · Paul Barker
Quoted 5 lines · Mark Hatle
Quoted 4 lines · Saul Wold
Quoted 1 line · Mark Hatle

+Upstream-status: Pending

I'm the new maintainer for opkg,

Congratulations! :)

Quoted 7 lines

I'd be happy to look at this patch
and any others if you could send them to [email protected] via git send-email. I like the idea of both '--no-install-recommends' and '--add-exclude'.

I stumbled on these as I'm looking at upgrading the opkg recipe to use the newly released opkg-0.2.0 rather than pulling from subversion.

Sounds great!

Nice to see releases and someone looking after opkg a bit more.

Cheers,

Richard

#15 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 4 lines · Richard Purdie
Quoted 3 lines · Paul Barker
Quoted 2 lines · Mark Hatle
Quoted 1 line · Saul Wold
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines · Mark Hatle
Quoted 1 line

+Upstream-status: Pending

I'm the new maintainer for opkg,

Congratulations! :)

My time for this is fairly limited, but felt it was important that someone maintain it as it's a critical dependency for a lot of us.

As I understand things the Yocto Project is currently in a stabilisation cycle. So my plan was to wait until 1.5 is released and then look at moving oe-core to opkg-0.2.0, adding PACKAGECONFIG options (I've got a signed package feed I'd like my target to be able to verify, this needs opkg to be built with --enable-gpg) and whatever else needs doing. For now the experimental recipes are available from
https://bitbucket.org/opkg/meta-opkg.

As a side question - is there a specific maintainer for opkg-utils? I'd like to discuss whether two separate repositories is a good idea or whether we'd benefit from merging this into the opkg repo.

Signature · 4 lines
Paul Barker

Email: [email protected]
http://www.paulbarker.me.uk
#16 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 2 lines · Paul Barker

My time for this is fairly limited, but felt it was important that someone maintain it as it's a critical dependency for a lot of us.

We all suffer from time problems so I appreciate someone stepping up there, it was certainly a gap.

Quoted 7 lines

As I understand things the Yocto Project is currently in a stabilisation cycle. So my plan was to wait until 1.5 is released and then look at moving oe-core to opkg-0.2.0, adding PACKAGECONFIG options (I've got a signed package feed I'd like my target to be able to verify, this needs opkg to be built with --enable-gpg) and whatever else needs doing. For now the experimental recipes are available from
https://bitbucket.org/opkg/meta-opkg.

PACKAGECONFIG sounds great but is 1.6 material, yes.

Quoted 3 lines

As a side question - is there a specific maintainer for opkg-utils? I'd like to discuss whether two separate repositories is a good idea or whether we'd benefit from merging this into the opkg repo.

I can probably speak for it. It was created out of necessity, we had the situation where patches were piling up against ipkg-utils and since that was dead, we created a new repository we could merge changes into rather than having piles of patches.

There are some pretty horrific things in there and it probably needs a good clean out, we only use a small part of it. If we have an actively maintained place for the in opkg, I'd be ok with that. Equally having them separate does better force sane API decisions (flag days where both need to change at the same time would be bad for example). If you wanted commit access to opkg-utils that could probably be arranged if that helps?

Cheers,

Richard

#17 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 10 lines · Richard Purdie
Quoted 3 lines · Paul Barker

As a side question - is there a specific maintainer for opkg-utils? I'd like to discuss whether two separate repositories is a good idea or whether we'd benefit from merging this into the opkg repo.

I can probably speak for it. It was created out of necessity, we had the situation where patches were piling up against ipkg-utils and since that was dead, we created a new repository we could merge changes into rather than having piles of patches.

Quoted 8 lines

There are some pretty horrific things in there and it probably needs a good clean out, we only use a small part of it. If we have an actively maintained place for the in opkg, I'd be ok with that. Equally having them separate does better force sane API decisions (flag days where both need to change at the same time would be bad for example). If you wanted commit access to opkg-utils that could probably be arranged if that helps?

I'd rather have opkg and opkg-utils merged together or next to each other on the same server if/when I move opkg to git. I think OpenEmbedded/Yocto is probably the main user of opkg but there are others and they'd also benefit from opkg-utils, so having everything in one place would make them easier to find.

My personal preference would be to move opkg and opkg-utils to Bitbucket/Github/similar, probably merged together, with at least one of the core developers from the Yocto Project having admin access to the repositories so that the bus factor is greater than 1. I know I could probably ask for opkg to be hosted on git.yoctoproject.org but I think that would make non-Yocto Project users feel a little bit too much like second-class citizens.

I want to avoid flag days where possible, at least one will be needed for the libopkg API but hopefully not for the command line interface or package format. I am planning on proposing that opkg explicitly follow semantic versioning (http://semver.org/) and I think a stable, sane API is important regardless of whether opkg-utils is separate or not.

Signature · 4 lines
Paul Barker

Email: [email protected]
http://www.paulbarker.me.uk
#18 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 2 lines · Paul Barker

I am planning on proposing that opkg explicitly
follow semantic versioning (http://semver.org/)

I'm not entirely sure I understand what you're saying here. Can you expand on what the practical effect of "following semantic versioning" would be?

thanks

p.

#19 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 8 lines · Phil Blundell
Quoted 2 lines · Paul Barker

I am planning on proposing that opkg explicitly
follow semantic versioning (http://semver.org/)

I'm not entirely sure I understand what you're saying here. Can you expand on what the practical effect of "following semantic versioning" would be?

I was responding to Richard's comment about flag days. Basically, they should be very rare and will be announced very loudly if they must occur. They will result in the major component of the version being bumped (where the version is of the form "major.minor.patch"). So if something works with v1.0 of a program, you can be guaranteed that any v1.x release won't introduce backwards-incompatible changes and break your script/library/whatever.

Even if opkg-utils is brought into opkg itself, it's a promise that library functions, command line arguments, config options and control fields won't disappear or change meaning arbitrarily. "Semantic Versioning" is just a set of rules that clarify this so that I don't have to write my own version numbering policy.

Signature · 4 lines
Paul Barker

Email: [email protected]
http://www.paulbarker.me.uk
#20 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

In reply to Paul Barker
Quoted 8 lines · Paul Barker

On 18 September 2013 17:48, Richard Purdie <[email protected]> wrote:
I'd rather have opkg and opkg-utils merged together or next to each other on the same server if/when I move opkg to git. I think OpenEmbedded/Yocto is probably the main user of opkg but there are others and they'd also benefit from opkg-utils, so having everything in one place would make them easier to find.

Quoted 4 lines

My personal preference would be to move opkg and opkg-utils to Bitbucket/Github/similar, probably merged together, with at least one of the core developers from the Yocto Project having admin access to the repositories so that the bus factor is greater than 1.

FWIW, personally I dislike some of those services as they can be temperamental and with some of them, I can't actually get a view of the code in the repos as well as when I'm used to with cgit. I know others have different preferences, its just life...

Quoted 4 lines

I know I
could probably ask for opkg to be hosted on git.yoctoproject.org but I think that would make non-Yocto Project users feel a little bit too much like second-class citizens.

The Yocto Project is there to be an umbrella for projects serving the needs of embedded users. Pseudo is an example of something which can be used standalone, yet it is hosted on the YP servers.

I'd say that opkg would fit under the umbrella and that we'd be more than happy to host the repo if that was appropriate so the offer is there.

Having more varied projects in the umbrella would actually help people understand what the Yocto Project is verses OpenEmbedded (the build system/architecture) and Poky (reference distro). We already have others like eglibc in there but that should be merging back with glibc, thankfully! :)

Quoted 3 lines

I want to avoid flag days where possible, at least one will be needed for the libopkg API but hopefully not for the command line interface or package format.

The API has the .so version and can be managed. The package format in particular need most careful attention.

Quoted 4 lines

I am planning on proposing that opkg explicitly
follow semantic versioning (http://semver.org/) and I think a stable, sane API is important regardless of whether opkg-utils is separate or not.

Agreed.

Cheers,

Richard

#21 lore raw

Re: [PATCH 08/11] opkg: Add --no-install-recommends option.

Quoted 14 lines · Richard Purdie
Quoted 8 lines · Paul Barker

On 18 September 2013 17:48, Richard Purdie <[email protected]> wrote:
I'd rather have opkg and opkg-utils merged together or next to each other on the same server if/when I move opkg to git. I think OpenEmbedded/Yocto is probably the main user of opkg but there are others and they'd also benefit from opkg-utils, so having everything in one place would make them easier to find.

Quoted 4 lines

My personal preference would be to move opkg and opkg-utils to Bitbucket/Github/similar, probably merged together, with at least one of the core developers from the Yocto Project having admin access to the repositories so that the bus factor is greater than 1.

Quoted 4 lines

FWIW, personally I dislike some of those services as they can be temperamental and with some of them, I can't actually get a view of the code in the repos as well as when I'm used to with cgit. I know others have different preferences, its just life...

I've not had much problems myself but I'll take your word on that. I'm used to both bitbucket and cgit, don't really have a preference between the two.

Quoted 14 lines
Quoted 5 lines

I know I
could probably ask for opkg to be hosted on git.yoctoproject.org but I think that would make non-Yocto Project users feel a little bit too much like second-class citizens.

The Yocto Project is there to be an umbrella for projects serving the needs of embedded users. Pseudo is an example of something which can be used standalone, yet it is hosted on the YP servers.

I'd say that opkg would fit under the umbrella and that we'd be more than happy to host the repo if that was appropriate so the offer is there.

Quoted 5 lines

Having more varied projects in the umbrella would actually help people understand what the Yocto Project is verses OpenEmbedded (the build system/architecture) and Poky (reference distro). We already have others like eglibc in there but that should be merging back with glibc, thankfully! :)

I'll admit to not fully realising that distinction myself as I've mostly been looking at OpenEmbedded. If the Yocto Project is more of an umbrella then yes, opkg probably would fit well within that. I'll have a think what opkg would need and then get back to you. It would certainly alleviate the question of what happens to the repository if I were to disappear. None of us even have full 'owner' access to the google group opkg-devel as I haven't been able to get hold of the original opkg creator!

Quoted 8 lines
Quoted 4 lines

I want to avoid flag days where possible, at least one will be needed for the libopkg API but hopefully not for the command line interface or package format.

The API has the .so version and can be managed. The package format in particular need most careful attention.

Agreed.

Signature · 4 lines
Paul Barker

Email: [email protected]
http://www.paulbarker.me.uk
#22 lore raw

opkg-devel group (was: Re: [PATCH 08/11] opkg: Add --no-install-recommends option.)

In reply to Paul Barker

Hello Paul,

Quoted 4 lines · Paul Barker

I'm the new maintainer for opkg, I'd be happy to look at this patch and any others if you could send them to [email protected] via git send-email. I like the idea of both '--no-install-recommends' and '--add-exclude'.

I just tried to submit some unrelated patches, but received a DSN due to not being subscribed to the opkg-devel group. If I understand correctly, this would require setting up a google account first.

Would it be possible to lower the hurdles for contribution?

Regards,
Andreas

#23 lore raw

Re: opkg-devel group (was: Re: [PATCH 08/11] opkg: Add --no-install-recommends option.)

Quoted 8 lines · Andreas Oberritter

Hello Paul,

I just tried to submit some unrelated patches, but received a DSN due to not being subscribed to the opkg-devel group. If I understand correctly, this would require setting up a google account first.

Would it be possible to lower the hurdles for contribution?

I've set posting to public, we'll see how this goes. Hopefully it won't result in an increase in spam...

Signature · 4 lines
Paul Barker

Email: [email protected]
http://www.paulbarker.me.uk
author
#24 lore raw

PATCH 9/11 package_ipk: Add support for NO_RECOMMENDATIONS

In reply to Mark Hatle

Uses the opkg --no-install-recommends option.

---
 meta/classes/package_ipk.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/package_ipk.bbclass +1 -0
index 3305879..69a6d95 100644
@@ -11,6 +11,7 @@ PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks"
 OPKGBUILDCMD ??= "opkg-build"
 
 OPKG_ARGS = "-f $INSTALL_CONF_IPK -o $INSTALL_ROOTFS_IPK --force_postinstall --prefer-arch-to-version"
+OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
 
 OPKGLIBDIR = "${localstatedir}/lib"
 
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#25 lore raw

PATCH 10/11 opkg: Add support for excluding packages from the install

In reply to Mark Hatle

This adds a new argument to opkg-cl, --add-exclude, which is used to add package names to the list of packages to exclude from the install.

If an excluded package is needed for the install to resolve, an error will be generated. Recommended packages will not generate an error.

---
 meta/recipes-devtools/opkg/opkg/add-exclude.patch | 99 +++++++++++++++++++++++
 meta/recipes-devtools/opkg/opkg_svn.bb            |  1 +
 2 files changed, 100 insertions(+)
 create mode 100644 meta/recipes-devtools/opkg/opkg/add-exclude.patch
meta/recipes-devtools/opkg/opkg/add-exclude.patch new file +99 -0
new file mode 100644
index 0000000..ca433a5
@@ -0,0 +1,99 @@
+Add a way to exclude specific packages from the install
+
+When an excluded package is required by another package an error
+will be generated.  If the excluded package is only recommended,
+no error will be generated.
+
+The lifespan of the exclude_list covers the execution of the process,
+so there is no need to free the data.
+
+Upstream-status: Pending
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+Index: trunk/libopkg/opkg_conf.h
+===================================================================
+--- trunk.orig/libopkg/opkg_conf.h
++++ trunk/libopkg/opkg_conf.h
+@@ -49,6 +49,8 @@ struct opkg_conf
+      pkg_dest_list_t pkg_dest_list;
+      pkg_dest_list_t tmp_dest_list;
+      nv_pair_list_t arch_list;
++     size_t exclude_count;
++     char ** exclude_list;
+ 
+      int restrict_to_default_dest;
+      pkg_dest_t *default_dest;
+Index: trunk/libopkg/pkg_depends.c
+===================================================================
+--- trunk.orig/libopkg/pkg_depends.c
++++ trunk/libopkg/pkg_depends.c
+@@ -212,6 +212,22 @@ pkg_hash_fetch_unsatisfied_dependencies(
+ 			 continue;
+ 		    }
+ 
++		    /* Check for excluded packages */
++		    if (satisfying_pkg != NULL && conf->exclude_list) {
++			int i, exclude = 0;
++			for (i = 0; i < conf->exclude_count; i++) {
++			    if (!strcmp(satisfying_pkg->name, conf->exclude_list[i])) {
++				opkg_msg(NOTICE, "%s: exclude required package %s"
++					"at users request\n",
++					pkg->name, satisfying_pkg->name);
++				exclude = 1;
++				break;
++			    }
++			}
++			if (exclude)
++			    continue;
++		    }
++
+ 		    opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
+ 		    if (satisfying_pkg != NULL) {
+ 			 satisfier_entry_pkg = satisfying_pkg;
+Index: trunk/src/opkg-cl.c
+===================================================================
+--- trunk.orig/src/opkg-cl.c
++++ trunk/src/opkg-cl.c
+@@ -45,6 +45,7 @@ enum {
+ 	ARGS_OPT_PREFER_ARCH_TO_VERSION,
+ 	ARGS_OPT_ADD_ARCH,
+ 	ARGS_OPT_ADD_DEST,
++	ARGS_OPT_ADD_EXCLUDE,
+ 	ARGS_OPT_NOACTION,
+ 	ARGS_OPT_DOWNLOAD_ONLY,
+ 	ARGS_OPT_NODEPS,
+@@ -95,6 +96,7 @@ static struct option long_options[] = {
+ 	{"offline-root", 1, 0, 'o'},
+ 	{"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
+ 	{"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
++	{"add-exclude", 1, 0, ARGS_OPT_ADD_EXCLUDE},
+ 	{"test", 0, 0, ARGS_OPT_NOACTION},
+ 	{"tmp-dir", 1, 0, 't'},
+ 	{"tmp_dir", 1, 0, 't'},
+@@ -198,6 +200,17 @@ args_parse(int argc, char *argv[])
+ 			}
+ 			free(tuple);
+ 			break;
++		case ARGS_OPT_ADD_EXCLUDE:
++			tuple = xstrdup(optarg);
++			if (!conf->exclude_list) {
++				conf->exclude_count = 1;
++				conf->exclude_list = malloc(sizeof(char *) * conf->exclude_count);
++				conf->exclude_list[conf->exclude_count - 1] = tuple;
++			} else {
++				conf->exclude_count++;
++				conf->exclude_list = realloc(conf->exclude_list, sizeof(char *) * conf->exclude_count);
++				conf->exclude_list[conf->exclude_count - 1] = tuple;
++			}
+ 		case ARGS_OPT_NOACTION:
+ 			conf->noaction = 1;
+ 			break;
+@@ -282,6 +295,7 @@ usage()
+ 	printf("\t--offline-root <dir>	offline installation of packages.\n");
+ 	printf("\t--add-arch <arch>:<prio>	Register architecture with given priority\n");
+ 	printf("\t--add-dest <name>:<path>	Register destination with given path\n");
++	printf("\t--add-exclude <name>		Register package to be excluded from install\n");
+ 	printf("\t--prefer-arch-to-version\t 	Use the architecture priority package rather\n");
+ 	printf("\t				than the higher version one if more\n");
+ 	printf("\t				than one candidate is found.\n");
meta/recipes-devtools/opkg/opkg_svn.bb +1 -0
index dbfca0f..bc10491 100644
@@ -2,6 +2,7 @@ require opkg.inc
 
 SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
            file://no-install-recommends.patch \
+           file://add-exclude.patch \
 "
 
 S = "${WORKDIR}/trunk"
Signature · 1 line
1.8.1.2.545.g2f19ada
author
#26 lore raw

PATCH 11/11 package_ipk: Add support for PACKAGE_EXCLUDE

In reply to Mark Hatle

This uses the new --add-exclude arguments in opkg-cl, to list the excluded packages.

If an excluded package is needed for the install to resolve, an error will be generated. Recommended packages will not generate an error.

---
 meta/classes/package_ipk.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/package_ipk.bbclass +1 -0
index 69a6d95..68ffc62 100644
@@ -12,6 +12,7 @@ OPKGBUILDCMD ??= "opkg-build"
 
 OPKG_ARGS = "-f $INSTALL_CONF_IPK -o $INSTALL_ROOTFS_IPK --force_postinstall --prefer-arch-to-version"
 OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE', True) or "").split())][(d.getVar("PACKAGE_EXCLUDE", True) or "") != ""]}"
 
 OPKGLIBDIR = "${localstatedir}/lib"
 
Signature · 1 line
1.8.1.2.545.g2f19ada
#27 lore raw
In reply to Mark Hatle
Quoted 2 lines · Mark Hatle

Debian(apt-get) does not appear to be capable of
BAD_RECOMEMNDATIONS,

The semantics of BAD_RECOMMENDATIONS is "these packages may be listed as recommendations, but don't install them", right? You *might* be able to do this with dpkg by setting the package state to "not-installed hold".

Ross

author
#28 lore raw
Quoted 6 lines · Ross
Quoted 2 lines · Mark Hatle

Debian(apt-get) does not appear to be capable of
BAD_RECOMEMNDATIONS,

The semantics of BAD_RECOMMENDATIONS is "these packages may be listed as recommendations, but don't install them", right? You *might* be

Correct. If it's a dependency, it -will- be installed. Helps trim some of the recommended packages from the final filesystem, without introducing potentially irreconcilable dependency failures.

Quoted 2 lines

able to do this with dpkg by setting the package state to "not-installed hold".

I tried that and it did not work. The hold semantic in dpkg/apt-get appears to say once it's installed keep it at a specific version. But it doesn't allow you to hold in the not-installed mode.

(I'd be more then happy for someone to prove me wrong btw..) I tried everything from setting special Pin-Priorities to playing with the state file, etc.. eventually I gave up and made it a warning instead. (This is not a regression BTW, it has never worked in the past... it's just functionality someone may want.)

Quoted 2 lines

Ross

#29 lore raw
Quoted 8 lines · Mark Hatle
Quoted 2 lines

able to do this with dpkg by setting the package state to "not-installed hold".

I tried that and it did not work. The hold semantic in dpkg/apt-get appears to say once it's installed keep it at a specific version. But it doesn't allow you to hold in the not-installed mode.

Quoted 5 lines

(I'd be more then happy for someone to prove me wrong btw..) I tried everything from setting special Pin-Priorities to playing with the state file, etc.. eventually I gave up and made it a warning instead. (This is not a regression BTW, it has never worked in the past... it's just functionality someone may want.)

Shame, I'm sure I'd seen this behaviour in aptitude. Maybe that's an aptitude extension.

Ross