[colug-432] custom distributions -- initramfs] systemimager-dracut: devel help needed (root= known only in initqueue) (fwd)
R P Herrold
herrold at owlriver.com
Tue Mar 27 10:49:59 EDT 2018
This interesting post crossed a mailing list I follow, and
discusses initscripts and dracut (boot time, and initramfs
matters)
-- Russ herrold
---------- Forwarded message ----------
Date: Tue, 27 Mar 2018 05:40:57
From: LAHAYE Olivier <olivier.lahaye at cea.fr>
To: "initramfs at vger.kernel.org" <initramfs at vger.kernel.org>
Subject: initramfs] systemimager-dracut: devel help needed (root= known only in
initqueue)
Sorry for initial long post, but this is worth reading :)
Hi,
I'm main active developper for systemimager (http://www.systemimager.org), a software that automates image deployments on cluster nodes that was initially developped by Brian Elliott Finley.
The imager consist of an initramf that initialise the disk, download the image and runs post installs.
The historic initramfs was build from scratch including kernel and was extremely hard to maintain.
I rewrote the whole stuff using dracut which is the perfect tool for that.
(https://github.com/finley/SystemImager/tree/initrd-from-imageserver-and-dont-package-initrd)
For that I wrote a somewhat complex (but easy to maintain) dracut module:
https://github.com/finley/SystemImager/tree/initrd-from-imageserver-and-dont-package-initrd/lib/dracut/modules.d/51systemimager
This works perfectly, but I want to go BEYOND a reboot after imaging.
I want, after imaging, to finish booting as normal boot (imaging is finnished in initqueue hook) if imager kernel has matching modules in imaged system.
My PROBLEM IS:
/sysroot is not automatically mounted and I'm trying to have it mounted without doing ugly hacks.
How I proceed: (CentOS7, fedora-27, Open SuSE 42.3 (and in another form CentOS-6))
1/ in cmdline, I set root='UNSET' and rootok=1
=> It ends in /dracut-state.sh and cmdline hook is happy
2/ in initqueue/online, I retrieve disk layout, image name, ... and using that I initialise the disk(s), raid if any, lvm if any and I install the image, configure bootloader, and runs some chrooted postinstall
3/ in initqueue/online (at the end, I umount all filesystems) and update /dracut-state.sh with root=block:/the/correct/root/device
=> is overridden with "none" between initqueue and pre-mount hooks ???? WHY? WHERE?
=> So I save it in /etc/cmdline.d/systemimager-rootfs.conf (rootfs-generator ignores /dracut-state.sh and uses getarg)
4/ in initqueue/finished (/sysroot is empty), I run systemctl daemon-reload to triggger dracut-rootfs-generator.
=> devexists-\x2fdev\x2fsystemvg\x2frootlv.sh is generated correctly
BUT, sysroot.mount is not generated anywhere (neither in /etc/systemd/system, nor in /lib/systemd/system)
QUESTION 1: what am I missing to have sysroot.mount be created AND mounted.
QUESTION 2: why /dracut-state.sh is overwritten between initqueue/finished and pre-mount hooks and why is it not used by dracut-rootfs-generator?
QUESTION 3: On CentOS-6 I use /tmp/root.info, how to I get the rootfs mounted without systemd? should I only settle udev?
Many thanks for any tips.
--
Olivier LAHAYE
CEA DRT/LIST/DIR
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the colug-432
mailing list