Skip to content
Snippets Groups Projects
Commit b89357c0 authored by Jonas Höppner's avatar Jonas Höppner
Browse files

fnginstall-postinstallation: Fix boot partition detection for fngsystem

The scripts failed if run in an installed fngsystem. This is needed in
FT2, when new xml files are installed after the FNGSystem installation.

(cherry picked from commit 920b5c91)
parent fa41aa9f
No related branches found
No related tags found
2 merge requests!418Integrate gitlab-ci/fix-gitlab-ci-integration and 6 more,!396Pull changes from dunfell branch
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# List of possible bootpartitions for this installation. # List of possible bootpartitions for this installation.
# Its possibly changed during installation # Its possibly changed during installation
BOOTPARTITIONS="/dev/disk/by-label/LINUX /dev/mmcblk0p2 /dev/mmcblk1p2" BOOTPARTITIONS="/dev/disk/by-label/LINUX /dev/mmcblk0p2 /dev/mmcblk1p2"
BOOTPARTITIONS_FNG="/dev/disk/by-label/Flash-N-Go /dev/mmcblk0p1 /dev/mmcblk1p1"
BOOTSCRIPTNAMES="boot.cfg bootB.cfg boot-alt.cfg" BOOTSCRIPTNAMES="boot.cfg bootB.cfg boot-alt.cfg"
error_out() error_out()
...@@ -206,8 +207,36 @@ get_platform() ...@@ -206,8 +207,36 @@ get_platform()
return 0 return 0
} }
# =================================================================
# Functions to find out if we are inside fngsystem
#
# =================================================================
is_fng_system_gfversion()
{
# gfversion return 0 if the version can be correctly found
# and an error otherwise
gf-versions.sh -q fngsystem 2>/dev/null && return 0
return 1
}
is_fng_system_deprecated()
{
# if the hostname contains 'FLASH-N-GO', return 0
grep -q FLASH-N-GO /etc/hostname && return 0
return 1
}
# Allow to debug commands # Allow to debug commands
VERBOSE="${VERBOSE:-0}" VERBOSE="${VERBOSE:-0}"
if [ "$VERBOSE" -gt 2 ];then if [ "$VERBOSE" -ge 2 ];then
set -x set -x
fi fi
if command -v gf-versions.sh 1>/dev/null;then
is_fng_system=is_fng_system_gfversion
else
is_fng_system=is_fng_system_deprecated
fi
if $is_fng_system; then
BOOTPARTITIONS=$BOOTPARTITIONS_FNG
fi
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