Add support for flavours to ship udev rules.d files and port over the mellanox variant to use this

This commit is contained in:
Chris Jones 2012-11-12 16:56:08 +00:00
parent cef3e552e6
commit f7091cb2fc
5 changed files with 23 additions and 1 deletions

View File

@ -86,6 +86,7 @@ create_base
populate_lib populate_lib
populate_busybox populate_busybox
populate_init populate_init
populate_udev
finalise_image finalise_image
save_image $IMAGE_NAME save_image $IMAGE_NAME

View File

@ -0,0 +1 @@
Flavour to force support for mellanox hardware

3
flavours/mellanox/init Normal file
View File

@ -0,0 +1,3 @@
# extra load for mellanox
modprobe mlx4_en

View File

@ -0,0 +1,6 @@
ACTION!="add", GOTO="drivers_end"
SUBSYSTEM=="net", RUN+="/sbin/modprobe mlx4_en"
LABEL="drivers_end"

View File

@ -101,7 +101,6 @@ function populate_busybox () {
function populate_init () { function populate_init () {
echo "Installing 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" cp "$INIT" "$TMP_MOUNT_PATH/init"
chmod +x $TMP_MOUNT_PATH/init chmod +x $TMP_MOUNT_PATH/init
for F in "$FUNCTIONS_D"/* ; do 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" ) (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
}