diff --git a/configs/update_imgs.sh b/configs/update_imgs.sh index a7b6dad6..eb56d978 100644 --- a/configs/update_imgs.sh +++ b/configs/update_imgs.sh @@ -4,5 +4,5 @@ mkdir -p /boot/imgs for img in fickit-kernel fickit-boot-initrd.img fickit-frontend-squashfs.img fickit-backend-squashfs.img fickit-update-initrd.img do - wget -O "/boot/imgs/${img}" "10.10.10.6/${img}" + wget -O "/boot/imgs/${img}" "$1/${img}" done diff --git a/fickit-prepare.yml b/fickit-prepare.yml index 53cd9fde..fb2ad01a 100644 --- a/fickit-prepare.yml +++ b/fickit-prepare.yml @@ -47,8 +47,8 @@ files: RAID=0 fi - ip a add 10.10.10.5/29 dev eth0 ip link set eth0 up + udhcpc -i eth0 # Try to detect backend/frontend setup if ip l | grep eth3 > /dev/null @@ -105,7 +105,7 @@ files: do /root/install_grub ${DEFAULT_BOOT} "${DISK}" done - /root/update_imgs + /root/update_imgs "$(ip r | grep default | awk '{ print $3 }')" } || /bin/ash diff --git a/fickit-update.yml b/fickit-update.yml index 0be7cf20..cdcf7b2b 100644 --- a/fickit-update.yml +++ b/fickit-update.yml @@ -38,26 +38,28 @@ files: BOOT_PART=/dev/sda1 fi - ip a add 10.10.10.5/29 dev eth0 ip link set eth0 up + udhcpc -i eth0 mkdir -p /boot + GW=$(ip r | grep default | awk '{ print $3 }') + # Wait e1000e launched - if ! ping -W 2 -c 1 10.10.10.6 + if ! ping -W 2 -c 1 "${GW}" then sleep 4 fi - while ! ping -W 10 -c 1 10.10.10.6 + while ! ping -W 10 -c 1 "${GW}" do - echo "Unable to contact 10.10.10.6" + echo "Unable to contact ${GW}" echo "Exit the shell when connection established." /bin/ash done mount "${BOOT_PART}" /boot/ && - /root/update_imgs || + /root/update_imgs "${GW}" || /bin/ash umount /boot &&