Compare commits

..

8 Commits
v4.31 ... v4.33

Author SHA1 Message Date
Kroese
f0ce992a27 feat: Control device nodes #382
feat: Control device nodes #382
2023-11-17 15:16:36 +01:00
databreach
6334cfc8bc Control device nodes
Add control over whether device nodes are created.
2023-11-17 14:39:53 +01:00
Kroese
451a569617 fix: Remove unused vars
fix: Remove unused vars
2023-11-16 23:28:53 +01:00
Kroese
44d82d6544 fix: Remove unused vars 2023-11-16 23:28:12 +01:00
Kroese
618ec66401 fix: Remove size check
fix: Remove size check
2023-11-16 23:02:31 +01:00
Kroese
d24ae86c12 fix: Remove size check 2023-11-16 23:00:21 +01:00
Kroese
32db74e50d style: Tabs
style: Tabs
2023-11-16 21:59:03 +01:00
Kroese
503c89f08c style: Tabs 2023-11-16 21:57:43 +01:00
3 changed files with 26 additions and 28 deletions

View File

@@ -27,9 +27,7 @@ addDisk () {
local GB
local DIR
local REQ
local SIZE
local SPACE
local MIN_SIZE
local CUR_SIZE
local DATA_SIZE
local DISK_ID=$1
@@ -46,8 +44,7 @@ addDisk () {
DISK_SPACE=$(echo "${DISK_SPACE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
DATA_SIZE=$(numfmt --from=iec "${DISK_SPACE}")
MIN_SIZE=6442450944
if (( DATA_SIZE < MIN_SIZE )); then
if (( DATA_SIZE < 6442450944 )); then
error "Please increase ${DISK_DESC^^}_SIZE to at least 6 GB." && exit 83
fi
@@ -119,19 +116,6 @@ addDisk () {
fi
fi
# Check if file exists
if [ ! -f "${DISK_FILE}" ]; then
error "File for ${DISK_DESC} ($DISK_FILE) does not exist!" && exit 88
fi
fi
# Check the filesize
SIZE=$(stat -c%s "${DISK_FILE}")
if [[ SIZE -ne DATA_SIZE ]]; then
error "File for ${DISK_DESC} (${DISK_FILE}) has the wrong size: ${SIZE} bytes" && exit 89
fi
DISK_OPTS="${DISK_OPTS} \

View File

@@ -6,14 +6,14 @@ echo " For support visit https://github.com/vdsm/virtual-dsm/"
cd /run
. reset.sh # Initialize system
. install.sh # Run installation
. disk.sh # Initialize disks
. network.sh # Initialize network
. gpu.sh # Initialize graphics
. serial.sh # Initialize serialport
. power.sh # Configure shutdown
. config.sh # Configure arguments
. reset.sh # Initialize system
. install.sh # Run installation
. disk.sh # Initialize disks
. network.sh # Initialize network
. gpu.sh # Initialize graphics
. serial.sh # Initialize serialport
. power.sh # Configure shutdown
. config.sh # Configure arguments
trap - ERR

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -Eeuo pipefail
: ${DEV:='Y'} # Controls whether device nodes are created.
if [ -f "$STORAGE"/dsm.ver ]; then
BASE=$(cat "${STORAGE}/dsm.ver")
else
@@ -107,8 +109,14 @@ if [ -f "${RDC}" ]; then
{ xz -dc <"$RDC" >"$TMP/rd" 2>/dev/null; rc=$?; } || :
(( rc != 1 )) && error "Failed to unxz $RDC, reason $rc" && exit 91
{ (cd "$TMP" && cpio -idm <"$TMP/rd" 2>/dev/null); rc=$?; } || :
(( rc != 0 )) && error "Failed to cpio $RDC, reason $rc" && exit 92
if [[ "${DEV}" == [Nn]* ]]; then
# 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=$?; } || :
(( rc != 0 )) && error "Failed to extract $RDC, reason $rc" && exit 92
else
{ (cd "$TMP" && cpio -idm <"$TMP/rd" 2>/dev/null); rc=$?; } || :
(( rc != 0 )) && error "Failed to cpio $RDC, reason $rc" && exit 92
fi
mkdir -p /run/extract
for file in $TMP/usr/lib/libcurl.so.4 \
@@ -240,7 +248,13 @@ MOUNT="$TMP/system"
rm -rf "$MOUNT" && mkdir -p "$MOUNT"
mv "$HDA.tgz" "$HDA.txz"
tar xpfJ "$HDA.txz" --absolute-names -C "$MOUNT/"
if [[ "${DEV}" == [Nn]* ]]; then
# Exclude dev/ from tar extract
tar xpfJ "$HDA.txz" --absolute-names --exclude="dev" -C "$MOUNT/"
else
tar xpfJ "$HDA.txz" --absolute-names -C "$MOUNT/"
fi
[ -d "$PKG" ] && mv "$PKG/" "$MOUNT/.SynoUpgradePackages/"
rm -f "$MOUNT/.SynoUpgradePackages/ActiveInsight-"*