Workaround to enable os facter

Treat yocto(Poky) as centos in facter and puppet modules. Fake the OS
release to CentOS 7. Obviously this must be removed prior to release.

TODO: enable facter and puppet OS required support on poky
This commit is contained in:
babak sarashki
2019-11-03 16:23:23 -08:00
parent ce578a3b0d
commit 40e88c8174
3 changed files with 20 additions and 0 deletions

View File

@@ -45,6 +45,11 @@ stx_postprocess_rootfs() {
done
cd $CPWD
# Fake being redhat for dev purpose only. This must be removed
cat > ${IMAGE_ROOTFS}/etc/redhat-release << \EOF
CentOS Linux release 7.3.1611 (Core)
EOF
cat > ${IMAGE_ROOTFS}/etc/build.info << \EOF
OS="poky"
SW_VERSION="19.01"

View File

@@ -0,0 +1,3 @@
FILESEXTRAPATHS_append := ":${THISDIR}/files:"
SRC_URI += " file://add_poky_lsbdistid.diff"

View File

@@ -0,0 +1,12 @@
diff -Nrupd a/lib/facter/operatingsystem/linux.rb b/lib/facter/operatingsystem/linux.rb
--- a/lib/facter/operatingsystem/linux.rb 2019-11-03 14:24:10.987872906 -0800
+++ b/lib/facter/operatingsystem/linux.rb 2019-11-03 14:25:31.222743152 -0800
@@ -13,6 +13,8 @@ module Facter
@operatingsystem ||= "Ubuntu"
elsif lsbdistid == "LinuxMint"
@operatingsystem ||= "LinuxMint"
+ elsif lsbdistid == "poky"
+ @operatingsystem ||= "CentOS"
else
@operatingsystem ||= get_operatingsystem_with_release_files
end