Error messages

This commit is contained in:
Kroese 2023-04-20 05:09:38 +02:00 committed by GitHub
parent 2484782a0b
commit 18e38f9ef1

View File

@ -41,10 +41,8 @@ configureDHCP() {
# create dev file (there is no udev in container: need to be done manually) # create dev file (there is no udev in container: need to be done manually)
IFS=: read MAJOR MINOR < <(cat /sys/devices/virtual/net/${VM_NET_TAP}/tap*/dev) IFS=: read MAJOR MINOR < <(cat /sys/devices/virtual/net/${VM_NET_TAP}/tap*/dev)
if [[ "x${MAJOR}" != "x" ]]; then if (( MAJOR < 1)); then
echo "Info: Please make sure that the following docker setting is used: --device-cgroup-rule='c ${MAJOR}:* rwm'" echo "ERROR: Cannot find: sys/devices/virtual/net/${VM_NET_TAP}" && exit 18
else
echo "Info: Macvtap creation issue: Cannot find: /sys/class/net/${VM_NET_TAP}/" && exit 18
fi fi
[[ ! -e ${TAP_PATH} ]] && [[ -e /dev0/${TAP_PATH##*/} ]] && ln -s /dev0/${TAP_PATH##*/} ${TAP_PATH} [[ ! -e ${TAP_PATH} ]] && [[ -e /dev0/${TAP_PATH##*/} ]] && ln -s /dev0/${TAP_PATH##*/} ${TAP_PATH}
@ -53,11 +51,11 @@ configureDHCP() {
mknod ${TAP_PATH} c $MAJOR $MINOR && : || ("ERROR: Cannot mknod: ${TAP_PATH}" && exit 20) mknod ${TAP_PATH} c $MAJOR $MINOR && : || ("ERROR: Cannot mknod: ${TAP_PATH}" && exit 20)
fi fi
if ! exec 30>>$TAP_PATH; then if ! exec 30>>$TAP_PATH 2>/dev/null; then
echo "ERROR: Please add the following docker variable: --device-cgroup-rule='c ${MAJOR}:* rwm'" && exit 21 echo "ERROR: Please add the following docker variable to your container: --device-cgroup-rule='c ${MAJOR}:* rwm'" && exit 21
fi fi
if ! exec 40>>/dev/vhost-net; then if ! exec 40>>/dev/vhost-net 2>/dev/null; then
echo "ERROR: Cannot find vhost!" && exit 22 echo "ERROR: Cannot find vhost!" && exit 22
fi fi