1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00

Add configuration for deterministic network interface names

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-04-27 10:53:45 +02:00
parent 1389c74f95
commit 387281fae4
4 changed files with 24 additions and 5 deletions

2
board/alix/ifrename Normal file
View file

@ -0,0 +1,2 @@
# Rename ALIX board interfaces to port0...port2
eth*,00:0d:b9:*,port

2
board/rpi3/ifrename Normal file
View file

@ -0,0 +1,2 @@
# Rename Raspberry Pi ethernet interfaces to port<X>
eth*,b8:27:eb:*,port

View file

@ -39,6 +39,12 @@ deploy() {
ln -s "/share/init/hwclock" "$DEPLOY/etc/init.d/hwclock"
fi
svc=$(file_path_override "ifrename")
if [ ! -z "$svc" ]; then
cp "$svc" "$DEPLOY/etc/netcfg/ifrename"
ln -s "/share/init/ifrename" "$DEPLOY/etc/init.d/ifrename"
fi
for svc in $GETTY_TTY; do
ln -s "/share/init/agetty" "$DEPLOY/etc/init.d/agetty@$svc"
done

View file

@ -1,20 +1,29 @@
cat_file_override() {
file_path_override() {
local fname="$1"
if [ -e "$SCRIPTDIR/product/$PRODUCT/${fname}.${BOARD}" ]; then
cat "$SCRIPTDIR/product/$PRODUCT/${fname}.${BOARD}"
echo "$SCRIPTDIR/product/$PRODUCT/${fname}.${BOARD}"
return
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/$fname" ]; then
cat "$SCRIPTDIR/product/$PRODUCT/$fname"
echo "$SCRIPTDIR/product/$PRODUCT/$fname"
return
fi
if [ -e "$SCRIPTDIR/board/$BOARD/$fname" ]; then
cat "$SCRIPTDIR/board/$BOARD/$fname"
echo "$SCRIPTDIR/board/$BOARD/$fname"
return
fi
if [ -e "$SCRIPTDIR/product/common/$fname" ]; then
cat "$SCRIPTDIR/product/common/$fname"
echo "$SCRIPTDIR/product/common/$fname"
return
fi
}
cat_file_override() {
local path=$(file_path_override "$1")
if [ ! -z "$path" ]; then
cat "$path"
fi
}