Commit 929fc154 authored by Ophélie Gagnard's avatar Ophélie Gagnard

installation/: Fix bugs in dracut.module/dracut.conf.in processing.

parent da399677
...@@ -4,26 +4,26 @@ set -e ...@@ -4,26 +4,26 @@ set -e
# get the root of the git repository (requires git to be installed) # get the root of the git repository (requires git to be installed)
GIT_ROOT=`git rev-parse --show-toplevel` GIT_ROOT=`git rev-parse --show-toplevel`
cd ${GIT_ROOT}/installation/ cd "$GIT_ROOT"/installation
# define useful variables # define useful variables
source env.sh source env.sh
# useful tools # useful tools
apt -y install ${APT_UTILITY_PACKAGES} apt -y install $APT_UTILITY_PACKAGES
git config --global user.email "ophelie.gagnard@nexedi.com" git config --global user.email "ophelie.gagnard@nexedi.com"
git config --global user.name "Ophelie Gagnard" git config --global user.name "Ophelie Gagnard"
# building initramfs # building initramfs
apt -y install ${APT_SPECIFIC_PACKAGES} apt -y install $APT_SPECIFIC_PACKAGES
rm -f ${MCA_PACKAGE_FILE} rm -f "$MCA_PACKAGE_FILE"
wget ${MCA_PACKAGE_URL} rm -f "$FLUENTBIT_PACKAGE_FILE"
wget ${FLUENTBIT_PACKAGE_URL} || true # TMP wget "$MCA_PACKAGE_URL"
wget "$FLUENTBIT_PACKAGE_URL"
apt -y install ./"$MCA_PACKAGE_FILE" apt -y install ./"$MCA_PACKAGE_FILE"
apt -y install ./"$FLUENTBIT_PACKAGE_FILE" apt -y install ./"$FLUENTBIT_PACKAGE_FILE"
MCA_CONF_PATH=/opt/${MCA_NAME_AND_VERSION}/etc/ MCA_CONF_PATH="/opt/${MCA_NAME_AND_VERSION}/etc"
#cp flb.conf.in $MCA_CONF_PATH # temporary fix
CONF_REGEX="s|%WENDELIN_URL%|${WENDELIN_URL}|g;s|%WENDELIN_PWD%|${WENDELIN_PWD}|g;s|%WENDELIN_REFERENCE%|${WENDELIN_REFERENCE}|g" CONF_REGEX="s|%WENDELIN_URL%|${WENDELIN_URL}|g;s|%WENDELIN_PWD%|${WENDELIN_PWD}|g;s|%WENDELIN_REFERENCE%|${WENDELIN_REFERENCE}|g"
sed $CONF_REGEX $MCA_CONF_PATH/flb.conf.in > $MCA_CONF_PATH/flb.conf sed "$CONF_REGEX" "${MCA_CONF_PATH}/flb.conf.in" > "${MCA_CONF_PATH}/flb.conf"
echo "Created ${MCA_CONF_PATH}/flb.conf from template ${MCA_CONF_PATH}/flb.conf.in" echo "Created ${MCA_CONF_PATH}/flb.conf from template ${MCA_CONF_PATH}/flb.conf.in"
...@@ -5,8 +5,8 @@ GIT_ROOT=`git rev-parse --show-toplevel` ...@@ -5,8 +5,8 @@ GIT_ROOT=`git rev-parse --show-toplevel`
PROJECT_DIR=$GIT_ROOT PROJECT_DIR=$GIT_ROOT
# TO BE MODIFIED BY USERS: ### TO BE MODIFIED BY USERS ###
# packages ## Packages
MCA_PACKAGE_NAME=dep--mca--static MCA_PACKAGE_NAME=dep--mca--static
FLUENTBIT_PACKAGE_NAME=dep--fluent-bit FLUENTBIT_PACKAGE_NAME=dep--fluent-bit
MCA_VERSION=1-1 MCA_VERSION=1-1
...@@ -14,13 +14,14 @@ FLUENTBIT_VERSION=1-1 ...@@ -14,13 +14,14 @@ FLUENTBIT_VERSION=1-1
TARGET_DISTRIBUTION=Debian_11 TARGET_DISTRIBUTION=Debian_11
ARCH=amd64 ARCH=amd64
PACKAGE_EXTENSION=.deb PACKAGE_EXTENSION=.deb
# wendelin ## Wendelin
WENDELIN_URL=https://softinst157546.host.vifib.net/erp5/portal_ingestion_policies/metadata_upload WENDELIN_URL=https://softinst157546.host.vifib.net/erp5/portal_ingestion_policies/metadata_upload
WENDELIN_PWD=qxrfkwod WENDELIN_PWD=qxrfkwod
WENDELIN_REFERENCE=c-light-data_05 WENDELIN_REFERENCE=c-light-data_05
# keys and certificates ## Keys and certificates
SERVER_GROUP=douai SERVER_GROUP=douai
CERT_NAME=db.cer # could be crt but does not work on every UEFI # sometimes .cer works, sometimes .crt works... it depends on the UEFI?
CERT_NAME=db.crt
SIGNING_KEY_NAME=db.key SIGNING_KEY_NAME=db.key
...@@ -42,15 +43,15 @@ FLUENTBIT_PACKAGE_URL=${URL_PATTERN}/${FLUENTBIT_PACKAGE_FILE} ...@@ -42,15 +43,15 @@ FLUENTBIT_PACKAGE_URL=${URL_PATTERN}/${FLUENTBIT_PACKAGE_FILE}
EFI_PARTITION_MOUNT_POINT=/boot/efi/ EFI_PARTITION_MOUNT_POINT=/boot/efi/
RELATIVE_EFI_IMAGE_DIR=/EFI/Linux/ RELATIVE_EFI_IMAGE_DIR=/EFI/Linux/
EFI_IMAGE_DIR=${EFI_PARTITION_MOUNT_POINT}/${RELATIVE_EFI_IMAGE_DIR} EFI_IMAGE_DIR=${EFI_PARTITION_MOUNT_POINT}/${RELATIVE_EFI_IMAGE_DIR}
EFI_PARITITON_MOUNT_POINT=$(realpath -m $EFI_PARTITION_MOUNT_POINT) EFI_PARITITON_MOUNT_POINT=$(realpath -m "$EFI_PARTITION_MOUNT_POINT")
RELATIVE_EFI_IMAGE_DIR=$(realpath -m $RELATIVE_EFI_IMAGE_DIR) RELATIVE_EFI_IMAGE_DIR=$(realpath -m "$RELATIVE_EFI_IMAGE_DIR")
EFI_IMAGE_DIR=$(realpath -m $EFI_IMAGE_DIR) EFI_IMAGE_DIR=$(realpath -m "$EFI_IMAGE_DIR")
dracut_output_file=dracut-output dracut_output_file=dracut-output
# used mainly in uefi-keys/make_keys.sh # used mainly in uefi-keys/make_keys.sh
CERT_DIR=public-certificates CERT_DIR=uefi-keys/public-certificates
KEYS_DIR=private-keys KEYS_DIR=private-keys
PUBLIC_CERT_DIR=${PROJECT_DIR}/${CERT_DIR}/${SERVER_GROUP} PUBLIC_CERT_DIR=${PROJECT_DIR}/${CERT_DIR}/${SERVER_GROUP}
PRIVATE_KEYS_DIR=${PROJECT_DIR}/${KEYS_DIR}/${SERVER_GROUP} PRIVATE_KEYS_DIR=${PROJECT_DIR}/${KEYS_DIR}/${SERVER_GROUP}
PUBLIC_CERT_DIR="$(realpath -m \"${PUBLIC_CERT_DIR}\")" PUBLIC_CERT_DIR=$(realpath -m "$PUBLIC_CERT_DIR")
PRIVATE_KEYS_DIR="$(realpath -m \"${PRIVATE_KEYS_DIR}\")" PRIVATE_KEYS_DIR=$(realpath -m "$PRIVATE_KEYS_DIR")
...@@ -125,7 +125,7 @@ make install ...@@ -125,7 +125,7 @@ make install
cd - cd -
# Generation of dracut.module/dracut.conf # Generation of dracut.module/dracut.conf
dracut_conf_regex="s|%PUBLIC_CERT_DIR%|${PUBLIC_CERT_DIR}|g;s|%CERT_NAME%|${CERT_NAME}|;s|%SIGNING_KEY_NAME%|${SIGNING_KEY_NAME}|g;s|||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|%HOSTNAME%|${HOSTNAME}|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|%HOSTNAME%|${HOSTNAME}|g"
cd dracut.module cd dracut.module
sed "${dracut_conf_regex}" dracut.conf.in > dracut.conf sed "${dracut_conf_regex}" dracut.conf.in > dracut.conf
cd - cd -
......
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