The officially official Devuan Forum!

You are not logged in.

#1 2017-08-02 21:57:50

greenjeans
Member
Registered: 2017-04-07
Posts: 505  
Website

Updating os-prober, need info from other popular linux distros! Help!

Okay, so one way or another i'll get the os-prober package's failure to recognize Devuan fixed, but I need help, I need people who have other modern linux distros like ubuntu or mint etc., I need the identifier for the os, usually in /etc.  For instance Devuan's is /etc/devuan_version and Debian is /etc/debian_version, Arch is /etc/arch_release.

This portion of the package hasn't been really updated in years, it still had distros that have been gone since 2003.

Here's what I have so far just adding Devuan (and Vuu-do, lol) and getting rid of the old discontinued ones:

#!/bin/sh
# Test for linux distributions.
set -e

. /usr/share/os-prober/common.sh

partition="$1"
dir="$2"
type="$3"

# This test is inaccurate, but given separate / and /boot partitions and the
# fact that only some architectures have ld-linux.so, I can't see anything
# better. Make sure this test has a high number so that more accurate tests
# can come first.
# Unless volumes to checked are already mounted, they will be mounted using
# GRUB's own filesystems through FUSE. Since these ATM doesn't support
# symlinks we need to also check in $dir/usr/lib* for distributions that
# moved /lib* to /usr and only left symlinks behind.
# TODO: look for ld-linux.so on arches that have it
if (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
	if [ -e "$dir/etc/debian_version" ]; then
		short="Debian"
		long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")"
	# RPM derived distributions may also have a redhat-release or
	# mandrake-release, so check their files first.

        elif [ -e "$dir/etc/devuan_version" ]; then
                short="Devuan"
                long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")"
        elif [ -e "$dir/etc/vuudo_version" ]; then
                short="Vuu-do"
                long="$(printf "Vuu-do GNU/Linux (%s)\n" "$(cat "$dir/etc/vuudo_version")")"
	elif [ -e "$dir/etc/altlinux-release" ]; then
		short="ALTLinux"
		long="$(cat "$dir/etc/altlinux-release")"
	elif [ -e "$dir/etc/magic-release" ]; then
		short="Magic"
		long="$(cat "$dir/etc/magic-release")"
	elif [ -e "$dir/etc/blackPanther-release" ]; then
		short="blackPanther"
		long="$(cat "$dir/etc/blackPanther-release")"
	elif [ -e "$dir/etc/ark-release" ]; then
		short="Ark"
		long="$(cat "$dir/etc/ark-release")"
	elif [ -e "$dir/etc/arch-release" ]; then
		short="Arch"
		long="$(cat "$dir/etc/arch-release")"
	elif [ -e "$dir/etc/vine-release" ]; then
		short="Vine"
		long="$(cat "$dir/etc/vine-release")"
	elif [ -e "$dir/etc/pld-release" ]; then
		short="PLD"
		long="$(cat "$dir/etc/pld-release")"
	elif [ -e "$dir/etc/fedora-release" ]; then
		short="Fedora"
		long="$(cat "$dir/etc/fedora-release")"
	elif [ -e "$dir/etc/redhat-release" ]; then
		short="RedHat"
		long="$(cat "$dir/etc/redhat-release")"
	elif [ -e "$dir/etc/SuSE-release" ]; then
		short="SuSE"
		long="$(head -n 1 "$dir/etc/SuSE-release")"
	elif [ -e "$dir/etc/gentoo-release" ]; then
		short="Gentoo"
		long="$(cat "$dir/etc/gentoo-release")"
	elif [ -e "$dir/etc/turbolinux-release" ]; then
		short="Turbolinux"
		long="$(cat "$dir/etc/turbolinux-release")"
	elif [ -e "$dir/etc/pardus-release" ]; then
		short="Pardus"
		long="$(cat "$dir/etc/pardus-release")"
	elif [ -e "$dir/etc/kanotix-version" ]; then
		short="Kanotix"
		long="$(cat "$dir/etc/kanotix-version")"
	elif [ -e "$dir/etc/slackware-version" ]; then
		short="Slackware"
		long="$(printf "Slackware Linux (%s)\n" "$(cat "$dir/etc/slackware-version")")"
	elif [ -e "$dir/sbin/pkgtool" ]; then
		short="Slackware"
		long="Slackware Linux"
	elif [ -e "$dir/etc/frugalware-release" ]; then
		short="Frugalware Linux"
		long="$(cat "$dir/etc/frugalware-release")"
	elif [ -e "$dir/etc/lfs-release" ]; then
		short="LFS"
		long="$(printf "Linux From Scratch (%s)\n" "$(cat "$dir/etc/lfs-release")")"
	else
		short="Linux"
		long="unknown Linux distribution"
	fi
	
        label="$(count_next_label "$short")"
	result "$partition:$long:$label:linux"
	exit 0
else
	exit 1
fi

https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#2 2017-08-03 08:39:41

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Re: Updating os-prober, need info from other popular linux distros! Help!

If you are using if elif will that mean that if you have both debian_vesion and devuan_version that you will only pick up Debian and miss the fact that it has been upgraded to Devuan?

Geoff

Offline

#3 2017-08-03 22:02:47

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,409  

Re: Updating os-prober, need info from other popular linux distros! Help!

Geoff 42 wrote:

If you are using if elif will that mean that if you have both debian_vesion and devuan_version that you will only pick up Debian and miss the fact that it has been upgraded to Devuan?

Geoff

That bit of code would select for whichever of the two got tested first. But that doesn't necessarily mean that you'd get that name in your grub menu. There are other tests that grub does to figure out which distro you have. And if I remember correctly, there's a reference to black magic somewhere in the comments in the script.

Current Refracta isos have /etc/devuan_version, but grub uses /etc/lsb-release instead, so it shows up as Refracta (or maybe Refracted Devuan). Ubunutu isos have /etc/debian_version, but I'm pretty sure it always shows up as Ubuntu in the grub menu (if you can find it.)

Offline

#4 2017-08-03 22:38:32

greenjeans
Member
Registered: 2017-04-07
Posts: 505  
Website

Re: Updating os-prober, need info from other popular linux distros! Help!

fsmithred wrote:

Current Refracta isos have /etc/devuan_version, but grub uses /etc/lsb-release instead, so it shows up as Refracta (or maybe Refracted Devuan). Ubunutu isos have /etc/debian_version, but I'm pretty sure it always shows up as Ubuntu in the grub menu (if you can find it.)

I actually haven't tried the default Devuan 1.0 iso, is there an /etc/lsb-release file in it now? I seem to remember you saying had to make one for Refracta...


https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#5 2017-08-04 12:05:12

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,409  

Re: Updating os-prober, need info from other popular linux distros! Help!

No, there's no /etc/lsb-release file in devuan. You recall correctly - I had to make it myself. Ubuntu does have /etc/lsb-release, and 40lsb runs before 90linux. Devuan does use /etc/os-release, but grub doesn't seem to check for that. (I grepped through all of /usr/lib/os-probes/mounted/ and /usr/lib/linux-boot-probes/ and couldn't find it.)

Offline

#6 2017-08-04 22:26:03

greenjeans
Member
Registered: 2017-04-07
Posts: 505  
Website

Re: Updating os-prober, need info from other popular linux distros! Help!

fsmithred wrote:

Devuan does use /etc/os-release, but grub doesn't seem to check for that. (I grepped through all of /usr/lib/os-probes/mounted/ and /usr/lib/linux-boot-probes/ and couldn't find it.)

Yep, you have to manually add the lines to 90linux, but after that it picks it right up when you update-grub.

So as long as a distro provides an lsb release , grub should pick it up without any further code correct?


https://sourceforge.net/projects/vuu-do/
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded.

Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#7 2017-08-06 01:03:55

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,409  

Re: Updating os-prober, need info from other popular linux distros! Help!

greenjeans wrote:

So as long as a distro provides an lsb release , grub should pick it up without any further code correct?

Yes.

Offline

Board footer