Skip to content

Commit

Permalink
Check existence of directory 'lost+found'
Browse files Browse the repository at this point in the history
The command `sudo rmdir $TARGET_ROOT/lost+found` will fail
if `$TARGET_ROOT/lost+found` directory doesn't exist,
e.g. when you use non-default image.

Fixes bug #1245856

Change-Id: I48c8f2f201b29912a726249023ca7d20893cc958
  • Loading branch information
iberezovskiy committed Oct 29, 2013
1 parent d91ecec commit f23babe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion elements/fedora/root.d/10-fedora-cloud-image
Expand Up @@ -73,4 +73,6 @@ fi
# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between
# image tarball and host OS e.g. when building Fedora image on an openSUSE host)
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR
sudo rmdir $TARGET_ROOT/lost+found
if [ -e "$TARGET_ROOT/lost+found" ]; then
sudo rmdir $TARGET_ROOT/lost+found
fi
4 changes: 3 additions & 1 deletion elements/rhel/root.d/10-rhel-cloud-image
Expand Up @@ -54,4 +54,6 @@ 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
sudo rmdir $TARGET_ROOT/lost+found
if [ -e "$TARGET_ROOT/lost+found" ]; then
sudo rmdir $TARGET_ROOT/lost+found
fi
4 changes: 3 additions & 1 deletion elements/ubuntu/root.d/10-cache-ubuntu-tarball
Expand Up @@ -27,4 +27,6 @@ fi
# 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
sudo rmdir $TARGET_ROOT/lost+found
if [ -e "$TARGET_ROOT/lost+found" ]; then
sudo rmdir $TARGET_ROOT/lost+found
fi

0 comments on commit f23babe

Please sign in to comment.