Bug 11343

Summary: Wrong execution order of PACKAGESPLITFUNCS
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Oleksandr Poznyak <oleksandr.poznyak>
Component: meta-yoctoAssignee: Ross Burton <ross.burton>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: Medium CC: juro.bystricky, oleksandr.poznyak, poky.bs.watcher, poky.watcher
Version: 2.1.3   
Target Milestone: 2.5   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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 ***