mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
feat: Allow installation on other architectures
This commit is contained in:
parent
58346cd6fc
commit
e10d5b9305
@ -10,11 +10,12 @@ DL="https://global.synologydownload.com/download/DSM"
|
|||||||
if [ -z "$URL" ]; then
|
if [ -z "$URL" ]; then
|
||||||
|
|
||||||
URL="$DL/release/7.2/64561/DSM_VirtualDSM_64561.pat"
|
URL="$DL/release/7.2/64561/DSM_VirtualDSM_64561.pat"
|
||||||
#URL="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
|
|
||||||
#URL="$DL/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat"
|
#URL="$DL/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ "$ARCH" != "amd64" ] && URL="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
|
||||||
|
|
||||||
# Check if output is to interactive TTY
|
# Check if output is to interactive TTY
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
PROGRESS="--progress=bar:noscroll"
|
PROGRESS="--progress=bar:noscroll"
|
||||||
@ -36,7 +37,7 @@ rm -rf "$TMP" && mkdir -p "$TMP"
|
|||||||
|
|
||||||
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
||||||
|
|
||||||
if [ ! -f "${RDC}" ]; then
|
if [ ! -f "${RDC}" ] && [ "$ARCH" == "amd64" ]; then
|
||||||
|
|
||||||
info "Install: Downloading installer..."
|
info "Install: Downloading installer..."
|
||||||
|
|
||||||
@ -68,14 +69,16 @@ if [ ! -f "${RDC}" ]; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ xz -dc <"$RDC" >"$TMP/rd" 2>/dev/null; rc=$?; } || :
|
if [ -f "${RDC}" ] && [ "$ARCH" == "amd64" ]; then
|
||||||
(( rc != 1 )) && error "Failed to unxz $RDC, reason $rc" && exit 91
|
|
||||||
|
|
||||||
{ (cd "$TMP" && cpio -idm <"$TMP/rd" 2>/dev/null); rc=$?; } || :
|
{ xz -dc <"$RDC" >"$TMP/rd" 2>/dev/null; rc=$?; } || :
|
||||||
(( rc != 0 )) && error "Failed to cpio $RDC, reason $rc" && exit 92
|
(( rc != 1 )) && error "Failed to unxz $RDC, reason $rc" && exit 91
|
||||||
|
|
||||||
mkdir -p /run/extract
|
{ (cd "$TMP" && cpio -idm <"$TMP/rd" 2>/dev/null); rc=$?; } || :
|
||||||
for file in $TMP/usr/lib/libcurl.so.4 \
|
(( rc != 0 )) && error "Failed to cpio $RDC, reason $rc" && exit 92
|
||||||
|
|
||||||
|
mkdir -p /run/extract
|
||||||
|
for file in $TMP/usr/lib/libcurl.so.4 \
|
||||||
$TMP/usr/lib/libmbedcrypto.so.5 \
|
$TMP/usr/lib/libmbedcrypto.so.5 \
|
||||||
$TMP/usr/lib/libmbedtls.so.13 \
|
$TMP/usr/lib/libmbedtls.so.13 \
|
||||||
$TMP/usr/lib/libmbedx509.so.1 \
|
$TMP/usr/lib/libmbedx509.so.1 \
|
||||||
@ -84,12 +87,14 @@ for file in $TMP/usr/lib/libcurl.so.4 \
|
|||||||
$TMP/usr/lib/libsynocodesign-ng-virtual-junior-wins.so.7 \
|
$TMP/usr/lib/libsynocodesign-ng-virtual-junior-wins.so.7 \
|
||||||
$TMP/usr/syno/bin/scemd; do
|
$TMP/usr/syno/bin/scemd; do
|
||||||
cp "$file" /run/extract/
|
cp "$file" /run/extract/
|
||||||
done
|
done
|
||||||
|
|
||||||
mv /run/extract/scemd /run/extract/syno_extract_system_patch
|
mv /run/extract/scemd /run/extract/syno_extract_system_patch
|
||||||
chmod +x /run/extract/syno_extract_system_patch
|
chmod +x /run/extract/syno_extract_system_patch
|
||||||
|
|
||||||
rm -rf "$TMP" && mkdir -p "$TMP"
|
rm -rf "$TMP" && mkdir -p "$TMP"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
info "Install: Downloading $(basename "$URL")..."
|
info "Install: Downloading $(basename "$URL")..."
|
||||||
|
|
||||||
@ -110,12 +115,18 @@ fi
|
|||||||
info "Install: Extracting downloaded image..."
|
info "Install: Extracting downloaded image..."
|
||||||
|
|
||||||
if { tar tf "$PAT"; } >/dev/null 2>&1; then
|
if { tar tf "$PAT"; } >/dev/null 2>&1; then
|
||||||
|
|
||||||
tar xpf "$PAT" -C "$TMP/."
|
tar xpf "$PAT" -C "$TMP/."
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
[ "$ARCH" != "amd64" ] && error "Wrong architecture: $ARCH" && exit 65
|
||||||
|
|
||||||
export LD_LIBRARY_PATH="/run/extract"
|
export LD_LIBRARY_PATH="/run/extract"
|
||||||
{ /run/extract/syno_extract_system_patch "$PAT" "$TMP/."; rc=$?; } || :
|
{ /run/extract/syno_extract_system_patch "$PAT" "$TMP/."; rc=$?; } || :
|
||||||
(( rc != 0 )) && error "Failed to extract PAT file, reason $rc" && exit 63
|
(( rc != 0 )) && error "Failed to extract PAT file, reason $rc" && exit 63
|
||||||
export LD_LIBRARY_PATH=""
|
export LD_LIBRARY_PATH=""
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HDA="$TMP/hda1"
|
HDA="$TMP/hda1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user