Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udev: Import 60-net.rules from initscripts #51

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
NAME:=ifcfg-devname

all: production check

check:
@cargo test

build:
@cargo build

production:
@cargo build --release

install:
mkdir -p $(DESTDIR)/usr/lib/udev/rules.d
install -p -m 0755 target/release/$(NAME) $(DESTDIR)/usr/lib/udev/
install -p -m 644 rules/60-net.rules $(DESTDIR)/usr/lib/udev/rules.d/

uninstall:
rm -f $(DESTDIR)/usr/lib/udev/$(NAME)
rm -f $(DESTDIR)/usr/lib/udev/rules/60-net.rules

clean:
@cargo clean

.PHONY: check build production install uninstall clean
1 change: 1 addition & 0 deletions rules/60-net.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="1", PROGRAM="/lib/udev/ifcfg-devname", RESULT=="?*", NAME="$result"
9 changes: 6 additions & 3 deletions rust-ifcfg-devname.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ Summary: Udev helper utility that provides network interface naming

# Upstream license specification: GPL-3.0
License: GPL-3.0-or-later
URL: https://crates.io/crates/ifcfg-devname
URL: https://crates.io/crates/%{crate}
Source: %{crates_source}

ExclusiveArch: %{rust_arches}

BuildRequires: rust-packaging
BuildRequires: systemd-rpm-macros

%global _description %{expand:
Udev helper utility that provides network interface naming using ifcfg configuration.}
Expand All @@ -31,7 +32,9 @@ License: GPL-3.0-or-later and MIT
%files -n %{crate}
%license LICENSE
%doc README.md
%{_bindir}/ifcfg-devname

%{_prefix}/lib/udev/%{crate}
%{_udevrulesdir}/60-net.rules

%package devel
Summary: %{summary}
Expand Down Expand Up @@ -70,7 +73,7 @@ use the "default" feature of the "%{crate}" crate.
%cargo_build

%install
%cargo_install
%make_install

%if %{with check}
%check
Expand Down
Loading