Loading run/disk.sh +44 −14 Original line number Diff line number Diff line Loading @@ -9,8 +9,6 @@ set -Eeuo pipefail : ${DISK_ROTATION:='1'} # Rotation rate, set to 1 for SSD storage and increase for HDD BOOT="$STORAGE/boot.img" [ ! -f "$BOOT" ] && echo "ERROR: Boot image does not exist ($BOOT)" && exit 81 DATA="${STORAGE}/data.img" DISK_SIZE=$(echo "${DISK_SIZE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g') DATA_SIZE=$(numfmt --from=iec "${DISK_SIZE}") Loading Loading @@ -120,42 +118,74 @@ if [[ SIZE -ne DATA_SIZE ]]; then error "Virtual disk has the wrong size: ${SIZE}" && exit 89 fi DISK_OPTS="\ DISK_OPTS="" if [ -f "$BOOT" ]; then DISK_OPTS="${DISK_OPTS} \ -drive id=cdrom0,if=none,format=raw,readonly=on,file=${BOOT} \ -device virtio-scsi-pci,id=scsi0 \ -device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=9 \ -device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=9" fi DISK_OPTS="${DISK_OPTS} \ -device virtio-scsi-pci,id=hw-userdata,bus=pcie.0,addr=0xa \ -drive file=${DATA},if=none,id=drive-userdata,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ -device scsi-hd,bus=hw-userdata.0,channel=0,scsi-id=0,lun=0,drive=drive-userdata,id=userdata0,rotation_rate=${DISK_ROTATION},bootindex=1" : ${DISK2_SIZE:=''} EXTRA_SIZE=DISK2_SIZE EXTRA_DISK="/storage2/data.img" if [ -f "${EXTRA_DISK}" ]; then if [ -d "$(dirname "${EXTRA_DISK}")" ]; then if [ ! -f "${EXTRA_DISK}" ]; then [ -z "$EXTRA_SIZE" ] && EXTRA_SIZE="16G" if ! truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}"; then error "Could not create the file for the second disk." && exit 53 fi fi if [ -n "$EXTRA_SIZE" ]; then CUR_SIZE=$(stat -c%s "${EXTRA_DISK}") DATA_SIZE=$(numfmt --from=iec "${EXTRA_SIZE}") if [ "$DATA_SIZE" -gt "$CUR_SIZE" ]; then truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}" fi fi DISK_OPTS="${DISK_OPTS} \ -device virtio-scsi-pci,id=hw-userdata2,bus=pcie.0,addr=0xd \ -drive file=${EXTRA_DISK},if=none,id=drive-userdata2,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ -device scsi-hd,bus=hw-userdata2.0,channel=0,scsi-id=0,lun=0,drive=drive-userdata2,id=userdata2,rotation_rate=${DISK_ROTATION},bootindex=4" else [ -d "$(dirname "${EXTRA_DISK}")" ] && error "Disk image ${EXTRA_DISK} does not exist! Please supply an empty file of at least 6 GB." && exit 53 fi : ${DISK3_SIZE:=''} EXTRA_SIZE=DISK3_SIZE EXTRA_DISK="/storage3/data.img" if [ -f "${EXTRA_DISK}" ]; then if [ -d "$(dirname "${EXTRA_DISK}")" ]; then if [ ! -f "${EXTRA_DISK}" ]; then [ -z "$EXTRA_SIZE" ] && EXTRA_SIZE="16G" if ! truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}"; then error "Could not create the file for the third disk." && exit 54 fi fi if [ -n "$EXTRA_SIZE" ]; then CUR_SIZE=$(stat -c%s "${EXTRA_DISK}") DATA_SIZE=$(numfmt --from=iec "${EXTRA_SIZE}") if [ "$DATA_SIZE" -gt "$CUR_SIZE" ]; then truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}" fi fi DISK_OPTS="${DISK_OPTS} \ -device virtio-scsi-pci,id=hw-userdata3,bus=pcie.0,addr=0xe \ -drive file=${EXTRA_DISK},if=none,id=drive-userdata3,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ -device scsi-hd,bus=hw-userdata3.0,channel=0,scsi-id=0,lun=0,drive=drive-userdata3,id=userdata3,rotation_rate=${DISK_ROTATION},bootindex=5" else [ -d "$(dirname "${EXTRA_DISK}")" ] && error "Disk image ${EXTRA_DISK} does not exist! Please supply an empty file of at least 6 GB." && exit 54 fi : ${DEVICE:=''} # Docker variable to passthrough a block device, like /dev/vdc1. Loading run/network.sh +5 −1 Original line number Diff line number Diff line Loading @@ -232,8 +232,12 @@ fi if [[ "${DHCP}" == [Yy1]* ]]; then if [[ "$GATEWAY" == "172."* ]]; then if [[ "${DEBUG}" == [Yy1]* ]]; then info "Warning: Are you sure the container is on a macvlan network?" else error "You can only enable DHCP while the container is on a macvlan network!" && exit 86 fi fi # Configuration for DHCP IP configureDHCP Loading Loading
run/disk.sh +44 −14 Original line number Diff line number Diff line Loading @@ -9,8 +9,6 @@ set -Eeuo pipefail : ${DISK_ROTATION:='1'} # Rotation rate, set to 1 for SSD storage and increase for HDD BOOT="$STORAGE/boot.img" [ ! -f "$BOOT" ] && echo "ERROR: Boot image does not exist ($BOOT)" && exit 81 DATA="${STORAGE}/data.img" DISK_SIZE=$(echo "${DISK_SIZE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g') DATA_SIZE=$(numfmt --from=iec "${DISK_SIZE}") Loading Loading @@ -120,42 +118,74 @@ if [[ SIZE -ne DATA_SIZE ]]; then error "Virtual disk has the wrong size: ${SIZE}" && exit 89 fi DISK_OPTS="\ DISK_OPTS="" if [ -f "$BOOT" ]; then DISK_OPTS="${DISK_OPTS} \ -drive id=cdrom0,if=none,format=raw,readonly=on,file=${BOOT} \ -device virtio-scsi-pci,id=scsi0 \ -device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=9 \ -device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=9" fi DISK_OPTS="${DISK_OPTS} \ -device virtio-scsi-pci,id=hw-userdata,bus=pcie.0,addr=0xa \ -drive file=${DATA},if=none,id=drive-userdata,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ -device scsi-hd,bus=hw-userdata.0,channel=0,scsi-id=0,lun=0,drive=drive-userdata,id=userdata0,rotation_rate=${DISK_ROTATION},bootindex=1" : ${DISK2_SIZE:=''} EXTRA_SIZE=DISK2_SIZE EXTRA_DISK="/storage2/data.img" if [ -f "${EXTRA_DISK}" ]; then if [ -d "$(dirname "${EXTRA_DISK}")" ]; then if [ ! -f "${EXTRA_DISK}" ]; then [ -z "$EXTRA_SIZE" ] && EXTRA_SIZE="16G" if ! truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}"; then error "Could not create the file for the second disk." && exit 53 fi fi if [ -n "$EXTRA_SIZE" ]; then CUR_SIZE=$(stat -c%s "${EXTRA_DISK}") DATA_SIZE=$(numfmt --from=iec "${EXTRA_SIZE}") if [ "$DATA_SIZE" -gt "$CUR_SIZE" ]; then truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}" fi fi DISK_OPTS="${DISK_OPTS} \ -device virtio-scsi-pci,id=hw-userdata2,bus=pcie.0,addr=0xd \ -drive file=${EXTRA_DISK},if=none,id=drive-userdata2,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ -device scsi-hd,bus=hw-userdata2.0,channel=0,scsi-id=0,lun=0,drive=drive-userdata2,id=userdata2,rotation_rate=${DISK_ROTATION},bootindex=4" else [ -d "$(dirname "${EXTRA_DISK}")" ] && error "Disk image ${EXTRA_DISK} does not exist! Please supply an empty file of at least 6 GB." && exit 53 fi : ${DISK3_SIZE:=''} EXTRA_SIZE=DISK3_SIZE EXTRA_DISK="/storage3/data.img" if [ -f "${EXTRA_DISK}" ]; then if [ -d "$(dirname "${EXTRA_DISK}")" ]; then if [ ! -f "${EXTRA_DISK}" ]; then [ -z "$EXTRA_SIZE" ] && EXTRA_SIZE="16G" if ! truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}"; then error "Could not create the file for the third disk." && exit 54 fi fi if [ -n "$EXTRA_SIZE" ]; then CUR_SIZE=$(stat -c%s "${EXTRA_DISK}") DATA_SIZE=$(numfmt --from=iec "${EXTRA_SIZE}") if [ "$DATA_SIZE" -gt "$CUR_SIZE" ]; then truncate -s "${EXTRA_SIZE}" "${EXTRA_DISK}" fi fi DISK_OPTS="${DISK_OPTS} \ -device virtio-scsi-pci,id=hw-userdata3,bus=pcie.0,addr=0xe \ -drive file=${EXTRA_DISK},if=none,id=drive-userdata3,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ -device scsi-hd,bus=hw-userdata3.0,channel=0,scsi-id=0,lun=0,drive=drive-userdata3,id=userdata3,rotation_rate=${DISK_ROTATION},bootindex=5" else [ -d "$(dirname "${EXTRA_DISK}")" ] && error "Disk image ${EXTRA_DISK} does not exist! Please supply an empty file of at least 6 GB." && exit 54 fi : ${DEVICE:=''} # Docker variable to passthrough a block device, like /dev/vdc1. Loading
run/network.sh +5 −1 Original line number Diff line number Diff line Loading @@ -232,8 +232,12 @@ fi if [[ "${DHCP}" == [Yy1]* ]]; then if [[ "$GATEWAY" == "172."* ]]; then if [[ "${DEBUG}" == [Yy1]* ]]; then info "Warning: Are you sure the container is on a macvlan network?" else error "You can only enable DHCP while the container is on a macvlan network!" && exit 86 fi fi # Configuration for DHCP IP configureDHCP Loading