#UGRD DM, issues

1 messages · Page 2 of 1

dull laurel
#

Device mapper not found

#

What did you do LOL

#

No device mapper information for gentoo , my crypto_luks

livid solar
#

what?

dull laurel
livid solar
#

ohhh

#

pull now

#

im actively working on that lol

#

the pains of 9999

#

i just fixed it

dull laurel
#

Works lmao

livid solar
#

it should actually validate the luks mounts now

#

you can try to set the lvm info again lol

dull laurel
#

I just had a thought

#

Could that be why dracut failed?

livid solar
#

absolutely

dull laurel
#

Udev. Links went nuclear

livid solar
#

ugrd is meant to have this kinda of checking

#

but in the past it errored out if it wasn't 100% sure it was a luks dm entry

#

and then i added lvm support and removed that so it just checked it was a dm item

dull laurel
#

Same start job. Hoping it’s not a udev thing again

livid solar
#

and now it properly validates it

#

i think

#

well idk about that, i have tested this on a systemd vm and it boots fine

#

no lvm tho

#

i guess i need to make a system lvm test

#

none of my openrc systems care that symlink isn't there

dull laurel
#

Same thing

livid solar
#

can you show the specific message?

#

also someone in support may really be able to help more here

#

idk that much about systemd

#

just that it is super touchy

#

i can barely get it running in lvm containers and it literally pollutes my cgroups when it runs

#

and if i don't let it, it refuses to run

#

in a container?!?!!?

dull laurel
#

yeah

livid solar
#

maybe systemd is like "oh i see you have a device, let me wait until i see udev has handled that device"

#

but since it's already handled it just sits there and waits

#

well i see the vg0 folder isn't there for me

#

but it's mounted fine lol

#

im not entirely sure what is actually supposed to make that

dull laurel
#

Found this. 2011 lol

livid solar
#

ok so vgscan states that path

#

but does nothing to make it lol

dull laurel
#

Yeah I think so. It says if you do vgmknodes after, it creates a dangling link

livid solar
#

yeah i'll try to ad that

#

you want to ad it lol

dull laurel
#

I’m testing to see if you do the nodes before vgscan it’s fine?

livid solar
#

you just add that to the lvm binaries, and the you add that line to the bash bit

#

yeah feel free to add the binary in a debug image and then see what is required, i bet you need to do it after vgscan or vgcgange

#

it could maybe be run last

#

it may just be there to help the system later

#

also most of the time im in the debug module i start by catting the init script and i more or less step through it

dull laurel
#

Oh got it

#

It must be vgscan —mknodes

livid solar
#

ohh if you can just add that to the main command that would be all you neeed

#

super simple pr if you want to make it lol

#

i can ofc

dull laurel
#

Sounds good. I’ll PR it

#

Feel free to accept.

livid solar
#

did you test it?

#

yeah i'll accept ofc i'll take all the help i can get it lol

dull laurel
#

Yeah. Let me rebuild the initramfs, in concept it should work, now gotta edit UGRD lol

#

How do you apply a patch?

livid solar
#

you can edit the site files directly lol

dull laurel
#

The scripts are in ‘usr/bin no?

livid solar
#

or you can edit the built dir

#

what scripts?

dull laurel
#

The main lvm modules built in UGRD

#

I assume there .sh scripts somewhere in the system

#

Then I gotta edit, then and try UGRD, with the mknodes and see if it fixes

livid solar
#

/usr/lib/python3.11/site-packages/ugrd/fs/

#

that is where the files actually live

#

you can also edit the init file in the build dir

#

and then repack the initramfs

#

pycpio --recursive --relative /tmp/initramfs -a /tmp/initramfs -o ugrd.cpio

#

you can do something like that too

#

pycpio is what ugrd uses to pack the images anyways

#

that recursively adds everything in /tmp/initramfs and then makes it all relative to that dir

#

you can do that to just plainly edit the built image and repack it

dull laurel
# livid solar

Oh do I need file,a bug report for UGRD, make install?

livid solar
#

im not sure this is necessarily related

#

and we can wait for andrew, he is in charge of installkernel, more or less

#

ugrd is in the process of being merged into ::gentoo so there are a few small changes taht are being made

#

so this stuff is kinda already in flux/motion

#

but the fact it was making those weird dracut images is totally separate from ugrd, and i talked with andrew in irc today and they are working on some changes to the linux-firmware initramfs behavior

dull laurel
livid solar
#

i mean for one you're not even technically using the same 9999 ebuild that is latest in guru

#

because it's in dev, not master

#

yeah i really don't know what's up wht that, like that is the kind of shit i'd see and just reinstall from scratch

#

like i kinda don't fuck with that kinda behavior lol

#

dracut is just a bundle of hacks on hacks, im kinda not suprised at what it does at times but at the same time, you'd really expect something that is so widely used to just be better

dull laurel
#

Technically, for UGRD, could I just edit the files in python3.11, add the command and see if it recompiles successfully?

livid solar
#

if you edit those site-package files then yea you're editing the live program more or less

#

it's not generally advisable but it's the most direct way to make a patch

#

i mean you can go really wrong editing your site-packages especially on gentoo where python is very integrated into the system

dull laurel
livid solar
#

makes the /dev/vg0 and the symlink?

#

that's nice, and should probably still be added, but systemd can never be pleased 😦

dull laurel
livid solar
#

the issue is that they don't often clearly define requirements, at least from what i've seen

#

and it's rarely a hard st andard

#

things just happen to work a certain way

dull laurel
#

Considered it’s been around for 9+ years

#

First accounts of these bugs I can find are 2009

livid solar
#

maybe you can tell udev to run again?

#

i think pulling udev into the initramfs image is kinda excessive

#

like sure it has a point but it's a ton of stuff and needs databases and things to properly wokr

#

if systemd wants more than just the device nodes present it should tell udev to reload or something

#

not sit around and wait for things to time out

#

there may be a way to configure that

dull laurel
#

Definitely.

#

Also seems to be a completely mess of systemd, skipping certain Udev rules, then more Udev rules in tern skip the needed ones

dull laurel
#

I found this excerpt on Udev, not sure tho.


You would typically call udev fairly early in your startup sequence. One of the few things you should (must?) do before that is mount /proc and /sys. After starting the daemon, call udevadm trigger --action=add; udevadm settle to make udev process all pending events from the kernel (trigger) and wait until the events are processed before continuing (settle). You can then proceed to locate the device containing the root filesystem.

Besides the udevd binary, you'll need the other parts of udev on your initrd. This includes configuration files in /etc/udev, the base configuration in /lib/udev as well as helper binaries such as scsi_id also in /lib/udev. You need all the programs that are called from udev rules that you include in the initrd.

At the end of the initrd, before transfering control to the real root partition, you'll need to stop udevd like every other program from the initrd. This doesn't remove any device from /dev. Use mount --move /dev /root/dev to move the mounted /dev to the real root.

Gentoo has an initramfs guide and an initramfs wiki page which mention udev among other things. Initramfs is the modern successor to initrd, using a cpio archive rather than a filesystem image, and with a different process interface (on an initrd, /linuxrc must exit, whereas on an initramfs, /init must exec the init from the real root); most systems have switched these days (even if the file might still be called initrd)```
livid solar
#

i use a devtpmfs

#

udev isn't really needed

#

it does some nice things like make syslinks for uuids of stuff

#

but it's really not required

#

and it's mostly for dynamic stuff

#

this is where i get caught up, because there's not really a single simple way to install udev

#

and if you have udev rules for your 4 required devices then udev is pointless

#

and i think switch_root moves that stuff

#

that move bit is from the old "initrd" days, this is an initramfs

dull laurel
#

What

livid solar
#

ok so that mknodes thing worked?

#

im assuming that made it

#

becuase i don't see that on my test system

#

idk why systemd is upset?

#

or it only made one for root?

#

no wait all of those are there

#

idk why systemd is upset?

#

i mean if lvm sees all of it fine, it should work, maybe it's just really made that those weren't made by udev lol

dull laurel
#

That’s what I’m confused about

#

It’s upset when you run the mknodes command

livid solar
#

yeah maybe you can read the systemd service files and see what it checks for

#

it may be worth disabling that service entirely if it is checking for something that doesn't matter

#

sometimes systemd just wants a super particular setup that doesn't really make sense

#

there's a chance it's checking for something important, but it may not be, kinda hard to tell with how it fails and how everything seems fine

dull laurel
dull laurel
warped notch
#

I strongly suspect you have an initrd left over in your kernel source tree

#

Check /usr/src/linux/arch/x86/boot

#

Or equivalent for your arch

#

@livid solar what is the behaviour of ugrd if the image it wants to install already exists? Does it overwrite?

#

Maybe the bug here is that somehow ugrd is not overwriting the existing image and instead is appending to it somehow

#

Anyway, try to mv /usr/src/linux/arch/x86/boot/initrd to somewhere else, and then try to install again cleanly

#

(mv and not rm so we can inspect that image later)

livid solar
#

I don't think I made more patches besides removing some code I verified was unused

livid solar
#

so it will make a .old and overwrite it essentially

#

it has no mechanism to append, and you'd have to disable "clean mode" for it to not overwrite but it would error out if it sees a file in that case

livid solar
warped notch
#

is this installkernel with or without systemd?

#

if it is +systemd, and there is a left-over dracut initrd in the kernel source tree, and if then ugrd rotates the file. We will have initrd and initrd.old in the staging area where one is dracut and the other is ugrd

#

depending on the bootloader you are using and if you're using UKIs, these two initrds may get merged

#

it would also be helpful to have the full log from make install

warped notch
#

but also we should probably not have this rotate behaviour in the +systemd kernel-install plugin for ugrd

#

for -systemd it doesn't matter since we only use the exact match 'initrd'. But +systemd uses every file on the staging area that matches initramfs* or initrd*

livid solar
#

I wasn't able to replicate any of this

livid solar
#

if there is a "right" way to merge the files i may do that

#

i don't think julian was able to extract the cpio inside that packed cpio, was using lzma compression and didn't know how to decomprress it (i didn't either)

#

but seeing it wasn't xz it wasn't the plain ugrd image so gave us some info

livid solar
#

if this just replaces a microcode cpio file that would be bad

livid solar
warped notch
#

idk about others

#

having multiple initrd files on the staging area is not something I had in mind when writing most of these plugins

warped notch
livid solar
livid solar
#

im sure when they are back they can help provide the exact file and more info

livid solar
#

but this still doesn't help me understand how things are getting mashed together because ugrd doesn't do that at all

warped notch
#

yeah I am also confused

#

but if this is -systemd then installkernel puts its stuff in the kernel source directory so I suspect that an old dracut initramfs is the origin of the dracut code

#

maybe obvious, but you did check that the files in the initramfs are not in the root file system?

livid solar
#

i think they unpacked it and it had dracut stuff inside

#

maybe they didn't clean the build dir?

#

they were using gentoo-sources

livid solar
#

@dull laurel i patched ugrd to not rotate files when used by installkernel, can you pull the latest 9999 and test when you have the time?

livid solar
#

thanks

#

and maybe try cleaning the kernel build dir or seeing if you can find dracut bits hanging around

#

and you're sure you have the uki stuff disabled right?

warped notch
#

I would just upgrade the kernel, it's a nice way of ensuring you're starting clean and saves compile time later

#

Note make clean is not sufficient, it does not remove initrd/UKI files

dull laurel
#

Question. What format does Dracut technically use?

#

It doesn’t seem it’s like yaml, toml or json tbh

livid solar
#

cursed bash? idk

dull laurel
livid solar
#

i've never seen anything else use that particular formatting, i think it may be based around bash? really not sure, its weird config syntax is one of the main things i hate about it

dull laurel
livid solar
#

wdym?

dull laurel
#

When you make the array for kmod_init

livid solar
#

you can use single quotes i think

#

i don't think toml cares

dull laurel
#

Uh just tested

#

Still getting dracut shit. Even re-emerged the kernel

#

Wack

livid solar
#

did you clean out the whole kernel dir?

#

like you're totally certain you deleted everything?

dull laurel
#

Yeah, but I’m triple checking rn

dull laurel
#

Rm -rf’d the whole Linux-6.8.9 directory, andmodules

#

Also rm’d my boot

livid solar
#

huh that is super strange @warped notch do you want any particular info to debug this?

#

i think if you can show the full output of make install that would help

#

like wgetpaste -c 'make install' in the build dir

dull laurel
#

Ok

livid solar
#

that's all of it?

#

and you checked and that creatd image is not ugrd?

#

oh wait huh it's writing it to /tmp/initramfs_out/arch/x86/boot/initrd

#

is it writing it to /boot?

dull laurel
#

Ye, but I do get a initramfs file in ‘boot

dull laurel
#

Not anymore.

livid solar
#

i just pushed a patch

#

can you see if that fixed it? i think it should have

dull laurel
#

Works now. Got kernel panic tho lol

livid solar
#

kernel panic means it's not loading ugrd

#

do you have xz enabled in the kernel?

#

you can disable compression if not

dull laurel
#

Oh wait LOL

#

I think it’s because make install yeah

#

When I built it yesterday I ran —no-compress

livid solar
#

yeah you can set that in the config, there is info on the readme in the cpio section

dull laurel
#

Cpio_compression?

livid solar
#

yup

#

if you set that to false it will not be used

#

i disable it sometimes for testing because the xz bit is by far the slowest part

#

the python module is single threaded :((

dull laurel
dull laurel
#

Weird after the patch

livid solar
#

what part fails?

dull laurel
#

Oh might be secure boot

livid solar
#

nah that shouldn't affect it

dull laurel
#

When I rebuilt the kernel, I think it regenerated the key

livid solar
#

woah mine is failing too, im looking into it

dull laurel
#

Oh I thought it was just me

livid solar
#

this is super weird? cryptsetup isn't able to read the device info or something?

#

woaahhhh

#

why is it using 1.7.0?

#

i thought i had 1.9.0 installed on this test...

dull laurel
#

I’m wonder if cause my module signature is broken

#

It’s failing to load nvme

livid solar
#

wtf it's reading the the boot uuuid not root??

#

oh i had that set, and it wasn't using the latest version?

#

that was to test to make sure it would correctly catch invalid devices

dull laurel
#

Uh is it a hardware thing or UGRD thing

#

After one patch yesterday I can’t see my caps lock light anymore lol

livid solar
#

yeah so things are actually fine, i just had misconfg set and it didn't validate that properly

#

im wokring on that

#

but if it's autoconfiguring your luks/lvm stuff it should work

livid solar
#

no validate that the luks entry is really a luks volume

dull laurel
#

Oh.

#

We still haven’t figured out the nodes right?

livid solar
#

if it's not reading your devices properly, i think you should check your kernel config

#

did you backup the known working config?

dull laurel
#

You can run vgmknodes, but it will always just mention udev is broken

livid solar
#

and no, im not sure waht systemd wants there

warped notch
#

make install can't invent them, they must be coming from somewhere

#

wait are you running this from a live usb?

warped notch
dull laurel
livid solar
#

wdym? you can manually set kmod_ignore

dull laurel
#

Oddly, assumed kmod_init should overwrite ignore no?

livid solar
#

no ignore is stronger

dull laurel
#

My main issue is I can’t for the love of me get my Ethernet in at all, I need to apply some patches to test

#

Ok got it nvm.

livid solar
#

ugrd generally avoids loading network stuff. it's generally better to have that stuff be loaded later - especially if firmware may be needed

dull laurel
livid solar
#

it should just work

dull laurel
livid solar
#

systemd gets a bit unhappy if there are other lvm partitions

#

it doesn't mount them for some reason

dull laurel
livid solar
#

what is the error?

#

and do you have it using your /boot mount and that's not mounted currently?

dull laurel
#

But now it’s hating cryptsetup 😭

livid solar
#

and yeah i made the config style a bit simpler, it should warn but work if you use an old style

dull laurel
#

It creates cryptsetup: root with my lvm (root) uuid

#

I think however it seems like because my lvm name is not root but rather lvm0, it’s failing

livid solar
#

do you have it manuall defined or are you using autodetect?

#

can you wgetpaste the log?

dull laurel
dull laurel
livid solar
#

autodetect works?

dull laurel
#

Yeah

#

Manually setting the lvm uuid doesn’t

livid solar
#

nice, i'd just double check what it says it detected

#

well you may have been setting the wrong one, you should be setting the uuid of whatever contains it

dull laurel
#

Cool thanks.

livid solar
#

but the autodetection may be wrong?

#

i think i tested it with the last release

dull laurel
livid solar
#

yeah

#

rn pycpio only supports xz

dull laurel
#

When I have time I might write a lz4 module / hook

#

Python be giving me a stroke tho.

dull laurel
#

cpio_compression=“none” does not work in the toml?

livid solar
#

i think you can set it to false

#

like the toml boolean

dull laurel
livid solar
#

ah i guess that error is fatal now lol

dull laurel
#

Lmao. What? Did you get this during testing 😭

dull laurel
livid solar
#

no i mean the mounts.boot.source thing

#

that is the old style

#

you've got to do llke:

[mounts.boot]
uuid = x
dull laurel
#

Okay. I’ll wgetpaste the new error now lol

dull laurel
livid solar
#

do you have autodetection in?

#

on

#

the "issue" is your root luks volume is called "gentoo"

#

in the config it's named root and it can't validate it

#

the info is right but the names differ

dull laurel
livid solar
#

this i mean

#

ah i think the autodetection may be looking for the name root?

#

well that's what it is named here

dull laurel
#

I think so yeah. What’s weird is

#

When I do UGRD normally, ie not specify the uuid, works fine

livid solar
#

what is your config?

#

oh yeha

#

from above, you specified the name in your config

#

that makes it unable to validate

dull laurel
livid solar
#

.root means mapped name root

#

i'd let it autodetect tbh

dull laurel
livid solar
#

well the workaround is to either make the names line up or disable validation

#

or just let it autodetect

dull laurel
# livid solar or just let it autodetect

How much work would it take to reimplement, I have any idea to implement using cryptsetup.volume_name, but I assume I need to patch alot of UGRD and rewrite the base hooks correct? Seems like your main code is based off root as you mentioned

livid solar
#

it already is cryptsetup.volume_name?

#

if you let it autodetect itll use the same mapped name currently in use

dull laurel
#

Wait, I thought it was cryptsetup.root in general? Unless I misunderstood how UGRD is analyzing the volumes.

livid solar
#

nah

dull laurel
#

Also is there a list of UGRD modules?

livid solar
#

i mean the root mount is kinda important

#

mor or less everything in a dir here

#

the rest is core code

#

all the autodetecton stuff is in mounts

#

im considering moving it to the cryptsetup module but the lvm stuff is kinda tacked on

dull laurel
#

Gotcha. My only concern is can I still use stuff like retries then for UGRD?

livid solar
#

yeah you just have to be sure to use the right mapped name

#

so it has to match whatever the currently used mapped name is

dull laurel
livid solar
#

in the config yea

dull laurel
# livid solar in the config yea

Uh when I tried just plain lvm0 it can’t find it? As well as tagging on the dm name, gentoo-lvm0 into. Cryptsetup same thing. Here’s the wget paste

livid solar
#

cryptsetup.gentoo

dull laurel
#

How does auto detection works? Auto detection seems the best compared to many config?

#

Cause manual configuration seems to like mismatch errors a lot I notice.

#

Now it’s picking the wrong uuid. But what I’m not sure is how autodetect differs fine. When I built it without the stuff in toml, it differed between my /dev/mapper/gentoo and gentoo-lvm0 fine.

livid solar
#

are you sure it's picking the wrong uuid?

#

can you send the output with --print-config if it works?

#

you can read the code here if you're intersted i how autodetection works

#

the "lvm" uuid will likely be pointing to the luks device, and the luks uuid will likely point to your drive

#

the root uuid pointing to lvm

#

so on

#

it's kinda confusing but in each case the uuid info is for the SOURCE, there's no point in having it define its own uuid

dull laurel
dull laurel
#

Also I’m wondering how feasible is something like UGRD with C, I just realized Python seems to make it alot nicer,

#

Might explain why Dracut and most seem built with Python

livid solar
dull laurel
#

Here it seems to be miss parsing

#

Am I formatting the config wrong?

dull laurel
livid solar
#

yeah that should work

dull laurel
#

I need to use hid_usb but it’s in kmod_jgnore, and when it’s in kmod_init I get “ cannot ignore external module in kmod_init”

carmine prairie