mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 04:34:27 +00:00
osbuilder: Allow running the tool several times
Once the ${ROOTFS_DIR} is created, the tool can't run the second time since the directory is populated and the debootstrap tool will fail. Fix by deleting the contents of ${ROOTFS_DIR} if the directory exists. Note that running make clean will also allow the re-run, it is only an optimization for some cases the build fails in the middle. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
This commit is contained in:
parent
a4214738b9
commit
65a1e13195
@ -326,7 +326,11 @@ build_rootfs_distro()
|
||||
trap error_handler ERR
|
||||
fi
|
||||
|
||||
mkdir -p ${ROOTFS_DIR}
|
||||
if [ -d "${ROOTFS_DIR}" ] && [ "${ROOTFS_DIR}" != "/" ]; then
|
||||
rm -rf "${ROOTFS_DIR}"/*
|
||||
else
|
||||
mkdir -p ${ROOTFS_DIR}
|
||||
fi
|
||||
|
||||
# need to detect rustc's version too?
|
||||
detect_rust_version ||
|
||||
|
Loading…
Reference in New Issue
Block a user