You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lorax need DracutChroot() class during make initrd.img, and lorax support --dracut-conf argument to pass the dracut_args for dracut --conf argument. In old dracut(<055-105-g7de9ffc05747) version, dracut.sh will skip the --conf conffile check if it is not exist, However, the new dracut(>=055-105-g7de9ffc05747, commit 7de9ffc05747("fix(dracut.sh): do not ignore invalid config file or dir path")) will exit 1 if --conf conffile is not exist, the patch as follows:
# if we were not passed a config file, try the default one
-if [[ ! -f $conffile ]]; then+if [[ -z $conffile ]]; then
if [[ $allowlocal ]]; then
conffile="$dracutbasedir/dracut.conf"
else
conffile="$dracutsysrootdir/etc/dracut.conf"
fi
+elif [[ ! -f $conffile ]]; then+ printf "%s\n" "dracut: Configuration file '$conffile' not found." >&2+ exit 1
fi
What we can do?(maybe)
forbidden lorax --dracut-conf argument;
find a good way to pass the --dracut-conf conffile in DracutChroot(), so that, [[ ! -f $conffile ]] will not exit 1;
Lorax Fatal Message
$ sudo lorax --dracut-conf /home/rongtao/cclinux/tools/dracut/conf.d/01.conf ...
...
rebuilding initramfs images
2022-12-27 10:51:01,768: dracut args = ['--conf', '/home/rongtao/cclinux/tools/dracut/conf.d/01.conf']
dracut args = ['--conf', '/home/rongtao/cclinux/tools/dracut/conf.d/01.conf']
2022-12-27 10:51:01,768: anaconda args = ['--conf', '/home/rongtao/cclinux/tools/dracut/conf.d/01.conf', '--add', 'anaconda pollcdrom qemu qemu-net prefixdevname-tools']
anaconda args = ['--conf', '/home/rongtao/cclinux/tools/dracut/conf.d/01.conf', '--add', 'anaconda pollcdrom qemu qemu-net prefixdevname-tools']
2022-12-27 10:51:01,800: rebuilding boot/initramfs-5.15.67-1.cl9.x86_64.img
rebuilding boot/initramfs-5.15.67-1.cl9.x86_64.img
Traceback (most recent call last):
File "/sbin/lorax", line 226, in <module>
main()
File "/sbin/lorax", line 207, in main
lorax.run(dnfbase, opts.product, opts.version, opts.release,
File "/usr/lib/python3.9/site-packages/pylorax/__init__.py", line 358, in run
treebuilder.rebuild_initrds(add_args=anaconda_args)
File "/usr/lib/python3.9/site-packages/pylorax/treebuilder.py", line 338, in rebuild_initrds
dracut.Run(args + [outfile, kernel.version])
File "/usr/lib/python3.9/site-packages/pylorax/imgutils.py", line 509, in Run
runcmd(["dracut"] + args, root=self.root)
File "/usr/lib/python3.9/site-packages/pylorax/executils.py", line 367, in runcmd
return execWithRedirect(cmd[0], cmd[1:], **kwargs)
File "/usr/lib/python3.9/site-packages/pylorax/executils.py", line 230, in execWithRedirect
return _run_program(argv, stdin=stdin, stdout=stdout, root=root, env_prune=env_prune,
File "/usr/lib/python3.9/site-packages/pylorax/executils.py", line 205, in _run_program
raise subprocess.CalledProcessError(proc.returncode, argv, output)
subprocess.CalledProcessError: Command '['dracut', '--nomdadmconf', '--nolvmconf', '--conf', '/home/rongtao/cclinux/tools/dracut/conf.d/01.conf', '--add', 'anaconda pollcdrom qemu qemu-net prefixdevname-tools', '--force', 'boot/initramfs-5.15.67-1.cl9.x86_64.img', '5.15.67-1.cl9.x86_64']' returned non-zero exit status 1.
2022-12-27 10:51:01,853: Cleaning up tempdir - /home/rongtao/cclinux/cclinux.out/tmp/lorax.w443f2n7
/home/rongtao/cclinux/tools/dracut/conf.d/01.conf
# dracut config file customized for My Linux OS
stdloglvl=3
sysloglvl=5
# see https://github.com/weldr/lorax.git: src/pylorax/__init__.py
# DRACUT_DEFAULT="--xz --install /.buildstamp --no-early-microcode --add fips"
compress="xz"
install_items+=" /.buildstamp "
early_microcode="no"
add_dracutmodules+=" fips "
# New Arch need ignition module
add_dracutmodules+=" ignition "
The text was updated successfully, but these errors were encountered:
dracut now runs inside a chroot, so the file passed to --dracut-conf
needs to be copied inside and the path rewritten to point to the right
location.
This also includes tests for DracutChroot when the tests are run as
root, without a container, because it uses bind mounts.
Fixesweldr#1296
Error Reason
Lorax need DracutChroot() class during make initrd.img, and lorax support
--dracut-conf
argument to pass thedracut_args
for dracut--conf
argument. In old dracut(<055-105-g7de9ffc05747) version, dracut.sh will skip the--conf
conffile check if it is not exist, However, the new dracut(>=055-105-g7de9ffc05747, commit 7de9ffc05747("fix(dracut.sh): do not ignore invalid config file or dir path")) willexit 1
if--conf
conffile is not exist, the patch as follows:What we can do?(maybe)
--dracut-conf
argument;--dracut-conf
conffile inDracutChroot()
, so that,[[ ! -f $conffile ]]
will notexit 1
;Lorax Fatal Message
/home/rongtao/cclinux/tools/dracut/conf.d/01.conf
The text was updated successfully, but these errors were encountered: