Skip to content

Commit

Permalink
openrc: remove duplicate multicall binaries, symlink instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mqqc committed Apr 17, 2023
1 parent c0289ce commit 0df1c66
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions recipes-init/openrc/openrc_0.45.2.bb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ EXTRA_OEMESON += " \
-Dpkg_prefix=${prefix} \
"

symlink_multicalls() {
local dir="$1"
local dest="$2"
shift 2
for src in "$@"; do
rm "${dir}/${src}"
ln -snf "${dest}" "${dir}/${src}"
done
}

do_install:append() {
# Default sysvinit doesn't do anything with keymaps on a minimal install so
# we're not going to either.
Expand All @@ -45,6 +55,23 @@ do_install:append() {
fi
sed -i "s|/sbin/openrc-run|${sbindir}/openrc-run|" ${D}${OPENRC_INITDIR}/volatiles
fi

# Many applets are really the same multicall compiled N times, so symlink them to save space.
rc_libdir="${D}${@bb.utils.contains('PACKAGECONFIG', 'usrmerge', '${libdir}', '${base_libdir}', d)}/rc"
symlink_multicalls "${rc_libdir}/bin" einfo \
einfon ewarn ewarnn eerror eerrorn ewend ebegin eend ewend eindent eoutdent \
veinfo vewarn vebegin veend vewend veindent veoutdent \
esyslog eval_ecolors ewaitfile
symlink_multicalls "${rc_libdir}/bin" service_get_value \
service_set_value get_options save_options
symlink_multicalls "${rc_libdir}/bin" service_started \
service_starting service_stopping service_stopped \
service_inactive service_wasinactive \
service_hotplugged service_started_daemon service_crashed
symlink_multicalls "${rc_libdir}/sbin" mark_service_started \
mark_service_starting mark_service_stopping mark_service_stopped \
mark_service_inactive mark_service_wasinactive \
mark_service_hotplugged mark_service_failed mark_service_crashed
}

RDEPENDS:${PN} = " \
Expand Down

0 comments on commit 0df1c66

Please sign in to comment.