mirror of
				https://github.com/vdsm/virtual-dsm.git
				synced 2025-11-04 17:04:52 +08:00 
			
		
		
		
	feat: Multi-platform support
This commit is contained in:
		
							parent
							
								
									05b2a3f360
								
							
						
					
					
						commit
						ab35207bc4
					
				@ -11,11 +11,10 @@ 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.1.1/42962-1/DSM_VirtualDSM_42962.pat"
 | 
					  #URL="$DL/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat"
 | 
				
			||||||
 | 
					  #URL="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.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"
 | 
				
			||||||
@ -37,7 +36,7 @@ rm -rf "$TMP" && mkdir -p "$TMP"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[ "${DEBUG}" == [Yy1]* ]] && set -x
 | 
					[[ "${DEBUG}" == [Yy1]* ]] && set -x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ ! -f "${RDC}" ] && [ "$ARCH" == "amd64" ]; then
 | 
					if [ ! -f "${RDC}" ]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  info "Install: Downloading installer..."
 | 
					  info "Install: Downloading installer..."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -69,7 +68,7 @@ if [ ! -f "${RDC}" ] && [ "$ARCH" == "amd64" ]; then
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -f "${RDC}" ] && [ "$ARCH" == "amd64" ]; then
 | 
					if [ -f "${RDC}" ]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  { xz -dc <"$RDC" >"$TMP/rd" 2>/dev/null; rc=$?; } || :
 | 
					  { xz -dc <"$RDC" >"$TMP/rd" 2>/dev/null; rc=$?; } || :
 | 
				
			||||||
  (( rc != 1 )) && error "Failed to unxz $RDC, reason $rc" && exit 91
 | 
					  (( rc != 1 )) && error "Failed to unxz $RDC, reason $rc" && exit 91
 | 
				
			||||||
@ -89,6 +88,13 @@ if [ -f "${RDC}" ] && [ "$ARCH" == "amd64" ]; then
 | 
				
			|||||||
    cp "$file" /run/extract/
 | 
					    cp "$file" /run/extract/
 | 
				
			||||||
  done
 | 
					  done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if [ "$ARCH" != "amd64" ]; then
 | 
				
			||||||
 | 
					    mkdir -p /lib64/
 | 
				
			||||||
 | 
					    cp $TMP/usr/lib/libc.so.6 /lib64/
 | 
				
			||||||
 | 
					    cp $TMP/usr/lib/libpthread.so.0 /lib64/
 | 
				
			||||||
 | 
					    cp $TMP/usr/lib/ld-linux-x86-64.so.2 /lib64/
 | 
				
			||||||
 | 
					  fi  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -120,10 +126,27 @@ if { tar tf "$PAT"; } >/dev/null 2>&1; then
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  [ "$ARCH" != "amd64" ] && error "Wrong architecture: $ARCH" && exit 65
 | 
					  if [ "$ARCH" != "amd64" ]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    export DEBCONF_NOWARNINGS="yes"
 | 
				
			||||||
 | 
					    export DEBIAN_FRONTEND="noninteractive"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    apt-get -qq update
 | 
				
			||||||
 | 
					    apt-get -qq -y upgrade
 | 
				
			||||||
 | 
					    apt-get -qq --no-install-recommends -y install qemu-user > /dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    export DEBIAN_FRONTEND=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  export LD_LIBRARY_PATH="/run/extract"
 | 
					  export LD_LIBRARY_PATH="/run/extract"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if [ "$ARCH" == "amd64" ]; then
 | 
				
			||||||
    { /run/extract/syno_extract_system_patch "$PAT" "$TMP/."; rc=$?; } || :
 | 
					    { /run/extract/syno_extract_system_patch "$PAT" "$TMP/."; rc=$?; } || :
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    { qemu-x86_64 /run/extract/syno_extract_system_patch "$PAT" "$TMP/."; rc=$?; } || :
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (( 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=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user