summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-extended/images/README.md26
-rw-r--r--recipes-extended/images/container-devtools-base.bb31
2 files changed, 55 insertions, 2 deletions
diff --git a/recipes-extended/images/README.md b/recipes-extended/images/README.md
index f087076a..1a25f724 100644
--- a/recipes-extended/images/README.md
+++ b/recipes-extended/images/README.md
@@ -130,7 +130,7 @@ The container shell is changed to bash from busybox.
130package-management is added to this image type, but by default there 130package-management is added to this image type, but by default there
131is no package feed configured (since it must be pointed at a build) 131is no package feed configured (since it must be pointed at a build)
132 132
133 % root@qemuarm64-54:~# docker run -it zeddii/container-devtools bash 133 % root@qemuarm64-54:~# docker run -it zeddii/container-devtools bash
134 bash-5.2# du -sh . 134 bash-5.2# du -sh .
135 399M . 135 399M .
136 bash-5.2# rpm -qa | wc -l 136 bash-5.2# rpm -qa | wc -l
@@ -141,6 +141,30 @@ is no package feed configured (since it must be pointed at a build)
141 This is free software; see the source for copying conditions. There is NO 141 This is free software; see the source for copying conditions. There is NO
142 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 142 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
143 143
144By default this container has (for rpm) package management configured
145to point to a feed being run against the local build on the host machine
146
147To create a package feed:
148
149 % bitbake package-index
150
151To add a package to the package-index (example: vim-tiny)
152
153 % bitbake vim-tiny
154 % bitbake vim-tiny --runall package_write_rpm
155 % bitbake package-index
156
157To run a local http server for the package feed:
158
159 % cd build/tmp/deploy
160 % sudo python3 -m http.server 80
161
162Run the dev container:
163
164 % docker run -it zeddii/container-devtools bash
165 % dnf makecache
166 % dnf --nogpgcheck install vim-tiny
167
144container-app-base: 168container-app-base:
145-------------------- 169--------------------
146 170
diff --git a/recipes-extended/images/container-devtools-base.bb b/recipes-extended/images/container-devtools-base.bb
index 21120d1f..12e13fe6 100644
--- a/recipes-extended/images/container-devtools-base.bb
+++ b/recipes-extended/images/container-devtools-base.bb
@@ -9,8 +9,15 @@ CORE_DEV_IMAGE_EXTRA_INSTALL ?= ""
9include container-base.bb 9include container-base.bb
10inherit core-image 10inherit core-image
11 11
12CORE_DEV_IMAGE_EDITOR ?= "vim-tiny"
13# base-utils is required for post-install scriptlets in most packages,
14# coreutils or busybox can do the job
15CORE_DEV_IMAGE_CORE_UTILS ?= "${VIRTUAL-RUNTIME_base-utils}"
16
12IMAGE_INSTALL += " \ 17IMAGE_INSTALL += " \
13 ${CORE_DEV_IMAGE_EXTRA_INSTALL} \ 18 ${CORE_DEV_IMAGE_EXTRA_INSTALL} \
19 ${CORE_DEV_IMAGE_CORE_UTILS} \
20 ${CORE_DEV_IMAGE_EDITOR} \
14 " 21 "
15 22
16OCI_IMAGE_ENTRYPOINT = "" 23OCI_IMAGE_ENTRYPOINT = ""
@@ -19,4 +26,26 @@ OCI_IMAGE_ENTRYPOINT = ""
19# the container. 26# the container.
20IMAGE_FEATURES += "dev-pkgs" 27IMAGE_FEATURES += "dev-pkgs"
21IMAGE_FEATURES += "tools-sdk" 28IMAGE_FEATURES += "tools-sdk"
22IMAGE_FEATURES += "package-management" \ No newline at end of file 29IMAGE_FEATURES += "package-management"
30
31# This default configuration of 10.0.2.2 is configured
32# to contact a web server running against a bitbaked
33# package-index
34#
35# % cd build/tmp/deploy
36# % sudo python3 -m http.server 80
37#
38DEVTOOLS_BASE_PKG_FEED_URL ?= "http://10.0.2.2/rpm"
39
40
41# TODO: support more than rpm
42ROOTFS_POSTPROCESS_COMMAND += "rootfs_pkg_feed_config ; "
43rootfs_pkg_feed_config () {
44 if [ "${IMAGE_PKGTYPE}" = "rpm" ]; then
45 install -m 755 -d ${IMAGE_ROOTFS}/${sysconfdir}/yum.repos.d
46cat <<EOF >>${IMAGE_ROOTFS}/${sysconfdir}/yum.repos.d/oe-packages.repo
47[oe-packages]
48baseurl="${DEVTOOLS_BASE_PKG_FEED_URL}"
49EOF
50 fi
51}