fickit: Use DHCP during preparation and update
This commit is contained in:
parent
b92b107efe
commit
722295989c
3 changed files with 10 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue