From a2a65621a19e30f1967fc9befebf5b97a788c9c5 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Thu, 19 Apr 2018 16:26:43 +0100 Subject: [PATCH] rootfs: Simplify code Use more variables to avoid duplication and make the code cleaner. Signed-off-by: James O. D. Hunt --- rootfs-builder/rootfs.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rootfs-builder/rootfs.sh b/rootfs-builder/rootfs.sh index 517859d649..f457427c54 100755 --- a/rootfs-builder/rootfs.sh +++ b/rootfs-builder/rootfs.sh @@ -240,10 +240,13 @@ make clean make INIT=${AGENT_INIT} make install DESTDIR="${ROOTFS_DIR}" INIT=${AGENT_INIT} popd -[ -x "${ROOTFS_DIR}/usr/bin/${AGENT_BIN}" ] || die "/usr/bin/${AGENT_BIN} is not installed in ${ROOTFS_DIR}" + +AGENT_DIR="${ROOTFS_DIR}/usr/bin" +AGENT_DEST="${AGENT_DIR}/${AGENT_BIN}" +[ -x "${AGENT_DEST}" ] || die "${AGENT_DEST} is not installed in ${ROOTFS_DIR}" OK "Agent installed" -[ "${AGENT_INIT}" == "yes" ] && setup_agent_init "${ROOTFS_DIR}/usr/bin/${AGENT_BIN}" "${init}" +[ "${AGENT_INIT}" == "yes" ] && setup_agent_init "${AGENT_DEST}" "${init}" info "Check init is installed" [ -x "${init}" ] || [ -L "${init}" ] || die "/sbin/init is not installed in ${ROOTFS_DIR}"