From c6f017d5597460aaad464e3a56959e729f267999 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Wed, 6 Feb 2019 15:54:48 +0100 Subject: enea-nfv-access-host-common: Fix /var/lib/dpkg move error A forced build of do_image_ostree task results in error due to /var/lib/dpkg folder being empty after it was moved out in previous builds. | mv: cannot stat '/data/fb/addu/nfv-rocko/poky/build-xeond-sb/tmp/work/xeon_d-enea-linux/enea-nfv-access-edgelink-netconf/1.0-r0/rootfs/var/lib/dpkg/*': No such file or directory | WARNING: exit code 1 from a shell command. | ERROR: Function failed: do_image_ostree Change-Id: Ia61278eeabec9062e57cc508348be2efcf7599e1 Signed-off-by: Adrian Dudau --- images/enea-nfv-access-host-common.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/images/enea-nfv-access-host-common.inc b/images/enea-nfv-access-host-common.inc index 2d19f3c..218cf2b 100644 --- a/images/enea-nfv-access-host-common.inc +++ b/images/enea-nfv-access-host-common.inc @@ -51,7 +51,9 @@ python __anonymous () { # Before building the OSTree image, move DPKG data to /usr/dpkg, because # OSTree does not preserve the contents of /var IMAGE_CMD_ostree_prepend () { - install -d ${IMAGE_ROOTFS}/usr/dpkg/ - mv ${IMAGE_ROOTFS}/var/lib/dpkg/* ${IMAGE_ROOTFS}/usr/dpkg/ + install -d ${IMAGE_ROOTFS}/usr/dpkg/ + if [ "$(ls -A ${IMAGE_ROOTFS}/var/lib/dpkg)" ]; then + mv ${IMAGE_ROOTFS}/var/lib/dpkg/* ${IMAGE_ROOTFS}/usr/dpkg/ + fi } -- cgit v1.2.3-54-g00ecf