Bug 11343 - Wrong execution order of PACKAGESPLITFUNCS
Summary: Wrong execution order of PACKAGESPLITFUNCS
Status: RESOLVED DUPLICATE of bug 10944
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 2.1.3
Hardware: All Multiple
: Medium normal
Target Milestone: 2.5
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-04-12 16:34 UTC by Oleksandr Poznyak
Modified: 2017-11-16 16:29 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksandr Poznyak 2017-04-12 16:34:40 UTC
Current order of PACKAGESPLITFUNCS is:
populate_packages_updatercd populate_packages_updatealternatives systemd_populate_packages package_do_split_locales populate_packages

As You see populate_packages_updatercd is executed before populate_packages_updatealternatives.

As a result we might have following content of DEB package postinst script:

#!/bin/sh
if type update-rc.d >/dev/null 2>/dev/null; then
	if [ -n "$D" ]; then
		OPT="-r $D"
	else
		OPT="-s"
	fi
	update-rc.d $OPT syslog start 20 2 3 4 5 . stop 90 0 1 6 .
fi
	update-alternatives --install /etc/init.d/syslog syslog-init /etc/init.d/syslog.syslog-ng 200

update-rc.d will fail in case of absence of syslog target. But syslog target is created after update-rc.d execution.

As You see, update-alternatives should be called BEFORE update-rc.d call.

So at the end we should have this order of PACKAGESPLITFUNCS:
populate_packages_updatealternatives populate_packages_updatercd systemd_populate_packages package_do_split_locales populate_packages
Comment 1 Ross Burton 2017-11-16 16:29:26 UTC
update-alternatives and update-rcd just don't play nicely together, luckily for this example there's an existing bug which has patches.

*** This bug has been marked as a duplicate of bug 10944 ***