Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openrc: remove duplicate multicall binaries, symlink instead #29

Open
wants to merge 1 commit into
base: langdale
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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