container-devtools: add editor + package management dependencies

Since we are intalling packagemanagement to this reference container,
it makes sense that our install include common utilities that post
install scriptlets will need.

We also add an editor by default.

Finally, we configure a reference rpm package feed to illustrate
how a container can be hooked to a packagefeed.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2024-12-10 03:33:44 +00:00
parent 405d625c86
commit 16c742b344
2 changed files with 55 additions and 2 deletions

View File

@ -130,7 +130,7 @@ The container shell is changed to bash from busybox.
package-management is added to this image type, but by default there
is no package feed configured (since it must be pointed at a build)
% root@qemuarm64-54:~# docker run -it zeddii/container-devtools bash
% root@qemuarm64-54:~# docker run -it zeddii/container-devtools bash
bash-5.2# du -sh .
399M .
bash-5.2# rpm -qa | wc -l
@ -141,6 +141,30 @@ is no package feed configured (since it must be pointed at a build)
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
By default this container has (for rpm) package management configured
to point to a feed being run against the local build on the host machine
To create a package feed:
% bitbake package-index
To add a package to the package-index (example: vim-tiny)
% bitbake vim-tiny
% bitbake vim-tiny --runall package_write_rpm
% bitbake package-index
To run a local http server for the package feed:
% cd build/tmp/deploy
% sudo python3 -m http.server 80
Run the dev container:
% docker run -it zeddii/container-devtools bash
% dnf makecache
% dnf --nogpgcheck install vim-tiny
container-app-base:
--------------------

View File

@ -9,8 +9,15 @@ CORE_DEV_IMAGE_EXTRA_INSTALL ?= ""
include container-base.bb
inherit core-image
CORE_DEV_IMAGE_EDITOR ?= "vim-tiny"
# base-utils is required for post-install scriptlets in most packages,
# coreutils or busybox can do the job
CORE_DEV_IMAGE_CORE_UTILS ?= "${VIRTUAL-RUNTIME_base-utils}"
IMAGE_INSTALL += " \
${CORE_DEV_IMAGE_EXTRA_INSTALL} \
${CORE_DEV_IMAGE_CORE_UTILS} \
${CORE_DEV_IMAGE_EDITOR} \
"
OCI_IMAGE_ENTRYPOINT = ""
@ -19,4 +26,26 @@ OCI_IMAGE_ENTRYPOINT = ""
# the container.
IMAGE_FEATURES += "dev-pkgs"
IMAGE_FEATURES += "tools-sdk"
IMAGE_FEATURES += "package-management"
IMAGE_FEATURES += "package-management"
# This default configuration of 10.0.2.2 is configured
# to contact a web server running against a bitbaked
# package-index
#
# % cd build/tmp/deploy
# % sudo python3 -m http.server 80
#
DEVTOOLS_BASE_PKG_FEED_URL ?= "http://10.0.2.2/rpm"
# TODO: support more than rpm
ROOTFS_POSTPROCESS_COMMAND += "rootfs_pkg_feed_config ; "
rootfs_pkg_feed_config () {
if [ "${IMAGE_PKGTYPE}" = "rpm" ]; then
install -m 755 -d ${IMAGE_ROOTFS}/${sysconfdir}/yum.repos.d
cat <<EOF >>${IMAGE_ROOTFS}/${sysconfdir}/yum.repos.d/oe-packages.repo
[oe-packages]
baseurl="${DEVTOOLS_BASE_PKG_FEED_URL}"
EOF
fi
}