ソースを参照

initscripts-swupdate-usb: Mark init with update alternatives

When using busybox init as main image's init system, postinsts for
busybox fails in swupdate-image because it tries to create link for
/sbin/init but it cant't because /sbin/init is already created by this
recipe but is not marked update alternative and build fails obscurely

ERROR: swupdate-image-1.0-r0 do_rootfs: Postinstall scriptlets of ['busybox'] have failed. If the intention is to defer them to first boot,
then please place them into pkg_postinst_ontarget_${PN} ().
Deferring to first boot via 'exit 1' is no longer supported.

but the real error is inside log.do_rootfs

pdate-alternatives: Error: not linking /mnt/b/yoe/build/tmp/work/raspberrypi4_64-yoe-linux-musl/swupdate-image/1.0-r0/rootfs/sbin/init to /bin/busybox.nosuid since /mnt/b/yoe/build/tmp/work/raspberrypi4_64-yoe-linux-musl/swupdate-image/1.0-r0/rootfs/sbin/init exists and is not a link

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Khem Raj 5 年 前
コミット
98650acaa4

+ 7 - 2
recipes-core/initscripts-swupdate/initscripts-swupdate-usb.bb

@@ -11,15 +11,20 @@ RPROVIDES_${PN} += "virtual/initscripts-swupdate"
 
 S = "${WORKDIR}"
 
+inherit allarch update-alternatives
+
 do_install () {
 	install -d ${D}/${sysconfdir}/init.d
 	install -d ${D}${base_sbindir}
 	install -m 755 ${S}/rcS.swupdate ${D}${base_sbindir}/init
 }
 
+ALTERNATIVE_PRIORITY = "300"
+ALTERNATIVE_${PN} = "init"
+ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
+ALTERNATIVE_PRIORITY[init] = "60"
+
 PACKAGES = "${PN}"
 FILES_${PN} = "/"
 
-inherit allarch
-
 CONFFILES_${PN} = ""