ChanServ changed the topic of #robotnix to: Robotnix: https://github.com/danielfullmer/robotnix || Channel logs: https://logs.nix.samueldr.com/robotnix
<samueldr> result/recovery.img !
<samueldr> now to get the device, copy the file, fastboot it
<danielrf[m]> awesome!
<samueldr> and it doesn't boot!
<samueldr> but that's most likely the device tree that's somehow wrong
<samueldr> fun thing is that it looks like the kernel's not even starting
<samueldr> btw, I don't really need help debugging the issue, just reporting
<samueldr> I kind of know my way around booting a Linux on phones :)
<danielrf[m]> Haha, no worries. I'm sure you have more expertise here than I do anyway :)
<samueldr> yeah, also I'm starting from an unknown condition
<samueldr> I don't know if it's supposed to work!
<danielrf[m]> that does complicate things!
<danielrf[m]> which phone / device is this for btw?
<samueldr> motorola-surfna
<samueldr> which doesn't have any trustable TWRP
<samueldr> since I saw that twrp device tree generator, I wanted to try it
<danielrf[m]> literally the first page on google when I searched for "motorola-surfna" is your mobile nixos doc page.
<samueldr> I know!
<samueldr> caught me again earlier today
<samueldr> moto e6
<samueldr> last year when I did the port there were no TWRPs, at all, and no custom ROMs
<samueldr> if the device tree it generate works, the next thing I wanted to try was add a kernel build to it, then maybe it'd give me an insight into making a LineageOS port from scratch :)
<samueldr> interesting, first it seems the initial recovery.img I was using as a source would't boot on the device
<samueldr> so I tracked another official one
<samueldr> which this one does boot
<samueldr> but a twrp from that tooling won't boot... what's interesting is that the kernel binary is the same
<samueldr> so I must assume something's not right with the init!
<samueldr> annoyingly enough it looks like console pstore doesn't work
<samueldr> committed / PR'd mostly to show the rest of the audience
<samueldr> I don't know if I'll follow through later on
<danielrf[m]> Thanks! I'd like to try building TWRP for marlin using this
<samueldr> building instructions for upstream TWRP trees seem iffy at best
<samueldr> added some relevant reading material links
<danielrf[m]> I have console access to marlin too so it should be easier for me to debug if I encounter failures
<samueldr> I have a sailfish now
<samueldr> haven't done any porting yet on it though :)
<samueldr> but I really assume my issues come from my build
<samueldr> (sailfish is the other pixel 1)
<danielrf[m]> I expect mobile-nixos for sailfish is almost identical to marlin except maybe resolution
<samueldr> I'm not sure whether it needs a different kernel build
<samueldr> I know the pixel 2 does
<samueldr> well, kinda
<samueldr> if it used modules it wouldn't need
<samueldr> and yes, part of the reason for getting it was having a serial-enabled phone of that vintage
<samueldr> and then another part was figuring out how to handle families of devices like those
<danielrf[m]> IIRC the kernel and kernel config is identical between marlin / sailfsh
<danielrf[m]> Do you have a serial cable already?
<samueldr> yes
<samueldr> made one for nexus 7
<danielrf[m]> cool, should work
<samueldr> AFAIUI yes
<samueldr> heh, coincidentally their last updated branch for marlin is android 9 too
<samueldr> so the branch should be usable without having to deal with thinking about the branches for 10 or other
<samueldr> but for some reason there's nothing for sailfish except a really old tree!
<danielrf[m]> sailfish has a config inside the marlin device tree
<samueldr> yeah
<samueldr> but
<samueldr> no published builds?
<danielrf[m]> strange
<samueldr> and the repository has this fun description
<samueldr> >> For building TWRP for Google Pixel XL ONLY
<samueldr> I wonder if it comes from their process they use to import a device tree
<samueldr> where they imported a combined tree, but left the sailfish stuff even if unused
<danielrf[m]> had you found any public CI / build server configurations while looking into this?
<samueldr> hadn't looked
<samueldr> since I didn't build one of their device trees
<danielrf[m]> understandable.
<samueldr> but should be easy, just go through the 39 pages of repos of the org ;)
<danielrf[m]> it'd be nice if there's some easy way to get a list of all the devices they support + associated device trees
<danielrf[m]> haha, I guess :(
<danielrf[m]> most instructions I'm seeing use the "eng" variant
<samueldr> same here
<samueldr> though I don't think it's as important for TWRP
<samueldr> TWRP has a different attack surface as the OS
<danielrf[m]> yeah, I'd be more worried that our default in robotnix of "user" might break things in twrp
<danielrf[m]> would probably set `variant = mkDefault "eng";` in the flavor
<danielrf[m]> oops missed that!
<samueldr> :)
<samueldr> I can't seem to find something relevant to their build infra
<samueldr> WELP
<samueldr> nothing on google
<samueldr> but since it was gerrit.twrp.me for their gerrit
<samueldr> what are the odds that https://jenkins.twrp.me/ works?
<samueldr> (seemingly high)
<danielrf[m]> hacker skills here
<samueldr> maybe you're joking, but that's actually seriously what it is
<samueldr> looks like there's also sailfish activity on their jenkins
<danielrf[m]> I've actively repressed my memories of jenkins so I don't know if it's possible to see the build configurations without higher permissions
<samueldr> I was about to say that jenkins looks totally unhelpful
<samueldr> where's the data!
<samueldr> but we do have a git commit ID
<samueldr> and marlin/sailfish share the same ID
<danielrf[m]> seeing some env vars and logs as well
<samueldr> yeah, logs
<samueldr> no env vars in sailfish/marlin
<samueldr> logs, surprisingly, show commands being run
<danielrf[m]> Wonder if this is public: `/builds/jenkins/scripts/buildtwrp.py`
<samueldr> you know I was just looking that up
<danielrf[m]> I'm working on a configuration for marlin right now, and it needs a couple extra repos: `hardware/qcom/{bootctrl,msm8998}`
<danielrf[m]> so I'd wonder where exactly those repos are being included in the jenkins config
<samueldr> exactly as my last reading material link documents
<danielrf[m]> (or maybe they're only needed for me since we're using the minimal manifest)
<samueldr> you might also end up needing some binaries from a rom
<samueldr> plausible too
<danielrf[m]> while using a minimal manifest would be nice, I'd hate to have to track down all these extra dependencies / kernel sources / etc manually for each device
<samueldr> huh!
<samueldr> it's only the twrp.me site that's wrong
<samueldr> the actual files listing for sailfish is the same as for marlin (with different names)
<danielrf[m]> success!
<danielrf[m]> I'd bet changing marlin to sailfish would work for you
<danielrf[m]> oh and needs changing the build target to bootimage as you already mentioned
<samueldr> it boots?
<danielrf[m]> yup
<samueldr> then pretty much confirmed the generated TWRP stuff didn't work for my device :)
<samueldr> I wonder if a hardware/qcom repo is needed
<samueldr> though it's not part of the documentation of their project so ¯\_(ツ)_/¯
<samueldr> those device trees are still so opaque
<danielrf[m]> For marlin at least, we need the `hardware/qcom/bootctrl` since the device tree refers to it: https://github.com/TeamWin/android_device_google_marlin/blob/72c4888ced18ffdbff962a3916cbd2a830f4c1ef/device-common.mk#L438
<samueldr> right, though I was more concerned about how to know if it is needed for the system
<samueldr> though that comment tells me it's for the BCB
<samueldr> and I suppose that if it's missing, TWRP just can't do the reboot-requiring scripts
<danielrf[m]> `vendor/google` dir didn't seem to be necessary for the twrp build to boot. Makes sense I guess
<danielrf[m]> One of the build documents you posted mentioned extracting vendor files from an existing image, so I added it in lieu of that
<samueldr> odd!
<samueldr> maybe they were able to get rid of it recently