Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No REQUIRED_PROGS in conf/GNU/Linux.conf #892

Closed
jsmeix opened this issue Jun 23, 2016 · 8 comments
Closed

No REQUIRED_PROGS in conf/GNU/Linux.conf #892

jsmeix opened this issue Jun 23, 2016 · 8 comments
Assignees
Labels
cleanup enhancement Adaptions and new features fixed / solved / done minor bug An alternative or workaround exists
Milestone

Comments

@jsmeix
Copy link
Member

jsmeix commented Jun 23, 2016

Current rear master.

The PROGS array in usr/share/rear/conf/GNU/Linux.conf
lists so many basic tools (like bash grep cat) but there is no
REQUIRED_PROGS array in usr/share/rear/conf/GNU/Linux.conf

I wonder if it wouldn't be better to have
the basic tools in an REQUIRED_PROGS array?

@jsmeix jsmeix added enhancement Adaptions and new features cleanup labels Jun 23, 2016
@jsmeix jsmeix added this to the Rear v1.19 milestone Jun 23, 2016
@jsmeix
Copy link
Member Author

jsmeix commented Jun 28, 2016

There is a predefined REQUIRED_PROGS array
in usr/share/rear/conf/default.conf that also contains
things like bash and grep but e.g. no cat
and no less ( cf. #755 )

@gdha
Copy link
Member

gdha commented Oct 3, 2016

@jsmeix I don't believe this issue is a show stopper for a new release, right? Perhaps, we better move the milestone?

@jsmeix jsmeix modified the milestones: Rear future, Rear v1.19 Oct 4, 2016
@jsmeix
Copy link
Member Author

jsmeix commented Oct 4, 2016

This is certainly not a show-stopper for the 1.19 release.

@gdha
Copy link
Member

gdha commented May 30, 2018

pushing fwd to 2.5

@gdha gdha modified the milestones: ReaR v2.4, ReaR v2.5 May 30, 2018
gdha added a commit that referenced this issue Nov 9, 2018
moved PROGS from GNU/Linux.conf to default.conf REQUIRED_PROGS #892
@jsmeix jsmeix self-assigned this Nov 12, 2018
@jsmeix
Copy link
Member Author

jsmeix commented Nov 12, 2018

I think with #1961 merged
it is a good first step into the right direction, cf.
#1961 (comment)

I do not yet close this issue because I like to play around a bit more
how ReaR behaves during "rear mkrescue" when basic programs are missing.

@jsmeix
Copy link
Member Author

jsmeix commented Nov 12, 2018

I had the dim feeling from the past that the checks
that intend to verify all REQUIRED_PROGS exist
are messy in current ReaR and I was right:

With REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" qqqq ) in local.conf
things somewhat work but do not work really well.

There are two checks with same code, one in usr/sbin/rear and
another one in prep/default/950_check_missing_programs.sh
and both are not fully right because:

1.)
In general there should not be duplicated code

2.)
The check in prep/default/950_check_missing_programs.sh
is too early for things like
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" cryptsetup dmsetup )
in layout/save/GNU/Linux/260_crypt_layout.sh or
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" "brctl" )
in rescue/GNU/Linux/310_network_devices.sh
because the 'prep' stage runs before the 'layout/save' and 'rescue' stages
so that it won't error out during "rear mkrescue" when
e.g. 'cryptsetup' or 'brctl' are required but do not exists.

3.)
In case of 2. it errors out too late when the user cannot fix things
during "rear recover" by the check in usr/sbin/rear

I will clean up the checks that verify all REQUIRED_PROGS exist...

@jsmeix
Copy link
Member Author

jsmeix commented Nov 12, 2018

#1962 intends to solve the issues in
#892 (comment)

@jsmeix jsmeix added the minor bug An alternative or workaround exists label Nov 12, 2018
jsmeix added a commit that referenced this issue Nov 14, 2018
…sue_892

Cleanup and enhancement of REQUIRED_PROGS and PROGS checks:
Moved prep/default/950_check_missing_programs.sh
to init/default/950_check_missing_programs.sh
and removed the duplicated code from usr/sbin/rear which is now
obsolete because 'init' stage scripts are run in any case.
Added build/default/950_check_missing_programs.sh symlink
that points to init/default/950_check_missing_programs.sh
so that this check is run again during 'build' stage (i.e. after the 'prep'
and 'layout/save' and 'rescue' stages where additional required programs
are added to REQUIRED_PROGS during "rear mkrescue/mkbackup").
Added a simple verification step to build/default/980_verify_rootfs.sh
which checks that each program in REQUIRED_PROGS and PROGS
(in case of PROGS provided the program exists on the original system)
can be found as an executable command within the recovery system.
See #892 (comment)
and #1962 (comment)
@jsmeix
Copy link
Member Author

jsmeix commented Nov 14, 2018

With #1962 merged
I consider this particular issue sufficiently fixed for now.

In the future we may find out that more programs
should be added to REQUIRED_PROGS by default, cf.
#1961 (comment)

What we will need to improve is that specific scripts which result
that specific programs will be called in the recovery system
need to add those programs to REQUIRED_PROGS.

For example I have an ext4 root filesystem and did

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

and "rear -D mkrescue" did not error out (or show any kind of message)
regardless that without mkfs and/or mkfs.ext4 in the recovery system

# find /tmp/rear.2VRqe2odrvdlsPY/rootfs | grep mkfs

/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.ext2
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.jfs
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.ext3
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.reiserfs
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.vfat
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.btrfs
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.xfs

# grep ext4 /tmp/rear.2VRqe2odrvdlsPY/rootfs/.../var/lib/rear/layout/disklayout.conf
# Filesystems (only ext2,ext3,ext4,vfat,xfs,reiserfs,btrfs are supported).
fs /dev/sda2 / ext4 uuid=aed8d81b-29bf-405e-9049-29a6c0e702d3 label= ...

the ext4 root filesystem cannot be recreated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup enhancement Adaptions and new features fixed / solved / done minor bug An alternative or workaround exists
Projects
None yet
Development

No branches or pull requests

2 participants