Repositories / jai.git

jai.git

Clone (read-only): git clone http://git.guha-anderson.com/git/jai.git

Branch

better error message from overlay mounts

Author
David Mazieres <dm@uun.org>
Date
2026-03-16 00:18:28 -0700
Commit
17bd7fa4101ef863f49e1b557079a72b2568ac5e
INSTALL
index 29982ee..ce2d6b8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,6 +1,8 @@
 
-This software only runs on modern versions of linux.  It makes
-extensive use of non-portable file system namespace facilities.
+This software only runs on modern versions of linux, starting with
+linux 6.13.  It makes extensive use of non-portable
+file-descriptor-based mount calls and file system namespace
+facilities.
 
 To get the software, run:
 
README.md
index a799f10..89cbe66 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 ![](./logo.svg "JAI logo")
 
-# JAI - An ultra lightweight jail for AI CLIs on linux
+# JAI - An ultra lightweight jail for AI CLIs on linux 6.13 and later
 
 `jai` strives to be the easiest container in the world to
 configure--so easy that you never again need to run a code assistant
jai.cc
index 067a43b..eab8db0 100644
--- a/jai.cc
+++ b/jai.cc
@@ -335,10 +335,13 @@ Config::make_home_overlay()
   restore.reset();
 
   Fd fsfd = xfsopen("overlay", cat("jai-", sb).c_str());
-  if (fsconfig(*fsfd, FSCONFIG_SET_FD, "lowerdir+", nullptr, home()) ||
-      fsconfig(*fsfd, FSCONFIG_SET_FD, "upperdir", nullptr, *changes) ||
-      fsconfig(*fsfd, FSCONFIG_SET_FD, "workdir", nullptr, *work))
-    syserr("fsconfig(FSCONFIG_SET_FD)");
+  auto xsetfd = [&](const char *param, int fd) {
+    if (fsconfig(*fsfd, FSCONFIG_SET_FD, param, nullptr, fd))
+      syserr("fsconfig(FSCONFIG_SET_FD, \"{}\")", param);
+  };
+  xsetfd("lowerdir+", home());
+  xsetfd("upperdir", *changes);
+  xsetfd("workdir", *work);
   Fd mnt = make_mount(*fsfd);
 
   xmnt_move(*mnt, *sandboxed_home);