Skip to content

Commit

Permalink
fix(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 Mar 9, 2024
1 parent 4980bad commit 94ce821
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 114 deletions.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ uefi-lib:
- changed-files:
- any-glob-to-any-file: 'modules.d/99uefi-lib/*'

net-lib:
- changed-files:
- any-glob-to-any-file: 'modules.d/45net-lib/*'

test:
- changed-files:
- any-glob-to-any-file: ['test/*', 'test/**/*', 'modules.d/80test*', 'modules.d/80test*/*']
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 94ce821

Please sign in to comment.