From 15dfc29882771fef01ff1744438871d29be72671 Mon Sep 17 00:00:00 2001 From: Babak Sarashki Date: Tue, 22 Sep 2020 19:45:37 -0700 Subject: [PATCH] stx-metal: set and limit checkouts to subpaths Signed-off-by: Babak Sarashki --- meta-stx-flock/stx-metal/inventory.bb | 3 +- meta-stx-flock/stx-metal/metal-common.inc | 9 ++++-- meta-stx-flock/stx-metal/mtce-common.bb | 3 +- meta-stx-flock/stx-metal/mtce-compute.bb | 3 +- meta-stx-flock/stx-metal/mtce-control.bb | 3 +- meta-stx-flock/stx-metal/mtce-storage.bb | 3 +- meta-stx-flock/stx-metal/mtce.bb | 4 +-- .../stx-metal/pxe-network-installer.bb | 28 ++++++++++++------- .../stx-metal/python-inventoryclient.bb | 3 +- 9 files changed, 31 insertions(+), 28 deletions(-) diff --git a/meta-stx-flock/stx-metal/inventory.bb b/meta-stx-flock/stx-metal/inventory.bb index 45c44b3..b767ee6 100644 --- a/meta-stx-flock/stx-metal/inventory.bb +++ b/meta-stx-flock/stx-metal/inventory.bb @@ -1,7 +1,6 @@ - require metal-common.inc -S = "${S_DIR}/inventory/inventory/" +SUBPATH0 = "inventory/inventory/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" diff --git a/meta-stx-flock/stx-metal/metal-common.inc b/meta-stx-flock/stx-metal/metal-common.inc index 105b9e6..0fe8fef 100644 --- a/meta-stx-flock/stx-metal/metal-common.inc +++ b/meta-stx-flock/stx-metal/metal-common.inc @@ -1,13 +1,16 @@ - DESCRIPTION = "stx-metal" STABLE = "starlingx/master" PROTOCOL = "https" BRANCH = "r/stx.3.0" +SRCNAME = "metal" SRCREV = "be3cf4eeb50eef55910cf9c73ea47c168005ad64" -S_DIR = "${WORKDIR}/git" +SRCREV_opendev = "be3cf4eeb50eef55910cf9c73ea47c168005ad64" +DESTSUFFIX = "${PN}-${PV}" PV = "1.0.0" -SRC_URI = "git://opendev.org/starlingx/metal.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH}" +SRC_URI = " \ + git://opendev.org/starlingx/${SRCNAME}.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH};destsuffix=${DESTSUFFIX};subpath=${SUBPATH0};name=opendev \ + " DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit" diff --git a/meta-stx-flock/stx-metal/mtce-common.bb b/meta-stx-flock/stx-metal/mtce-common.bb index 40436cd..7d554cf 100644 --- a/meta-stx-flock/stx-metal/mtce-common.bb +++ b/meta-stx-flock/stx-metal/mtce-common.bb @@ -1,7 +1,6 @@ - require metal-common.inc -S = "${S_DIR}/mtce-common/src/" +SUBPATH0 = "mtce-common/src/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" diff --git a/meta-stx-flock/stx-metal/mtce-compute.bb b/meta-stx-flock/stx-metal/mtce-compute.bb index f2bf558..ca05e46 100644 --- a/meta-stx-flock/stx-metal/mtce-compute.bb +++ b/meta-stx-flock/stx-metal/mtce-compute.bb @@ -1,7 +1,6 @@ - require metal-common.inc -S = "${S_DIR}/mtce-compute/src/" +SUBPATH0 = "mtce-compute/src/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" diff --git a/meta-stx-flock/stx-metal/mtce-control.bb b/meta-stx-flock/stx-metal/mtce-control.bb index 01ffc24..20084e7 100644 --- a/meta-stx-flock/stx-metal/mtce-control.bb +++ b/meta-stx-flock/stx-metal/mtce-control.bb @@ -1,7 +1,6 @@ - require metal-common.inc -S = "${S_DIR}/mtce-control/src/" +SUBPATH0 = "mtce-control/src/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" diff --git a/meta-stx-flock/stx-metal/mtce-storage.bb b/meta-stx-flock/stx-metal/mtce-storage.bb index 34e2d1b..fbaaa90 100644 --- a/meta-stx-flock/stx-metal/mtce-storage.bb +++ b/meta-stx-flock/stx-metal/mtce-storage.bb @@ -1,7 +1,6 @@ - require metal-common.inc -S = "${S_DIR}/mtce-storage/src/" +SUBPATH0 = "mtce-storage/src/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" diff --git a/meta-stx-flock/stx-metal/mtce.bb b/meta-stx-flock/stx-metal/mtce.bb index 3c67874..65f90b6 100644 --- a/meta-stx-flock/stx-metal/mtce.bb +++ b/meta-stx-flock/stx-metal/mtce.bb @@ -1,8 +1,6 @@ - require metal-common.inc -S = "${S_DIR}/mtce/src/" - +SUBPATH0 = "mtce/src/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" diff --git a/meta-stx-flock/stx-metal/pxe-network-installer.bb b/meta-stx-flock/stx-metal/pxe-network-installer.bb index b0ce70f..4eb95e6 100644 --- a/meta-stx-flock/stx-metal/pxe-network-installer.bb +++ b/meta-stx-flock/stx-metal/pxe-network-installer.bb @@ -1,7 +1,5 @@ - require metal-common.inc - -S = "${S_DIR}/installer/pxe-network-installer/pxe-network-installer" +SUBPATH0 = "installer/pxe-network-installer/pxe-network-installer" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" @@ -15,20 +13,30 @@ RDEPENDS_${PN}_append += " \ do_compile[noexec] = "1" +do_unpack_append() { + bb.build.exec_func('do_restore_files', d) +} + +do_restore_files() { + cd ${S} + git reset ${SRCREV} bsp-files/ + git checkout bsp-files +} + do_install() { install -d -m 0755 ${D}/pxeboot install -d -m 0755 ${D}/pxeboot/pxelinux.cfg.files install -d -m 0755 ${D}/pxeboot/rel-${STX_REL} install -d -m 0755 ${D}/pxeboot/EFI - install -d -m 0755 ${D}/pxeboot/EFI/poky-stx - ln -fs poky-stx ${D}/pxeboot/EFI/centos - ln -fs ${libdir}/grub/x86_64-efi ${D}/pxeboot/EFI/poky-stx/ - - install -d -m 0755 ${D}/${sbindir} + install -d -m 0755 ${D}/pxeboot/EFI/poky-stx + ln -fs poky-stx ${D}/pxeboot/EFI/centos + ln -fs ${libdir}/grub/x86_64-efi ${D}/pxeboot/EFI/poky-stx/ + + install -d -m 0755 ${D}/${sbindir} install -m 755 pxeboot-update.sh ${D}/${sbindir}/pxeboot-update-${STX_REL}.sh - install -m 644 ${S_DIR}/bsp-files/kickstarts/post_clone_iso_ks.cfg ${D}/pxeboot/post_clone_iso_ks.cfg + install -m 644 bsp-files/kickstarts/post_clone_iso_ks.cfg ${D}/pxeboot/post_clone_iso_ks.cfg install -m 644 default ${D}/pxeboot/pxelinux.cfg.files/default install -m 644 default.static ${D}/pxeboot/pxelinux.cfg.files/default.static @@ -56,7 +64,7 @@ do_install() { ${D}/pxeboot/pxelinux.cfg.files/pxe-* ${D}/pxeboot/pxelinux.cfg.files/efi-pxe-* # Copy Titanium grub.cfg. It will be used to create ISO on the Controller. - install -m 0644 ${S_DIR}/bsp-files/grub.cfg ${D}/pxeboot/EFI/ + install -m 0644 bsp-files/grub.cfg ${D}/pxeboot/EFI/ # UEFI bootloader expect the grub.cfg file to be in /pxeboot/ so create a symlink for it ln -fs pxelinux.cfg/grub.cfg ${D}/pxeboot/grub.cfg diff --git a/meta-stx-flock/stx-metal/python-inventoryclient.bb b/meta-stx-flock/stx-metal/python-inventoryclient.bb index 5025c05..067ed73 100644 --- a/meta-stx-flock/stx-metal/python-inventoryclient.bb +++ b/meta-stx-flock/stx-metal/python-inventoryclient.bb @@ -1,7 +1,6 @@ - require metal-common.inc -S = "${S_DIR}/python-inventoryclient/inventoryclient" +SUBPATH0 = "python-inventoryclient/inventoryclient" LICENSE = "Apache-2.0"