2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 PACKAGES += " pxe-network-installer"
18 DEPENDS += " syslinux"
19 RDEPENDS_pxe-network-installer += " \
24 do_configure_prepend () {
28 do_compile_prepend () {
32 do_install_prepend () {
33 cd ${S}/installer/pxe-network-installer/pxe-network-installer
34 install -d -m 0755 ${D}/pxeboot
35 install -d -m 0755 ${D}/pxeboot/pxelinux.cfg.files
36 install -d -m 0755 ${D}/pxeboot/rel-${STX_REL}
37 install -d -m 0755 ${D}/pxeboot/rel-${STX_REL}/LiveOS/
38 install -d -m 0755 ${D}/pxeboot/EFI
39 install -d -m 0755 ${D}/pxeboot/EFI/stx_thud
40 install -d -m 0755 ${D}/${sbindir}
41 ln -fs /pxeboot/stx_thud ${D}/pxeboot/centos
42 ln -fs ${libdir}/grub/x86_64-efi ${D}/pxeboot/EFI/stx_thud/
45 if [ ! -z "${INSTALLER_IMG_DIR}" ]; then
46 install -m 0644 ${INSTALLER_IMG_DIR}/vmlinuz ${D}/pxeboot/stx_thud/rel-${STX_REL}/installer-bzImage_1.0
47 install -m 0644 ${INSTALLER_IMG_DIR}/initrd.img ${D}/pxeboot/stx_thud/rel-${STX_REL}/installer-intel-x86-64-initrd_1.0
48 install -m 0644 ${INSTALLER_IMG_DIR}/squashfs.img ${D}/pxeboot/stx_thud/rel-${STX_REL}/LiveOS/squashfs.img
49 ln -fs installer-bzImage_1.0 ${D}/pxeboot/rel-${STX_REL}/installer-bzImage
50 ln -fs installer-intel-x86-64-initrd_1.0 ${D}/pxeboot/rel-${STX_REL}/installer-initrd
53 install -m 755 pxeboot-update.sh ${D}/${sbindir}/pxeboot-update-${STX_REL}.sh
54 install -m 644 ${S}/bsp-files/kickstarts/post_clone_iso_ks.cfg ${D}/pxeboot/post_clone_iso_ks.cfg
55 install -m 644 default ${D}/pxeboot/pxelinux.cfg.files/default
56 install -m 644 default.static ${D}/pxeboot/pxelinux.cfg.files/default.static
57 install -m 644 centos-pxe-controller-install ${D}/pxeboot/pxelinux.cfg.files/pxe-controller-install-${STX_REL}
58 install -m 644 centos-pxe-worker-install ${D}/pxeboot/pxelinux.cfg.files/pxe-worker-install-${STX_REL}
59 install -m 644 centos-pxe-smallsystem-install ${D}/pxeboot/pxelinux.cfg.files/pxe-smallsystem-install-${STX_REL}
60 install -m 644 centos-pxe-storage-install ${D}/pxeboot/pxelinux.cfg.files/pxe-storage-install-${STX_REL}
61 install -m 644 centos-pxe-worker_lowlatency-install ${D}/pxeboot/pxelinux.cfg.files/pxe-worker_lowlatency-install-${STX_REL}
62 install -m 644 centos-pxe-smallsystem_lowlatency-install ${D}/pxeboot/pxelinux.cfg.files/pxe-smallsystem_lowlatency-install-${STX_REL}
65 install -m 644 pxe-grub.cfg ${D}/pxeboot/pxelinux.cfg.files/grub.cfg
66 install -m 644 pxe-grub.cfg.static ${D}/pxeboot/pxelinux.cfg.files/grub.cfg.static
68 # Copy EFI boot image. It will be used to create ISO on the Controller.
69 if [ ! -z "${INSTALLER_IMG_DIR}" ]; then
70 install -m 644 efiboot.img ${D}/pxeboot/rel-${STX_REL}/
72 install -m 644 efi-centos-pxe-controller-install ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-controller-install-${STX_REL}
73 install -m 644 efi-centos-pxe-worker-install ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-worker-install-${STX_REL}
74 install -m 644 efi-centos-pxe-smallsystem-install ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-smallsystem-install-${STX_REL}
75 install -m 644 efi-centos-pxe-storage-install ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-storage-install-${STX_REL}
76 install -m 644 efi-centos-pxe-worker_lowlatency-install ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-worker_lowlatency-install-${STX_REL}
77 install -m 644 efi-centos-pxe-smallsystem_lowlatency-install ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-smallsystem_lowlatency-install-${STX_REL}
79 sed -i "s/xxxSW_VERSIONxxx/${STX_REL}/g" ${D}/pxeboot/pxelinux.cfg.files/pxe-* ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-*
81 # Copy Titanium grub.cfg. It will be used to create ISO on the Controller.
82 install -m 0644 ${S}/bsp-files/grub.cfg ${D}/pxeboot/EFI/
83 # UEFI bootloader expect the grub.cfg file to be in /pxeboot/ so create a symlink for it
84 ln -fs pxelinux.cfg/grub.cfg ${D}/pxeboot/grub.cfg
87 pkg_postinst_ontarget_pxe-network_installer() {
88 install -m 0644 /usr/share/syslinux/menu.c32 /pxeboot
89 install -m 0644 /usr/share/syslinux/vesamenu.c32 /pxeboot
90 install -m 0644 /usr/share/syslinux/chain.c32 /pxeboot
91 install -m 0644 /usr/share/syslinux/linux.c32 /pxeboot
92 install -m 0644 /usr/share/syslinux/reboot.c32 /pxeboot
93 install -m 0644 /usr/share/syslinux/pxechn.c32 /pxeboot
94 install -m 0644 /usr/share/syslinux/pxelinux.0 /pxeboot
95 install -m 0644 /usr/share/syslinux/gpxelinux.0 /pxeboot
98 FILES_pxe-network-installer = " \
100 ${sbindir}/pxeboot-update-${STX_REL}.sh \