gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
jasongrossman has quit [Ping timeout: 252 seconds]
Synthetica has quit [Quit: Connection closed for inactivity]
<elvishjerricco> What is an "EFI driver executable"? Mojave uses an apfs.efi driver executable to boot off apfs, and I'm trying to figure out how to get it to work in virtualbox. I'd prefer to not have to make a custom uefi bios, if it can be used directly somehow.
<samueldr> elvishjerricco: maybe a place to start looking https://efi.akeo.ie/
<elvishjerricco> `load fs0:/apfs.efi`, then `map -r`, then exit and boot from file. APFS filesystems will be available now.
<samueldr> let's hope
<elvishjerricco> Yea it's working and macOS's installation has continued.
<samueldr> yay!
<elvishjerricco> I bet qemu can add an EFI driver with the host command line. Sounds like something it'd do. That'll make this easier.
<samueldr> I wouldn't on it, AFAIK it's a tianocore build that's used for their EFI... though it's highly probably you could build one with everything built in
<samueldr> I wouldn't count on it*
<samueldr> and to refine my answer, what I mean is that it seems like it acts like a standard EFI implementation (because it is) so I'm not sure there's any qemu-specific magic to manipulate the boot process
<elvishjerricco> Ah
<elvishjerricco> I'll find a way
<elvishjerricco> I'd rather not modify the firmware, but it's a fine fallback method
<samueldr> I'm kinda curious about how problematic it is to build the tianocore image needed for qemu using nix :)
<elvishjerricco> Hm well macOS freezes in the installation phase now
<clever> elvishjerricco: have you heard of the qemu data injection thing?
<elvishjerricco> clever: Nope. What's that?
<clever> finding the name&page...
<clever> basically, you can start qemu with -fw_cfg ....
<clever> and it will then provide that data to the guest via a dedicated IO device
<clever> linux has a driver for it already
<clever> and the qemu "bios" uses that same api to fetch the kernel, initrd, cmdline, and other metadata
<clever> so when you -kernel bzImage, it configures a fw_cfg with the kernel
<elvishjerricco> Oh. Neat. Yea that'd probably do it.
<clever> elvishjerricco: ive also heard of somebody taking all of the FS drivers from either grub or linux (i forget), and packaging them into efi binaries
<clever> so efi can then magically support all of those FS's
<elvishjerricco> clever: Yea, samueldr linked that earlier
<elvishjerricco> https://efi.akeo.ie/
<clever> oh, lol, i was just reading that and trying to see what it was about
<samueldr> clever: I was sure you would have linked it if you weren't AFK at that time :)
<clever> samueldr: ive heard of it, but lost the link :P
<clever> https://lwn.net/Articles/641244/ is another fun thing
<samueldr> I learned of it from you :)
<clever> heh
<clever> with python in grub (with grub in efi mode) you can then use the full power of python, to poke and prod efi
<clever> and you could write a custom FS driver for efi, in python, to learn the efi api
<clever> grub lacks a way to exit back to efi and "fail" to boot, so you cant just load it like efi.akeo.ie though
<samueldr> though it can't exit, IIRC it can load another efi program, which could be the shell right?
<samueldr> (but yeah, not the actual firmware)
<clever> yeah
<samueldr> I wonder if the firmware itself is accessible, and if in it there is an efi program which is the firmware, which you could then chainload
<samueldr> (I'm thinking: no)
<clever> samueldr: ive extracted the bios from my NAS before (flashrom just works)
<clever> and its loaded with PE headers
<clever> and if i extract those, i get "valid" "windows" executables
<samueldr> related: there's a PR for uefi-tools in nixpkgs
<clever> i have also heard rumors that you can unpack that firmware, jam another .efi into it, then repack it
<clever> and still have it boot
<samueldr> yeah, those are EFI programs, which are PE executables, but not valid windows executables :)
<clever> hence all the quotes around "windows"
<samueldr> well, uefi-tools is made to do exactly that, and it is described as being used to enhance vmware's efi implementation
<clever> but i dont think my nas supported writes with flashrom, not sure
<samueldr> #45963
<{^_^}> https://github.com/NixOS/nixpkgs/pull/45963 (by tadfisher, 11 weeks ago, open): uefitool: init at 0.25.1
<samueldr> the main issue is when the CPU checks signatures of the bios
<samueldr> which is the main reason there probably won't be a coreboot port for anything mainstream and recent in the laptop space
<samueldr> AFAIK, I hope I'm wrong
<samueldr> (ignoring all chromeos devices, obv.)
<clever> samueldr: ive read up on how a lot of game console security works
<clever> and i find it very unlikely that any cpu would be checking signatures on bios firmware
<gchristensen> anyone good with serial ports? I'm having a pretty weird experience: https://asciinema.org/a/WKLS4iwldNM1geDxouvPBP8Ss
<clever> its just not capable of things that early on, and wouldnt have the public keys
<gchristensen> skip to 0:19 for the serial console part to start -- and every time the screen changes, I'm pressing Enter
<clever> gchristensen: `sudo -i`, stop mixing sudo and su! lol
<samueldr> clever: intel boot guard is the foe to vanquish :(
<samueldr> and I *did* check, both my recent laptops have it enabled
<samueldr> so no playing around
<gchristensen> clever: we can talk about that later :P
<clever> gchristensen: ah, i see the corruption now, do you know if both ends support hardware flow control, how big the fifo is on ogden, and roughly how fast ogden is?
<clever> and what the serial device is on both ends
<gchristensen> ogden is a fast (>3ghz) system dunno about fifo. the adapter is a Tripp Lite U209-000-R (Prolific PL2303RA Chipset). this is what I know about the other end, a Juniper EX2200 https://kb.juniper.net/InfoCenter/index?page=content&id=KB6011
<clever> gchristensen: so ogden is using a usb serial port?
<gchristensen> usb-to-serial adapter, yeah
<clever> gchristensen: and if you strace picoterm, what bytes do you see it reading from ttyUSB?
<gchristensen> ooh!
ottidmes has quit [Quit: WeeChat 2.2]
<gchristensen> ok wtf it works now
pie_ has joined #nixos-chat
<gchristensen> lol
* samueldr wonders how that logo got there
<gchristensen> clever: well I don't know why or how, but it isn't awful now
<samueldr> the colors are all wrong :/
<samueldr> (old colors on new flake!)
<clever> gchristensen: try minicom maybe
<clever> gchristensen: it might just be a race condition in picoterm
<gchristensen> the problem also exists with screen
<clever> weird
<Arahael> I'm having difficulty with flatpak, does anyone know how to deal with the following error?
<Arahael> error: The name org.freedesktop.Flatpak.SystemHelper was not provided by any .service files
<elvishjerricco> There's like no info online about EFI drivers, short of supermassive specification manuals.
<elvishjerricco> can't for the life of me figure out how to get the firmware to auto-load the apfs.efi driver.
<clever> elvishjerricco: from my understanding, there is a service that deals with mounting things, and i expect it to have a function to register an FS driver
<elvishjerricco> a service?
<clever> which likely is a table of function pointers
<clever> efi is loaded with services, refered to by uuid's
<clever> and you can request a handle to a given service, and call methods on it
<elvishjerricco> clever: The issue is that I'm trying to avoid needing to install custom firmware.
<elvishjerricco> Like I'd rather just use efibootmgr to tell it where to find drivers and have it autoload them
<clever> i suspect that you can configure the firmware to run a given .efi file from the ESP
<clever> and that file can then register drivers, and then "fail" to boot
<clever> the firmware will then just try the next EFI system in the config
<clever> and the state mutates along the way, gaining features
<elvishjerricco> clever: Oh, if one fails, it just moves to the next?
<clever> thats how i understand it
<elvishjerricco> Neat.
<clever> efi binaries are essentially just executables
<elvishjerricco> Then maybe I can just make a boot entry for apfs.efi?
<clever> and they can return back to the parent
<clever> an OS is just a hostile take-over of the system :P
<clever> "this is my cpu now!"
<elvishjerricco> Lol
<Arahael> Turns out flatpak requires a service to run, so the folks in #flatpak helped me out there. :)
<clever> disable interupts, clear the interupt vector table, and the cpu is basically yours :P
<clever> efi just happens to co-operate more, and says you should run ExitBootServices() first
<clever> elvishjerricco: related, is co-linux
<clever> from the windows point of view, colinux is just a network driver, that needs 2gig of ram, and chews up an abnormal amount of cpu, and has a lot of ioctl's
<clever> but behind the scenes, every time that "network driver" gets control of the cpu, it disables irqs, and jmp's into the linux kernel!
<clever> and when linux tries to put the cpu to "idle" mode, it restores some state, and returns control back to the windows kernel
<clever> boom!, you now have 2 kernels, on 1 cpu, without any virtual machines!!
<elvishjerricco> wow
<gchristensen> bahaha that is amazing
<elvishjerricco> that sounds breakable :P
<clever> elvishjerricco: there are extra rules to make it stable
<clever> for example, most hardware (and drivers) dont like sharing the hardware between 2 OS's
<clever> so colinux has zero "hardware" drivers
<clever> all disk IO is thru a special colinux driver, that references files on the host ntfs disk
<clever> all network IO is via a tunnel device on the host, then standard NIC bridging gives you internet
<clever> all console IO goes thru an ioctl to a console GUI app
<clever> X11 is just forwarded over tcp
<gchristensen> some people are disgustingly smart
<clever> sadly, colinux has no SMP support, and never got 64bit support
<clever> so it only works on 32bit windows kernels
<gchristensen> I noticed the 64b port was canelled
<clever> the project has basically died
<clever> and the windows linux subsystem gives you similar (but not perfect) features
<samueldr> virtualisation probably took measures for the coffin
<clever> samueldr: yeah, colinux doesnt help you with a hostile guest
<samueldr> I remember using colinux way back when
<clever> VM's are a lot more secure when the guest gets hostile
<samueldr> at that point in time virtualisation wasn't really a thing :)
<Arahael> clever: Not really
<Arahael> clever: It's possible to access data or escape the VM.
<clever> Arahael: relative to colinux at least, colinux gave the guest real ring0 perms
<Arahael> Vm's aren't really designed for security. Ah, ok, relatively, sure.
<clever> another fun project id like to see get more use, usermode linux
<clever> all you do, is compile the linux kernel, into a linux ELF executable, that runs under linux
* samueldr thought it was dead
<clever> id like to see it not be dead :P
<elvishjerricco> So I'm a little confused about the EFI variables though. The BootXXXX variables influence boot order. What do the DriverXXXX variables do?
<gchristensen> iirc nixos's test suite used to use UML
<clever> samueldr: UML could likely fix a lot of the performance issues in things like make-disk-image.nix
<clever> samueldr: and get rid of the need for kvm
<samueldr> it might not be dead, I just thought it was :)
<samueldr> mailing lists have some activity http://lists.infradead.org/pipermail/linux-um/
<samueldr> (apparently their new mailing lists since earlier this year)
<clever> elvishjerricco: i dont see any Driver vars on my machine
<elvishjerricco> clever: Yea there aren't any by default
<elvishjerricco> Looks like there's a DriverOrder variable to correspond to BootOrder. Not setting that explains why it didn't work for me
<samueldr> and there's still work on user mode linux https://github.com/torvalds/linux/commits/master/arch/um
<clever> samueldr: i would like to see it building on nix again as a first step
<samueldr> :/ I don't remember the reasons I had some time ago why I wanted to check user-mode linux
<samueldr> oh well, probably will remember some day
<Arahael> gchristensen: Lame. They need to discover unicode. ;)
<clever> gchristensen: wut? lol
<clever> now your just getting ridiculus :P
<gchristensen> :) ok time to try to sleep. it didn't work the first time, hopefully second time does the trick.
<Arahael> gchristensen: If the second time doesn't work, try compiling a list of FLA's. (Four-letter acronyms)
<elvishjerricco> Ok I've properly set the DriverOrder, but the firmware that VirtualBox uses just seems to ignore it
<elvishjerricco> Ok I see part of the issue now. For some reason the normal ways of setting nvram from a guest OS aren't working, so EFI vars aren't being persisted. If that worked, then at least my manually loading the apfs driver would work, because the macOS installer would have set the BootXXXX var
<clever> i suspect virtualbox doesnt support setting nvram vars
<clever> it just generates them dynamically, based on the gui config
jasongrossman has joined #nixos-chat
<elvishjerricco> clever: it lets you write them, and you can read them back in the same session without error. It either just fails to persist them when the session ends (which would be dumb; they should persist when they're written), or it never even tries, or it overwrites them at boot.
<elvishjerricco> Yep, according to some docs that may or may not be out of date: "It is currently not possible to manipulate EFI variables from within a running guest"
jasongrossman has quit [Ping timeout: 272 seconds]
<clever> elvishjerricco: the args ive found for qemu, seem to setup things to support efi vars
<elvishjerricco> clever: Oh?
<clever> it sets up 2 pflash devices, one for the uefi firmware, and one for the efi vars
<elvishjerricco> Alright. So next step is switch to qemu :P
<clever> elvishjerricco: however, there are no strings like nixos in my my_uefi_vars.bin file
<clever> despite doing an nvme+uefi install on it just today
<elvishjerricco> clever: Why would there be strings like nixos in that file? Doesn't NixOS only touch the Boot* vars (and only if you enable canTouchEfiVars)?
<clever> Boot0004* UEFI OS HD(1,GPT,27c99b08-455d-4dfe-a44f-6150cbc09ef8,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
<clever> usually, the name nixos is here
<clever> but i dont even see EFI\BOOT\BOOTX64.EFI in the file
<elvishjerricco> Try setting a var with efibootmgr and see if the file changes.
<clever> -rw-r--r-- 1 clever users 128K Apr 6 2018 my_uefi_vars.bin
jasongrossman has joined #nixos-chat
<sphalerite> clever: it's probably in UTF-16.
<clever> sphalerite: i did hexdump, no trace of 16bit chars
<sphalerite> huh
<sphalerite> fine, I'm out of ideas :D
<sphalerite> well maybe it's compressed or something
<sphalerite> idk
<clever> not enough entropy
<clever> or enough bytes
<sphalerite> hm indeed
<sphalerite> I don't suppose binwalk would find anything useful in such a small file either
<clever> its 128kb, but yeah, nearly all of it is just ff's
alienpirate5 has quit [Remote host closed the connection]
alienpirate5 has joined #nixos-chat
alienpirate5 has quit [Read error: Connection reset by peer]
Lisanna has quit [Quit: Lisanna]
<andi-> Following the orders for the new hardware is a strange experience.. From Amazon, the local online shop to DHL they all mutate the state they show the customer over time while keeping the timestamps the same.. Combined with vague things and every portal reporting different "translations". It drives me crazy.
__monty__ has joined #nixos-chat
obadz has quit [Ping timeout: 268 seconds]
obadz has joined #nixos-chat
obadz has quit [Client Quit]
obadz has joined #nixos-chat
<gchristensen> andi-: what all did you order?
<andi-> that board I posted yesterday
<andi-> Maybe a ledger would be a great technology for the delivery people..
<gchristensen> did you order any companion pieces?
<andi-> chassis, ram, disks, nvme disks, 2 SSDs, cables, power supply, …
<gchristensen> nice
<andi-> After reading about what disks to buy these days I just ordered some random Seagat 8TB platters... They'll fail some day anyway
<gchristensen> and probably not all at once
<gchristensen> this sounds like quite the storage rig
<andi-> just some replacement.. will have it running in paralllel for a good 6 months until I am confident with my zfs setup and other things..
aanderse has quit []
MichaelRaskin has quit [Ping timeout: 250 seconds]
MichaelRaskin has joined #nixos-chat
ekleog has quit [Remote host closed the connection]
ekleog has joined #nixos-chat
<infinisil> simpson: Linking somebody who's afraid of functional programming to dhall when they ask about NixOS doesn't seem like the best move tbh
<simpson> infinisil: hio is bad-faith.
<infinisil> How so?
<simpson> They started a flame war in another channel by deliberately insulting channel members' work.
<infinisil> Oh I see, I wish we had more op's in the channel so we could ban them if it gets out of hand
<simpson> Learn how to defuse trolls. Keep them busy, make your insults casual and backhanded, constantly create a sense of bathos.
<infinisil> gchristensen: Are you here?
<sphalerite> oh yay trolls
<sphalerite> simpson: hahahaha
<simpson> infinisil: Note how the troll is sounding stressed. This doesn't actually mean that they're stressed, just that their feelings are hurt by insults.
<infinisil> Haha, well I'd like to get rid of trolls as fast as possible, they're just wasting everybodys time
<simpson> Resist that urge. Let it go. Don't let a troll dictate your emotions.
<sphalerite> infinisil: there's a great way to get rid of trolls, it's called /ignore
<simpson> Note how, when the troll is starved, it only wants to talk to food sources. Not help on how to Nix, but just complaints about Nix.
<capisce> trolls can be converted sometimes, if you address their concerns and ignore their hyperbole
<sphalerite> capisce: is that the one where they convince the troll to try haskell?
<capisce> yep
<infinisil> Ahhhhh
<infinisil> gchristensen: Can you give me ban rights? It doesn't happen often, but it's annoying when it does
<sphalerite> infinisil: note that if you ban someone, *you* will not be rid of them, just everyone else in the channel will be :p
<simpson> We're at least onto on-topic good-faith attempts to use NixOS.
<infinisil> Yeah, surprisingly
<simpson> Which is far better than my last interaction with them. They came into a PLT channel and tried to start a "X language is best" flamewar.
<simpson> They did not calm down and left in an acrimonious manner.
* samueldr re-wrote the 2.2 section for 18.09 ;)
ottidmes has joined #nixos-chat
<ottidmes> infinisil: maybe the API should have used some newtypes, such that you would needed to have: M.insertWith (\(New (_, new)) (Old (uses, _)) -> ...)
<infinisil> ottidmes: Not sure, it's a really old API and used all througout Haskell, hard to change that without breaking almost every program out there
<infinisil> But yeah I also thought how this could be prevented
<infinisil> This might be the only way
<infinisil> Idris at least can give names to arguments in the type, very neat
<ottidmes> infinisil: I know, I was just thinking, yep, the type system is not perfect, it should have captured this somehow and thought this could have done so, but about Idris, I assume they are named arguments, are they implicit, so if you pass it position wise rather than named, is that still allowed, if so you might still have gotten this error
<infinisil> ottidmes: All arguments can be named, even non-implicit ones
<infinisil> But you can only have the name in the source code with implicit ones
<infinisil> For non-implicit ones the name is just in the type of the function, but not at the use-site
<infinisil> But the editor integrates that well with autosuggested argument names
drakonis_ has joined #nixos-chat
drakonis1 has quit [Ping timeout: 250 seconds]
<samueldr> (I may be wrong) it's either the one from this repo or the one from nixos, I seem to recall it being the OSX-KVM one https://github.com/kholia/OSX-KVM
<samueldr> ,locate OVMF_CODE.fd
<{^_^}> Found in packages: OVMF-CSM.fd
<samueldr> hmm, on 18.09 it may be `OVMF.fd`
<elvishjerricco> samueldr: Thanks!
<elvishjerricco> I might try to figure out how to build it from source
<elvishjerricco> I am determined to do this clover-less-ly :P
<samueldr> rooting for you :)
<samueldr> and hoping you share back your findings :)
<elvishjerricco> Absolutely! Probably going to end up being a fork of gchristensen's NixOS module
<samueldr> any particular goal?
<elvishjerricco> Yea, replace my real macos partition on my laptop with a zvol
<samueldr> making it easier for the community to test macOS things (for those that don't care as much doing it the legit way)
<samueldr> oops, forgot the question mark! ^?
<elvishjerricco> So I'm just doing it for my personal system, but I'm trying to do it "the right way" for personal satisfaction :P
vasarmilan has joined #nixos-chat
<gchristensen> samueldr: I prefer to assume everyone just happens to be running a mac host :P
<elvishjerricco> Hm. Qemu doesn't seem to be attaching my iso as a cdrom
<elvishjerricco> Oh no, I just can't read
<elvishjerricco> But tianocore isn't mapping it to an fs
drakonis1 has joined #nixos-chat
drakonis_ has quit [Ping timeout: 250 seconds]
drakonis_ has joined #nixos-chat
drakonis1 has quit [Ping timeout: 250 seconds]
vasarmilan has quit [Remote host closed the connection]
<andi-> Do we have happy users of the still "unstable" zfs encryption here?
<elvishjerricco> andi-: I tried it but switched off. It worked perfectly fine, but I just prefer LUKS.
<elvishjerricco> Ok, so one of the reasons people use Clover is that OVMF only includes EFI drivers for FAT variants, meaning it doesn't know how to boot a cdrom. I'll try loading other drivers from efifs.
pie_ has quit [Ping timeout: 256 seconds]
<elvishjerricco> oh, no the sources imply cd-rom support is included. Turns out the macOS installation image uses apple partition map -_-
<samueldr> quick note, updated https://nix.samueldr.com/explorer/ and will look into making it self-updating, since it looks like it was used by some
<elvishjerricco> anyone know how to make a copy of an iso that uses a different partition map?
<elvishjerricco> Heh. The script everyone's been cargo culting around for creating the installer media is what creates the APM. You can just change it to GPT
NinjaTrappeur has quit [Quit: WeeChat 2.3]
drakonis1 has joined #nixos-chat
drakonis_ has quit [Ping timeout: 252 seconds]
__monty__ has quit [Quit: leaving]
drakonis has joined #nixos-chat
drakonis1 has quit [Ping timeout: 250 seconds]
<colemickens> Well, I've determined that my CPU scaling issues are probably just related to my USB Type C hub.
<colemickens> I think.
<colemickens> and/or has to do with the laptop charging via the hub instead of directly?
srk has quit [Ping timeout: 245 seconds]
srk has joined #nixos-chat
<colemickens> also, after installing NoScript, I better understand the frustrations with CloudFlare.