random-archer / mkinitcpio-systemd-tool

Provisioning tool for systemd in initramfs (systemd-tool)
https://www.archlinux.org/packages/community/any/mkinitcpio-systemd-tool/
Other
112 stars 27 forks source link

Bridge creation in initramfs? #76

Closed adam900710 closed 3 years ago

adam900710 commented 4 years ago

Hi,

It looks like the systemd-tool hook only reads the file initrd-network.network, but not the full *.netdev *.network, which makes it pretty hard to create bridge device.

Is it possible to create bridges at initramfs? Or is there any special config grammar that I can put all the bridge setup into the same file?

Andrei-Pozolotin commented 4 years ago

try the following:

  1. add overrides into a new file in order to provision initrd-network.netdev and bridge dependencies:

/etc/systemd/system/initrd-network.service.d/override.conf

for example:

#
# this is initrd-network.service.d/override.conf
#

[X-SystemdTool]

# include bridge device config
InitrdPath=/etc/systemd/network/initrd-network.netdev source=/etc/mkinitcpio-systemd-tool/network/initrd-network.netdev

# provision bridge support binaries and libraries if needed
InitrdBinary=/usr/bin/some-bridge-tool
InitrdBinary=/usr/lib/some-bridge-support.so
  1. provide custom bridge configuration content in both files:
    • /etc/mkinitcpio-systemd-tool/network/initrd-network.network
    • /etc/mkinitcpio-systemd-tool/network/initrd-network.netdev
Andrei-Pozolotin commented 3 years ago

assume resolved

adam900710 commented 3 years ago

Yep, resolved.

In fact, it turns out that re-building the network interface after network-manager or whatever the tool is completely fine.

Since the main purpose for the network in initramfs is for LUKS decryption, it doesn't really matter any more.