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
|
for img in fickit-kernel fickit-boot-initrd.img fickit-frontend-squashfs.img fickit-backend-squashfs.img fickit-update-initrd.img
|
||||||
do
|
do
|
||||||
wget -O "/boot/imgs/${img}" "10.10.10.6/${img}"
|
wget -O "/boot/imgs/${img}" "$1/${img}"
|
||||||
done
|
done
|
||||||
|
|
|
@ -47,8 +47,8 @@ files:
|
||||||
RAID=0
|
RAID=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ip a add 10.10.10.5/29 dev eth0
|
|
||||||
ip link set eth0 up
|
ip link set eth0 up
|
||||||
|
udhcpc -i eth0
|
||||||
|
|
||||||
# Try to detect backend/frontend setup
|
# Try to detect backend/frontend setup
|
||||||
if ip l | grep eth3 > /dev/null
|
if ip l | grep eth3 > /dev/null
|
||||||
|
@ -105,7 +105,7 @@ files:
|
||||||
do
|
do
|
||||||
/root/install_grub ${DEFAULT_BOOT} "${DISK}"
|
/root/install_grub ${DEFAULT_BOOT} "${DISK}"
|
||||||
done
|
done
|
||||||
/root/update_imgs
|
/root/update_imgs "$(ip r | grep default | awk '{ print $3 }')"
|
||||||
} ||
|
} ||
|
||||||
/bin/ash
|
/bin/ash
|
||||||
|
|
||||||
|
|
|
@ -38,26 +38,28 @@ files:
|
||||||
BOOT_PART=/dev/sda1
|
BOOT_PART=/dev/sda1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ip a add 10.10.10.5/29 dev eth0
|
|
||||||
ip link set eth0 up
|
ip link set eth0 up
|
||||||
|
udhcpc -i eth0
|
||||||
|
|
||||||
mkdir -p /boot
|
mkdir -p /boot
|
||||||
|
|
||||||
|
GW=$(ip r | grep default | awk '{ print $3 }')
|
||||||
|
|
||||||
# Wait e1000e launched
|
# Wait e1000e launched
|
||||||
if ! ping -W 2 -c 1 10.10.10.6
|
if ! ping -W 2 -c 1 "${GW}"
|
||||||
then
|
then
|
||||||
sleep 4
|
sleep 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while ! ping -W 10 -c 1 10.10.10.6
|
while ! ping -W 10 -c 1 "${GW}"
|
||||||
do
|
do
|
||||||
echo "Unable to contact 10.10.10.6"
|
echo "Unable to contact ${GW}"
|
||||||
echo "Exit the shell when connection established."
|
echo "Exit the shell when connection established."
|
||||||
/bin/ash
|
/bin/ash
|
||||||
done
|
done
|
||||||
|
|
||||||
mount "${BOOT_PART}" /boot/ &&
|
mount "${BOOT_PART}" /boot/ &&
|
||||||
/root/update_imgs ||
|
/root/update_imgs "${GW}" ||
|
||||||
/bin/ash
|
/bin/ash
|
||||||
|
|
||||||
umount /boot &&
|
umount /boot &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue