Skip to content

Commit 3500bed

Browse files
committed
repos: update multi-arch scripts
1 parent 444725e commit 3500bed

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

repos/patches/proxmox-backup/multi-arch.patch

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ new mode 100755
1010
+usr/lib/${DEB_HOST_MULTIARCH}/proxmox-backup/file-restore/proxmox-restore-daemon
1111
usr/share/man/man1/proxmox-file-restore.1
1212
usr/share/zsh/vendor-completions/_proxmox-file-restore
13+
diff --git a/debian/proxmox-backup-file-restore.postinst b/debian/proxmox-backup-file-restore.postinst
14+
--- a/debian/proxmox-backup-file-restore.postinst
15+
+++ b/debian/proxmox-backup-file-restore.postinst
16+
@@ -3,8 +3,12 @@
17+
set -e
18+
19+
update_initramfs() {
20+
+ case "$(dpkg --print-architecture)" in
21+
+ amd64) INST_PATH="/usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore" ;;
22+
+ arm64) INST_PATH="/usr/lib/aarch64-linux-gnu/proxmox-backup/file-restore" ;;
23+
+ esac
24+
+
25+
# regenerate initramfs for single file restore VM
26+
- INST_PATH="/usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore"
27+
CACHE_PATH="/var/cache/proxmox-backup/file-restore-initramfs.img"
28+
CACHE_PATH_DBG="/var/cache/proxmox-backup/file-restore-initramfs-debug.img"
29+
1330
diff --git a/debian/proxmox-backup-server.install b/debian/proxmox-backup-server.install
1431
old mode 100644
1532
new mode 100755
@@ -48,3 +65,48 @@ diff --git a/debian/rules b/debian/rules
4865

4966
include /usr/share/dpkg/pkg-info.mk
5067
include /usr/share/rustc/architecture.mk
68+
diff --git a/pbs-buildcfg/src/lib.rs b/pbs-buildcfg/src/lib.rs
69+
--- a/pbs-buildcfg/src/lib.rs
70+
+++ b/pbs-buildcfg/src/lib.rs
71+
@@ -52,12 +52,21 @@ macro_rules! PROXMOX_BACKUP_CACHE_DIR_M {
72+
}
73+
74+
#[macro_export]
75+
+#[cfg(target_arch = "x86_64")]
76+
macro_rules! PROXMOX_BACKUP_FILE_RESTORE_BIN_DIR_M {
77+
() => {
78+
"/usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore"
79+
};
80+
}
81+
82+
+#[macro_export]
83+
+#[cfg(target_arch = "aarch64")]
84+
+macro_rules! PROXMOX_BACKUP_FILE_RESTORE_BIN_DIR_M {
85+
+ () => {
86+
+ "/usr/lib/aarch64-linux-gnu/proxmox-backup/file-restore"
87+
+ };
88+
+}
89+
+
90+
/// namespaced directory for in-memory (tmpfs) run state
91+
pub const PROXMOX_BACKUP_RUN_DIR: &str = PROXMOX_BACKUP_RUN_DIR_M!();
92+
93+
diff --git a/src/tape/drive/lto/mod.rs b/src/tape/drive/lto/mod.rs
94+
--- a/src/tape/drive/lto/mod.rs
95+
+++ b/src/tape/drive/lto/mod.rs
96+
@@ -284,9 +284,14 @@ impl TapeDriver for LtoTapeHandle {
97+
}
98+
}
99+
100+
+#[cfg(target_arch = "x86_64")]
101+
+const SG_TAPE_PATH: &str = "/usr/lib/x86_64-linux-gnu/proxmox-backup/sg-tape-cmd";
102+
+
103+
+#[cfg(target_arch = "aarch64")]
104+
+const SG_TAPE_PATH: &str = "/usr/lib/aarch64-linux-gnu/proxmox-backup/sg-tape-cmd";
105+
+
106+
fn run_sg_tape_cmd(subcmd: &str, args: &[&str], fd: RawFd) -> Result<String, Error> {
107+
- let mut command =
108+
- std::process::Command::new("/usr/lib/x86_64-linux-gnu/proxmox-backup/sg-tape-cmd");
109+
+ let mut command = std::process::Command::new(SG_TAPE_PATH);
110+
command.args([subcmd]);
111+
command.args(["--stdin"]);
112+
command.args(args);

0 commit comments

Comments
 (0)