Skip to content
Snippets Groups Projects
Commit 3a397d44 authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

fng-install:prepare-kernel: Removed i.MX8 specific script

The i.MX8 used a custom post-install script for the prepare-kernel
step. Since the default script has been adopted for the i.MX8, the
custom script is removed.

BCS 746-000877
parent 3edf9fc8
No related branches found
No related tags found
1 merge request!391Add RTC detection for TANARO
#!/bin/sh
# shellcheck disable=2154
#
# This script is called during installation from the fng-install script.
# In this case the following env variables are set from the caller:
# DEVICETREE='$DEVICETREE' \
# DEVICETREEOV='$DEVICETREEOV' \
# ROOTPARTITION='$TARGET_PARTITION_ROOT' \
# BOOTPARTITION='$TARGET_PARTITION_BOOT' \
#
# The script can also be called standalone, or by the fnginstall-postinstallation
# script in the target OS, to update configurations
#
# This helper script to select the used base kernel and base devicetree
# and combine those together to linux image
# In dunfell we currently use the feature to load the devicetree directly
# after the kernel in the memory by concat both files
#
# Kernel and devicetree files are detect automatically
# but may be specified on the commandline
# After the selection, the result is written to two textfiles
# 'kernel' and 'devicetree'.
# When these are found, these values override the autodetection
#
# The files to work on, are selected by a list of known boot partitions
# from which the first one is selected.
# To work on an other folder it needs to be mounted externally
# and specified in the environment variable BOOTDIR
# shellcheck source=../../../../recipes-guf/sharedconf/sharedconf/gf-functions.sh
if ! . /usr/sbin/gf-functions.sh; then
echo "Unable to include gf-functions"
fi
# shellcheck source=../gf-prepare-common.sh
if ! . /usr/sbin/gf-prepare-common.sh; then
echo "Unable to include gf-prepare-common"
fi
#========================================================
# Get the directory containing the bootfiles
mount_bootpartition BOOTFILES_DIR
# Get the bootscript in that directory
find_bootscript BOOTSCRIPT "$BOOTFILES_DIR"
#========================================================
cd "$BOOTFILES_DIR" || exit 1
# Exchange the devicetree to load during boot in boot.cfg
if [ -n "$DEVICETREE" ]; then
DEVICETREE="${DEVICETREE##*/}"
if [ ! -e "${DEVICETREE}" ]; then
echo "Unable to find $DEVICETREE"
exit 1
fi
sed -i -e "s/^devicetree=.*\$/devicetree=${DEVICETREE}/g" "$BOOTSCRIPT"
fi
#==============================================================
# Change boot file to load the correct kernel image
#==============================================================
KERNEL_FILE="$( find . -maxdepth 1 -name "*Image*" | head -n 1 )"
if [ -z "$KERNEL_FILE" ];then
echo "Failed to determine the kernel file to use."
exit 1
fi
KERNEL_FILE="${KERNEL_FILE##*/}"
echo "$KERNEL_FILE" > kernel
# Exchange the kernel file to load during boot in boot.cfg
sed -i -e "s/^kernel=.*\$/kernel=${KERNEL_FILE}/g" "$BOOTSCRIPT" || echo "Failed to set kernel image file in ${BOOTSCRIPT}."
# We are done, cleanup
umount_bootpartition
exit 0
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment