-
jean-loups
be-back
-
jean-loups
i just install FreeBSD 13.2 on virt-manager with bios. i would like how activate framebuffer dkms or kms for have full screen and litle font view on my VM. thank
-
derzahl
though I have found nothing documented- theres gonna be a way too boot an encrypted zfs root, right?
-
derzahl
load the kernel from EFI or other unencrypted 'boot'partition perhaps?
-
derzahl
why are we stuck with this ancient zfs efi driver based on grub from like 2004?
-
RhodiumToad
huh?
-
derzahl
theres no one in the whole world who can build EFI drivers from a recent openzfs codebase?
-
derzahl
im so confused
-
RhodiumToad
you can currently boot from a partition encrypted using GELI, but not one using zfs native encryption
-
» derzahl would like to add fbsd 14 to an existing ZFSonROOT linux laptop
-
RhodiumToad
loader[.efi] already has code from the same openzfs version as the kernel
-
RhodiumToad
(but not the support for encryption)
-
derzahl
hm, so then loader.efi should be able to boot the kernel and decrypt the root zpool or dataser?
-
derzahl
somehow?
-
derzahl
ah
-
RhodiumToad
not if the kernel is on the encrypted pool
-
derzahl
can the kernel be put on the uefi partition?
-
RhodiumToad
in theory, yes (though you'd have to put the zfs module there too, plus any other modules that need loading before boot)
-
derzahl
i thought there should be a way
-
RhodiumToad
it's not something the installer will do for you, but it's a setup I've experimented with in the past
-
derzahl
but nothing documented?
-
derzahl
i am not at all familiar with the fbsd boot process
-
RhodiumToad
I can't actually recall what I did
-
derzahl
oh nice. i went with "shell" at the installer and created a zpool/BSD dataset that is encrypted and installed to that, plus a have an unencrypted ZFS boot partition with all the features off for grub to work
-
RhodiumToad
the boot process on EFI is straightforward: loader.efi is responsible for finding /boot/ (to get loader.conf, the kernel, etc.), processing loader.conf, and running the kernel
-
derzahl
but im not sure how to get it to boot
-
RhodiumToad
encrypted how?
-
derzahl
native zfs
-
derzahl
freebsd doesnt use an initrd ,right?
-
derzahl
and im guessing theres no way to build something like a linux UKI?
-
RhodiumToad
loader.efi supports doing a whole lot of things
-
RhodiumToad
I'm pretty sure I got it to boot from an image file on the ESP, but I don't have the details handy
-
derzahl
where can i find a copy of the loader.efi dark magik book?
-
derzahl
hm
-
derzahl
image file? like an mfsroot?
-
RhodiumToad
let me see if I still have it kicking around somewhere
-
RhodiumToad
seems not
-
RhodiumToad
so loader has the concept of a vdisk, which can be any file that it can access via any of the filesystems it can read
-
RhodiumToad
and which is treated as a device in itself
-
RhodiumToad
so that can be a file on the ESP for example
-
RhodiumToad
what I was aiming for when I looked at this was to see whether it was possible to make a "rescue" filesystem on the ESP
-
derzahl
hm. interesting. ill look. any links you may have woudl be helpful
-
parv
Happy Canada Day! <wherever applicable>
-
la_mettrie
happy birthday, leibniz
-
pvalenta
hi, is possible to disable ASLR for only one binary or jail? I would like to make this working: cc -fsanitize=address ...
-
yuripv
pvalenta: try 'proccontrol -m aslr -s disable your-command'
-
pvalenta
yuripv, great, thanks!
-
meena
pvalenta, yuripv: see also,
man.freebsd.org/elfctl(1)
-
VimDiesel
Title: elfctl(1)
-
meena
maybe those two man pages need to crosslink to each other
-
pvalenta
the interesting is: binary compiled by cc -fsanitize=addres works but clang -fsanitize=addres does not. cc is from base, clang from ports. Clang compiler from base has probably some tweaks
-
pvalenta
meena, another useful tool, thanks
-
meena
pvalenta: for probably quite sensible reasons none of which i remember, the sanitise framework is not in base
-
tyler82
i am trying efibootmgr -a -c -l pathtoloader.efi -L Freebsd in chroot but it says efi variables not supported on this system. root? kldload efirt? kldload: cant load efirt: module already loaded or in kernel.
-
tyler82
if already loaded why i cant add bootentry then?
-
tsoome
tyler82 if you run kenv | grep efi-version what it does tell?
-
tyler82
tsoome: 2.31
-
tsoome
so, it may not provide the variables... you can try another thing, what does efivar command show?
-
tyler82
-
VimDiesel
Title: Pasteboard - Uploaded Image
-
tyler82
tsoome: efivar: no such file or directory
-
tsoome
or efi-show from loader OK prompt. but it seems, there are no variables... have you checked for firmware update for this machine?
-
tyler82
tsoome: yes. it was okay before i deleted the boot entry in BIOS
-
tsoome
so it can be some sort of firmware bug.
-
tsoome
can you re-add it from frmware?
-
tyler82
i dont know how to add it? it is a chrooted system
-
tyler82
do i have to bind mount sys or something??
-
tyler82
tsoome: its work now. efivar command now listing the files. i just needed mount -t devfs none /dev in chroot.
-
tyler82
but efibootmgr still does not work
-
tyler82
-
VimDiesel
Title: Pasteboard - Uploaded Image
-
pvalenta
meena, i have tried dereference pointer after free and error is reported so i thing sanitizer is in base: ==7049==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000000070 ...
-
tyler82
pasteboard.co/4Z4HXMYoSPV1.jpg operation not permitted. boot partition is mounted before chroot.
-
VimDiesel
Title: Pasteboard - Uploaded Image
-
meena
pvalenta: weird
-
meena
tyler82: can you put that gpart call under (d)truss?
-
tyler82
meena: wdym?
-
meena
tyler82: I'm wondering why the operation failed with permission denied, and naïvely hoping (d)truss will be able to tell
-
Schamschula
devel/ccache-memcached just got removed. What should I replace it with?
-
meena
Schamschula: something that has upstream support?
-
Schamschula
For sure! I'm just not to familiar with these packages. Just using them as part of the Poudriere infrastructure.
-
Schamschula
I see devel/ccache4, it conflicts with my currently installed tools but it's unclear if it works the same way.
-
meena
Schamschula: i didn't realise that poudriere references it directly
-
meena
let me hit up the committer who removed it, and ask them to fix up poudriere.conf, too
-
meena
(done)
-
meena
Schamschula: i reckon you can probably replace it with any other ccache, but don't quote me on that, because I'm not using any
-
Schamschula
I'll give ccache4 a try
-
spork_css
Any recs on a VPS provider for very small stuff? I really like Vultr, but I want to put some eggs in other baskets. DO dropped official FreeBSD support, so not them.
-
spork_css
No interest in AWS or Google. Also tried Ramnode, and... meh.
-
otis
ovh maybe?
-
otis
oracle cloud has arm64 free tier
-
spork_css
hmmm... that's interesting.
-
spork_css
I tried Google's "free" tier but somehow have ended up at $9/month. Too AWS-like anyhow.
-
otis
i run there a 13.2-RELEASE vm
-
meena
can't wait until we run on Hetzner's arm64 cloud. it's about half the price of their amd64 stuff
-
otis
(and also poudriere jobs)
-
otis
meena: hetzner left bitter taste in my mouth since they dropped freebsd support
-
otis
although i run tens of freebsd servers there
-
meena
otis: still hoping my project more projects to readopt FreeBSD
-
V_PauAmma_V
Hetzner dropped FreeBSD support? That one was on my shortlist. *removes*
-
meena
V_PauAmma_V: for the servers. the cloud stuff still allows installing it, but it takes two steps
-
V_PauAmma_V
Thanks.
-
meena
and lots of people are able to bootstrap FreeBSD on the servers, too. with mfBSD and depenguinator and stuff like that, but it sucks that we need to do extra work
-
tyler82
meena: i think it is geom issue...
-
vkarlsen
mfsBSD is awesome though
-
V_PauAmma_V
If Hztzner "supports" FreeBSD by making customers jump through the depenguinator hoop, there's no advantage for me in moving from Linode.
-
V_PauAmma_V
s/Hz/He/
-
meena
at least on cloud thing they give you the ISOs to mount and install stuff, but yeah, that still stinks
-
meena
hoping by the next cloud-init release to support enough to bug them into readopting it
-
V_PauAmma_V
*nod*
-
otis
on servers you can install it using mfsbsd or a usb flash drive
-
otis
but no longer directly using installimage
-
otis
anyway, their price-performance for bare-metal is unbeatable.
-
rtprio
spork_css: you can get some free vms that run freebsd on oracle cloud
-
meena
right. i really need to put that in as standard test
-
meena
I created an AWS account, but the standard images don't boot on the free Tier
-
meena
(yet, fix is already committed)
-
meena
-
VimDiesel
Title: FreeBSD / src / bcf9147 / EC2: Default to "uefi-preferred" boot mode - FreshBSD
-
tyler82
how can i boot into the system if i have no boot entry in BIOS? i was failed to add new boot entry with efibootmgr. i have 12 partitions on my ssd only one partition is zfs. the boot partition is fat but if i write the bootcode on it i will be unable to mount it and therefore unable to create a new boot entry with efibootmgr.
-
meena
-
VimDiesel
Title: FreeBSD / src / 1178acf / EC2: Default to "uefi-preferred" boot mode - FreshBSD
-
meena
tyler82: do you mean the efi partition is fat?
-
tyler82
meena: yep. i was created with newfs_msdos /dev/ada0p12
-
tyler82
the system is zfs
-
tyler82
on /dev/ada0p10
-
tyler82
i am able to accesd it via other freebsd installation on external ssd and chroot into it. my aim is to create a boot entry and make it bootable again.
-
meena
why does it need to be in chroot?
-
meena
tyler82: you boot a life system, and tell that life system's efibootmanager to do its thing
-
tyler82
meena: u mean live system? shell?
-
meena
live System, yes, from Stick, or CD-ROM
-
tyler82
meena: yes. i am on it but where to mount boot partition? under /rescue/boot ?
-
tyler82
read-only filesystem
-
meena
shouldn't really matter where you mount it to, if the tools can be convinced to write anywhere other than /boot
-
meena
usually /mnt is what we use for temporary mounting
-
tyler82
meena: yeah. but giving read-only filesystem error. i can mount it only under /tmp
-
tyler82
but the zfs pool how shall i mount it? mount -t zfs does not work. shall i zpool import -f -d /dev ada0p10 ?
-
tyler82
gpart bootcode -p operation not permitted
-
meena
you'd Import it, put a temporary mount point to a different location
-
RhodiumToad
you shouldn't use gpart bootcode -p on EFI systems
-
meena
see, if my brain was working i should have said this hours ago
-
mason
RhodiumToad: You can if you set up both in parallel. I do that most of the time.
-
RhodiumToad
if you want both legacy boot and EFI, yes. but not for EFI only
-
RhodiumToad
and not if you want EFI boot management
-
mewt
hi, i think i talked about this before but decided now i actually do want to ask about it
-
mewt
anope silently segfaults for me on 13.1-RELEASE
-
mewt
as far as i can tell it's after linking to inspircd, and it gives absolutely no indication of error
-
mewt
would appreciate some direction about how to troubleshoot
-
RhodiumToad
is there a core dump?
-
mewt
let me see
-
RhodiumToad
(the message in /var/log/messages will say "killed by signal 11 (core dumped)" if so)
-
mewt
apparently not
-
RhodiumToad
there's a message that just says "... killed by signal 11" ?
-
mewt
pid 99493 (services), jid 0, uid 65534: exited on signal 11
-
meena
if there's no corefile, it's time to *checks
man.freebsd.org/core(5) * `sysctl kern.corefile`
-
VimDiesel
Title: core(5)
-
RhodiumToad
there are three main reasons why a core dump might not be created:
-
RhodiumToad
1) the process is running with the corefile limit set to 0, 2) the process is setuid or has changed its uid or gid, and 3) the process's current dir is not writable by it
-
meena
I got all three right! my brain is still good enough
-
RhodiumToad
65534 is uid "nobody". was the program started under that user or did it switch to it itself?
-
mewt
it was started as a service
-
meena
that doesn't answer the question, but makes it easy to verify
-
RhodiumToad
ok, then what does the service startup script look like?
-
mewt
sorry, let me find where that is
-
RhodiumToad
(running programs as "nobody" is actually a bad idea. nonprivileged services should be assigned their own unique uids.)
-
mewt
ah i got it
-
mewt
the user is indeed set to nobody
-
RhodiumToad
how?
-
mewt
I'll just pastebin the full script, one sec
-
RhodiumToad
is this anope installed from ports, or manually?
-
mewt
pkg
-
mewt
-
mewt
it's from the actual repos, not ports
-
RhodiumToad
ports, pkg, same thing
-
mewt
alright, sorry
-
RhodiumToad
the pkg repos are just the results of building the ports tree
-
RhodiumToad
ok. so it's letting rc.subr change the user for it, which shouldn't prevent a core dump.
-
mewt
kern.sugid_coredump looks like what i want
-
mewt
is it?
-
RhodiumToad
so the most likely thing is it running in a directory it can't write to
-
RhodiumToad
yeah, setting ${name}_user (anope_user in this case) causes rc.subr to use either su or chroot to set the user before running the program
-
RhodiumToad
you can set sysctl kern.corefile=/var/tmp/%N.core or something of the sort to put the core file there
-
mewt
it...doesn't appear to do that still. hmmm
-
mewt
there we go!
-
mewt
thank you for help, let's see if i can figure out what the issue is now
-
mewt
Ok, so the bt shows #0 0x00000000002db839 in ChannelInfo::WhoSends() const () as the function where SIGSEGV was received
-
mewt
#1 0x000000080135d86b in ChanServCore::OnCheckModes(Reference<Channel>&) () from lib/modules/chanserv.so, and probably the rest is not that interesting
-
RhodiumToad
what are the registers and the failing instruction?
-
mewt
I'll pastebin those. Register content:
bpa.st/JCCQK . I've never used layout asm before so I'll paste all of what I see and hope it started on the failing instruction, sorry. I think it's the top?
bpa.st/KD2RK
-
VimDiesel
Title: View paste JCCQK
-
RhodiumToad
ok, so this is a straightforward null pointer dereference
-
mewt
oh that 0x258(%rdi) is indirect addressing, right
-
mewt
and rdi contains 0
-
mewt
hrm ok
-
mewt
i guess I could try to build this with debug symbols and have a look how that gets there?
-
RhodiumToad
which debugger are you using?
-
mewt
i used gdb to get to this point
-
RhodiumToad
what's the output of disass ChannelInfo::WhoSends()
-
mewt
huh my bt is empty now
-
tyler82
RhodiumToad: so what shall i use then? -p /boot/gptzfsboot -i 12 ada0 ?
-
mewt
let me figure that out...
-
RhodiumToad
tyler82: on an EFI system you should not be using gpart bootcode -p AT ALL
-
mewt
yeah, I'm not sure what happened because my entire bt is gone despite loading the core and the program the same way
-
RhodiumToad
exactly the same way? what did you do?
-
mewt
exited, changed directory
-
mewt
nothing else
-
mewt
using absolute paths on both
-
mewt
i'll paste the disassembly for where I currently am, anyway
-
mewt
-
VimDiesel
Title: View paste 2BD6A
-
tyler82
RhodiumToad: thats interesting. i was reading the man page and also searching on forum and found this.
forums.freebsd.org/threads/update-o…he-bootcodes-for-a-gpt-scheme.80163 The first post says. -p /boot/gptzfsboot. So what shall i use for GPT UEFI then??
-
VimDiesel
Title: Update of the bootcodes for a GPT scheme | The FreeBSD Forums
-
mewt
this appears to be the function you wanted, just can't see the bt anymore for reasons I don't really understand
-
mewt
oh, interesting, the directory matters
-
RhodiumToad
tyler82: the ESP is just an msdos filesystem. you don't use anything.
-
RhodiumToad
tyler82: all that matters is that there's a copy of loader.efi on the ESP and the EFI boot manager (or the EFI firmware) knows where to find it.
-
RhodiumToad
mewt: so, that looks like "this" in the function is NULL
-
RhodiumToad
mewt: (the source code is checking for that, but the compiler probably optimized that out since this isn't allowed to be null afaik)
-
tyler82
RhodiumToad: i see. but i am hsving with this issue.
bugs.freebsd.org/bugzilla/show_bug.cgi?id=229191#c2
-
mewt
huh alright
-
VimDiesel
Title: 229191 – efibootmgr(8) fails to create boot var when ESP is mounted using a gpt label
-
tyler82
cannot translate unix loader path
-
RhodiumToad
tyler82: what exact command did you run
-
tyler82
so what is the correct way to write the bootcode then? -b will do MBR. But i have GPT UEFI
-
mason
tyler82: You don't write it per se. You copy an .efi file into the right location.
-
RhodiumToad
mewt: so looking at ChanServCore::OnCheckModes, it's doing this:
-
mason
tyler82: maybe cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi
-
RhodiumToad
mewt: if (c->ci) ... else c->SetModes(c->ci->WhoSends(), ...
-
mquin
tyler82:
wiki.freebsd.org/UEFI might help explain what's going on
-
VimDiesel
Title: UEFI - FreeBSD Wiki
-
RhodiumToad
mewt: so it's explicitly calling WhoSends on a null pointer, which I don't believe is legal C++
-
mewt
exciting!
-
tyler82
mason: fuck. i see. but why everywhere mentioned this gpart bootcode -p then??
-
RhodiumToad
mewt: the code seems to be assuming that it just works and ends up in the method with "this" NULL, but the compiler seems to be eliding that tests
-
tyler82
mquin: ok. thx.
-
RhodiumToad
gpart bootcode -p is for GPT with legacy boot
-
mewt
maintainer is not in here, I guess I can try and fix it and get a patch to submit?
-
daemon
patches are welcome everywhere :)
-
dev1ls
hehehehe
-
mewt
"egypcio", apparently
-
mquin
mewt: which version of anope are you using?
-
mewt
Anope-2.0.12 -- build #1, compiled 00:10:09 Apr 21 2023