diff --git a/src/disk.sh b/src/disk.sh index f35a53a..1b888db 100644 --- a/src/disk.sh +++ b/src/disk.sh @@ -27,11 +27,11 @@ SYSTEM="$STORAGE/$BASE.system.img" [ ! -s "$SYSTEM" ] && error "Virtual DSM system-image does not exist ($SYSTEM)" && exit 82 if ! setOwner "$BOOT"; then - error "Failed to set the owner for \"$BOOT\" !" + warn "failed to set the owner for \"$BOOT\" !" fi if ! setOwner "$SYSTEM"; then - error "Failed to set the owner for \"$SYSTEM\" !" + warn "failed to set the owner for \"$SYSTEM\" !" fi fmt2ext() { @@ -633,7 +633,7 @@ addDisk () { if [ -f "$DISK_FILE" ]; then if ! setOwner "$DISK_FILE"; then - error "Failed to set the owner for \"$DISK_FILE\" !" + warn "failed to set the owner for \"$DISK_FILE\" !" fi fi diff --git a/src/install.sh b/src/install.sh index 2c243d1..de1f2c1 100644 --- a/src/install.sh +++ b/src/install.sh @@ -252,7 +252,7 @@ if ! touch "$SYSTEM"; then error "Could not create file $SYSTEM for the system disk." && exit 98 fi -! setOwner "$SYSTEM" && error "Failed to set the owner for \"$SYSTEM\" !" +! setOwner "$SYSTEM" && warn "failed to set the owner for \"$SYSTEM\" !" if [[ "${FS,,}" == "btrfs" ]]; then { chattr +C "$SYSTEM"; } || : @@ -327,7 +327,7 @@ fakeroot -- bash -c "set -Eeu;\ rm -rf "$MOUNT" echo "$BASE" > "$STORAGE/dsm.ver" -! setOwner "$STORAGE/dsm.ver" && error "Failed to set the owner for \"$STORAGE/dsm.ver\" !" +! setOwner "$STORAGE/dsm.ver" && warn "failed to set the owner for \"$STORAGE/dsm.ver\" !" if [[ "$URL" == "file://$STORAGE/$BASE.pat" ]]; then rm -f "$PAT" @@ -336,11 +336,11 @@ else fi if [ -f "$STORAGE/$BASE.pat" ]; then - ! setOwner "$STORAGE/$BASE.pat" && error "Failed to set the owner for \"$STORAGE/$BASE.pat\" !" + ! setOwner "$STORAGE/$BASE.pat" && warn "failed to set the owner for \"$STORAGE/$BASE.pat\" !" fi mv -f "$BOOT" "$STORAGE/$BASE.boot.img" -! setOwner "$STORAGE/$BASE.boot.img" && error "Failed to set the owner for \"$STORAGE/$BASE.boot.img\" !" +! setOwner "$STORAGE/$BASE.boot.img" && warn "failed to set the owner for \"$STORAGE/$BASE.boot.img\" !" rm -rf "$TMP" diff --git a/src/utils.sh b/src/utils.sh index 8e4ac4e..c0d98d9 100644 --- a/src/utils.sh +++ b/src/utils.sh @@ -224,10 +224,16 @@ makeDir() { ! mkdir -p "$path" && return 1 dir=$(dirname -- "$path") - uid=$(stat -c '%u' "$dir") || return 1 - gid=$(stat -c '%g' "$dir") || return 1 - ! chown "$uid:$gid" "$path" && return 1 + if ! uid=$(stat -c '%u' "$dir") || ! gid=$(stat -c '%g' "$dir"); then + warn "failed to determine the owner for \"$path\"." + return 0 + fi + + if ! chown "$uid:$gid" "$path"; then + warn "failed to set the owner for \"$path\"." + return 0 + fi return 0 }