Skip to content

Conversation

@Matombo
Copy link

@Matombo Matombo commented Oct 26, 2022

Alternative to #257

Check the distribution the way dkms.in does it and not solely rely und the lsb_release command.

Not yet tested.

@evelikov
Copy link
Collaborator

(Copy/paste for cross-referencing purposes)

I've proposed removing the common.postinst script with #339. If you think that may cause issue please reply in there.

If we end up removing it, this MR will no longer be needed.

@bac0n
Copy link

bac0n commented Jan 14, 2025

I have redone my distro_version function (original only check from the beginning of the running_distibution= string):

distro_version(){
    local ID ID_LIKE
    for f in /etc/os-release /usr/lib/os-release; do
        [[ -r $f ]] && ( . "$f" && echo "${ID_LIKE:-$ID}" ) && return
    done
    die 4 "System is missing os-release file."
}

running_distribution=$(distro_version) || exit $?

and the case switches:

case " $running_distribution " in
    *\ @(ubuntu|debian)\ *)
        echo "Matching debian" ;;
    *\ pop\ *)
        echo "Matching pop!_os" ;;
    *)
        echo "no match!" ;;
esac

@anbe42
Copy link
Collaborator

anbe42 commented Sep 15, 2025

lsb_release usage has been dropped in 3.0.12

@anbe42 anbe42 closed this Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants