2018-12-10 01:16:07 +00:00
|
|
|
kernel:
|
2022-06-01 10:39:40 +00:00
|
|
|
#image: nemunaire/kernel:5.10.62-0b705d955f5e283f62583c4e227d64a7924c138f-amd64
|
2024-01-29 13:26:29 +00:00
|
|
|
image: linuxkit/kernel:6.6.13
|
2018-12-10 01:16:07 +00:00
|
|
|
cmdline: "console=ttyS0 console=tty0"
|
|
|
|
|
|
|
|
|
|
|
|
init:
|
2024-03-24 10:42:11 +00:00
|
|
|
- nemunaire/mdadm:04814350d71ba9417e1f861be1685de26adf7a67
|
|
|
|
- linuxkit/metadata:v1.0.0
|
2020-01-30 18:00:46 +00:00
|
|
|
- alpine:latest
|
2018-12-10 01:16:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
files:
|
2020-01-30 18:00:46 +00:00
|
|
|
- path: /init
|
|
|
|
contents: |
|
|
|
|
#!/bin/sh -x
|
2022-06-02 09:40:43 +00:00
|
|
|
modprobe xhci_pci
|
|
|
|
modprobe ahci
|
|
|
|
modprobe megaraid_sas
|
|
|
|
modprobe e1000e
|
|
|
|
modprobe tg3
|
|
|
|
modprobe bnxt_en
|
|
|
|
|
|
|
|
echo -n "Waiting module loading... "
|
|
|
|
sleep 3
|
|
|
|
echo
|
|
|
|
|
2020-01-30 18:00:46 +00:00
|
|
|
mount -t devtmpfs none /dev
|
|
|
|
mount -t proc none /proc
|
|
|
|
mount -t sysfs none /sys
|
|
|
|
|
|
|
|
mdev -s
|
2022-06-02 09:40:43 +00:00
|
|
|
|
|
|
|
if [ -b /dev/sdb ]; then
|
|
|
|
mdadm --auto-detect
|
|
|
|
mdadm --assemble /dev/md2 /dev/sd*1
|
|
|
|
BOOT_PART=/dev/md2
|
2023-10-23 15:32:40 +00:00
|
|
|
META_PART=/dev/md3
|
2022-06-02 09:40:43 +00:00
|
|
|
else
|
|
|
|
BOOT_PART=/dev/sda1
|
2023-10-23 15:32:40 +00:00
|
|
|
META_PART=/dev/sda2
|
2022-06-02 09:40:43 +00:00
|
|
|
fi
|
2020-01-30 18:00:46 +00:00
|
|
|
|
|
|
|
ip link set eth0 up
|
2022-06-02 10:02:38 +00:00
|
|
|
udhcpc -i eth0
|
2020-01-30 18:00:46 +00:00
|
|
|
|
|
|
|
mkdir -p /boot
|
|
|
|
|
2022-06-02 10:02:38 +00:00
|
|
|
GW=$(ip r | grep default | awk '{ print $3 }')
|
|
|
|
|
2020-01-30 18:00:46 +00:00
|
|
|
# Wait e1000e launched
|
2022-06-02 10:02:38 +00:00
|
|
|
if ! ping -W 2 -c 1 "${GW}"
|
2020-01-30 18:00:46 +00:00
|
|
|
then
|
|
|
|
sleep 4
|
|
|
|
fi
|
|
|
|
|
2022-06-02 10:02:38 +00:00
|
|
|
while ! ping -W 10 -c 1 "${GW}"
|
2020-01-30 18:00:46 +00:00
|
|
|
do
|
2022-06-02 10:02:38 +00:00
|
|
|
echo "Unable to contact ${GW}"
|
2020-01-30 18:00:46 +00:00
|
|
|
echo "Exit the shell when connection established."
|
|
|
|
/bin/ash
|
|
|
|
done
|
|
|
|
|
2022-06-02 09:40:43 +00:00
|
|
|
mount "${BOOT_PART}" /boot/ &&
|
2023-10-23 15:32:40 +00:00
|
|
|
/root/update_imgs "${GW}" "${META_PART}" ||
|
2020-01-30 18:00:46 +00:00
|
|
|
/bin/ash
|
|
|
|
|
|
|
|
umount /boot &&
|
|
|
|
sync &&
|
|
|
|
reboot -f
|
|
|
|
|
|
|
|
/bin/ash
|
|
|
|
mode: "0755"
|
|
|
|
|
2018-12-10 01:16:07 +00:00
|
|
|
- path: root/update_imgs
|
|
|
|
source: configs/update_imgs.sh
|
|
|
|
mode: "0755"
|