Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,19 @@ Check_Docker_Running() {
done
}

# A root that is itself an overlay (FriendlyElec images, some live systems): Docker
# cannot make its own overlay layers on it, and a pull ends at "failed to convert
# whiteout file ... operation not permitted". Said before Docker is installed or used;
# the install goes on, as Docker's folder may be put elsewhere afterwards.
Warn_Docker_On_Overlay() {
local dir=/var/lib/docker
[[ -d "${dir}" ]] || dir=/var/lib
if [[ "$(stat -f -c %T "${dir}" 2>/dev/null)" == overlay* ]]; then
Show 3 "${dir} is on an overlay file system: Docker cannot unpack images there, and apps will fail to install.
Put /var/lib/docker on a real disk (ext4, a partition of its own), or turn the overlay root off as this system's maker documents, then run this installer again."
fi
}

#Check Docker Installed and version
Check_Docker_Install() {
if [[ -x "$(command -v docker)" ]]; then
Expand Down Expand Up @@ -2134,6 +2147,7 @@ Check_Dependency_Installation
Install_SMB_Discovery_Depends

# Step 6: Check And Install Docker
Warn_Docker_On_Overlay
Check_Docker_Install

# Step 7: Configuration Addon
Expand Down
10 changes: 9 additions & 1 deletion scripts/test-install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INSTALL_SH="${WORK}/install.sh"
tr -d '\r' <"${ROOT}/install.sh" >"${INSTALL_SH}"
bash -n "${INSTALL_SH}" || fail "install.sh does not parse"

for f in Answer_Is_Yes Debian_Archive_Agreed Use_Debian_Archive Package_Install_Failed Check_Docker_Install Check_Docker_Install_Final Update_Package_Resource; do
for f in Answer_Is_Yes Debian_Archive_Agreed Use_Debian_Archive Package_Install_Failed Warn_Docker_On_Overlay Check_Docker_Install Check_Docker_Install_Final Update_Package_Resource; do
eval "$(sed -n "/^${f}() {\$/,/^}\$/p" "${INSTALL_SH}")"
declare -F "${f}" >/dev/null || fail "install.sh defines no ${f}()"
done
Expand Down Expand Up @@ -247,6 +247,14 @@ docker_says() { # <what docker answers, or "down"; "none" for no docker> <expect
)" || status=$?
[[ "${status}" -eq "$2" ]] || fail "docker '$1': status ${status}, wanted $2: ${out}"
}
# a root that is an overlay is said, and the install goes on; any other file system says nothing
stat() { echo overlayfs; }
out="$(Warn_Docker_On_Overlay)" || fail "overlay root: the warning ended the install"
grep -q 'overlay file system' <<<"${out}" || fail "overlay root: not said: ${out}"
stat() { echo ext2/ext3; }
out="$(Warn_Docker_On_Overlay)"
[[ -z "${out}" ]] || fail "ext4 root: warned: ${out}"
unset -f stat
docker_says 28.0.4 0
grep -q 'Current Docker version is 28.0.4' <<<"${out}" || fail "docker 28.0.4: not said to be fine"
docker_says "26.1.5+dfsg1" 0
Expand Down