#2532 PR merged: ppc64 support for BACKUP=DP

Labels: enhancement, fixed / solved / done, external tool

sebastian-koehler opened issue at 2020-11-30 23:02:

Type: Enhancement

Impact: High
Other platforms supporting the Data Protector Disk Agent, but not the Cell Console (GUI), will be supported with REAR and BACKUP=DP. This includes ppc64.

Reference to related issue (URL):
none

How was this pull request tested?
Applied the changes to a SLES15 SP1 system running rear 2.6.1. Created a new ISO, booted the system and ran through various test cases.

Brief description of the changes in this pull request:
Relevant checks unavailable on clients without the Data Protector Cell Console (GUI) are skipped. Restore defaults to external Data Protector GUI restore.

jsmeix commented at 2020-12-01 11:21:

@rear/contributors
I would appreciate it if there was a second review from someone else.
If not and when there are no objections I would like to merge it tomorrow afternoon.

schlomo commented at 2020-12-01 11:27:

I obviously can't test this but it looks to me like the code would benefit from a refactoring to better utilize our arch-dependent sub directory structure so that the ReaR framework will make sure to include the right scripts for the platform that ReaR runs on.

Otherwise looks good.

jsmeix commented at 2020-12-01 11:41:

As far as I see those code parts that should behave different
depending on the value for the ARCH variable are within one script.
But our arch-dependent sub directory structure only works for whole scripts.
So I think smaller code parts within one script cannot be easily moved out
into separated scripts in arch-dependent sub directories.

Currently the following arch-dependent Linux-ARCH sub directories are in use

/Linux-arm/
/Linux-i386/
/Linux-ia64/
/Linux-ppc64/
/Linux-ppc64le/
/Linux-s390/

In usr/share/rear/conf/default.conf x86_64|i686|i586 are mapped to i386 via

# These variables are used to include arch/os/version specific stuff:
# machine architecture, OS independent
REAL_MACHINE="$( uname -m )"
case "$REAL_MACHINE" in
    (x86_64|i686|i586)
        # all these behave exactly like i386. For 64bit we took care to handle the
        # special cases within the 32bit scripts to prevent code duplication
        MACHINE=i386
        ;;
    (arm*|aarch*)
        MACHINE=arm
        ;;
    (s390*)
        MACHINE=s390
        ;;
    (*)
        MACHINE=$REAL_MACHINE
esac
# Architecture, e.g. Linux-i386
ARCH="$( uname -s )-$MACHINE" 2>>/dev/null

so Linux-x86_64 never happens as arch-dependent sub directory
or as value for the ARCH variable.
So it seems those tests could be simplified to

if [ $ARCH == "Linux-i386" ] || [ $ARCH == "Linux-ia64" ] ; then

sebastian-koehler commented at 2020-12-01 11:47:

As far as I see those code parts that should behave different
depending on the value for the ARCH variable are within one script.
But our arch-dependent sub directory structure only works for whole scripts.
So I think smaller code parts within one script cannot be easily moved out
into separated scripts in arch-dependent sub directories.

I was actually looking into this before I did the changes and came to a similar conclusion. In the end it would result in multiple scripts all doing the same making it very complex to maintain.

so Linux-x86_64 never happens as arch-dependent sub directory
or as value for the ARCH variable.
So it seems those tests could be simplified to

if [ $ARCH == "Linux-i386" ] || [ $ARCH == "Linux-ia64" ] ; then

Okay, that's handy. Will work on this, too.

sebastian-koehler commented at 2020-12-01 12:13:

Thanks for the feedback.

jsmeix commented at 2020-12-02 13:05:

@sebastian-koehler
thank you for your continuous enhancements
of the BACKUP=DP support in ReaR.


[Export of Github issue for rear/rear.]