Intel-BMC/openbmc

Invalid texts in /etc/os-release

mine260309 opened this issue · 4 comments

Note on Bugs
The text in /etc/os-release contains invalid (or error) texts.

Unexpected behavior you saw

# cat /etc/os-release
ID="openbmc-phosphor"
NAME="Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro)"
VERSION="wht.0-0"
VERSION_ID="wht-0.0-0-d2bd6ff"
PRETTY_NAME="Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) wht.0-0"
BUILD_ID="fatal: not a git repository: '/extra/leiyu/work/intel-openbmc/meta-openbmc-mods/.git'"
OPENBMC_TARGET_MACHINE="intel-ast2500"
OPENBMC_VERSION="fatal: No names found, cannot describe anything."
IPMI_MAJOR="0"
IPMI_MINOR="0"
IPMI_AUX13="0x0"
IPMI_AUX14="0xfa"
IPMI_AUX15="0xta"
IPMI_AUX16="0xl:"

# Build Configuration Details

# REPOSITORY: intel-openbmc +++++++++++++++++++++++++++++++++++++++++++++++++++
# HEAD: c32415fd39e3ed18ef48073c02a75d82858fb21f
# TAG: fatal: No names found, cannot describe anything.
# STATUS: ## dev-intel-enable-rest-debug-tweak-on-0.53

# REPOSITORY: meta-openbmc-mods +++++++++++++++++++++++++++++++++++++++++++++++
# HEAD: fatal: not a git repository: '/extra/leiyu/work/intel-openbmc/meta-openbmc-mods/.git'
# TAG: fatal: not a git repository: '/extra/leiyu/work/intel-openbmc/meta-openbmc-mods/.git'
# STATUS: fatal: not a git repository: '/extra/leiyu/work/intel-openbmc/meta-openbmc-mods/.git'

Expected behavior
The file shall contain valid texts.

To Reproduce

  1. Clone intel-bmc/openbmc, with either intel or update branch.
  2. Build and flash to the CRB
  3. On the CRB's BMC, run cat /etc/os-release
  4. See error
cjia4 commented

Try to create a local git tag like "wht-0.01" in your git. The build script will fetch info from git and make it a part of os-release. creating a placeholder will help to eliminate the error text.

Try to create a local git tag like "wht-0.01" in your git. The build script will fetch info from git and make it a part of os-release. creating a placeholder will help to eliminate the error text.

No it does not work.
From the code in meta-openbmc-mods/meta-common/recipes-core/os-release/version-vars.inc, it's checking the git version and tag for meta-openbmc-mods instead of the openbmc tree.

    corebase = d.getVar('COREBASE', True)
    mibase = os.path.join(corebase, 'meta-openbmc-mods')
    obmc_vers = irun_git(d, corebase, 'describe --dirty --long')

Be noted that in Intel-BMC/openbmc, meta-openbmc-mods is not a git repo, and that explains why I see the incorrect output in os-release:

BUILD_ID="fatal: not a git repository: '/extra/leiyu/work/intel-openbmc/meta-openbmc-mods/.git'"
cjia4 commented

That explains. it is separate repo for meta-openbmc-mods from internal.

For quick workaround, you can just remove these git info. It is not required for open source repository.

For quick workaround, you can just remove these git info. It is not required for open source repository.

Yup that will be a workaround.
Could you kindly help to make a fix so that it works both in Intel internal and open sourced repo?
(Since this repo is expected to be a reference OpenBMC for Intel's x86 systems)