#1964 PR merged: Add specific required programs to REQUIRED_PROGS (issue 1963)

Labels: enhancement, bug, fixed / solved / done

jsmeix opened issue at 2018-11-14 13:37:

  • Type: Bug Fix / Enhancement

  • Impact: High
    Basically no impact on usual systems where all those tools are installed
    but high impact on systems where such tools are missing because
    when specific required programs are missing on a system
    better safe than sorry and error out during "rear mkrescue/mkbackup"
    than "successfully" provide the user a recovery system that is useless.

  • Reference to related issue (URL):
    https://github.com/rear/rear/issues/1963

  • How was this pull request tested?
    By me on my system with an ext4 root filesystem as in
    https://github.com/rear/rear/issues/1963#issue-380602044

  • Brief description of the changes in this pull request:

Currently this is only a first step where I only added specific
required parted and mkfs.* programs to REQUIRED_PROGS
in layout/save/GNU/Linux/200_partition_layout.sh
and layout/save/GNU/Linux/230_filesystem_layout.sh
depending on what there actually is in disklayout.conf

Further commits here will add more specific required programs
in the 'layout/save' scripts as far as I can with reasonable effort
(I am not an expert in all those various kind of storage stuff
so that I cannot imagine what specific programs are required
to recreate all those various kind of storage objects).

jsmeix commented at 2018-11-14 13:46:

How it errors out if specific required mkfs.* programs are missing:

# mv /usr/sbin/mkfs /usr/sbin/mkfs.away
# mv /usr/sbin/mkfs.ext4 /usr/sbin/mkfs.ext4.away

# usr/sbin/rear -D mkrescue
...
ERROR: Cannot find required programs:  mkfs mkfs.ext4
Some latest log messages since the last called script 950_check_missing_programs.sh:
  2018-11-14 14:43:43.830345921 Leaving debugscripts mode (back to previous bash flags and options settings).
  2018-11-14 14:43:43.833867674 Including build/GNU/Linux/630_verify_resolv_conf_file.sh
  2018-11-14 14:43:43.834822203 Entering debugscripts mode via 'set -x'.
  2018-11-14 14:43:43.838457382 Leaving debugscripts mode (back to previous bash flags and options settings).
  2018-11-14 14:43:43.841995557 Including build/default/950_check_missing_programs.sh
  2018-11-14 14:43:43.842928019 Entering debugscripts mode via 'set -x'.
  /root/rear.github.master/usr/share/rear/lib/_input-output-functions.sh: line 331: type: mkfs: not found
  /root/rear.github.master/usr/share/rear/lib/_input-output-functions.sh: line 331: type: mkfs.ext4: not found
Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-g243.log for details
Exiting rear mkrescue (PID 3383) and its descendant processes
Running exit tasks
You should also rm -Rf /tmp/rear.YXblpvIoVW51qZR
Terminated

jsmeix commented at 2018-11-15 11:23:

Now specific required programs are added to REQUIRED_PROGS
in those scripts:

usr/share/rear/layout/save/GNU/Linux/200_partition_layout.sh
usr/share/rear/layout/save/GNU/Linux/210_raid_layout.sh
usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh
usr/share/rear/layout/save/GNU/Linux/230_filesystem_layout.sh
usr/share/rear/layout/save/GNU/Linux/240_swaps_layout.sh
usr/share/rear/layout/save/GNU/Linux/250_drbd_layout.sh
usr/share/rear/layout/save/GNU/Linux/260_crypt_layout.sh
usr/share/rear/layout/save/GNU/Linux/270_hpraid_layout.sh
usr/share/rear/layout/save/GNU/Linux/280_multipath_layout.sh

which means specific required programs are added to REQUIRED_PROGS
for those component keywords in disklayout.conf:

disk part (via 200_partition_layout.sh)
raid (via 210_raid_layout.sh)
lvmdev lvmgrp lvmvol (via 220_lvm_layout.sh)
fs (via 230_filesystem_layout.sh)
swap (via 240_swaps_layout.sh)
drbd (via 250_drbd_layout.sh)
crypt (via 260_crypt_layout.sh)
logicaldrive smartarray (via 270_hpraid_layout.sh)
multipath (via 280_multipath_layout.sh)

[Export of Github issue for rear/rear.]