Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
6242a2b8
Commit
6242a2b8
authored
Oct 22, 2012
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
barebox: add patch for default MAC address
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
586b605b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
0008-barebox-add-MAC-address-to-environment.patch
...barebox/0008-barebox-add-MAC-address-to-environment.patch
+49
-0
No files found.
patches/barebox/0008-barebox-add-MAC-address-to-environment.patch
0 → 100644
View file @
6242a2b8
From 8892b8a2a8b0bec9f5f2bead0401cb56f5be9227 Mon Sep 17 00:00:00 2001
From: Federico Vaga <federico.vaga@gmail.com>
Date: Tue, 23 Oct 2012 01:44:59 +0200
Subject: [PATCH] barebox: add MAC addresses to environment
This patch add to default mac addresses to the barebox evironment. The
first MAC address (eth0.ethaddr) is the one to assign to the ethernet
port on board.
The second MAC address (macaddr) is the base for all switch ports
Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
---
common/environment.c | 13 +++++++++++++
1 file modificato, 13 inserzioni(+)
diff --git a/common/environment.c b/common/environment.c
index 0fdbd03..7b5d5ea 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -176,6 +176,10 @@ int envfs_load(char *filename, char *dir)
char *str, *tmp;
int namelen_full;
unsigned long size;
+#ifdef __BAREBOX__
+ char *mac_addr_1="02:34:56:78:9A:BC";
+ char *mac_addr_2="02:34:56:78:9A:00";
+#endif
envfd = open(filename, O_RDONLY);
if (envfd < 0) {
@@ -269,6 +273,15 @@ int envfs_load(char *filename, char *dir)
}
ret = 0;
+
+#ifdef __BAREBOX__
+ /* When the environment is correctly loaded, set the MAC address */
+ setenv("eth0.ethaddr", mac_addr_1);
+ export("eth0.ethaddr");
+ setenv("macaddr", mac_addr_2);
+ export("macaddr");
+#endif
+
out:
close(envfd);
if (buf_free)
--
1.7.11.7
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment