add ability to set torrent per kernel parameter

This commit is contained in:
Simon Bruder 2018-02-14 14:11:05 +00:00
parent f4eddb83ad
commit 926f578092
2 changed files with 8 additions and 2 deletions

View file

@ -70,6 +70,9 @@ for x in "$@"; do
partsize)
partsize="$(echo $x | cut -d= -f2)"
;;
torrent)
torrent="$(echo $x | cut -d= -f2)"
;;
qemu)
qemu="$(echo $x | cut -d= -f2)"
;;
@ -87,6 +90,9 @@ fi
if [ -z $partsize ];then
error_fatal "The partsize parameter is missing"
fi
if [ -z $torrent ];then
error_fatal "The torrent parameter is missing"
fi
print_done
##
@ -172,7 +178,7 @@ echo '
# --summary-interval=0: do not show summary while downloading
# --console-log-level=error: Only show errors
# --dht-file-path=dht.dat: use generated dht data file and do not complain
aria2c --allow-overwrite --check-integrity --seed-time=0 --summary-interval=0 --console-log-level=error --dht-file-path=dht.dat 'http://10.2.2.1:8081/rootfs.torrent'
aria2c --allow-overwrite --check-integrity --seed-time=0 --summary-interval=0 --console-log-level=error --dht-file-path=dht.dat $torrent
rm dht.dat
print_done

View file

@ -16,7 +16,7 @@ qemu-system-x86_64 \
-kernel vmlinuz \
-initrd initrd.gz \
-drive format=raw,file=pladde.img \
-append "disk=/dev/sda root=/dev/sda1 partsize=3072 qemu" \
-append "disk=/dev/sda root=/dev/sda1 partsize=3072 torrent=http://10.2.2.1:8081/rootfs.torrent qemu quiet" \
-curses \
-enable-kvm \
-m 1G \