ChanServ changed the topic of #robotnix to: Robotnix: || Channel logs:
<Miyu-saki> Hiii, I'm back, with a personal question this time. \o
<Miyu-saki> How do I have a rooted device?
<Miyu-saki> Rather, how do I build an image with root?
<Miyu-saki> Oh, I guess I can just sideload it through recovery
<Miyu-saki> "it" being Magisk.
<samueldr> though I remembered it was about rooting too, but it is not
<samueldr> I also didn't remember that someone answered with possible clues to build it into the ro
<samueldr> rom*
<Miyu-saki> Yep! I'll try to integrate that if I do find the time to.
<Miyu-saki> One other thing. How do you install LineageOS? Is boot.img + OTA all I need?
<samueldr> I don't exactly know!
<samueldr> I would assume the ota zip is enough by itself
<samueldr> I mean, that's what I know, but if you're asking maybe there is an issue?
<Miyu-saki> Oh, I'm just wondering if this is still relevant.
<samueldr> ah, yes, boot.img for a way to do the initial adb sideload
<samueldr> maybe?
<samueldr> those instructions are more for AOSP on pixel devices though AFAIK
<samueldr> I believe you could follow the instructions here
<samueldr> (the 7 and 8 shouldn't have any differences that matter for the general instructions)
<Miyu-saki> Right. I'm flashing with boot.img + OTA right now. Hope that's all I have to do!
<samueldr> I don't know if with robotnix you get the custom recovery though
<samueldr> >> In some cases slot b can be unpopulated or contain much older firmware than slot a, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of slot a to slot b. This step is NOT optional.
<samueldr> ah, so it's not a motorola-only issue
<samueldr> interesting
<Miyu-saki> Yep, I was reading up on this last night too. Seems like it also happens on Sony/pioneer.
<Miyu-saki> Though, what exactly does hard-brick mean here?
<samueldr> hard brick in theory should mean it's irrecoverable
<samueldr> it won't boot anything useful
<samueldr> that's what bricked once meant
<samueldr> and it seems "hard bricked" now is slowly meaning what "bricked" now means
<samueldr> but if you see hard bricked, assume that it means completely unable to boot anything anymore
<Miyu-saki> Yeah, it's a bit interesting too because etymology-wise, it's called a brick because it's as useful as a brick kinda thing lol.
<samueldr> for oneplus, though, hard bricks *should* be fixable by the end users, unverified what's the status with oneplus 8
<Miyu-saki> Or rather, it's functionally a brick.
<samueldr> oh, interesting, I think that bit must be part of their A/B termplate
<samueldr> template*
<Miyu-saki> Thanks. I'm like, not really familiar with the Android booting process.
<samueldr> basically, it goes this way: SoC boot rom verifies and boots the firmware. In recent android devices it's XBL, a minimal EFI implementation
<samueldr> XBL then starts ABL, an EFI implementation of aboot
<samueldr> before XBL existed, the firmware was something more bespoke, and loaded aboot
<samueldr> aboot (and ABL) loads the kernel from the boot partition, and also implements the fastboot protocol bits
<samueldr> ABL and aboot are also verified
<samueldr> so bricking generally happens when either the firmware (e.g. XBL) or the bootloader (aboot, ABL) either does not verify, or is bad
<samueldr> when this happens, generally the device is toast...
<samueldr> except for EDL mode on qualcomm devices, there are equivalents with mediatek and spreadtrum
<samueldr> EDL mode stands for emergency download
<samueldr> except, this requires a signed (by the vendor) program to boot something
<samueldr> and generally vendors do not publish those programs
<Miyu-saki> Oh that's actually pretty cursed, and firmware is writable by your vendor through updates, right?
<samueldr> yes
<samueldr> what happens when A/B is empty
<samueldr> well, when B is empty
<samueldr> is that there is no XBL, no ABL!
<Miyu-saki> Oh
<samueldr> in theory the bootrom is supposed to switch back ot A
<samueldr> except it's been shown to not do that
<samueldr> at least, for some vendors
<Miyu-saki> Right, so partition selecting happens very early
<samueldr> yes, this allows shipping updates in a safe fashion
<samueldr> *assuming it can recover at the earliest part!
<samueldr> but I guess they never tested the case where A/B users got a fresh device, *never* ran an update, then switched slots!
<Miyu-saki> Yep. So theoretically, the first-stage bootloader should also realize that XBL/ABL is empty, and select the other partition
<samueldr> that's the basic idea
<Miyu-saki> But not all(any?) devices do this
<samueldr> you got the (any?) right!
<samueldr> at least verified that motorola-def will fail that way
<samueldr> though, luckily, motorola implemented something custom to recover their devices
<samueldr> so that user (not using robotnix) was able to restore their devices to working
<Miyu-saki> First thing I disable on any new device is to disable the system update lol. I should keep this in mind.
<Miyu-saki> Moment of truth in a few minutes.
<Miyu-saki> I added a patch to my kernel
<Miyu-saki> I'd be like
<Miyu-saki> very happy
<Miyu-saki> Welps, it didn't work. I'm pretty sure I patched the wrong file though.
<Miyu-saki> Yep, it works now!
<Miyu-saki> Hmm
mcint has quit [*.net *.split]
mcint has joined #robotnix
colemickens has quit [Ping timeout: 240 seconds]
danielrf[m] has quit [Ping timeout: 260 seconds]
colemickens has joined #robotnix
danielrf[m] has joined #robotnix
<Miyu-saki> Does signing work with LineageOS?
<danielrf[m]> Miyu-saki: Yep. It should work
<Miyu-saki> Thanks. I'm testing something rn, and wondering if it'd refuse to boot if I unpack and repack boot.img.
<ajs124> If you haven't re-locked the device, fastboot boot basically always works, in my experience.
<Miyu-saki> Oh okay, thanks.
<Miyu-saki> Uhh, I need an opinion here.
<Miyu-saki> On recovery mode, it presents itself as /dev/.../modem_a and /dev/.../modem_b.
<Miyu-saki> Should I change the fstab do reflect that?
<danielrf[m]> I don't believe so
<danielrf[m]> I'd expect there is some mechanism that provides the partitions corresponding to the slot you are currently in.
<Miyu-saki> Right. Turns out we were looking at the wrong directory.
<samueldr> yeah, under /dev/block/bootdevice links are made for the correct slot
<samueldr> active slot*
<samueldr> but IIRC that's only done by android's thing that does what udev does... so don't go looking for it in a non-android system
<Miyu-saki> Right, thanks. Both slots are visible, and contain the firmware, so we're kinda ??? right now.
<Miyu-saki> s/visible/mountable/
<Miyu-saki> Maybe it's something else which is preventing it to mount?
<samueldr> you'd need to look at the logs to know, I guess
<samueldr> one thing to consider is that maybe this is not a robotnix issue, but outright LineageOS 18.1 still being in development
<Miyu-saki> Funnn
<Miyu-saki> Finally got binfmt_misc to work.
<Miyu-saki> @s9lavender:/ # hello
<Miyu-saki> Hello, world!
<Miyu-saki> lavender:/ # file $(which hello)
<Miyu-saki> /system/xbin/hello: ELF executable, 64-bit LSB x86-64, static, not stripped
<Miyu-saki> Time to run steam on my phone (unironically)
<samueldr> (becoming off-topic for here) you might prefer using something like
<samueldr> for x86_64 there's FEX
<Miyu-saki> Thanks! I appreciate the links.
<Miyu-saki> Though, that aside. I actually really wanted to compile a custom kernel for my phone for more productivity tasks (e.g. NixOS container, instead of just using a chroot), and robotnix makes that so easy, so I'm pretty glad.