pxe: simplify and avoid error

This commit is contained in:
pedro 2024-09-25 13:45:54 -03:00
parent c2848c265a
commit 6bb491ce1c
1 changed files with 5 additions and 8 deletions

View File

@ -53,12 +53,6 @@ tftp-root=${tftp_path}
END END
} }
extract_live_parts_for_tftp() {
cp -fv "${PXE_DIR}/../iso/staging/live/vmlinuz" "${tftp_path}/"
cp -fv "${PXE_DIR}/../iso/staging/live/initrd" "${tftp_path}/"
rsync -av "${PXE_DIR}/../iso/staging/live/filesystem.squashfs" "${nfs_path}/live/"
}
install_netboot() { install_netboot() {
# if you want to refresh install, remove or move dir # if you want to refresh install, remove or move dir
if [ ! -d "${tftp_path}" ] || [ "${FORCE:-}" ]; then if [ ! -d "${tftp_path}" ] || [ "${FORCE:-}" ]; then
@ -70,7 +64,10 @@ install_netboot() {
rm -rf "${tftp_path}/pxelinux.cfg" rm -rf "${tftp_path}/pxelinux.cfg"
mkdir -p "${tftp_path}/pxelinux.cfg" mkdir -p "${tftp_path}/pxelinux.cfg"
fi fi
extract_live_parts_for_tftp
cp -fv "${PXE_DIR}/../iso/staging/live/vmlinuz" "${tftp_path}/"
cp -fv "${PXE_DIR}/../iso/staging/live/initrd" "${tftp_path}/"
rsync -av "${PXE_DIR}/../iso/staging/live/filesystem.squashfs" "${nfs_path}/live/"
cat > "${tftp_path}/pxelinux.cfg/default" <<END cat > "${tftp_path}/pxelinux.cfg/default" <<END
default wb default wb
@ -103,9 +100,9 @@ init_config() {
main() { main() {
init_config init_config
install_dependencies install_dependencies
install_netboot
install_tftp install_tftp
install_nfs install_nfs
install_netboot
echo "PXE: Installation finished" echo "PXE: Installation finished"
} }