Add support for flavours to ship udev rules.d files and port over the mellanox variant to use this
This commit is contained in:
parent
cef3e552e6
commit
f7091cb2fc
@ -86,6 +86,7 @@ create_base
|
||||
populate_lib
|
||||
populate_busybox
|
||||
populate_init
|
||||
populate_udev
|
||||
finalise_image
|
||||
save_image $IMAGE_NAME
|
||||
|
||||
|
1
flavours/mellanox/README.md
Normal file
1
flavours/mellanox/README.md
Normal file
@ -0,0 +1 @@
|
||||
Flavour to force support for mellanox hardware
|
3
flavours/mellanox/init
Normal file
3
flavours/mellanox/init
Normal file
@ -0,0 +1,3 @@
|
||||
# extra load for mellanox
|
||||
modprobe mlx4_en
|
||||
|
6
flavours/mellanox/udev/81-mellanox-drivers.rules
Normal file
6
flavours/mellanox/udev/81-mellanox-drivers.rules
Normal file
@ -0,0 +1,6 @@
|
||||
ACTION!="add", GOTO="drivers_end"
|
||||
|
||||
SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx4_en"
|
||||
|
||||
LABEL="drivers_end"
|
||||
|
@ -101,7 +101,6 @@ function populate_busybox () {
|
||||
|
||||
function populate_init () {
|
||||
echo "Installing init"
|
||||
# XXX: This needs to understand flavours and the pre-shipped init needs to split up
|
||||
cp "$INIT" "$TMP_MOUNT_PATH/init"
|
||||
chmod +x $TMP_MOUNT_PATH/init
|
||||
for F in "$FUNCTIONS_D"/* ; do
|
||||
@ -129,3 +128,15 @@ function finalise_image () {
|
||||
(cd "$TMP_MOUNT_PATH"; find . | cpio -o -H newc | gzip > "$TMP_IMAGE_PATH" )
|
||||
}
|
||||
|
||||
function populate_udev () {
|
||||
echo "Installing udev rules"
|
||||
|
||||
for _FLVR in ${RAMDISK_FLAVOUR} ; do
|
||||
_DIR="${FLAVOURS_DIR}/${_FLVR}/udev"
|
||||
if [ -d $_DIR ]; then
|
||||
find $_DIR -type f -exec cp -v {} $TMP_MOUNT_PATH/lib/udev/rules.d/ \;
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user