Skip to content

Commit

Permalink
feat(net-lib): add a new dracut module called net-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
LaszloGombos committed Oct 28, 2023
1 parent b2af8c8 commit f6b62f9
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 114 deletions.
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,6 @@ test:
- test/**/*
- modules.d/80test*
- modules.d/80test*/*

net-lib:
- modules.d/45net-lib/*
3 changes: 1 addition & 2 deletions modules.d/35connman/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ check() {

# called by dracut
depends() {
echo dbus systemd bash
echo dbus systemd bash net-lib
return 0
}

Expand All @@ -25,7 +25,6 @@ install() {
# in an emergency shell.
inst_multiple ip sed grep

inst_script "$moddir/netroot.sh" "/sbin/netroot"
inst connmand
inst connmanctl
inst connmand-wait-online
Expand Down
1 change: 1 addition & 0 deletions modules.d/35network-legacy/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ check() {

# called by dracut
depends() {
echo net-lib
return 0
}

Expand Down
2 changes: 1 addition & 1 deletion modules.d/35network-manager/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ check() {

# called by dracut
depends() {
echo dbus bash
echo dbus bash net-lib
return 0
}

Expand Down
18 changes: 1 addition & 17 deletions modules.d/40network/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ depends() {
network_handler="network-legacy"
fi
fi
echo "kernel-network-modules $network_handler"
echo "net-lib kernel-network-modules $network_handler"
return 0
}

# called by dracut
installkernel() {
return 0
}

# called by dracut
install() {
inst_script "$moddir/netroot.sh" "/sbin/netroot"
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
inst_multiple ip sed awk grep pgrep tr
inst_multiple -o arping arping2
dracut_need_initqueue
}
92 changes: 0 additions & 92 deletions modules.d/40network/netroot.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions modules.d/45net-lib/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

check() {
return 255
}

depends() {
echo base
return 0
}

install() {
inst_script "$moddir/netroot.sh" "/sbin/netroot"
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
inst_multiple ip sed awk grep pgrep tr
inst_multiple -o arping arping2
dracut_need_initqueue
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion modules.d/95nfs/nfs-lib.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
. /lib/net-lib.sh
type get_ip > /dev/null 2>&1 || . /lib/net-lib.sh

# TODO: make these things not pollute the calling namespace

Expand Down
2 changes: 1 addition & 1 deletion test/TEST-20-NFS/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ test_setup() {
inst_simple "${PKGLIBDIR}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/45url-lib/url-lib.sh" "/lib/url-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/40network/net-lib.sh" "/lib/net-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/45net-lib/net-lib.sh" "/lib/net-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/95nfs/nfs-lib.sh" "/lib/nfs-lib.sh"
inst_binary "${PKGLIBDIR}/dracut-util" "/usr/bin/dracut-util"
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
Expand Down

0 comments on commit f6b62f9

Please sign in to comment.