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:
parent
f303b6546c
commit
267e96f52c
@ -145,6 +145,12 @@ do_extra_package_install
|
|||||||
run_d_in_target install
|
run_d_in_target install
|
||||||
run_d_in_target post-install
|
run_d_in_target post-install
|
||||||
prepare_first_boot
|
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
|
# Free up /mnt
|
||||||
unmount_image
|
unmount_image
|
||||||
mv $TMP_BUILD_DIR/mnt $TMP_BUILD_DIR/built
|
mv $TMP_BUILD_DIR/mnt $TMP_BUILD_DIR/built
|
||||||
|
@ -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
|
|
@ -95,6 +95,3 @@ fi
|
|||||||
# image tarball and host OS e.g. when building Fedora image on an openSUSE host)
|
# image tarball and host OS e.g. when building Fedora image on an openSUSE host)
|
||||||
echo "Extracting base root image from $CACHED_TAR"
|
echo "Extracting base root image from $CACHED_TAR"
|
||||||
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $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
|
|
||||||
|
@ -55,6 +55,3 @@ fi
|
|||||||
# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between
|
# 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)
|
# 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
|
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
|
|
||||||
|
@ -45,9 +45,6 @@ function get_ubuntu_tarball() {
|
|||||||
# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between
|
# 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)
|
# 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
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user