Skip to content

Commit fb13e21

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

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@ 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,16 @@
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+
+ *)
24+
+ echo "proxmox-backup-file-restore: architecture not supported, skipping update." >&2
25+
+ exit 0
26+
+ ;;
27+
+ esac
28+
+
29+
# regenerate initramfs for single file restore VM
30+
- INST_PATH="/usr/lib/x86_64-linux-gnu/proxmox-backup/file-restore"
31+
CACHE_PATH="/var/cache/proxmox-backup/file-restore-initramfs.img"
32+
CACHE_PATH_DBG="/var/cache/proxmox-backup/file-restore-initramfs-debug.img"
33+
1334
diff --git a/debian/proxmox-backup-server.install b/debian/proxmox-backup-server.install
1435
old mode 100644
1536
new mode 100755
@@ -48,3 +69,48 @@ diff --git a/debian/rules b/debian/rules
4869

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

0 commit comments

Comments
 (0)