Jump to content

MOTD DISTRIBUTION_CODENAME empty in debian-based Armbian 22.02.1


blacki2
Go to solution Solved by blacki2,

Recommended Posts

Hi,

 

since I upgraded my debian-based Armbian installations from 21.08.x to 22.02.1 the DISTRIBUTION_CODENAME variable is empty in the MOTD.

 

It seems this error is in file https://github.com/armbian/build/blob/master/packages/bsp/common/etc/update-motd.d/10-armbian-header since commit https://github.com/armbian/build/pull/3378/commits/1c71761973858c2bea16074075ef74157c2a960b.

 

It tries to read the DISTRIBUTION_CODENAME from /etc/lsb-release, which is non-existent on debian-based Armbian.

 

So I propose to read the variable from /etc/os-release instead, which is existent on Ubuntu AND Debian:

 

--- /etc/update-motd.d/10-armbian-header.old	2022-01-11 20:04:18.000000000 +0100
+++ /etc/update-motd.d/10-armbian-header	2022-03-10 23:57:46.516373135 +0100
@@ -14,7 +14,7 @@
 
 [[ -f /etc/armbian-release ]] && . /etc/armbian-release
 [[ -f /etc/armbian-distribution-status ]] && . /etc/armbian-distribution-status
-[[ -f /etc/lsb-release && -f /etc/armbian-distribution-status ]] && DISTRIBUTION_CODENAME=$(cat /etc/lsb-release | grep CODENAME | cut -d"=" -f2) && DISTRIBUTION_STATUS=$(cat /etc/armbian-distribution-status | grep $DISTRIBUTION_CODENAME | cut -d"=" -f2)
+[[ -f /etc/os-release && -f /etc/armbian-distribution-status ]] && DISTRIBUTION_CODENAME=$(cat /etc/os-release | grep CODENAME | cut -d"=" -f2) && DISTRIBUTION_STATUS=$(cat /etc/armbian-distribution-status | grep $DISTRIBUTION_CODENAME | cut -d"=" -f2)
 [[ -f /etc/default/armbian-motd ]] && . /etc/default/armbian-motd
 
 for f in $MOTD_DISABLE; do

 

regards,

Chris

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines