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

Why do we need dracut stuff in the recovery system? #3156

Open
jsmeix opened this issue Feb 16, 2024 · 6 comments
Open

Why do we need dracut stuff in the recovery system? #3156

jsmeix opened this issue Feb 16, 2024 · 6 comments

Comments

@jsmeix
Copy link
Member

jsmeix commented Feb 16, 2024

We have in conf/GNU/Linux.conf

COPY_AS_IS+=( ... /etc/dracut.conf /etc/dracut.conf.d /usr/lib/dracut ... )

It was added via
2d54454
which mentiones #233
but that does not explain anything about dracut
(or I am blind and don't see the obvious)?

In current GitHub master code

find usr/sbin/rear usr/share/rear/ -type f | xargs grep 'dracut'

finds only rescue/GNU/Linux/220_load_modules_from_initrd.sh

if test -s /etc/dracut.conf ; then
    MODULES_LOAD+=(
        $(
            add_drivers=
            source /etc/dracut.conf
            for s in /etc/dracut.conf.d/*.conf ; do
                source $s
            done
            echo $add_drivers
        )
    )
fi

where /etc/dracut.conf and /etc/dracut.conf.d
are used on the original system.

But I fail to see where anything of
/etc/dracut.conf /etc/dracut.conf.d /usr/lib/dracut
is needed in the recovery system.

So I am wondering why we need dracut stuff in the recovery system?

@jsmeix jsmeix added this to the ReaR v2.8 milestone Feb 16, 2024
@jsmeix jsmeix self-assigned this Feb 16, 2024
@jsmeix
Copy link
Member Author

jsmeix commented Feb 16, 2024

@rear/contributors
can someone of you explain to me
why we need dracut stuff in the recovery system?

Copy link

Stale issue message

@schlomo
Copy link
Member

schlomo commented Apr 17, 2024

@jsmeix I agree with your question, however I find more files that mention dracut:

❯ grep -lr dracut
./usr/sbin/rear
./usr/share/rear/rescue/GNU/Linux/220_load_modules_from_initrd.sh
./usr/share/rear/lib/network-functions.sh
./usr/share/rear/finalize/Fedora/550_rebuild_initramfs.sh
./usr/share/rear/finalize/SUSE_LINUX/i386/550_rebuild_initramfs.sh
./usr/share/rear/conf/GNU/Linux.conf

However, I also don't see anything that seems to use the dracut configuration files of the rescue system.

I'd suppose this is a leftover from something that either was changed or an attempt that turned out to be not required.

Maybe you just try removing it and check on RHEL and SUSE_LINUX?

Besides that, probably nice example for the value of #3203

@jsmeix
Copy link
Member Author

jsmeix commented Apr 18, 2024

@schlomo
regarding which files contain 'dracut':
I think things were different at the time when I made
my initial comment. Now I get the same as you:

# find usr/sbin/rear usr/share/rear/ -type f | xargs grep -l 'dracut'
usr/sbin/rear
usr/share/rear/conf/GNU/Linux.conf
usr/share/rear/finalize/Fedora/550_rebuild_initramfs.sh
usr/share/rear/finalize/SUSE_LINUX/i386/550_rebuild_initramfs.sh
usr/share/rear/rescue/GNU/Linux/220_load_modules_from_initrd.sh
usr/share/rear/lib/network-functions.sh

I will try out how it works on SUSE without
/etc/dracut.conf /etc/dracut.conf.d /usr/lib/dracut
in COPY_AS_IS.

I do not understand why this issue
is an example for the value of
#3203
Could you explain?

@schlomo
Copy link
Member

schlomo commented Apr 18, 2024

I thought that the following code could be simplified with the help of a function that reads shell variables from shell-style configuration files:

# Old SUSE style
if test -s /etc/sysconfig/kernel ; then
MODULES_LOAD+=(
$(
INITRD_MODULES=
source /etc/sysconfig/kernel
echo $INITRD_MODULES
)
)
fi
# Fedora, Red Hat & new SUSE uses dracut
if test -s /etc/dracut.conf ; then
MODULES_LOAD+=(
$(
add_drivers=
source /etc/dracut.conf
for s in /etc/dracut.conf.d/*.conf ; do
source $s
done
echo $add_drivers
)
)
fi

@jsmeix
Copy link
Member Author

jsmeix commented Apr 18, 2024

Ah - yes of course - now even I see the connection ;-)

As far as I see we have currently
43 places where we call 'source' in our scripts, see
#3203 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants