#3234 Issue closed: Replace direct usage of /etc/rear-release with RECOVERY_MODE¶
Labels: cleanup, fixed / solved / done
jsmeix opened issue at 2024-05-27 08:04:¶
See
https://github.com/rear/rear/pull/3228#issuecomment-2132868526
that reads (excerpts)
replace our leftover direct usage of /etc/rear-release
...
where direct usage of /etc/rear-release is not needed.
At first glance I think direct usage of /etc/rear-release
is only needed in
--------------------------------------------------------------------
usr/sbin/rear:
test -e "/etc/rear-release" && RECOVERY_MODE='y' || RECOVERY_MODE=''
usr/share/rear/build/default/970_add_rear_release.sh:
echo "$PRODUCT release $VERSION" >$ROOTFS_DIR/etc/rear-release
--------------------------------------------------------------------
so direct usage of /etc/rear-release in
--------------------------------------------------------------------
usr/share/rear/init/default/002_check_rear_recover_mode.sh
usr/share/rear/lib/help-workflow.sh
usr/share/rear/lib/recover-workflow.sh
usr/share/rear/lib/mountonly-workflow.sh
--------------------------------------------------------------------
should be replaced by using RECOVERY_MODE instead.
gdha commented at 2024-07-01 14:25:¶
@jsmeix Do you want this be fixed for release 3.0 or 3.1? Please adapt the milestone to the one you prefer. Thanks.
gdha commented at 2024-09-05 08:18:¶
@jsmeix milestone is still 'ReaR v2.8' - please adjust as you think it best fits (v3.0 or v3.1). Thanks.
jsmeix commented at 2024-09-05 08:28:¶
I postponed it to the ReaR v3.1 milestone
because things work with direct usage of /etc/rear-release
so this could be cleaned up for ReaR v3.1 as time permits.
github-actions commented at 2025-02-15 02:33:¶
Stale issue message
github-actions commented at 2025-04-19 02:43:¶
Stale issue message
github-actions commented at 2025-06-22 03:13:¶
Stale issue message
github-actions commented at 2025-08-23 02:48:¶
Stale issue message
jsmeix commented at 2026-02-27 09:07:¶
This issue could be a bug, for the reason see
https://github.com/rear/rear/pull/3565#issuecomment-3966777467
(excerpts)
... perhaps testing for RECOVERY_MODE
might be what could be actually needed here
when GRUB-BLS support is also intended
for Portable Recovery Mode where "rear -p recover"
is run within a foreign rescue system
...
in current ReaR code we still use /etc/rear-release
at various places instead of testing for RECOVERY_MODE
which could be bugs in several cases for the same reason
as I explained above
I.e. testing for /etc/rear-release
instead of testing for RECOVERY_MODE
could be wrong in Portable Recovery Mode
because /etc/rear-release does not exist
within a foreign rescue system.
I will have a look as soon as possible
to check if this issue is a bug and
to fix things for ReaR 3.0 as needed.
jsmeix commented at 2026-03-04 11:54:¶
I checked where /etc/rear-release is used,
see https://github.com/rear/rear/pull/3577
The unexpected result is that almost all places
where /etc/rear-release is used are correct
so I only added comments to explain
why usage of /etc/rear-release is correct.
Even in init/default/002_check_rear_recover_mode.sh
/etc/rear-release could be used because
also in this case things should be done
only when we are in the ReaR recovery system
and not when we are in PORTABLE mode.
jsmeix commented at 2026-03-05 12:49:¶
There was no bug, all was OK, see
https://github.com/rear/rear/issues/3234#issuecomment-3997067169
[Export of Github issue for rear/rear.]