mirror of
				https://github.com/vdsm/virtual-dsm.git
				synced 2025-11-04 08:54:51 +08:00 
			
		
		
		
	Fixes
This commit is contained in:
		
							parent
							
								
									c483a65ddc
								
							
						
					
					
						commit
						10b149e689
					
				
							
								
								
									
										8
									
								
								run.sh
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								run.sh
									
									
									
									
									
								
							@ -18,11 +18,11 @@ if [ ! -f "$IMG/system.img" ]; then
 | 
				
			|||||||
    echo "Downloading Synology DSM from $URL..."
 | 
					    echo "Downloading Synology DSM from $URL..."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TMP="$IMG/tmp"
 | 
					    TMP="$IMG/tmp"
 | 
				
			||||||
 | 
					    FILE="$TMP/dsm.pat"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rm -rf $TMP
 | 
					    rm -rf $TMP
 | 
				
			||||||
    mkdir -p $TMP
 | 
					    mkdir -p $TMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FILE="$TMP/dsm.pat"
 | 
					 | 
				
			||||||
    rm -rf $FILE
 | 
					 | 
				
			||||||
    wget $URL -O $FILE -q --show-progress
 | 
					    wget $URL -O $FILE -q --show-progress
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    echo "Extracting DSM boot image..."
 | 
					    echo "Extracting DSM boot image..."
 | 
				
			||||||
@ -156,8 +156,6 @@ touch /var/lib/misc/udhcpd.leases
 | 
				
			|||||||
# Finally, start our DHCPD server
 | 
					# Finally, start our DHCPD server
 | 
				
			||||||
udhcpd -I $DUMMY_DHCPD_IP -f $DHCPD_CONF_FILE 2>&1 &
 | 
					udhcpd -I $DUMMY_DHCPD_IP -f $DHCPD_CONF_FILE 2>&1 &
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Launching Synology Serial Emulator..."
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Start the Serial Emulator
 | 
					# Start the Serial Emulator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HOST_SERIAL=$(/run/serial.sh)
 | 
					HOST_SERIAL=$(/run/serial.sh)
 | 
				
			||||||
@ -208,7 +206,7 @@ _graceful_shutdown() {
 | 
				
			|||||||
trap _graceful_shutdown SIGINT SIGTERM SIGHUP
 | 
					trap _graceful_shutdown SIGINT SIGTERM SIGHUP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# And run the VM! A brief explaination of the options here:
 | 
					# And run the VM! A brief explaination of the options here:
 | 
				
			||||||
# -enable-kvm: Use KVM for this VM (much faster for our case).
 | 
					# -accel=kvm: use KVM for this VM (much faster for our case).
 | 
				
			||||||
# -nographic: disable SDL graphics.
 | 
					# -nographic: disable SDL graphics.
 | 
				
			||||||
# -serial mon:stdio: use "monitored stdio" as our serial output.
 | 
					# -serial mon:stdio: use "monitored stdio" as our serial output.
 | 
				
			||||||
exec qemu-system-x86_64 -name Synology -m $RAM_SIZE -machine accel=kvm -cpu host -nographic -serial mon:stdio \
 | 
					exec qemu-system-x86_64 -name Synology -m $RAM_SIZE -machine accel=kvm -cpu host -nographic -serial mon:stdio \
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										32
									
								
								serial.sh
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								serial.sh
									
									
									
									
									
								
							@ -1,37 +1,7 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function random() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	printf "%06d" $(($RANDOM % 30000 + 1))
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function randomhex() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	val=$(($RANDOM % 255 + 1))
 | 
					 | 
				
			||||||
	echo "obase=16; $val" | bc
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function generateRandomLetter() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for i in a b c d e f g h j k l m n p q r s t v w x y z; do
 | 
					 | 
				
			||||||
		echo $i
 | 
					 | 
				
			||||||
	done | sort -R | tail -1
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function generateRandomValue() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h j k l m n p q r s t v w x y z; do
 | 
					 | 
				
			||||||
		echo $i
 | 
					 | 
				
			||||||
	done | sort -R | tail -1
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function toupper() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	echo $1 | tr '[:lower:]' '[:upper:]'
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
permanent="PSN"
 | 
					permanent="PSN"
 | 
				
			||||||
serialstart="1960"
 | 
					serialstart="1960"
 | 
				
			||||||
serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random)
 | 
					serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(printf "%06d" $(($RANDOM % 30000 + 1)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo $serialnum
 | 
					echo $serialnum
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user