Skip to content

Commit

Permalink
make constants and some (more or less fixed) variables really immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPawn committed Oct 31, 2018
1 parent b448012 commit c960824
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions bootmanager/gui_bootmanager
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,76 +78,76 @@
# common values # # common values #
# # # #
####################################################################################################### #######################################################################################################
html_cache_file="/var/tmp/gui_bootmanager.html" readonly html_cache_file="/var/tmp/gui_bootmanager.html"
html_cache_error="/var/tmp/gui_bootmanager.rc" readonly html_cache_error="/var/tmp/gui_bootmanager.rc"
urlader_environment="/proc/sys/urlader/environment" readonly urlader_environment="/proc/sys/urlader/environment"
system_select_name="linux_fs_start" readonly system_select_name="linux_fs_start"
active_name="active" readonly active_name="active"
inactive_name="inactive" readonly inactive_name="inactive"
branding_name="firmware_version" readonly branding_name="firmware_version"
proc_mtd="/proc/mtd" readonly proc_mtd="/proc/mtd"
proc_devices="/proc/devices" readonly proc_devices="/proc/devices"
mtd_prefix="mtd" readonly mtd_prefix="mtd"
mtdblock_prefix="/dev/mtdblock" readonly mtdblock_prefix="/dev/mtdblock"
mtdblock_mask="${mtdblock_prefix}%u" readonly mtdblock_mask="${mtdblock_prefix}%u"
proc_cpuinfo="/proc/cpuinfo" readonly proc_cpuinfo="/proc/cpuinfo"
proc_mountinfo="/proc/self/mountinfo" readonly proc_mountinfo="/proc/self/mountinfo"
kernel_name="kernel" readonly kernel_name="kernel"
filesystem_name="filesystem" readonly filesystem_name="filesystem"
reserved_prefix="reserved" readonly reserved_prefix="reserved"
alt_root_mount_name="alt_root" readonly alt_root_mount_name="alt_root"
defaults_dir="etc/default.$CONFIG_PRODUKT" readonly defaults_dir="etc/default.$CONFIG_PRODUKT"
sysfs_block_dir="/sys/block" readonly sysfs_block_dir="/sys/block"
loop_driver_name="loop" readonly loop_driver_name="loop"
backing_file_name="backing_file" readonly backing_file_name="backing_file"
tmpdir="${TMPDIR:-/var/tmp}" readonly tmpdir="${TMPDIR:-/var/tmp}"
avm_rcconf="etc/init.d/rc.conf" readonly avm_rcconf="etc/init.d/rc.conf"
semafile="/var/run/gui_bootmanager.sem" readonly semafile="/var/run/gui_bootmanager.sem"
fdt_chosen="/proc/device-tree/chosen" readonly fdt_chosen="/proc/device-tree/chosen"
saved_environment="/var/env" readonly saved_environment="/var/env"
version_components="VERSION SUBVERSION DATE" readonly version_components="VERSION SUBVERSION DATE"
radio_button_checked=" checked=\\\"checked\\\"" readonly radio_button_checked=" checked=\\\"checked\\\""
####################################################################################################### #######################################################################################################
# # # #
# various sources for version numbers # # various sources for version numbers #
# # # #
####################################################################################################### #######################################################################################################
yourfritz_version_file="etc/.yourfritz_version" readonly yourfritz_version_file="etc/.yourfritz_version"
freetz_version_file="etc/.freetz-version" readonly freetz_version_file="etc/.freetz-version"
modfs_version_file="etc/.modfs_version" readonly modfs_version_file="etc/.modfs_version"
avm_version_file="etc/version" readonly avm_version_file="etc/version"
version_files="$yourfritz_version_file $freetz_version_file $modfs_version_file $avm_version_file" readonly version_files="$yourfritz_version_file $freetz_version_file $modfs_version_file $avm_version_file"
modified_by="YourFritz Freetz modfs -" readonly modified_by="YourFritz Freetz modfs -"
####################################################################################################### #######################################################################################################
# # # #
# GRX5 and VR9 specific settings # # GRX5 and VR9 specific settings #
# # # #
####################################################################################################### #######################################################################################################
mtd_filesystem_name_active="${filesystem_name}" readonly mtd_filesystem_name_active="${filesystem_name}"
mtd_filesystem_name_inactive="${reserved_prefix}-${filesystem_name}" readonly mtd_filesystem_name_inactive="${reserved_prefix}-${filesystem_name}"
mtd_kernel_name_active="${kernel_name}" readonly mtd_kernel_name_active="${kernel_name}"
mtd_kernel_name_inactive="${reserved_prefix}-${kernel_name}" readonly mtd_kernel_name_inactive="${reserved_prefix}-${kernel_name}"
####################################################################################################### #######################################################################################################
# # # #
# VR9 specific settings # # VR9 specific settings #
# # # #
####################################################################################################### #######################################################################################################
wrapper_mount_name="wrapper" readonly wrapper_mount_name="wrapper"
vr9_wrapper_dir="/wrapper" readonly vr9_wrapper_dir="/wrapper"
vr9_rootfs_name="/filesystem_core.squashfs" readonly vr9_rootfs_name="/filesystem_core.squashfs"
vr9_image_source_active="${vr9_wrapper_dir}${vr9_rootfs_name}" readonly vr9_image_source_active="${vr9_wrapper_dir}${vr9_rootfs_name}"
vr9_image_source_inactive="mount:%s:${vr9_rootfs_name}" readonly vr9_image_source_inactive="mount:%s:${vr9_rootfs_name}"
######################################################################################################## ########################################################################################################
# # # #
# Puma6 / Puma7 specific settings # # Puma6 / Puma7 specific settings #
# # # #
####################################################################################################### #######################################################################################################
puma_helper="/etc/puma6_helper.sh" readonly puma_helper="/etc/puma6_helper.sh"
puma_partitions="/proc/avm_partitions" readonly puma_partitions="/proc/avm_partitions"
puma_filesystem_name_active="${filesystem_name}_ATOM" readonly puma_filesystem_name_active="${filesystem_name}_ATOM"
puma_filesystem_name_inactive="${filesystem_name}_${reserved_prefix}_ATOM" readonly puma_filesystem_name_inactive="${filesystem_name}_${reserved_prefix}_ATOM"
puma_kernel_name_active="${kernel_name}_ATOM" readonly puma_kernel_name_active="${kernel_name}_ATOM"
puma_kernel_name_inactive="${kernel_name}_${reserved_prefix}_ATOM" readonly puma_kernel_name_inactive="${kernel_name}_${reserved_prefix}_ATOM"
####################################################################################################### #######################################################################################################
# # # #
# sub-functions # # sub-functions #
Expand Down Expand Up @@ -1004,10 +1004,10 @@ not_supported()
####################################################################################################### #######################################################################################################
collect_data() collect_data()
{ {
running_version="$(get_system_version)" readonly running_version="$(get_system_version)"
running_date="$(get_system_date)" readonly running_date="$(get_system_date)"
running_fsdate="$(get_modified_date)" readonly running_fsdate="$(get_modified_date)"
running_modified="$(get_modified_by)" readonly running_modified="$(get_modified_by)"
chg_running_branding=0 chg_running_branding=0
running_branding_fixed=0 running_branding_fixed=0
if change_branding_support; then if change_branding_support; then
Expand All @@ -1016,7 +1016,7 @@ collect_data()
[ -z "$(get_fixed_branding)" ] || running_branding_fixed=1 [ -z "$(get_fixed_branding)" ] || running_branding_fixed=1
[ $(count_of_items "$running_brandings") -gt 1 ] && chg_running_branding=1 [ $(count_of_items "$running_brandings") -gt 1 ] && chg_running_branding=1
fi fi
current_system_switch=$(get_system_switch) readonly current_system_switch=$(get_system_switch)
alternative_is_missing=1 alternative_is_missing=1
chg_alternative_branding=0 chg_alternative_branding=0
alternative_branding_fixed=0 alternative_branding_fixed=0
Expand Down Expand Up @@ -1070,7 +1070,7 @@ is_dualboot_supported()
####################################################################################################### #######################################################################################################
exec 2>&1 exec 2>&1
set -e set -e
tempdir="$tmpdir/$$_$(date +%s)" readonly tempdir="$tmpdir/$$_$(date +%s)"
mkdir -p "$tempdir" 2>/dev/null mkdir -p "$tempdir" 2>/dev/null
trap cleanup HUP EXIT INT TERM trap cleanup HUP EXIT INT TERM
rc=127 rc=127
Expand Down

0 comments on commit c960824

Please sign in to comment.