Skip to content

Commit cf4832b

Browse files
committed
Use /etc/os-release as alternative when lsb_release is not available
Extract the OS/release information This is not 100% doable with /etc/os-release only. The Debian difference between Release & Codename is not shown in the official containers for example. See: https://hub.docker.com/_/debian
1 parent d44adc2 commit cf4832b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

misc-tools/dj_make_chroot.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ RELEASE=""
3434
DEBIAN_ARCHLIST="amd64,arm64,armel,armhf,i386,mips,mips64el,mipsel,ppc64el,s390x"
3535
UBUNTU_ARCHLIST="amd64,arm64,armhf,i386,powerpc,ppc64el,s390x"
3636

37+
if ! command -v lsb_release; then
38+
echo "Please install `lsb_release`."
39+
exit 1
40+
fi
41+
3742
# If host system is Debian or Ubuntu, use its release and architecture by default
3843
if [ "$(lsb_release -i -s || true)" = 'Debian' ] || \
3944
[ "$(lsb_release -i -s || true)" = 'Ubuntu' ]; then

0 commit comments

Comments
 (0)