orivej has quit [Ping timeout: 265 seconds]
ryantrinkle has quit [Ping timeout: 240 seconds]
orivej has joined #nixos-aarch64
<samueldr> I did it
<samueldr> looked long enough at `tig log HEAD...v4.4.201` in the files of those functions in the commit log, identified something of interest, git reverted my way to a working kernel
h0m1 has quit [Ping timeout: 252 seconds]
h0m1 has joined #nixos-aarch64
orivej has quit [Ping timeout: 240 seconds]
<samueldr> danielrf[m]++
<samueldr> mobile-nixos#51 if this confuses anyone
<{^_^}> https://github.com/NixOS/mobile-nixos/pull/51 (by danielfullmer, 28 minutes ago, open): [WIP] device: Google Pixel 1 XL // google-marlin
<samueldr> (now wondering why the bot didn't take the ++)
<samueldr> my main guess is lack of IRC activity :)
<danielrf[m]> samueldr: sure, I'll split those commits now
<samueldr> thanks
<samueldr> I got confused by GitHub
<samueldr> I though I hadn't sent the review still
<samueldr> and saw you do the change I thought I hadn't asked for yet
<samueldr> danielrf[m]: basically, the contribution looks ready to merge, and you're likely at the same level of support as the other devices
<danielrf[m]> ah, cool. I wasn't sure what was the minimum required features for it to be merged
<danielrf[m]> but thought I would PR anyway in case anyone else was thinking of working on marlin as well
<samueldr> great work :)
<danielrf[m]> thanks!
<samueldr> did you face any issue?
<danielrf[m]> I'll work on supporting usb / touchscreen / etc in the future
<samueldr> touchscreen is likely working already :)
<samueldr> I haven't seen a single android device without touchscreen working out of the box yet, with an OEM kernel
<danielrf[m]> yeah, it seems to need gcc 6
<samueldr> a couple devices do
<samueldr> there's even xiaomi-lavender requiring 4.9
<samueldr> and it's a newer device!
<danielrf[m]> I messed around with the kernel config a lot before figuring this out
<danielrf[m]> well- even in AOSP I believe the marlin kernel is compiled with gcc 4.9
<danielrf[m]> but seems to work with gcc6 at least!
<samueldr> forgot to check the source you used for the kernel, already using android-linux-stable, great!
<samueldr> so, other than that, no specific issues in getting started with Mobile NixOS?
<samueldr> I mean, I know docs might be lacking, so notes for improvement are appreciated
<danielrf[m]> yeah, other than docs I didn't run into any mobile-nixos issues
<danielrf[m]> but reading everyone else's code for a while I eventually figured it out
<danielrf[m]> I found looking through the AOSP source helpful as well: Under device/google/marlin
<samueldr> yeah, figuring out the info, also in well-produced projects like lineageOS helps
<danielrf[m]> lots of options like BOARD_KERNEL_CMDLINE are right there
<samueldr> yeah
<samueldr> though there's a cheat-code :) unpackbootimg
* samueldr adds a note to document this bit quickly
<danielrf[m]> haha I figured that out as well while when I thought my boot issues were offset-related and not GCC
<samueldr> you can get all the required info
<samueldr> in fact, not only document it, but automate the device bringup
<samueldr> like, bring your TWRP, or ROM and figure out basic stuff
<samueldr> you can even get a .config using binwalk and some pre-built kernels
<samueldr> but some OEMs (google) will have a "clean" kernel without a useful .config :(
<danielrf[m]> also, some docs on getting .config right would be nice -- I had to add stuff like DEVTMPFS
<samueldr> yeah, those are also the next upcoming subjects
<samueldr> you might be lacking a few, I haven't validated
<danielrf[m]> do you have any plans to maybe have nix generate parts of .config like in nixos?
<danielrf[m]> yeah--I wasn't sure exactly what was needed
<samueldr> no plans yet, but I still think that complete module-less kernels like those are going to be useful in the future
<samueldr> so they're of value
<danielrf[m]> but I did run kernel-normalize-config
<samueldr> (that was a followup of a previous sentence)
<samueldr> yeah, saw that
<clever> samueldr: remember my haskell-init project?
<samueldr> clever: yeah
<clever> kernel module loading, involves userland (modprobe/insmod) doing symlink lookup and linker duties
<clever> so there is no simple ffi function haskell can use to load kernel modules
<samueldr> danielrf[m]: CONFIG_VT will be required for X11, not sure about other "display servers"
<clever> so i'm forced to put a dirty C binary into the initrd if haskell-init wants kernel modules!!
<clever> but a module-less nix build of the kernel would solve that issue!
<samueldr> CONFIG_USER_NS (already enabled) for stuff like the nix sandbox, some systemd stuff
<danielrf[m]> ok--I'll regenerate the kernel config with CONFIG_VT
<samueldr> if you're lucky, it'll continue booting just fine
<samueldr> if you're unlucky like today's yakshave of mine, you might be hunting for a while :)
<samueldr> as for running X11, there's the `examples/demo` folder, which generates a system.img
<samueldr> though system.img, most likely, cannot be flashed to the system partition
<samueldr> (too big)
<samueldr> so fastboot flash userdata can be used instead
<samueldr> but obviously, that means erasing all the contents
<samueldr> and that part does not build with cross-compilation
<danielrf[m]> I have no problem wiping userdata--my daily driver is a pixel 3 XL
<samueldr> nice
<samueldr> you're well started, and well equipped to follow and contribute to the project then :)
<danielrf[m]> the non-cross compilation is an inconvenience--I'll either have to spin up an AWS instance
<danielrf[m]> or hopefully get most things from the nixos cache and just cross compile the kernel?
<samueldr> yeah, the kernel and initrd should always be cross-compilable
<samueldr> so yes, most things will be available from the cache
<samueldr> there's always this, too https://github.com/nix-community/aarch64-build-box
<danielrf[m]> ah cool--maybe I'll ask for access if I find myself having to build too much arm64 stuff myself
<samueldr> ask already, that way when you'll need it you'll have it
<danielrf[m]> not sure if i'm a "well known member of the community" haha
<samueldr> not sure either, I didn't recognize your IRC presence at first
<danielrf[m]> I've done some driveby contributions to nixpkgs in the past
<samueldr> or at the very least, not inactive :)
<samueldr> so with that link, and a link to the marlin PR, that might help get you in
<danielrf[m]> ok cool I'll send a PR
<samueldr> with the 1, and 2 done, we're left with 2 (or 3) Pixel families to deal with :)
<samueldr> (depending on if the 3a is entirely different or not from another Pixel device)
<samueldr> I was curious, looks like pmOS doesn't have the Pixel 1 going yet... wondering why
<samueldr> I mean, wondering the exact issue
<danielrf[m]> they have an open PR I believe
<samueldr> yeah, searching for the PR
<samueldr> (there's no link from the wiki page)
<danielrf[m]> a year old
<samueldr> no real info, though it looks like one of the user was working on mainline
<samueldr> a whole other thing
<danielrf[m]> samueldr: It still boots to the same place while CONFIG_VT and related options similarly as in the URL you linked earlier
<danielrf[m]> would you like the change as a new commit or a fixup+rebase for the existing kernel commit
<samueldr> both are fine
<samueldr> the kernel vs. device separation was more important than it being unique commits
<samueldr> and yeah, if it boots the same it's likely good then
<danielrf[m]> whoops--messed up the rebase
<danielrf[m]> just a sec
<danielrf[m]> ok should be fixed now
<samueldr> Thanks!
<danielrf[m]> No problem! I think this project is great! Happy to contribute
<samueldr> glad to see contributions, the bet of front-loading a couple of ports before making it useful seems to pay off
zupo has joined #nixos-aarch64
zupo has quit [Ping timeout: 240 seconds]
zupo has joined #nixos-aarch64
<craige> That's a couple of exciting commits that went through samueldr :-d
<craige> ugh, :-D
* craige watches all the commits that go through.
<craige> danielrf[m]++
<{^_^}> danielrf[m]'s karma got increased to 1
h0m1 has quit [Quit: WeeChat 2.6]
h0m1 has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has joined #nixos-aarch64
h0m1 has quit [Quit: WeeChat 2.6]
h0m1 has joined #nixos-aarch64
lordcirth__ has quit [Remote host closed the connection]
lordcirth__ has joined #nixos-aarch64
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
ryantrinkle has joined #nixos-aarch64
zupo has quit [Client Quit]
cptchaos83 has quit [Remote host closed the connection]
cptchaos83 has joined #nixos-aarch64
zupo has joined #nixos-aarch64
<samueldr> yes
<samueldr> what command(s) did you use to burn u-boot?
<samueldr> what this looks like is that the SPL could not do a read on the SD card (nor on the MMC)... "mmc block read error" though not sure if the error could be re-used for "not the expected data" or if it's really "couldn't even read"
<samueldr> though, for the eMMC (MMC2 I presume) it could happen I guess if the switch turned it off
<samueldr> the SD card maybe is one that u-boot's SPL code dislikes?
<samueldr> that would be surprising though :/
<Thra11> eMMC is both switched off and removed.
<samueldr> how did you end up building u-boot?
<samueldr> using the derivation from my wip repo?
<Thra11> Yes. I have a copy in that repo
<Thra11> (my overlay doesn't do the conditional pkgsCross stuff at the moment, but it is building on an aarch64 host)
<samueldr> maybe first try manually writing the u-boot to the SD card to see
<samueldr> or another sd card
<samueldr> that's weir
<samueldr> weird*
<samueldr> though, one difference with my setup is that the eMMC is present, but zeroed, haven't checked without eMMC what happens
<samueldr> as a note
<samueldr> this is where it fails
<samueldr> likely `if (count == 0)`
<samueldr> no, disregard that comment
<samueldr> it could be the final else
<samueldr> I don't think it's loading a FIT, and I'm pretty sure it's not loading an IMX container
<samueldr> so it's likely mmc_load_legacy
<samueldr> building it so debug() prints to the console could help
<samueldr> I still haven't found the "right" way to do that though... there's so many conflicting information about that
<Thra11> samueldr: I'll try some of those things later. Thanks for your help!
<Thra11> samueldr: just to confirm, you have the eMMC connected, but zeroed (at least the start of the disk) and the eMMC switch is set to eMMC enabled?
<samueldr> yes
<samueldr> in my case, u-boot doesn't even try to look at MMC2
<samueldr> only checks MMC1
<samueldr> and continues to proper u-boot
h0m1 has quit [Quit: WeeChat 2.6]
h0m1 has joined #nixos-aarch64
h0m1 has quit [Quit: WeeChat 2.6]
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
h0m1 has joined #nixos-aarch64
h0m1 has quit [Client Quit]
h0m1 has joined #nixos-aarch64
<samueldr> now it's up to craige for the pixel 3 ;)
aminechikhaoui has joined #nixos-aarch64
zupo has joined #nixos-aarch64
<Thra11> I see the rockpro64 uboot in nixpkgs merges u-boot.itb onto idbloader.img so you only have a single image to write. (Not relevant to current issue, just noticed it)
<samueldr> yeah
<samueldr> I haven't investigated further in making it better :)
<Thra11> When you say, "proper u-boot", are there any more u-boot bits beyond idbloader.img and u-boot.itb?
<samueldr> not that I know of
<Thra11> No u-boot.img in /boot or anything like that?
<samueldr> no filesystem needed at all
<samueldr> my SD card has no filesystem :)
<lordcirth> samueldr, just uboot to a USB or what?
<samueldr> u-boot to sd card, for testing u-boot
<lordcirth> Oh I see
<samueldr> the RK3399 doesn't check USB for boot
<samueldr> it checks, in order, SPI, eMMC, SD
<lordcirth> Yeah, that's why I thought some people were installing a bootloader just to chainload a USB
<samueldr> first magic signature found is used, even if it doesn't end up working
<lordcirth> Or NVMe
<samueldr> I'm not sure I follow "installing a bootloader to chainload a USB"... kinda doesn't make sense with u-boot, but at the same time, could be multiple layers of misinterpreted info
<samueldr> (NVMe is different in this situation)
<lordcirth> If you want your rootfs on USB or NVMe, you could install a bootloader on eMMC that points to the rootfs, right?
<samueldr> not exactly
<samueldr> :)
<samueldr> u-boot (unless it changed in the last ~1 weeks) doesn't know about the PBP NVMe stuff, so yeah, something needs to be aware of it. Here the Linux kernel, and likely an initramfs
<samueldr> this, though, doesn't chainload, it just boots
<lordcirth> Ah ok, so /boot on eMMC, / on NVMe should work?
<clever> so the kernel and initrd would also have to be on the eMMC
<samueldr> so it's more about having the kernel/initramfs on a different storage than your root / home
<samueldr> lordcirth: yeah
<clever> lordcirth: ive done very similar when i put my / on iscsi, with a raspberry pi
<samueldr> USB is a different kettle of fish
<samueldr> u-boot knows about USB
<samueldr> though the BSP one doesn't
<samueldr> the mainline one does!
<clever> /boot was on SD fat32 (for firmware reasons), / was on iscsi to the nas
<samueldr> so you could realistically remove the eMMC, remove the SD card, then boot from USB with a u-boot in SPI
<samueldr> mainline u-boot had no issue with grub from the nixos UEFI aarch64 .iso
<lordcirth> samueldr, so what config do you intend to use for your image?
<samueldr> hm?
<samueldr> do you mean what config on the PBP?
<lordcirth> Yeah
<samueldr> not sure yet
<samueldr> might dogfood Mobile NixOS rather than NixOS proper
<samueldr> still thinking about it
<lordcirth> Btw I tinkered with generating x86_64 images, to figure out how to configure it. Looks like I need to do a PR to fix lxqt
<samueldr> and the boot chain is not shared, up to stage-2, so that will cause issues
<samueldr> well, not cause issues, but there will be discrepancies
<Thra11> samueldr: It boots!!!!!!
<samueldr> when `dd'd` appropriately?
<samueldr> I have a hunch
<samueldr> the sd image might be creating a partition over the u-boot data?
<samueldr> when `dd`'d manually*
<Thra11> samueldr: Yeah probably.
<Thra11> I dd'd it manually because I wanted to test some changes without rewriting the whole image
<Thra11> But I suspect the manual dd was the critical bit, not the changes
<samueldr> that's plausible since IIRC the default sd-image the FAT32 partition overlaps with u-boot for rockchip
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Thra11> The changes were 1) adding `extraConfig = ''LOG y'';` 2) patching include/configs/rk3399_common.h to increase ramdisk_addr_r to sort the big nixos kernel-ramdisk overlap
<Thra11> So nothing you'd expect to make a big difference unless the log output affects timings
<samueldr> wouldn't think so
<Thra11> Wifi is working now too, which is nice
<samueldr> :/ it looks like the pinephone also will ship without gfx init in u-boot
<samueldr> extremely an issue with easy selection of generation at boot
<Thra11> What SOC is the pinephone again?
<samueldr> Allwinner A64
<samueldr> I'm just now circling back and getting up to speed with the actual current state of things
<Thra11> I wonder if there's a way to change initial KDE/plasma settings in an sd-image. The compositor backend defaults to OpenGL, which is glitchy at the moment, but if you set it to XRender it's ok
<samueldr> no idea, it falls in the user settings category of issues, mainly
<samueldr> of those, I have found that xfce has a great support for system-wide defaults
<samueldr> (which is a reason I used xfce in my Mobile NixOS cheaty demo)
<samueldr> it's trivial to put files at the right location under /etc/ and the user settings default to those unless configured differently
zupo has joined #nixos-aarch64
zupo has quit [Client Quit]
h0m1 has quit [Quit: WeeChat 2.6]
h0m1 has joined #nixos-aarch64
zupo has joined #nixos-aarch64
<Thra11> Apparently I can just put plasma config files in /etc/skel and new users will get a copy
<clever> Thra11: ls: cannot access '/etc/skel': No such file or directory
<samueldr> a copy, which is annoying for option changes :)
<samueldr> xfce's way is nice since it's in-between the compiled-in defaults and the user's config
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<samueldr> the more I look at it, the easier it'll be to document and use if I treat the pinephone basically as if it was an android-based device
<samueldr> in all cases, someone wanting another kind of setup can still do it the usual ways, it's a standard A64 device
<samueldr> and for updating the kernel, I really want to have a universal solution that does not replace the "known good" kernel off the boot partition for android-based devices, so the same solution will be useful there