增加在sysroot中集成TSG-OS版本号的机制。

This commit is contained in:
Lu Qiuwen
2021-05-13 15:28:08 +08:00
parent ffc9303ff5
commit 3f2915e983
3 changed files with 17 additions and 10 deletions

View File

@@ -44,12 +44,13 @@ OS_BUILD_TIME := $(subst :,$e,$(OS_BUILD_TIME))
OS_BUILD_TIME := $(subst T,$e,$(OS_BUILD_TIME))
OS_BUILD_TIME := $(subst Z,$e,$(OS_BUILD_TIME))
OS_BUILD_TIME := $(subst ",$e,$(OS_BUILD_TIME))
OS_BUILD_TIME := $(subst +,$e,$(OS_BUILD_TIME))
OS_BUILD_HASH := $(subst ",$e,$(VCS_SHORT_HASH))
OS_BUILD_TAG := $(subst ",$e,$(VCS_TAG))
ifeq ($(OS_BUILD_TAG),)
OS_BUILD_TAG := UN-$(OS_BUILD_TIME)
OS_BUILD_TAG := $(OS_BUILD_TIME)
endif
ifdef DALIY_BUILD_VERSION

View File

@@ -1,18 +1,19 @@
PROFILE_ID := 9000-NPB-P01R01
SUPPORTED_MACHINE_ID := 9000-NPB-P01R01
CHROOT_PKG := tsg-os-${OS_RELEASE_VER}-${PROFILE_ID}-chroot.tar.bz2
CHROOT_BIN := tsg-os-${OS_RELEASE_VER}-${PROFILE_ID}-ONIE.bin
TARGET_BUILD_DIR := $(BUILDDIR_BASE)/$(PROFILE_ID)
TARGET_INSTALLER_DIR := $(TARGET_BUILD_DIR)/installer
TARGET_SYSROOT_DIR := $(TARGET_BUILD_DIR)/sysroot
KERNEL_ARGS := console=ttyS0,115200n8 crashkernel=auto intel_iommu=on iommu=pt pci=realloc,assign-busses isolcpus=1,14-27,42-55
GRUB_SERIAL_COMMAND :=
SIZE_PART_SYSROOT := 65536M
SIZE_PART_DATA := 4096M
PROFILE_ID_IN_SHORT := $(subst -,$e,$(PROFILE_ID))
CHROOT_PKG := tsg-os-${OS_RELEASE_VER}-${PROFILE_ID_IN_SHORT}-chroot.tar.bz2
CHROOT_BIN := tsg-os-${OS_RELEASE_VER}-${PROFILE_ID_IN_SHORT}-ONIE.bin
TARGET_BUILD_DIR := $(BUILDDIR_BASE)/$(PROFILE_ID)
TARGET_INSTALLER_DIR := $(TARGET_BUILD_DIR)/installer
TARGET_SYSROOT_DIR := $(TARGET_BUILD_DIR)/sysroot
.PHONY: all builddir installer sysroot-base sysroot-ansible sysroot-cleanup sysroot-archive sysroot-binary clean
all: sysroot-binary
@@ -38,7 +39,12 @@ installer: builddir
sysroot-base: builddir
$(TOOLSDIR)/mk-base-image $(CONFDIR)/yum.conf $(TARGET_SYSROOT_DIR) $(PROJECTDIR)
sysroot-ansible: sysroot-base
sysroot-verfile: sysroot-base
sed -i -e "s/^NAME=.*/NAME=\"TSG-OS\"/" $(TARGET_SYSROOT_DIR)/usr/lib/os-release
sed -i -e "s/^VERSION=.*/VERSION=\"$(OS_RELEASE_VER) ($(PROFILE_ID_IN_SHORT))\"/" $(TARGET_SYSROOT_DIR)/usr/lib/os-release
sed -i -e "s/^PRETTY_NAME=.*/PRETTY_NAME=\"TSG-OS v$(OS_RELEASE_VER) ($(PROFILE_ID_IN_SHORT))\"/" $(TARGET_SYSROOT_DIR)/usr/lib/os-release
sysroot-ansible: sysroot-verfile sysroot-base
$(TOOLSDIR)/ansible-stage-one $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR)
sysroot-cleanup:

View File

@@ -21,7 +21,7 @@ locak_package_to_install="$projectdir/package/kernel-lt-$kernel_version.rpm
setopt="group_package_types=mandatory,default,optional"
yum -c "$yum_config" --installroot="$target" -y --setopt=$setopt install $package_to_install
yum -c "$yum_config" --installroot="$target" -y --setopt=$setopt install $locak_package_to_install
yum -c "$yum_config" --installroot="$target" -y --setopt=$setopt localinstall $locak_package_to_install
cat > "$target"/etc/sysconfig/network <<EOF
NETWORKING=yes