public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup-restore-image] fix #4477: init: symlink busybox binaries on init
@ 2023-04-20 12:53 Max Carrara
  2023-05-17  9:34 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Max Carrara @ 2023-04-20 12:53 UTC (permalink / raw)
  To: pbs-devel

This change makes Busybox symbolically link its inbuilt utils to their
respective locations, allowing them to be invoked through their
absolute path. This means that Busybox inbuilts like e.g. `mount`
and `env` become available at `/bin/mount` and `/usr/bin/env` etc.

In particular, when entering any of the snapshot directories in
`.zfs/snapshot` (e.g. via `cd` or `ls`), ZFS normally mounts the
respective snapshot(s) on demand, using `/usr/bin/env mount [...]`
internally. Before this change, this would fail, rendering ZFS
snapshots unavailable when restoring individual files.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
---
 src/init-shim-rs/src/main.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/init-shim-rs/src/main.rs b/src/init-shim-rs/src/main.rs
index a6e093c..083c08f 100644
--- a/src/init-shim-rs/src/main.rs
+++ b/src/init-shim-rs/src/main.rs
@@ -31,6 +31,14 @@ fn main() {
         do_mknod("/dev/null", NULL_MAJ, NULL_MIN)
     });
 
+    // tell busybox to symlink its binaries
+    wrap_err("busybox --install -s", || {
+        Command::new("/bin/busybox")
+            .args(["--install", "-s"])
+            .spawn()?;
+        Ok(())
+    });
+
     if let Err(err) = run_agetty() {
         // not fatal
         println!("[init-shim] debug: agetty start failed: {}", err);
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup-restore-image] fix #4477: init: symlink busybox binaries on init
  2023-04-20 12:53 [pbs-devel] [PATCH proxmox-backup-restore-image] fix #4477: init: symlink busybox binaries on init Max Carrara
@ 2023-05-17  9:34 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-05-17  9:34 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Max Carrara

Am 20/04/2023 um 14:53 schrieb Max Carrara:
> This change makes Busybox symbolically link its inbuilt utils to their
> respective locations, allowing them to be invoked through their
> absolute path. This means that Busybox inbuilts like e.g. `mount`
> and `env` become available at `/bin/mount` and `/usr/bin/env` etc.
> 
> In particular, when entering any of the snapshot directories in
> `.zfs/snapshot` (e.g. via `cd` or `ls`), ZFS normally mounts the
> respective snapshot(s) on demand, using `/usr/bin/env mount [...]`
> internally. Before this change, this would fail, rendering ZFS
> snapshots unavailable when restoring individual files.
> 
> Signed-off-by: Max Carrara <m.carrara@proxmox.com>
> ---
>  src/init-shim-rs/src/main.rs | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-17  9:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-20 12:53 [pbs-devel] [PATCH proxmox-backup-restore-image] fix #4477: init: symlink busybox binaries on init Max Carrara
2023-05-17  9:34 ` [pbs-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal