File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 8787INSTALL_DIR := ${DESTDIR}
8888endif
8989
90- IMAGE_BASE_DISTRO := $(shell cat /etc/os-release | grep "^ID=" | cut -d "=" -f2 | tr -d '"')
90+ # Assume the default distro if /etc/os-release is not present.
91+ ifeq ($(wildcard /etc/os-release) ,)
92+ IMAGE_BASE_DISTRO := $(DEFAULT_DISTRO)
93+ else
94+ IMAGE_BASE_DISTRO := $(shell cat /etc/os-release | grep "^ID=" | cut -d "=" -f2 | tr -d '"')
95+ endif
9196
9297# Host kernel info
9398KERNEL_REL := $(shell uname -r)
@@ -99,7 +104,7 @@ export KERNEL_REL
99104ifeq ($(IMAGE_BASE_DISTRO ) ,$(filter $(IMAGE_BASE_DISTRO ) ,centos fedora redhat almalinux rocky amzn) )
100105 IMAGE_BASE_RELEASE := $(shell cat /etc/os-release | grep "^VERSION_ID" | cut -d "=" -f2 | tr -d '"' | cut -d "." -f1)
101106 KERNEL_HEADERS := kernels/$(KERNEL_REL)
102- else
107+ else ifdef $(shell command -v lsb_release 2>/dev/null)
103108 IMAGE_BASE_RELEASE := $(shell cat /etc/os-release | grep "^VERSION_CODENAME" | cut -d "=" -f2)
104109 ifeq ($(IMAGE_BASE_DISTRO),linuxmint)
105110 IMAGE_BASE_DISTRO := ubuntu
You can’t perform that action at this time.
0 commit comments