Centralize handling of /lost+found

Just remove globally /lost+found after the root and install phases, so
distribution elements don't need to do that by themselves.

Change-Id: Ic783e613bd8794aefd3f40c9a7c308d14cd04b8d
This commit is contained in:
Pino Toscano 2014-08-04 05:40:47 -04:00
parent f303b6546c
commit 267e96f52c
5 changed files with 6 additions and 16 deletions

View File

@ -145,6 +145,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
}
(