Commit adad0b19 authored by Ophélie Gagnard's avatar Ophélie Gagnard

generation: Add drivers in initramfs.

Add a kernel version in dracut command-line options.
parent 44a11e1a
......@@ -20,6 +20,7 @@ SIGNING_KEY_NAME=db.key
KERNEL_COMPILATION_DIR="$GIT_ROOT"/generation/kernel-compilation
KERNEL_DIR="$KERNEL_COMPILATION_DIR"/extracted-image-package
KERNEL_IMAGE="$KERNEL_DIR"/boot/vmlinuz-"$KERNEL_VERSION"-amd64
DRIVERS_DIR="$KERNEL_DIR"/lib/modules/"$KERNEL_VERSION"-amd64
# used mainly in dracut.module/configure
MCA_NAME_AND_VERSION=${MCA_PACKAGE_NAME}_${MCA_VERSION}-1
FLB_NAME_AND_VERSION=${FLB_PACKAGE_NAME}_${FLB_VERSION}-1
......
......@@ -129,7 +129,7 @@ make install
cd -
# Generation of dracut.module/dracut.conf
dracut_conf_regex="s|%PROJECT_DIR%|${PROJECT_DIR}|g;s|%PUBLIC_CERT_DIR%|${PUBLIC_CERT_DIR}|g;s|%PRIVATE_KEYS_DIR%|${PRIVATE_KEYS_DIR}|g;s|%CERT_NAME%|${CERT_NAME}|;s|%SIGNING_KEY_NAME%|${SIGNING_KEY_NAME}|g;s|%ROOT_PARTITION_ID%|${ROOT_PARTITION_ID}|g;s|%DEFAULT_INTERFACE%|${DEFAULT_INTERFACE}|g;s|%DEFAULT_ROUTER%|${DEFAULT_ROUTER}|g;s|%DEFAULT_IP%|${DEFAULT_IP}|g;s|%FORMATTED_NETMASK%|${FORMATTED_NETMASK}|g;s|%TARGET_HOSTNAME%|${TARGET_HOSTNAME}|g;s|%KERNEL_IMAGE%|${KERNEL_IMAGE}|g"
dracut_conf_regex="s|%PROJECT_DIR%|${PROJECT_DIR}|g;s|%PUBLIC_CERT_DIR%|${PUBLIC_CERT_DIR}|g;s|%PRIVATE_KEYS_DIR%|${PRIVATE_KEYS_DIR}|g;s|%CERT_NAME%|${CERT_NAME}|;s|%SIGNING_KEY_NAME%|${SIGNING_KEY_NAME}|g;s|%ROOT_PARTITION_ID%|${ROOT_PARTITION_ID}|g;s|%DEFAULT_INTERFACE%|${DEFAULT_INTERFACE}|g;s|%DEFAULT_ROUTER%|${DEFAULT_ROUTER}|g;s|%DEFAULT_IP%|${DEFAULT_IP}|g;s|%FORMATTED_NETMASK%|${FORMATTED_NETMASK}|g;s|%TARGET_HOSTNAME%|${TARGET_HOSTNAME}|g;s|%KERNEL_IMAGE%|${KERNEL_IMAGE}|g;s|%DRIVERS_DIR%|${DRIVERS_DIR}|g"
cd dracut.module
sed "${dracut_conf_regex}" dracut.conf.in > dracut.conf
cd -
......@@ -137,17 +137,11 @@ cd -
# Add files in initramfs
INCLUDE_DIR=files-to-include
rm -rf "$INCLUDE_DIR"
mkdir -p "$INCLUDE_DIR"/usr
cp -r "$KERNEL_DIR"/lib "$INCLUDE_DIR"/usr
#additional_dracut_options="-i /a /b"
#additional_dracut_options=" \
#-c ./dracut.module/dracut.conf \
#--force \
#--include $INCLUDE_DIR / \
#"
mkdir -p "$INCLUDE_DIR"
cp -r "$KERNEL_DIR"/lib "$INCLUDE_DIR"
export DRACUT_KMODDIR_OVERRIDE=1
# Create an initramfs image
rm -f "$dracut_output_file"
#dracut "$UEFI_IMAGE_NAME" "$additional_dracut_options" |& tee -a "$dracut_output_file"
dracut "$UEFI_IMAGE_NAME" -c ./dracut.module/dracut.conf --force --include "$INCLUDE_DIR" / |& tee -a "$dracut_output_file"
dracut "$UEFI_IMAGE_NAME" "$KERNEL_VERSION" -c ./dracut.module/dracut.conf --force --include "$INCLUDE_DIR" / |& tee -a "$dracut_output_file"
echo New initramfs image: $(pwd)/"$UEFI_IMAGE_NAME"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment