Merge "Centralize handling of /lost+found"

This commit is contained in:
Jenkins 2014-08-28 16:33:12 +00:00 committed by Gerrit Code Review
commit 7d0e7fe5ad
5 changed files with 6 additions and 16 deletions

View File

@ -146,6 +146,12 @@ do_extra_package_install
run_d_in_target install
run_d_in_target post-install
prepare_first_boot
# ensure we do not have a lost+found directory in the root folder
# that could cause copy to fail (it will be created again later
# when creating the file system, if it needs such directory)
if [ -e "$TMP_BUILD_DIR/mnt/lost+found" ]; then
sudo rm -rf "$TMP_BUILD_DIR/mnt/lost+found"
fi
# Free up /mnt
unmount_image
mv $TMP_BUILD_DIR/mnt $TMP_BUILD_DIR/built

View File

@ -1,7 +0,0 @@
#!/bin/bash
# ensure we do not have a lost+found directory in the root folder
# that could cause copy to fail.
set -eu
set -o pipefail
rm -rf lost+found

View File

@ -95,6 +95,3 @@ fi
# image tarball and host OS e.g. when building Fedora image on an openSUSE host)
echo "Extracting base root image from $CACHED_TAR"
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $CACHED_TAR
if [ -e "$TARGET_ROOT/lost+found" ]; then
sudo rmdir $TARGET_ROOT/lost+found
fi

View File

@ -55,6 +55,3 @@ fi
# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between
# image tarball and host OS e.g. when building RHEL image on an openSUSE host)
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR
if [ -e "$TARGET_ROOT/lost+found" ]; then
sudo rmdir $TARGET_ROOT/lost+found
fi

View File

@ -45,9 +45,6 @@ function get_ubuntu_tarball() {
# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between
# image tarball and host OS e.g. when building Ubuntu image on an openSUSE host)
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
if [ -e "$TARGET_ROOT/lost+found" ]; then
sudo rmdir $TARGET_ROOT/lost+found
fi
}
(