Commit 62ed7f2b authored by Natanael Copa's avatar Natanael Copa

setup-interfaces: install packages for bonding and/or bridge if needed

parent c316bc87
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
PROGRAM=setup-interfaces PROGRAM=setup-interfaces
PREFIX= PREFIX=
PKGS=
for i in ./libalpine.sh $PREFIX/lib/libalpine.sh; do for i in ./libalpine.sh $PREFIX/lib/libalpine.sh; do
[ -e $i ] && . $i && break [ -e $i ] && . $i && break
done done
...@@ -354,9 +356,11 @@ prompt_for_interfaces() { ...@@ -354,9 +356,11 @@ prompt_for_interfaces() {
echo "auto $iface" >> interfaces echo "auto $iface" >> interfaces
echo "iface $iface inet $type" >> interfaces echo "iface $iface inet $type" >> interfaces
if [ -n "$bridge_ports" ]; then if [ -n "$bridge_ports" ]; then
PKGS="$PKGS bridge"
echo -e "\tbridge-ports $bridge_ports" >> interfaces echo -e "\tbridge-ports $bridge_ports" >> interfaces
fi fi
if [ -n "$bond_slaves" ]; then if [ -n "$bond_slaves" ]; then
PKGS="$PKGS bonding"
echo -e "\tbond-slaves $bond_slaves" >> interfaces echo -e "\tbond-slaves $bond_slaves" >> interfaces
fi fi
case $type in case $type in
...@@ -394,7 +398,11 @@ prompt_for_interfaces() { ...@@ -394,7 +398,11 @@ prompt_for_interfaces() {
esac esac
${EDITOR:-vi} interfaces ${EDITOR:-vi} interfaces
fi fi
if [ -n "$PKGS" ]; then
apk add -q $PKGS
fi
mkdir -p $ROOT/etc/network mkdir -p $ROOT/etc/network
cp interfaces $ROOT/etc/network/ cp interfaces $ROOT/etc/network/
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment