libopkg: implement lightweight package listing logic Instead of building a complete package dependency tree internally, use a lightweight list data structure to gather and sort package names, version and descriptions. This reduced the "opkg list" memory footprint on x86/64 from ~8MB to ~1.5MB. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
opkg: add --no-check-certificate argument For cases when artifacts are stored on https:// accessible locations and you don't want to install ca-certificates (for various reasons). I'll admit, using SSL like this is not recommended, but since wget (even uclient-fetch) allows the --no-check-certificate option, it would be nice for opkg to support setting it if needed/configured. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
opkg-cl: stop preloading package feeds on install Instead of unconditionally loading all package feed lists entirely into memory, let opkg_install_cmd() selectively parse the lists using the new pkg_hash_load_package_details() helper. This will result in a slightly longer runtime but dramatically reduces the memory requirements. On an x86_64 test system, the peak heap memory consumption during an "opkg install luci" dropped from 3.7 MB to about 360 KB, a decrease of roughly 90%. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
pkg: use a blob buffer in pkg_t to store variable fields Adds infrastructure to use a blob buffer in pkg_t to store and retrieve optional dynamic fields. This reduces the size of the pkg_t structure itself and lays the ground work for further optimization. Signed-off-by: Jo-Philipp Wich <jo@mein.io>