Fix lcx creation for aarch64

This commit is contained in:
yalh76 2019-03-02 16:29:01 +01:00
parent ccfd928e55
commit f16dce149c

View file

@ -88,7 +88,13 @@ then # Si le conteneur existe déjà
fi fi
echo -e "\e[1m> Création d'une machine debian $DISTRIB minimaliste.\e[0m" | tee -a "$LOG_BUILD_LXC" echo -e "\e[1m> Création d'une machine debian $DISTRIB minimaliste.\e[0m" | tee -a "$LOG_BUILD_LXC"
sudo lxc-create -n $LXC_NAME -t debian -- -r $DISTRIB >> "$LOG_BUILD_LXC" 2>&1 uname=$(uname -m)
if [[ $uname =~ aarch64 ]]
then
sudo lxc-create -n $LXC_NAME -t debian -- -r $DISTRIB --arch=arm64 >> "$LOG_BUILD_LXC" 2>&1
else
sudo lxc-create -n $LXC_NAME -t debian -- -r $DISTRIB >> "$LOG_BUILD_LXC" 2>&1
fi
echo -e "\e[1m> Autoriser l'ip forwarding, pour router vers la machine virtuelle.\e[0m" | tee -a "$LOG_BUILD_LXC" echo -e "\e[1m> Autoriser l'ip forwarding, pour router vers la machine virtuelle.\e[0m" | tee -a "$LOG_BUILD_LXC"
echo "net.ipv4.ip_forward=1" | sudo tee /etc/sysctl.d/lxc_pchecker.conf >> "$LOG_BUILD_LXC" 2>&1 echo "net.ipv4.ip_forward=1" | sudo tee /etc/sysctl.d/lxc_pchecker.conf >> "$LOG_BUILD_LXC" 2>&1