Skip to content

Commit

Permalink
feat: Add support for Bluefin Linux
Browse files Browse the repository at this point in the history
Bluefin is a Fedora Silverblue derivative that focuses on providing a polished desktop experience. This commit adds support for detecting Bluefin Linux via both os-release and lsb_release methods.

- Added Bluefin variant to Type enum\n- Added Bluefin to LSB release matcher\n- Added test case with actual os-release file\n- Updated all relevant test cases and match expressions
  • Loading branch information
sargunv committed Feb 1, 2025
1 parent 983ee17 commit a41a664
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions os_info/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ mod tests {
Type::Android,
Type::Arch,
Type::Artix,
Type::Bluefin,
Type::CachyOS,
Type::CentOS,
Type::Debian,
Expand Down
12 changes: 12 additions & 0 deletions os_info/src/linux/file_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static DISTRIBUTIONS: [ReleaseInfo; 6] = [
"arch" => Some(Type::Arch),
"archarm" => Some(Type::Arch),
"artix" => Some(Type::Artix),
"bluefin" => Some(Type::Bluefin),
"cachyos" => Some(Type::CachyOS),
"centos" => Some(Type::CentOS),
//"clear-linux-os" => ClearLinuxOS
Expand Down Expand Up @@ -304,6 +305,17 @@ mod tests {
assert_eq!(info.codename, None);
}

#[test]
fn bluefin_os_release() {
let root = "src/linux/tests/Bluefin";

let info = retrieve(&DISTRIBUTIONS, root).unwrap();
assert_eq!(info.os_type(), Type::Bluefin);
assert_eq!(info.version, Version::Semantic(41, 0, 0));
assert_eq!(info.edition, None);
assert_eq!(info.codename, None);
}

#[test]
fn centos_7_os_release() {
let root = "src/linux/tests/CentOS_7";
Expand Down
1 change: 1 addition & 0 deletions os_info/src/linux/lsb_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub fn get() -> Option<Info> {
Some("Amazon") | Some("AmazonAMI") => Type::Amazon,
Some("Arch") => Type::Arch,
Some("Artix") => Type::Artix,
Some("Bluefin") => Type::Bluefin,
Some("cachyos") => Type::CachyOS,
Some("CentOS") => Type::CentOS,
Some("Debian") => Type::Debian,
Expand Down
1 change: 1 addition & 0 deletions os_info/src/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mod tests {
| Type::Amazon
| Type::Arch
| Type::Artix
| Type::Bluefin
| Type::CachyOS
| Type::CentOS
| Type::Debian
Expand Down
24 changes: 24 additions & 0 deletions os_info/src/linux/tests/Bluefin/etc/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
NAME="Bluefin"
VERSION="41.20250119.1 (Silverblue)"
RELEASE_TYPE=stable
ID=bluefin
ID_LIKE="fedora"
VERSION_ID=41
VERSION_CODENAME="Archaeopteryx"
PLATFORM_ID="platform:f41"
PRETTY_NAME="Bluefin (Version: 41.20250119.1 / FROM Fedora Silverblue 41)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:universal-blue:bluefin:41"
DEFAULT_HOSTNAME="bluefin"
HOME_URL="https://projectbluefin.io"
DOCUMENTATION_URL="https://docs.projectbluefin.io"
SUPPORT_URL="https://github.com/ublue-os/bluefin/issues/"
BUG_REPORT_URL="https://github.com/ublue-os/bluefin/issues/"
SUPPORT_END=2025-12-15
VARIANT="Silverblue"
VARIANT_ID=bluefin-dx
OSTREE_VERSION='41.20250119.1'
BUILD_ID="36c6eef"
IMAGE_ID="bluefin-dx"
IMAGE_VERSION="41.20250119.1"
4 changes: 4 additions & 0 deletions os_info/src/os_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub enum Type {
Arch,
/// Artix Linux (<https://en.wikipedia.org/wiki/Artix_Linux>).
Artix,
/// Bluefin (<https://projectbluefin.io>).
Bluefin,
/// CachyOS (<https://en.wikipedia.org/wiki/Arch_Linux#Derivatives>).
CachyOS,
/// CentOS (<https://en.wikipedia.org/wiki/CentOS>).
Expand Down Expand Up @@ -122,6 +124,7 @@ impl Display for Type {
Type::AlmaLinux => write!(f, "AlmaLinux"),
Type::Amazon => write!(f, "Amazon Linux AMI"),
Type::Arch => write!(f, "Arch Linux"),
Type::Bluefin => write!(f, "Bluefin"),
Type::CachyOS => write!(f, "CachyOS Linux"),
Type::Artix => write!(f, "Artix Linux"),
Type::DragonFly => write!(f, "DragonFly BSD"),
Expand Down Expand Up @@ -169,6 +172,7 @@ mod tests {
(Type::Android, "Android"),
(Type::Arch, "Arch Linux"),
(Type::Artix, "Artix Linux"),
(Type::Bluefin, "Bluefin"),
(Type::CachyOS, "CachyOS Linux"),
(Type::CentOS, "CentOS"),
(Type::Debian, "Debian"),
Expand Down

0 comments on commit a41a664

Please sign in to comment.