[source] rootfs: fail on errors in postinst scripts
LEDE Commits
lede-commits at lists.infradead.org
Mon Sep 26 08:59:50 PDT 2016
neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/5b99693832d0307744ac16d29fb359b730fd86a3
commit 5b99693832d0307744ac16d29fb359b730fd86a3
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Sep 26 15:25:38 2016 +0200
rootfs: fail on errors in postinst scripts
The Gluon firmware framework [1] uses postinst scripts for sanity checks.
Make the build fail when a postinst script exits with an error to make
these sanity checks effective.
All postinst scripts in packages from the LEDE core and the packages feed
seem to work correctly with this change and will always return 0 unless
something is very broken.
[1] https://github.com/freifunk-gluon/gluon
Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
include/rootfs.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/rootfs.mk b/include/rootfs.mk
index 15f71ae..b161721 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -60,6 +60,11 @@ define prepare_rootfs
cd $(1); \
for script in ./usr/lib/opkg/info/*.postinst; do \
IPKG_INSTROOT=$(1) $$(which bash) $$script; \
+ ret=$$?; \
+ if [ $$ret -ne 0 ]; then \
+ echo "postinst script $$script has failed with exit code $$ret" >&2; \
+ exit 1; \
+ fi; \
done; \
for script in ./etc/init.d/*; do \
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
More information about the lede-commits
mailing list