feat(os): support NI Linux Real-Time's opkg package manager (#870)
NI Linux Real-Time is a Yocto Linux-based distribution used with NI's embedded and real-time controllers. Related links: - https://www.ni.com/en/shop/linux/introduction-to-ni-linux-real-time.html - https://github.com/ni/nilrt - https://github.com/ni/nilrt-docs
This commit is contained in:
@@ -30,6 +30,7 @@ pub enum Distribution {
|
|||||||
FedoraImmutable,
|
FedoraImmutable,
|
||||||
Debian,
|
Debian,
|
||||||
Gentoo,
|
Gentoo,
|
||||||
|
NILRT,
|
||||||
OpenMandriva,
|
OpenMandriva,
|
||||||
OpenSuseTumbleweed,
|
OpenSuseTumbleweed,
|
||||||
PCLinuxOS,
|
PCLinuxOS,
|
||||||
@@ -71,6 +72,7 @@ impl Distribution {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some("nilrt") => Distribution::NILRT,
|
||||||
Some("nobara") => Distribution::Nobara,
|
Some("nobara") => Distribution::Nobara,
|
||||||
Some("void") => Distribution::Void,
|
Some("void") => Distribution::Void,
|
||||||
Some("debian") | Some("pureos") | Some("Deepin") | Some("linuxmint") => Distribution::Debian,
|
Some("debian") | Some("pureos") | Some("Deepin") | Some("linuxmint") => Distribution::Debian,
|
||||||
@@ -158,6 +160,7 @@ impl Distribution {
|
|||||||
Distribution::OpenMandriva => upgrade_openmandriva(ctx),
|
Distribution::OpenMandriva => upgrade_openmandriva(ctx),
|
||||||
Distribution::PCLinuxOS => upgrade_pclinuxos(ctx),
|
Distribution::PCLinuxOS => upgrade_pclinuxos(ctx),
|
||||||
Distribution::Nobara => upgrade_nobara(ctx),
|
Distribution::Nobara => upgrade_nobara(ctx),
|
||||||
|
Distribution::NILRT => upgrade_nilrt(ctx),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,6 +288,14 @@ fn upgrade_nobara(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upgrade_nilrt(ctx: &ExecutionContext) -> Result<()> {
|
||||||
|
let sudo = require_option(ctx.sudo().as_ref(), REQUIRE_SUDO.to_string())?;
|
||||||
|
let opkg = require("opkg")?;
|
||||||
|
|
||||||
|
ctx.run_type().execute(sudo).arg(&opkg).arg("update").status_checked()?;
|
||||||
|
ctx.run_type().execute(sudo).arg(&opkg).arg("upgrade").status_checked()
|
||||||
|
}
|
||||||
|
|
||||||
fn upgrade_fedora_immutable(ctx: &ExecutionContext) -> Result<()> {
|
fn upgrade_fedora_immutable(ctx: &ExecutionContext) -> Result<()> {
|
||||||
let ostree = require("rpm-ostree")?;
|
let ostree = require("rpm-ostree")?;
|
||||||
let mut command = ctx.run_type().execute(ostree);
|
let mut command = ctx.run_type().execute(ostree);
|
||||||
@@ -1254,4 +1265,9 @@ mod tests {
|
|||||||
fn test_nobara() {
|
fn test_nobara() {
|
||||||
test_template(include_str!("os_release/nobara"), Distribution::Nobara);
|
test_template(include_str!("os_release/nobara"), Distribution::Nobara);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_nilrt() {
|
||||||
|
test_template(include_str!("os_release/nilrt"), Distribution::NILRT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
src/steps/os/os_release/nilrt
Normal file
8
src/steps/os/os_release/nilrt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
ID=nilrt
|
||||||
|
NAME="NI Linux Real-Time"
|
||||||
|
VERSION="10.0 (kirkstone)"
|
||||||
|
VERSION_ID=10.0
|
||||||
|
PRETTY_NAME="NI Linux Real-Time 10.0 (kirkstone)"
|
||||||
|
DISTRO_CODENAME="kirkstone"
|
||||||
|
BUILD_ID="23.8.0f153-x64"
|
||||||
|
VERSION_CODENAME="kirkstone"
|
||||||
Reference in New Issue
Block a user