Round 338: Cgroups ext, Namespaces ext, Systemd-nspawn ext, Firejail ext, Bubblewrap ext (20 commands)

ober

d2609a12b0b5fd3bf50f5fe9697656c90d6e5ea1

diff --git a/docs/jemacs-vs-emacs.md b/docs/jemacs-vs-emacs.md
index c927acf..50584a0 100644
--- a/docs/jemacs-vs-emacs.md
+++ b/docs/jemacs-vs-emacs.md
@@ -4583,6 +4583,31 @@ No remaining Tier 1 gaps. All core editing, completion, and navigation features 
 | ebib-import-file | :orange_circle: | Import file into Ebib |
 | ebib-push-citation | :orange_circle: | Push Ebib citation to buffer |
 
+### Round 338 — Cgroups ext, Namespaces ext, Systemd-nspawn ext, Firejail ext, Bubblewrap ext
+
+| Feature | Status | Notes |
+|---|---|---|
+| cgroups-list | :orange_circle: | Cgroups: list control groups |
+| cgroups-tree | :orange_circle: | Cgroups: show cgroup tree |
+| cgroups-create | :orange_circle: | Cgroups: create a cgroup |
+| cgroups-move | :orange_circle: | Cgroups: move PID to cgroup |
+| namespaces-list | :orange_circle: | Namespaces: list all namespaces |
+| namespaces-enter | :orange_circle: | Namespaces: enter a namespace |
+| namespaces-create | :orange_circle: | Namespaces: create a namespace |
+| namespaces-pid | :orange_circle: | Namespaces: show for PID |
+| nspawn-boot | :orange_circle: | Nspawn: boot container |
+| nspawn-directory | :orange_circle: | Nspawn: run in directory |
+| nspawn-image | :orange_circle: | Nspawn: boot from image |
+| nspawn-network | :orange_circle: | Nspawn: configure networking |
+| firejail-run | :orange_circle: | Firejail: run sandboxed command |
+| firejail-profile | :orange_circle: | Firejail: use a profile |
+| firejail-list | :orange_circle: | Firejail: list sandboxed processes |
+| firejail-join | :orange_circle: | Firejail: join a sandbox |
+| bubblewrap-run | :orange_circle: | Bubblewrap: run sandboxed command |
+| bubblewrap-bind | :orange_circle: | Bubblewrap: bind a path |
+| bubblewrap-network | :orange_circle: | Bubblewrap: enable network |
+| bubblewrap-tmpfs | :orange_circle: | Bubblewrap: mount tmpfs |
+
 ### Round 337 — Ftrace ext, Irqbalance ext, Chrt ext, Ionice ext, Tuna ext
 
 | Feature | Status | Notes |
diff --git a/src/jerboa-emacs/editor-extra-final.ss b/src/jerboa-emacs/editor-extra-final.ss
index 569431f..9665861 100644
--- a/src/jerboa-emacs/editor-extra-final.ss
+++ b/src/jerboa-emacs/editor-extra-final.ss
@@ -24937,3 +24937,59 @@
     (echo-read-string echo "Tuna isolate CPU: "
       (lambda (cpu)
         (echo-message! echo (str "Tuna: isolating CPU " cpu))))))
+
+;;; Round 338 — Systemd-nspawn ext, Firejail ext, Bubblewrap ext (batch 2)
+
+(def (cmd-nspawn-image app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Nspawn image file: "
+      (lambda (img)
+        (echo-message! echo (str "Nspawn: booting from image " img))))))
+
+(def (cmd-nspawn-network app)
+  (let* ((echo (app-state-echo app)))
+    (echo-message! echo "Nspawn: configuring container networking")))
+
+(def (cmd-firejail-run app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Firejail command: "
+      (lambda (cmd)
+        (echo-message! echo (str "Firejail: running " cmd))))))
+
+(def (cmd-firejail-profile app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Firejail profile: "
+      (lambda (prof)
+        (echo-message! echo (str "Firejail: using profile " prof))))))
+
+(def (cmd-firejail-list app)
+  (let* ((echo (app-state-echo app)))
+    (echo-message! echo "Firejail: listing sandboxed processes")))
+
+(def (cmd-firejail-join app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Firejail join PID: "
+      (lambda (pid)
+        (echo-message! echo (str "Firejail: joining sandbox " pid))))))
+
+(def (cmd-bubblewrap-run app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Bubblewrap command: "
+      (lambda (cmd)
+        (echo-message! echo (str "Bubblewrap: running " cmd))))))
+
+(def (cmd-bubblewrap-bind app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Bubblewrap bind path: "
+      (lambda (path)
+        (echo-message! echo (str "Bubblewrap: binding " path))))))
+
+(def (cmd-bubblewrap-network app)
+  (let* ((echo (app-state-echo app)))
+    (echo-message! echo "Bubblewrap: enabling network in sandbox")))
+
+(def (cmd-bubblewrap-tmpfs app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Bubblewrap tmpfs mount point: "
+      (lambda (mnt)
+        (echo-message! echo (str "Bubblewrap: mounting tmpfs at " mnt))))))
diff --git a/src/jerboa-emacs/editor-extra-modes.ss b/src/jerboa-emacs/editor-extra-modes.ss
index b20ccea..49c2724 100644
--- a/src/jerboa-emacs/editor-extra-modes.ss
+++ b/src/jerboa-emacs/editor-extra-modes.ss
@@ -25632,3 +25632,59 @@
     (echo-read-string echo "Chrt FIFO priority (1-99): "
       (lambda (prio)
         (echo-message! echo (str "Chrt: setting FIFO priority " prio))))))
+
+;;; Round 338 — Cgroups ext, Namespaces ext, Systemd-nspawn ext, Firejail ext, Bubblewrap ext (batch 1)
+
+(def (cmd-cgroups-list app)
+  (let* ((echo (app-state-echo app)))
+    (echo-message! echo "Cgroups: listing control groups")))
+
+(def (cmd-cgroups-tree app)
+  (let* ((echo (app-state-echo app)))
+    (echo-message! echo "Cgroups: showing cgroup tree")))
+
+(def (cmd-cgroups-create app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Cgroup name: "
+      (lambda (name)
+        (echo-message! echo (str "Cgroups: creating cgroup " name))))))
+
+(def (cmd-cgroups-move app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Move PID to cgroup: "
+      (lambda (pid)
+        (echo-message! echo (str "Cgroups: moving PID " pid))))))
+
+(def (cmd-namespaces-list app)
+  (let* ((echo (app-state-echo app)))
+    (echo-message! echo "Namespaces: listing all namespaces")))
+
+(def (cmd-namespaces-enter app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Namespace PID: "
+      (lambda (pid)
+        (echo-message! echo (str "Namespaces: entering namespace of PID " pid))))))
+
+(def (cmd-namespaces-create app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Namespace type (mnt/net/pid/user): "
+      (lambda (type)
+        (echo-message! echo (str "Namespaces: creating " type " namespace"))))))
+
+(def (cmd-namespaces-pid app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Show namespaces for PID: "
+      (lambda (pid)
+        (echo-message! echo (str "Namespaces: showing for PID " pid))))))
+
+(def (cmd-nspawn-boot app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Nspawn container directory: "
+      (lambda (dir)
+        (echo-message! echo (str "Nspawn: booting container from " dir))))))
+
+(def (cmd-nspawn-directory app)
+  (let* ((echo (app-state-echo app)))
+    (echo-read-string echo "Nspawn directory: "
+      (lambda (dir)
+        (echo-message! echo (str "Nspawn: running in directory " dir))))))
diff --git a/src/jerboa-emacs/editor-extra-regs2.ss b/src/jerboa-emacs/editor-extra-regs2.ss
index 92a6853..7ce6c9e 100644
--- a/src/jerboa-emacs/editor-extra-regs2.ss
+++ b/src/jerboa-emacs/editor-extra-regs2.ss
@@ -8518,4 +8518,26 @@
   (register-command! 'tuna-irqs cmd-tuna-irqs)
   (register-command! 'tuna-threads cmd-tuna-threads)
   (register-command! 'tuna-isolate cmd-tuna-isolate)
+
+  ;; Round 338 — Cgroups ext, Namespaces ext, Systemd-nspawn ext, Firejail ext, Bubblewrap ext
+  (register-command! 'cgroups-list cmd-cgroups-list)
+  (register-command! 'cgroups-tree cmd-cgroups-tree)
+  (register-command! 'cgroups-create cmd-cgroups-create)
+  (register-command! 'cgroups-move cmd-cgroups-move)
+  (register-command! 'namespaces-list cmd-namespaces-list)
+  (register-command! 'namespaces-enter cmd-namespaces-enter)
+  (register-command! 'namespaces-create cmd-namespaces-create)
+  (register-command! 'namespaces-pid cmd-namespaces-pid)
+  (register-command! 'nspawn-boot cmd-nspawn-boot)
+  (register-command! 'nspawn-directory cmd-nspawn-directory)
+  (register-command! 'nspawn-image cmd-nspawn-image)
+  (register-command! 'nspawn-network cmd-nspawn-network)
+  (register-command! 'firejail-run cmd-firejail-run)
+  (register-command! 'firejail-profile cmd-firejail-profile)
+  (register-command! 'firejail-list cmd-firejail-list)
+  (register-command! 'firejail-join cmd-firejail-join)
+  (register-command! 'bubblewrap-run cmd-bubblewrap-run)
+  (register-command! 'bubblewrap-bind cmd-bubblewrap-bind)
+  (register-command! 'bubblewrap-network cmd-bubblewrap-network)
+  (register-command! 'bubblewrap-tmpfs cmd-bubblewrap-tmpfs)
 )