mirror of
https://github.com/kairos-io/osbuilder.git
synced 2025-07-17 00:31:09 +00:00
Add netboot script
This commit is contained in:
parent
82847a139d
commit
ebbd1c9a1a
@ -86,6 +86,7 @@ COPY ./arm /arm
|
|||||||
COPY ./gce.sh /gce.sh
|
COPY ./gce.sh /gce.sh
|
||||||
COPY ./raw-images.sh /raw-images.sh
|
COPY ./raw-images.sh /raw-images.sh
|
||||||
COPY ./azure.sh /azure.sh
|
COPY ./azure.sh /azure.sh
|
||||||
|
COPY ./netboot.sh /netboot.sh
|
||||||
|
|
||||||
COPY defaults.yaml /defaults.yaml
|
COPY defaults.yaml /defaults.yaml
|
||||||
|
|
||||||
|
25
tools-image/netboot.sh
Executable file
25
tools-image/netboot.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Extracts squashfs, kernel, initrd and generates a ipxe template script
|
||||||
|
|
||||||
|
ISO=$1
|
||||||
|
OUTPUT_NAME=$2
|
||||||
|
VERSION=$3
|
||||||
|
|
||||||
|
isoinfo -x /rootfs.squashfs -R -i $ISO > $OUTPUT_NAME.squashfs
|
||||||
|
isoinfo -x /boot/kernel -R -i $ISO > $OUTPUT_NAME-kernel
|
||||||
|
isoinfo -x /boot/initrd -R -i $ISO > $OUTPUT_NAME-initrd
|
||||||
|
|
||||||
|
RELEASE_URL=${RELEASE_URL:-https://github.com/kairos-io/kairos/releases/download}
|
||||||
|
|
||||||
|
cat > $OUTPUT_NAME.ipxe << EOF
|
||||||
|
#!ipxe
|
||||||
|
set url ${RELEASE_URL}/
|
||||||
|
set kernel $OUTPUT_NAME-kernel
|
||||||
|
set initrd $OUTPUT_NAME-initrd
|
||||||
|
set rootfs $OUTPUT_NAME.squashfs
|
||||||
|
# set config https://example.com/machine-config
|
||||||
|
# set cmdline extra.values=1
|
||||||
|
kernel \${url}/\${kernel} initrd=\${initrd} ip=dhcp rd.cos.disable root=live:\${url}/\${rootfs} netboot nodepair.enable config_url=\${config} console=tty1 console=ttyS0 \${cmdline}
|
||||||
|
initrd \${url}/\${initrd}
|
||||||
|
boot
|
||||||
|
EOF
|
Loading…
Reference in New Issue
Block a user