bitbake: Use IPK packaging for rootfs assembly
bitbake offers a choice of DEB, RPM or IPK packaging. To a degree the
choice is functionally arbitrary for image generation but control over
the package format becomes important if we want to:
1. Include runtime package management functionality in the firmware image
2. Mess about with the packages on the build system
With respect to 1 the IPK format and opkg (an ipk package manager) are
designed for embedded systems[1] - by contrast to RPMs have heavier
dependencies and a greater impact on the size and complexity of the
firmware image.
Regarding 2, the embedded nature and the need for opkg to work without
much fuss leads to a lower configuration barrier by comparison to RPMs.
With ipk it becomes possible to reuse the packages built during image
preparation for core analysis without needing to generate an SDK:
```
$ export LD_LIBRARY_PATH=./tmp/work/x86_64-linux/opkg-native/*/recipe-sysroot-native/usr/lib
$ MY_DEBUG_ROOT=tmp/rootfs-debug
$ ./tmp/sysroots-components/x86_64/opkg-native/usr/bin/opkg \
-f ./tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-phosphor-image/*/opkg.conf \
-o $MY_DEBUG_ROOT \
update
$ fakeroot ./tmp/sysroots-components/x86_64/opkg-native/usr/bin/opkg \
-f ./tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-phosphor-image/1.0-r0/opkg.conf \
-o $MY_DEBUG_ROOT \
install dbus-sensors dbus-sensors-dbg
$ gdb-multiarch
(gdb) set solib-absolute-prefix .../tmp/rootfs-debug
(gdb) add-auto-load-safe-path .../tmp/rootfs-debug
(gdb) file tmp/rootfs-debug/usr/bin/nvmesensor
(gdb) core-file obmcdump_17_9597/core.nvmesensor.0.aae91b519d0e4e0e8bbe746e3f6cd25f.2779.9594000000
Core was generated by `/usr/bin/nvmesensor'.
Program terminated with signal SIGABRT, Aborted.
pthread_kill.c:45
45 pthread_kill.c: No such file or directory.
(gdb) bt
pthread_kill.c:45
../sysdeps/posix/raise.c:26
/home/andrew/src/openbmc/openbmc/build/p10bmc/tmp/rootfs-debug/usr/lib/libstdc++.so.6
/home/andrew/src/openbmc/openbmc/build/p10bmc/tmp/rootfs-debug/usr/lib/libstdc++.so.6
/home/andrew/src/openbmc/openbmc/build/p10bmc/tmp/rootfs-debug/usr/lib/libstdc++.so.6
/home/andrew/src/openbmc/openbmc/build/p10bmc/tmp/rootfs-debug/usr/lib/libstdc++.so.6
"xyz.openbmc_project.NVMeSensor", this=0x488f04) at
/usr/include/sdbusplus/bus.hpp:234
../../../../../../workspace/sources/dbus-sensors/src/NVMeSensorMain.cpp:159
(gdb)
```
This approach documented in the Poky Reference Manual:
https://www.yoctoproject.org/docs/1.0/poky-ref-manual/poky-ref-manual.html#platdev-gdb-remotedebug-launch-gdb-inferiorbins
Switch all machines to IPK to align the debugging experience with
upstream's documentation and to facilitate efficient use of packaged
software at runtime.
[1] https://openwrt.org/docs/guide-user/additional-software/opkg
Change-Id: I8ef526add2d7a6790de1b3eb3fb85cd39b864f23
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meta-inspur/meta-fp5280g2/conf/local.conf.sample b/meta-inspur/meta-fp5280g2/conf/local.conf.sample
index bb64c15..1e3361f 100644
--- a/meta-inspur/meta-fp5280g2/conf/local.conf.sample
+++ b/meta-inspur/meta-fp5280g2/conf/local.conf.sample
@@ -1,6 +1,6 @@
MACHINE ??= "fp5280g2"
DISTRO ?= "openbmc-fp5280g2"
-PACKAGE_CLASSES ?= "package_rpm"
+PACKAGE_CLASSES ?= "package_ipk"
SANITY_TESTED_DISTROS:append ?= " *"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-prelink"
diff --git a/meta-inspur/meta-on5263m5/conf/local.conf.sample b/meta-inspur/meta-on5263m5/conf/local.conf.sample
index 6e212f3..f829ce5 100644
--- a/meta-inspur/meta-on5263m5/conf/local.conf.sample
+++ b/meta-inspur/meta-on5263m5/conf/local.conf.sample
@@ -104,7 +104,7 @@
# - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to rpm:
-PACKAGE_CLASSES ?= "package_rpm"
+PACKAGE_CLASSES ?= "package_ipk"
#
# SDK/ADT target architecture