mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
fix: Variables
This commit is contained in:
parent
f0ce992a27
commit
3113e2b64e
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
: ${DEV:='Y'} # Controls whether device nodes are created.
|
: ${URL:=''} # URL of the PAT file to be downloaded.
|
||||||
|
: ${DEV:='Y'} # Controls whether device nodes are created.
|
||||||
|
|
||||||
if [ -f "$STORAGE"/dsm.ver ]; then
|
if [ -f "$STORAGE"/dsm.ver ]; then
|
||||||
BASE=$(cat "${STORAGE}/dsm.ver")
|
BASE=$(cat "${STORAGE}/dsm.ver")
|
||||||
@ -10,7 +11,6 @@ else
|
|||||||
BASE="DSM_VirtualDSM_42962"
|
BASE="DSM_VirtualDSM_42962"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${URL:=''}
|
|
||||||
[ -n "$URL" ] && BASE=$(basename "$URL" .pat)
|
[ -n "$URL" ] && BASE=$(basename "$URL" .pat)
|
||||||
|
|
||||||
if [[ -f "$STORAGE/$BASE.boot.img" ]] && [[ -f "$STORAGE/$BASE.system.img" ]]; then
|
if [[ -f "$STORAGE/$BASE.boot.img" ]] && [[ -f "$STORAGE/$BASE.system.img" ]]; then
|
||||||
@ -112,12 +112,12 @@ if [ -f "${RDC}" ]; then
|
|||||||
if [[ "${DEV}" == [Nn]* ]]; then
|
if [[ "${DEV}" == [Nn]* ]]; then
|
||||||
# Exclude dev/ from cpio extract
|
# Exclude dev/ from cpio extract
|
||||||
{ (cd "$TMP" && cpio -it < "$TMP/rd" | grep -Ev 'dev/' | while read -r entry; do cpio -idm "$entry" < "$TMP/rd" 2>/dev/null; done); rc=$?; } || :
|
{ (cd "$TMP" && cpio -it < "$TMP/rd" | grep -Ev 'dev/' | while read -r entry; do cpio -idm "$entry" < "$TMP/rd" 2>/dev/null; done); rc=$?; } || :
|
||||||
(( rc != 0 )) && error "Failed to extract $RDC, reason $rc" && exit 92
|
|
||||||
else
|
else
|
||||||
{ (cd "$TMP" && cpio -idm <"$TMP/rd" 2>/dev/null); rc=$?; } || :
|
{ (cd "$TMP" && cpio -idm <"$TMP/rd" 2>/dev/null); rc=$?; } || :
|
||||||
(( rc != 0 )) && error "Failed to cpio $RDC, reason $rc" && exit 92
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
(( rc != 0 )) && error "Failed to extract $RDC, reason $rc" && exit 92
|
||||||
|
|
||||||
mkdir -p /run/extract
|
mkdir -p /run/extract
|
||||||
for file in $TMP/usr/lib/libcurl.so.4 \
|
for file in $TMP/usr/lib/libcurl.so.4 \
|
||||||
$TMP/usr/lib/libmbedcrypto.so.5 \
|
$TMP/usr/lib/libmbedcrypto.so.5 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user