Support running with read-only root on Xenial
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dpkg (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
dpkg 1.8.11 has fixed this issue when running with read-only root. The Debian bug is https:/
Could you backport the fix to Xenial?
The patch is trivial and looks safe to backport.
https:/
diff --git a/lib/dpkg/
index 3086408e8.
--- a/lib/dpkg/
+++ b/lib/dpkg/
@@ -137,6 +137,13 @@ path_remove_
if (errno == ENOTDIR)
return;
}
+ /* Trying to remove a directory or a file on a read-only filesystem,
+ * even if non-existent, always returns EROFS. */
+ if (errno == EROFS) {
+ if (access(pathname, F_OK) < 0 && errno == ENOENT)
+ return;
+ errno = EROFS;
+ }
if (errno != ENOTEMPTY && errno != EEXIST) /* Huh? */
ohshite(
Thanks.