Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [gentoo-user] dracut vs. genkernel

126 views
Skip to first unread message

Stefan G. Weichinger

unread,
Jun 12, 2013, 7:10:01 AM6/12/13
to
Am 12.06.2013 13:06, schrieb Stefan G. Weichinger:

> How do you generate your kernel and initramfs with dracut? Any handy
> scripts available ... any tricks or hints?

Additional fact here:

I boot with grub2 ... so I need to have an initramfs generated that is
detected by grub2-mkconfig. For now I simply let it use the name of the
genkernel-initramfs ... how do you handle this?

Stefan

Stefan G. Weichinger

unread,
Jun 12, 2013, 7:10:01 AM6/12/13
to

Greets, gentoo-users ...

I am currently trying to find out why my LVM2-volumes aren't activated
correctly at boot time. I am using packages from the overlay
systemd-love as I run systemd as init-system (why? that's another
discussion ;-) ).

Until now I always was kind of lazy and used genkernel (or lately
"genkernel-next") to build and install my kernels/modules. Yes, it's
uncool, but so far it worked for me and it was comfortable.

In my discussion with one of the devs of the systemd-love-overlay he
pointed me at dracut to generate my initramfs. Never used it before and
so I am still learning (yes, it booted already).

I found infos in the Gentoo Wiki but I would also hear your opinions and
experience:

How do you generate your kernel and initramfs with dracut? Any handy
scripts available ... any tricks or hints?

Where are the advantages of dracut compared to genkernel? The udev-approach?

Thanks, Stefan

Canek Peláez Valdés

unread,
Jun 12, 2013, 12:00:01 PM6/12/13
to
I use this script to generate my initramfs:

--------------------------------------------------------------------------------
#!/bin/sh

KVER=$(readlink /usr/src/linux | sed "s/^linux-//g")

echo "Creating initrd for kernel version ${KVER}..."

FIRMWARE=""

for i in $(find /lib64/firmware -type f); do
FIRMWARE+=" ${i}"
done

/usr/bin/dracut -f -H -I "${FIRMWARE}" /boot/initrd-${KVER} ${KVER}
--------------------------------------------------------------------------------

I use this command to generate my GRUB2 config:

grub2-mkconfig -o /boot/grub2/grub.cfg

Everything just works. However, I don't use LVM, and I don't use the
systemd-love overlay.

Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México

Michael Hampicke

unread,
Jun 12, 2013, 12:00:02 PM6/12/13
to
Am 12.06.2013 13:06, schrieb Stefan G. Weichinger:
>
> I am currently trying to find out why my LVM2-volumes aren't activated
> correctly at boot time. I am using packages from the overlay
> systemd-love as I run systemd as init-system (why? that's another
> discussion ;-) ).

When you find a solution, I'd be interested :) Having the same problem,
also running grub2, systemd, lvm.

This is my current work-around

$ cat /etc/systemd/system/lvm.service
[Unit]
Description=Load LVM

[Service]
Type=oneshot
ExecStart=/sbin/pvscan
ExecStart=/sbin/vgscan --mknodes
ExecStart=/sbin/vgchange --sysinit -a ly
ExecStart=/usr/bin/sleep 1
ExecStart=/bin/mount -o noatime /dev/vg1/a /mnt/a
ExecStart=/bin/mount -o noatime /dev/vg1/b /mnt/b

[Install]
WantedBy=multi-user.target

signature.asc

Stefan G. Weichinger

unread,
Jun 12, 2013, 2:00:02 PM6/12/13
to
Am 12.06.2013 17:53, schrieb Canek Peláez Valdés:

> I use this script to generate my initramfs:
>
> --------------------------------------------------------------------------------
> #!/bin/sh
>
> KVER=$(readlink /usr/src/linux | sed "s/^linux-//g")
>
> echo "Creating initrd for kernel version ${KVER}..."
>
> FIRMWARE=""
>
> for i in $(find /lib64/firmware -type f); do
> FIRMWARE+=" ${i}"
> done
>
> /usr/bin/dracut -f -H -I "${FIRMWARE}" /boot/initrd-${KVER} ${KVER}
> --------------------------------------------------------------------------------
>
> I use this command to generate my GRUB2 config:
>
> grub2-mkconfig -o /boot/grub2/grub.cfg
>
> Everything just works. However, I don't use LVM, and I don't use the
> systemd-love overlay.

Nice script, thanks!

I will have to adapt it a bit to be able to use it with

linux -> /usr/src/linux-git ....

But for stuff like gentoo-sources it just works, yes!

Stefan

Stefan G. Weichinger

unread,
Jun 12, 2013, 2:30:01 PM6/12/13
to
Am 12.06.2013 17:54, schrieb Michael Hampicke:

> This is my current work-around
>
> $ cat /etc/systemd/system/lvm.service [Unit] Description=Load LVM
>
> [Service] Type=oneshot ExecStart=/sbin/pvscan
> ExecStart=/sbin/vgscan --mknodes ExecStart=/sbin/vgchange --sysinit
> -a ly ExecStart=/usr/bin/sleep 1 ExecStart=/bin/mount -o noatime
> /dev/vg1/a /mnt/a ExecStart=/bin/mount -o noatime /dev/vg1/b
> /mnt/b
>
> [Install] WantedBy=multi-user.target

Yes, looks like a workaround ;-)

I will check back if I find something ...

S

Stefan G. Weichinger

unread,
Jun 12, 2013, 2:30:02 PM6/12/13
to
Am 12.06.2013 19:50, schrieb Stefan G. Weichinger:

> I will have to adapt it a bit to be able to use it with
>
> linux -> /usr/src/linux-git ....

I hacked something ... can't share right now as I shamelessly used
function from genkernel to read in the kernel version ;-)

S
0 new messages