Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial VLAN support via boot option "vlan"
This provides support for something like: ip=10.10.10.42::10.10.10.1:255.255.255.0:grml:eth0:off vlan=301,eth0 Development sponsored by Sipwise Gmbh
- Loading branch information
Showing
3 changed files
with
68 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- a/components/9990-cmdline-old | ||
+++ b/components/9990-cmdline-old | ||
@@ -266,6 +266,11 @@ | ||
UNIONTYPE="${_PARAMETER#union=}" | ||
export UNIONTYPE | ||
;; | ||
+ | ||
+ vlan=*) | ||
+ VLANS="${VLANS} ${_PARAMETER#vlan=}" | ||
+ export VLANS | ||
+ ;; | ||
esac | ||
done | ||
|
||
--- a/components/9990-grml-networking.sh | ||
+++ b/components/9990-grml-networking.sh | ||
@@ -67,10 +67,39 @@ | ||
method="dhcp" | ||
fi | ||
|
||
- cat >> $IFFILE << EOF | ||
+ if [ -n "$VLANS" ] ; then | ||
+ modprobe 8021q | ||
+ | ||
+ # vlan=<vlanname>:<phydevice> | ||
+ for line in $(echo $VLANS | sed 's/ /\n'/) ; do | ||
+ vlandev=${line#*,} | ||
+ vlanid=${line%,*} | ||
+ | ||
+ if [ -n "$vlandev" ] && [ -n "$vlanid" ] ; then | ||
+ case "$vlandev" in | ||
+ "$interface") | ||
+ vlan_raw_dev=$interface | ||
+ interface="${vlandev}.${vlanid}" | ||
+ ;; | ||
+ esac | ||
+ fi | ||
+ done | ||
+ fi | ||
+ | ||
+ if [ -n "$vlan_raw_dev" ] ; then | ||
+ cat >> $IFFILE << EOF | ||
+auto ${interface} | ||
+iface ${interface} inet ${method} | ||
+ vlan-raw-device $vlan_raw_dev | ||
+EOF | ||
+ else | ||
+ cat >> $IFFILE << EOF | ||
allow-hotplug ${interface} | ||
iface ${interface} inet ${method} | ||
EOF | ||
+ fi | ||
+ | ||
+ unset vlandev vlanid vlan_raw_dev # unset variables to have clean state for next device | ||
|
||
# DNS for resolvconf and /etc/resolv.conf | ||
if [ -e "${netconfig}" ]; then |