<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://nandiprh.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://nandiprh.github.io/" rel="alternate" type="text/html" /><updated>2026-09-02T02:36:49+00:00</updated><id>https://nandiprh.github.io/feed.xml</id><title type="html">Pratyush Nandi</title><subtitle>Interested in systems programming. Tinkering with Gentoo, Android BSP, kernel work, PL theory. Notes and logs from my system.</subtitle><author><name>Pratyush Nandi</name></author><entry><title type="html">Starting with NetBSD and fixing QEMU flags</title><link href="https://nandiprh.github.io/blog/2026/08/17/Starting-with-NetBSD/" rel="alternate" type="text/html" title="Starting with NetBSD and fixing QEMU flags" /><published>2026-08-17T00:00:00+00:00</published><updated>2026-08-17T00:00:00+00:00</updated><id>https://nandiprh.github.io/blog/2026/08/17/Starting-with-NetBSD</id><content type="html" xml:base="https://nandiprh.github.io/blog/2026/08/17/Starting-with-NetBSD/"><![CDATA[<p>In the last post I jotted down my understanding of Virtualization and how hypervisors like Xen and KVM/QEMU works, along with working scripts.
Considering the fact that my initial focus is to understand the whole NetBSD layout,its init system and rc scripts, how its package manager pkgin functions, the ports system of pkgsrc, though I shouldn’t be using the term ports for NetBSD.
Further components like pkg_add, pkg_delete, pkg_info along with how the pkgsrc tree tries to be OS agnostic, the NetBSD’s make known to everyone as “bmake”.
Working with NetBSD’s sndio drivers and delving into kernel code. Then I would delve into rump kernels. With my main focus on resolving the fact that despite NetBSD source tree having a stable NVME driver, the installer media doesn’t recognize it.
Same issue persists with OpenBSD, with only FreeBSD working without any caveats. So understanding the FreeBSD specific driver and then I will try to port it to NetBSD.
But foremost I need to fix the issue with entropy and shared directory with KVM/QEMU. From now on the main refernece guide will be NetBSD manual pages.</p>

<p>So earlier I had done a custom installation of NetBSD selecting different sets and installing them from installation media and importing rest from NetBSD’s CDN via http.
The sets for reference were kernel(generic), discarding kernel(generic_kaslr) which is the same generic kernel with kernel address space randomization enabled, loadable kernel modules(.kmod files), base(mandatory and required ofc), base 32-bit compatibility(I disabled this because I’m not going to working with 32 bit binaries and legacy software but good to have for daily drivers),config files(/etc), compiler tools(Needed for developemt), 
Games(old BSD TUI games, not required ), Man pages(troff formatted, gold source of info), Man pages HTML (pre-rendered as HTML instead of troff ), graphics driver firmware(I disabled this, because initially my work is solely TUI based and getting NVME and other peripherals work and getting non-llvmpipe display is my last concern for now), misc(no idea honestly, probably some extra locales, good to have ), recovery tools(Enabled, better than runnnig the installation media again), test programs(enabled, as mostly required for my VMD work), text processing tools(must for troff based man pages), x11 sets(disabled), source and debug sets(installs /usr/src, anyways needed for devel work, better to have now than installing later from github mirror, for debugging we get tools like gdb for a panic kernel).
Further I enabled sshd(because using with -nographic means dealing with vt100 or vt220 terminal, they are fine for physical hardware but the buffering isn’t great when virtualising, even setting stty rows and cols, rendering is unpredictable. It sometimes fills screen, sometimes display only in half, so ssh is useful for visual satisfaction pov), enabling ntpd, The ntpd utility is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers.
Then ntpdate,  ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host, better to leave it disabled, leans more towards legacy outdated tech and not much relevant to kernel work.
Other options like multicast dns and cgd(similar to Linux’s LUKS encryption), LVM and raidframe disabled because I don’t require redundancy and disk flexibility on qemu virtual disks.
Also the reasoning behind, the irregular display with -nographic is ,there is no monitor hence no pixel resolution, no window for qemu to manage, qemu’s serial output just gets piped to whatever terminal application I launched with boot_normal.sh, in my case ghostty.
So the screen filling half/full is a rendering issue of the terminal emulator’s own window behaving inconsistently, window manager auto sizing, terminal app remembering a stale size, etc. Its nothing on qemu for fixing it.
So a real serial console has no way to report the guest OS, what size is my terminal emulator. So setting stty sizes will also not help, but in case of ssh, it negotiates window size(TIOCWINSZ) and sends SIGWINCH automatically on resize, thus with -nographic the serial console just uses the default which most likely is 80x24.</p>

<p>Also while booting via serial console with -nographic simply choosing normal boot via 1, will boot the system but lack serial port because it expects a VGA display there.
So boot using option 3, and use the boot parameters</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>consdev com0
boot
</code></pre></div></div>
<p>Upstream source for all QEMU flags are listed here:</p>
<pre><code class="language-txt">https://wiki.qemu.org/Features/
</code></pre>
<p>Now comes the entropy part, as soon as I boot into the system I’m greeted with</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Welcome to NetBSD!
<span class="nt">--</span> UNSAFE KEYS WARNING:
        The ssh host keys on this machine have been generated with
        not enough entropy configured, so they may be predictable.
        To fix, follow the <span class="s2">"Adding entropy"</span> section <span class="k">in </span>the entropy<span class="o">(</span>7<span class="o">)</span>
        man page.  After this machine has enough entropy, re-generate
        the ssh host keys by running:
                /etc/rc.d/sshd keyregen
</code></pre></div></div>
<p>Honestly in the installation phase itself NetBSD will complain lack of entropy and advise either to generate it or fetch it via network, for a VM its fine but still a secure practise to follow on a development environment.
Entropy is random unpredictable secrets needed for security,</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>man entropy     <span class="c"># hardware random number generators based on thermal noise in silicon circuits</span>
                <span class="c"># others may require operator intervention for security.</span>
</code></pre></div></div>
<pre><code class="language-txt">Features/VirtIORNG, QEMU Wiki, https://wiki.qemu.org/Features/VirtIORNG  # from NetBSD man page
</code></pre>
<p>In our case we don’t do a passthrough, that leaves the host vulnerable for the time being the guest is active, so we simply use -device virtio-rng-pci.
From qemu’s wiki -device virtio-rng-pci to the QEMU invocation will add the device with a default host backend. As of QEMU 1.3, the default backend is to use the host’s /dev/random as a source of entropy.
To modify this source to a real hardware RNG on the host, use:</p>
<pre><code class="language-txt">-object rng-random,filename=/dev/hwrng,id=rng0 \
-device virtio-rng-pci,rng=rng0

# optional parameter to limit the rate of data sent to the guest
-device virtio-rng-pci,max-bytes=1024,period=1000
</code></pre>
<p>As its a guest mostly running on userspace, I prefer passing /dev/urandom instead of /dev/hwrng.
/dev/urandom is a fast software-based cryptographic pseudorandom generator meant for general applications, while /dev/hwrng provides raw, direct access to a physical hardware random number generator
At the end /dev/hwrng writes to /dev/random, if you trust hardware better use /dev/hwrng.
Modifying the boot_normal.sh, requires a device shutdown and poweron for the guest, a mere reboot doesn’t seem to work.
In NetBSD to shutdown use</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>halt <span class="nt">-p</span>    <span class="c"># As root or use doas</span>
</code></pre></div></div>
<p>To see if changes are taking place inside the NetBSD guest,</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>netbsd_devel<span class="nv">$ </span>doas rndctl <span class="nt">-l</span>
Source       Estimated bits    Samples Type   Flags
/dev/random               0          0 ???    collect, v
cd0                       0          0 disk   collect, v, t
wd0                       0       6701 disk   collect, v, t
fd0                       0          0 disk   collect, v, t
hardclock                 0      19029 skew   collect, t
pms0                      0          0 <span class="nb">tty    </span>collect, v, t
pckbd0                    0          0 <span class="nb">tty    </span>collect, v, t
system-power              0          0 power  collect, v, t
autoconf                  0        152 ???    collect, t
seed                      0          1 ???    collect, v
uvmfault                  0        502 vm     collect, v, t

<span class="c"># no viornd0 listed, so changes haven't taken place requires halt.</span>
</code></pre></div></div>
<p>Additionally we may check what flags QEMU launched with using</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>~]&gt; pgrep <span class="nt">-fa</span> qemu-system-x86_64
1227820 qemu-system-x86_64 <span class="nt">-m</span> 4G <span class="nt">-smp</span> 4 <span class="nt">-drive</span> <span class="nv">file</span><span class="o">=</span>netbsd.img,format<span class="o">=</span>qcow2 <span class="nt">-boot</span> c <span class="nt">-enable-kvm</span> <span class="nt">-virtfs</span> <span class="nb">local</span>,path<span class="o">=</span>/home/honken/virtual-machines/NetBSD,mount_tag<span class="o">=</span>hostshare,security_model<span class="o">=</span>none <span class="nt">-netdev</span> user,id<span class="o">=</span>network-vm,hostfwd<span class="o">=</span>tcp::2222-:22 <span class="nt">-device</span> virtio-net-pci,netdev<span class="o">=</span>network-vm <span class="nt">-bios</span> /usr/share/edk2/OvmfX64/OVMF_CODE.fd <span class="nt">-object</span> rng-random,filename<span class="o">=</span>/dev/urandom,id<span class="o">=</span>viornd0 <span class="nt">-nographic</span>
</code></pre></div></div>
<p>To confirm the device is visible at the PCI level inside NetBSD we use pcictl and dmesg remains a traditional source.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>netbsd_devel<span class="nv">$ </span>pcictl pci0 list
000:00:0: Intel 82441FX <span class="o">(</span>PMC<span class="o">)</span> PCI and Memory Controller <span class="o">(</span>host bridge, revision 0x02<span class="o">)</span>
000:01:0: Intel 82371SB <span class="o">(</span>PIIX3<span class="o">)</span> PCI-ISA Bridge <span class="o">(</span>ISA bridge<span class="o">)</span>
000:01:1: Intel 82371SB <span class="o">(</span>PIIX3<span class="o">)</span> IDE Interface <span class="o">(</span>IDE mass storage, interface 0x80<span class="o">)</span>
000:01:3: Intel 82371AB <span class="o">(</span>PIIX4<span class="o">)</span> Power Management Controller <span class="o">(</span>miscellaneous bridge, revision 0x03<span class="o">)</span>
000:02:0: vendor 1234 product 1111 <span class="o">(</span>VGA display, revision 0x02<span class="o">)</span>
000:03:0: Qumranet Virtio 9p Filesystem <span class="o">(</span>prehistoric, subclass 0x02<span class="o">)</span>
000:04:0: Qumranet Virtio Network <span class="o">(</span>ethernet network<span class="o">)</span>
000:05:0: Qumranet Virtio RNG Entropy <span class="o">(</span>prehistoric, subclass 0xff<span class="o">)</span>
netbsd_devel<span class="nv">$ </span>doas rndctl <span class="nt">-l</span>
Source       Estimated bits    Samples Type   Flags
/dev/random               0          0 ???    collect, v
cd0                       0          0 disk   collect, v, t
wd0                       0       6318 disk   collect, v, t
fd0                       0          0 disk   collect, v, t
hardclock                 0        499 skew   collect, t
viornd0                 512          2 rng    estimate, collect, v
pms0                      0          0 <span class="nb">tty    </span>collect, v, t
pckbd0                    0          0 <span class="nb">tty    </span>collect, v, t
system-power              0          0 power  collect, v, t
autoconf                  0        156 ???    collect, t
seed                      0          1 ???    collect, v
uvmfault                  0        434 vm     collect, v, t            

<span class="c"># clearly now viornd0 is present after a fresh boot.</span>
</code></pre></div></div>
<p>More info using dmesg, if still not present we can check for viornd driver support in kernel, if not fetch using pkgin and use modload to load a module.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dmesg | <span class="nb">grep</span> <span class="nt">-i</span> <span class="nt">-E</span> <span class="s2">"virtio|viornd|rnd"</span>
modstat | <span class="nb">grep</span> <span class="nt">-i</span> virtio
modload viornd
</code></pre></div></div>
<p>Then after entropy is generated, we regenerate ssh keys and clear stale host keys, then connect via ssh.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/rc.d/sshd keyregen
ssh-keygen <span class="nt">-R</span> <span class="s2">"[localhost]:2222"</span>       <span class="c"># this is the port I opened for the guest, passed via qemu flag</span>
ssh <span class="nt">-p</span> 2222 pratyush@localhost         <span class="c"># guest user@localhost</span>
</code></pre></div></div>

<p>Since I can’t always rely on networking to fetch files via some remote repository, I need hostshare for quick access to large files from host to guest.
So I attach the VM directory for hostshare, and this acts as an attached disk that can be accessed from /mnt.
Earlier in my boot_normal.sh, I had used the QEMU flag</p>
<pre><code class="language-txt">-virtfs local,path=/home/honken/virtual-machines/NetBSD,mount_tag=hostshare,security_model=none \
</code></pre>
<p>But the above flag has simply no effect, /mnt has nothing attached to it, because that flag isn’t configured properly, it needs the protocol to be specified. Implemeting of a hostshare via virtfs is a mechanism but OS have different policy to reach that result.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>~]&gt; pgrep <span class="nt">-fa</span> qemu-system-x86_64 | <span class="nb">grep</span> <span class="nt">-o</span> <span class="s2">"mount_tag=[a-zA-Z0-9]*"</span>
<span class="nv">mount_tag</span><span class="o">=</span>hostshare                                                                  
<span class="o">(</span>pratyush<span class="o">)</span>::[~] <span class="o">&gt;&gt;</span> mount_9p hostshare /mnt
mount_9p: No address associated with <span class="nb">hostname</span>
<span class="o">(</span>pratyush<span class="o">)</span>::[~] <span class="o">&gt;&gt;</span> doas mount_9p hostshare /mnt
mount_9p: No address associated with <span class="nb">hostname</span>
<span class="o">(</span>pratyush<span class="o">)</span>::[~] <span class="o">&gt;&gt;</span> modstat | <span class="nb">grep</span> <span class="nt">-i</span> puffs
puffs                      vfs      <span class="nb">builtin</span>  -        0       - putter
<span class="o">(</span>pratyush<span class="o">)</span>::[~] <span class="o">&gt;&gt;</span> modstat | <span class="nb">grep</span> <span class="nt">-i</span> 9p
vio9p                      driver   <span class="nb">builtin</span>  -        0       - virtio
<span class="o">(</span>pratyush<span class="o">)</span>::[~] <span class="o">&gt;&gt;</span> doas modload puffs
modload: puffs: File exists
<span class="o">(</span>pratyush<span class="o">)</span>::[~] <span class="o">&gt;&gt;</span> <span class="nb">ls</span> /mnt
</code></pre></div></div>
<p>We can check if the device is attached to PCI/drier level</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pcictl pci0 list | <span class="nb">grep</span> <span class="nt">-i</span> 9p
dmesg | <span class="nb">grep</span> <span class="nt">-i</span> vio9p
</code></pre></div></div>
<p>From qemu docs:</p>
<pre><code class="language-txt">https://www.qemu.org/docs/master/system/qemu-manpage.html
</code></pre>
<p>Virtfs defines a new virtual filesystem device and expose it to the guest using a virtio-9p-device (a.k.a. 9pfs), 
which essentially means that a certain directory on host is made directly accessible by guest as a pass-through file system by using the 9P network protocol for communication between host and guests, if desired even accessible, shared by several guests simultaneously.
virtfs is actually just a convenience shortcut for its generalized form -fsdev -device virtio-9p-pci.
“security_model=security_model” specifies the security model to be used for this export path. Supported security models are “passthrough”, “mapped-xattr”, “mapped-file” and “none”. In “passthrough” security model, files are stored using the same credentials as they are created on the guest. This requires QEMU to run as root. 
In “mapped-xattr” security model, some of the file attributes like uid, gid, mode bits and link target are stored as file attributes. For “mapped-file” these attributes are stored in the hidden .virtfs_metadata directory. Directories exported by this security model cannot interact with other unix tools. 
“none” security model is same as passthrough except the sever won’t report failures if it fails to set file attributes like ownership. Security model is mandatory only for local fsdriver.
Also by default the hostshare is read-write, but can be set to readonly=on.</p>

<p>More info on the 9plan file sharing protocol:</p>
<pre><code class="language-txt">man mount_9p
man vio9p
https://ericvh.github.io/9p-rfc/
https://doc.cat-v.org/plan_9/4th_edition/papers/names   # use of namespaces, plan9s central idea uniform namespaces, everything is a file by Rob Pike et al
https://docs.kernel.org/filesystems/9p.html
https://github.com/chaos/diod/blob/master/protocol.md   # The 9P2000.L protocol spec itself, maintained in the v9fs project
https://github.com/NetBSD/src/tree/trunk/sys/fs/puffs   # client code under /sys/dev/pci
https://www.qemu.org/docs/master/system/qemu-manpage.html  # central doc, search for virtfs or fsdev

so apply changes to qemu flags in boot_normal.sh
```bash
-fsdev local,security_model=none,id=fsdev0,path=/home/honken/virtual-machines/NetBSD \
-device virtio-9p-pci,fsdev=fsdev0,mount_tag=hostshare
</code></pre>
<p>Then in the NetBSD guest</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>doas mount_9p <span class="nt">-c</span> <span class="nt">-u</span> /dev/vio9p0 /mnt
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">(</span>pratyush<span class="o">)</span>::[~] <span class="o">&gt;&gt;</span> <span class="nb">ls</span> /mnt
NetBSD-10.1-amd64.iso                boot_install.sh                      netbsd-internals-en.pdf.gz           pkgsrc.pdf
NetBSD-11.0-amd64.iso                boot_normal.sh                       netbsd.img
NetBSD-11.0_RC2-amd64-dvd.iso        netbsd-en.pdf                        notes.txt
</code></pre></div></div>
<p>If dmesg shows vio9p0 is connected, but the device is still not present, then we must check if device node exists. If its missing then we create it using MAKEDEV, because some virtio device nodes aren’t created and requires manual intervention via MAKEDEV.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">ls</span> <span class="nt">-la</span> /dev/vio9p<span class="k">*</span>
<span class="nb">cd</span> /dev
doas ./MAKEDEV vio9p
</code></pre></div></div>
<p>The above process is highly unlikely, the virtfs mounting works only by plan9 file transfer protocol because of uniform namespaces.
This makes the VM ready for the NetBSD specific study.</p>

<p>As I had pkgin enabled while installing by installer, I will be installing git bash nvim, one crucial detail is pkgin fetches precompiled tarballs for the specific architecture from ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/$branch/All.
These tarballs are built for a snapshot of pkgsrc, so a lot of time pkgin throws error because of dependency mismatch. In that case pkgsrc is the only option, and packages need to be compiled.
so for example installing links</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /usr/pkgsrc/www/links
doas make <span class="nb">install</span>

<span class="c"># In case to search for a particular application just use</span>
<span class="o">(</span>pratyush<span class="o">)</span>::[/usr/pkgsrc] <span class="o">&gt;&gt;</span> find ./<span class="k">*</span>/wgetpaste
./net/wgetpaste
./net/wgetpaste/CVS
./net/wgetpaste/CVS/Root
./net/wgetpaste/CVS/Repository
./net/wgetpaste/CVS/Entries
./net/wgetpaste/CVS/Tag
./net/wgetpaste/Makefile
./net/wgetpaste/DESCR
./net/wgetpaste/distinfo
./net/wgetpaste/PLIST
./net/wgetpaste/files
./net/wgetpaste/files/CVS
./net/wgetpaste/files/CVS/Root
./net/wgetpaste/files/CVS/Repository
./net/wgetpaste/files/CVS/Entries
./net/wgetpaste/files/CVS/Tag
./net/wgetpaste/files/wgetpaste.conf
./net/wgetpaste/patches
./net/wgetpaste/patches/CVS
./net/wgetpaste/patches/CVS/Root
./net/wgetpaste/patches/CVS/Repository
./net/wgetpaste/patches/CVS/Entries
./net/wgetpaste/patches/CVS/Tag
./net/wgetpaste/patches/patch-wgetpaste
<span class="o">(</span>pratyush<span class="o">)</span>::[/usr/pkgsrc] <span class="o">&gt;&gt;</span> <span class="nb">cd </span>net/wgetpaste/
<span class="o">(</span>pratyush<span class="o">)</span>::[/usr/pkgsrc/net/wgetpaste] <span class="o">&gt;&gt;</span> <span class="nb">ls
</span>CVS      DESCR    Makefile PLIST    distinfo files    patches
</code></pre></div></div>
<p>pkgsrc is NetBSD package collection,it is a framework for building and maintaining 3rd party software on NetBSD and other UNIX like systems, pkgsrc also works on DragonflyBSD, used to work on MINIX, SmartOS (an Illumos distribution). These have like 1st class support(informally based on use cases, though no such tiering from pkgsrc its highly portable).
The notable difference to linux is XDG naming, there are no ~/.config files created by default, these are freedesktop specific conventions, applications don’t require it mandatorily, if it exists it reads it.
Same goes with /etc, there is a clean seperation of base system and user installed packages, base packages configs reside in /etc, whereas for 3rd party applications in /usr/pkg/etc, thus the base system remains clean across major releases.
As pkgsrc primarily uses bmake to compile and then pkg_add to install and pkg_delete to remove generated binaries, there needs a centralised config file to control compile time options, like gentoo’s /etc/portage/make.conf.
In case of NetBSD its /etc/mk.conf. It follows the same pattern, a file doesn’t exist unless its defaults needs to be overridden.
All the compile time options are listed in the mk.conf manpage, and the real defaults reside in /usr/pkgsrc/mk/defaults/mk.conf</p>

<p>Now since I will try to port ytm (https://ytm-player.com/), on NetBSD, I need to setup the audio stack.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">-audiodev</span> pa,id<span class="o">=</span>snd0 <span class="se">\</span>
<span class="nt">-device</span> intel-hda <span class="se">\</span>
<span class="nt">-device</span> hda-output,audiodev<span class="o">=</span>snd0
</code></pre></div></div>
<p>But my host Gentoo system is configured to use pipewire as a sound server than pulseaudio, this still works because pipewire has a running socket for maintaining pulseaudio compatibility.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~]&gt; pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: <span class="nb">yes
</span>Client Index: 404
Tile Size: 65472
User Name: honken
Host Name: Pratyush-PC
Server Name: PulseAudio <span class="o">(</span>on PipeWire 1.6.7<span class="o">)</span>
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink
Default Source: alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic1__source
Cookie: 0559:bffe
</code></pre></div></div>
<p>Now we activate sound interface up in NetBSD</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>audioctl <span class="nt">-a</span>
</code></pre></div></div>
<p>If my host was OpenBSD then I would have had to use -audiodev sndio, because sndio is OpenBSD’s audio driver. In Linux we have ALSA(Advanced Linux Sound Architecture),along with libasound, a userspace library that exposes the framwork to programs.Now pulseaudio is a sound server on top of it, it mixes the sound, routes to different outputs, per app streams.
Pipewire is newer sound server, written from scratch, it has broader scope, implements both pulseaudio and JACK’s(pro audio low latency server) functionality.Unifies audio and video/screen capturing routing, opens pulseaudio compat socket and hence pactl info works.</p>

<p>The approach of *BSD to sound server, NetBSD is the 1st to implement the existing 386BSD stack, and in 1999 release notes of 1.4, bring the “audio” stack. Then OpenBSD is born out of forking NetBSD and implements improvenments over audio, and later created something new entirely called “sndio”.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>man audio
</code></pre></div></div>
<p>FreeBSD’s approach was very different, its sound and pcm driver was influenced and compatible with 4FrontTechnologies OSS(Open Sound System) API.Unlike Linux userspace servers, FreeBSD does the mixing in the kernel level itself via virtual channels, that requires more exclusive handling request.
Illumos audio architecture is SADA(Sun Audio Device Architecture),its mostly device driver along with local API oriented.
**Case study to read: closest thing to “network transparent audio” in Unix history generally was NAS (Network Audio System, from NCSA, later Network Computing Devices) — a genuinely X11-inspired audio equivalent, but it was cross-platform third-party software, never Solaris’s own native stack, and never gained the ecosystem traction X11 did — most systems (including Solaris) just didn’t prioritize networked audio the way display was prioritized.</p>

<p>Further we can list available audio drivers</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~]&gt; qemu-system-x86_64 <span class="nt">-audiodev</span> <span class="nb">help
</span>Available audio drivers:
none
alsa
dbus
oss
pa
pipewire
sdl
wav
</code></pre></div></div>
<p>For audio peripheral emulation we can list options</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>~]&gt; qemu-system-x86_64 <span class="nt">-device</span> <span class="nb">help</span> | <span class="nb">grep</span> <span class="nt">-i</span> hda
name <span class="s2">"hda-duplex"</span>, bus HDA, desc <span class="s2">"HDA Audio Codec, duplex (line-out, line-in)"</span>
name <span class="s2">"hda-micro"</span>, bus HDA, desc <span class="s2">"HDA Audio Codec, duplex (speaker, microphone)"</span>
name <span class="s2">"hda-output"</span>, bus HDA, desc <span class="s2">"HDA Audio Codec, output-only (line-out)"</span>
name <span class="s2">"ich9-intel-hda"</span>, bus PCI, desc <span class="s2">"Intel HD Audio Controller (ich9)"</span>
name <span class="s2">"intel-hda"</span>, bus PCI, desc <span class="s2">"Intel HD Audio Controller (ich6)"</span>
</code></pre></div></div>
<p>As there is audio handling via pipewire I prefer that:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>-audiodev pipewire,id=snd0 \
-device intel-hda \
-device hda-output,audiodev=snd0

# worth noting available options are hda-output(strictly output), hda-duplex(receives input + gives output) and hda-micro(more for microphone and output).
</code></pre></div></div>

<p>Since this blog has already streched long, I would end it here, with next blog expalaining creation of a pkg and installation, then optimisations using LLVM/Clang, and methods to override the default gcc compiler.</p>]]></content><author><name>Pratyush Nandi</name></author><category term="System" /><category term="Architecture" /><summary type="html"><![CDATA[In the last post I jotted down my understanding of Virtualization and how hypervisors like Xen and KVM/QEMU works, along with working scripts. Considering the fact that my initial focus is to understand the whole NetBSD layout,its init system and rc scripts, how its package manager pkgin functions, the ports system of pkgsrc, though I shouldn’t be using the term ports for NetBSD. Further components like pkg_add, pkg_delete, pkg_info along with how the pkgsrc tree tries to be OS agnostic, the NetBSD’s make known to everyone as “bmake”. Working with NetBSD’s sndio drivers and delving into kernel code. Then I would delve into rump kernels. With my main focus on resolving the fact that despite NetBSD source tree having a stable NVME driver, the installer media doesn’t recognize it. Same issue persists with OpenBSD, with only FreeBSD working without any caveats. So understanding the FreeBSD specific driver and then I will try to port it to NetBSD. But foremost I need to fix the issue with entropy and shared directory with KVM/QEMU. From now on the main refernece guide will be NetBSD manual pages.]]></summary></entry><entry><title type="html">Virtualization Notes</title><link href="https://nandiprh.github.io/blog/2026/08/16/Virtualization-notes/" rel="alternate" type="text/html" title="Virtualization Notes" /><published>2026-08-16T00:00:00+00:00</published><updated>2026-08-16T00:00:00+00:00</updated><id>https://nandiprh.github.io/blog/2026/08/16/Virtualization-notes</id><content type="html" xml:base="https://nandiprh.github.io/blog/2026/08/16/Virtualization-notes/"><![CDATA[<p>As I’m delving in NetBSD, I have encountered that perhaps NetBSD’s installer doesn’t recognise my NVME disk, also I’m pretty sure the hardware support for my latest Intel wifi cards,
processor (generation of Raptor Lake, which is quite an enhanced version of alder lake), and then my IRISxe integrated graphics card is not on the supported device list.
Its obvious though, NetBSD caters to older devices that needs an operating system that has lower baseline of memory footprint, smaller and cleaner sound server, and support for older obscure hardware.
So, it becomes important to know ins and outs of virtualization techniques on a surface level. As I would be relying on nographics on initial stage, though I could have perfectly spun up a vm and then used ssh to get remote access,
I don’t like the idea, because initally I want to understand the overall system layout, go and look through the kernel and its codebase, get more understanding on how the processor support works and what exactly stays same across various generations of Intel CPU’s and also 
similarliy with Intel’s graphics card, which are in most cases integrated. Then I’m more interested on the sound server and NetBSD’s implementation of it at kernel level, which is completely different from Linux ALSA framework.
Next target would be bluetooth obviously, a painfully difficult technology to implement, and atlast graphics stack, getting hardware acceleration and more info on framebuffering mode.
This post will mostly cover what exactly is qemu, then how do kvm and xen differ, also techniques like pcie forwarding of xen hypervisor and its equivalent of kvm.</p>

<p>So qemu stands for quick emulation, its for most part a software level emulator, that can emulate different architecture via TCG (Tiny Code Generator) emulation,more info here:</p>
<pre><code class="language-txt">https://www.qemu.org/docs/master/devel/index-tcg.html
</code></pre>
<p>So from upstream docs, whenever qemu encounters a code block of a particular ISA, it converts it to native ISA code block using a dynamic translator, and QEMU’s dynamic translator backend is TCG.
QEMU is foremost a userspace process that emulates disk controllers, network cards, GPU, USB, BIOS/UEFI, and can use KVM to implement the processor natively.
KVM is a linux driver, the kernel needs to be compiled with this module but this module is only useful if the hardware supports it. At hardware level it needs extensions like Intel VT-x or AMD-V. So this turns the Linux kernel into a type-1 hypervisor. Type-1 also called bare metal hypervisor, gives almost native level performance like Xen hypervisor, type-2 is mostly software level emulation and then 
there is type-3, that is more of a hybrid like KVM/QEMU, that can perform both of the above, QEMU is simply a type-2 but combining with KVM turns it closer to type-1.
KVM is the cpu acceleration backend, without it qemu just simply fallbacks to TCG based emulation. KVM is very much Linux specific, though it has been ported earlier to Illumos, which then moved to FreeBSD based bhyve hypervisor.
NetBSD uses NVMM (NetBSD Virtual Machine Monitor) its own native hypervisor. QEMU has native support for it, like for Linux host we pass -enable-kvm, we use -accel-nvmm.
In both cases we need a simple check at /dev. For linux /dev/kvm needs to exist if not load the module, for NetBSD /dev/nvmm needs to be present.</p>

<p>Basically hypervisor is a software that creates and manages vm’s by controlling cpu/memory/device access on their behalf(guest os).Type 0 runs on a privileged layer, basically ring 0 in terms of Intel’s hardware.
Rings are basically like modes, but modern hardware has multiple modes other than just the krnel and user mode.
So existence of kvm module on Linux makes the whole OS along with QEMU act like a type 1. Xen is a different case.</p>
<pre><code class="language-txt">https://wiki.xenproject.org/wiki/Main_Page
</code></pre>
<p>With kVM/QEMU , Linux host acted as a VMM/hypervisor, it had the control of starting/stopping the hypervisor. In case on Xen, it calls the guest OS running on it as “domains”. A special OS is tagged dom0, that can control the hypervisor and start/stop other guest OS’s.
From the Xen wiki, the hypervisor supports two primary types of virtualization: paravirtualization (PV) and hardware virtualized machine (HVM) also known as “full virtualization”. Paravirtualization uses modified guest operating systems that we refer to as “enlightened” guests. These operating systems are aware that they are being virtualized and as such don’t require virtual hardware devices. Instead they make special calls to the hypervisor that allow them to access CPUs, storage and network resources.
In contrast, HVM guests need not be modified, as the hypervisor will create a fully virtual set of hardware devices for the machine resembling a physical x86 computer. This emulation requires more overhead than the paravirtualization approach but allows unmodified guest operating systems like Microsoft Windows to run on top of the hypervisor. HVMs are supported through virtualization extensions in the CPU. Several iterations of these extensions have been introduced in the last decade or so, collectively known as Intel VT and AMD-V and development continues. The technology is now prevalent; all recent servers, many desktops and some mobile systems should be equipped with at least some extensions.
Xen virtualization is now seen as on a spectrum, with PV at one end and HVM at the other. In between are various enhancements to improve performance: HVM with PV drivers, PVHVM or “Paravirtualization on HVM”, and most recently PVH.
Since KVM is bolted at the Linux kernel itself, Xen doesn’t work like that, it has its own minimal microkernel like layer that boots before any OS,then it starts a privileged domain dom0, which starts other VM’s.
To check if the existing kernel has Xen support:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>zgrep XEN /proc/config.gz
</code></pre></div></div>
<p>In my case, output looks like this and the kernel supports it.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~]&gt; zgrep XEN /proc/config.gz
<span class="nv">CONFIG_XEN</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PV</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_512GB</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PV_SMP</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PV_DOM0</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PVHVM</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PVHVM_SMP</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PVHVM_GUEST</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_DEBUG_FS</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PVH</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_DOM0</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PV_MSR_SAFE</span><span class="o">=</span>y
<span class="nv">CONFIG_PCI_XEN</span><span class="o">=</span>y
<span class="nv">CONFIG_KVM_XEN</span><span class="o">=</span>y
<span class="nv">CONFIG_NET_9P_XEN</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_PCIDEV_FRONTEND</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_BLKDEV_FRONTEND</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_BLKDEV_BACKEND</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_SCSI_FRONTEND</span><span class="o">=</span>m
<span class="nv">CONFIG_NETXEN_NIC</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_NETDEV_FRONTEND</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_NETDEV_BACKEND</span><span class="o">=</span>m
<span class="nv">CONFIG_INPUT_XEN_KBDDEV_FRONTEND</span><span class="o">=</span>m
<span class="nv">CONFIG_HVC_XEN</span><span class="o">=</span>y
<span class="nv">CONFIG_HVC_XEN_FRONTEND</span><span class="o">=</span>y
<span class="c"># CONFIG_TCG_XEN is not set</span>
<span class="nv">CONFIG_XEN_WDT</span><span class="o">=</span>m
<span class="c"># CONFIG_DRM_XEN_FRONTEND is not set</span>
<span class="nv">CONFIG_XEN_FBDEV_FRONTEND</span><span class="o">=</span>y
<span class="nv">CONFIG_SND_XEN_FRONTEND</span><span class="o">=</span>m
<span class="nv">CONFIG_USB_XEN_HCD</span><span class="o">=</span>m
<span class="nv">CONFIG_MMC_SDHCI_XENON</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_BALLOON</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_BALLOON_MEMORY_HOTPLUG</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_MEMORY_HOTPLUG_LIMIT</span><span class="o">=</span>512
<span class="nv">CONFIG_XEN_SCRUB_PAGES_DEFAULT</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_DEV_EVTCHN</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_BACKEND</span><span class="o">=</span>y
<span class="nv">CONFIG_XENFS</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_COMPAT_XENFS</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_SYS_HYPERVISOR</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_XENBUS_FRONTEND</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_GNTDEV</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_GRANT_DEV_ALLOC</span><span class="o">=</span>m
<span class="c"># CONFIG_XEN_GRANT_DMA_ALLOC is not set</span>
<span class="nv">CONFIG_SWIOTLB_XEN</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PCI_STUB</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_PCIDEV_BACKEND</span><span class="o">=</span>m
<span class="c"># CONFIG_XEN_PVCALLS_FRONTEND is not set</span>
<span class="c"># CONFIG_XEN_PVCALLS_BACKEND is not set</span>
<span class="nv">CONFIG_XEN_SCSI_BACKEND</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_PRIVCMD</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_PRIVCMD_EVENTFD</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_ACPI_PROCESSOR</span><span class="o">=</span>m
<span class="c"># CONFIG_XEN_MCE_LOG is not set</span>
<span class="nv">CONFIG_XEN_HAVE_PVMMU</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_EFI</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_AUTO_XLATE</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_ACPI</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_SYMS</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_HAVE_VPMU</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_FRONT_PGDIR_SHBUF</span><span class="o">=</span>m
<span class="nv">CONFIG_XEN_UNPOPULATED_ALLOC</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_GRANT_DMA_OPS</span><span class="o">=</span>y
<span class="nv">CONFIG_XEN_VIRTIO</span><span class="o">=</span>y
<span class="c"># CONFIG_XEN_VIRTIO_FORCE_GRANT is not set</span>


<span class="c"># clearly CONFIG_XEN_DOM0=y, CONFIG_XEN_PV=y, CONFIG_XEN_PVHVM=y is set, hence the kernel has builtin support.</span>
</code></pre></div></div>
<p>Mechanisms that enable guest and host communication -:</p>

<ol>
  <li>
    <p>MMIO/PIO - memory mapped I/O or port I/O, it is the old/boomer solution, the guest thinks its talking to real hardware registers, when it reads/writes those addresses,the CPU traps out of guest mode (via KVM), returns control to QEMU, then QEMU’s device emulation code interprets what the guest wanted and updates emulated device state.
This is the mechanism behind the e1000 Network Interface Controller, ide disk controller works. Qemu pretends to be real hardware down to register level.</p>
  </li>
  <li>
    <p>Virtio - This is the modern alternative, like virtio-net-pci, virtio-gpu-pci, virtio-rng. Instead of pretending to be real hardware, virtio is a paravirtualized interface, th guest OS clearly knows its talking to a virtualised environment and uses a purpose built protocol: shared memory ring buffers(virtqueues) that both guest and QEMU can read/write to.Also there exists a lightweight notification mechanism called ioeventfd/irqfd, kernel level avoids trapping to qemu userspace for notifcation itself.This
method has far less overhead than MMIO/PIO, which emulates hardware at register level.So only thing is NetBSD needs virtio guest drivers like viornd, vioif, etc.</p>
  </li>
</ol>

<p>Modern systems invlove heavy usage and presence of GPU’s. We need is virgl/virglrenderer, its layered on top of virtio-gpu. The guest’s Mesa driver will serialize the OpenGL/Gallium commands to a command buffer, write it to the virtqueue like other virtio traffic. Now the host will read the command buffer and display it as a real OpenGL/Vulkan calls against the host’s GPU driver. In my case it is IRISxe.
virglrenderer, is a library that qemu links itself to is what reads the command buffer.
So, the communication channel is virtio(shared memory + virtqueue), and virglrenderer is the translator sitting on the host end.
Parameters like -display gtk,gl=on is important, as the display backend will need its own GL context to composite the result. gl=on, tells QEMU’s GTK frontend to set that up.</p>

<p>The similar mechanism is followed for sound, virtio-sound is the interface, its newer compared to others and has lesser universal support, truth being QEMU still mostly relies on semi-emulated devices like intel-hda (emulating a real Intel HDA controller), paired with a host audio backend like -audiodev-pa for pulseaudio, others like alsa,sdl also exists. The guest HDA driver follows the MMIO path. Then QEMU translates it to calls against the host’s audio system.
Another aspect is existence of a shared folder. It uses different protocol, the Plan 9’s filesystem protocol, carried over virtio (virtio-9p) as the transport.
Guest mounts it as a real filesystem (mount_9p), the only difference here is every file operation (read/write/open/stat) is serialized as a 9p protocol message, gets sent to virtqueue, and qemu translates it into a real syscall against the host directory listed by the -virtfs parameter.</p>

<p>So the pattern we follow is if any virtio* variant exists, we use it or else we go to MMIO mechanism.
Other parameters that we might use, is virtio-blk-pci instead of default IDE style -drive interface. Useful for faster disk I/O for heavy build workloads. We need is vioblk driver support for the host, in my case NetBSD.
Next in the line is actual core counts and threads, we have to use -smp cores=4,threads=1 style topology control. We will need this while creating our own pkgsrc builds.
For even heavier usage we might need -object memeory-backend-memfd + hugepages.</p>

<p>The core part, is how exactly is the host going to emulate a hardware it doesn’t even support. NetBSD doesn’t have any support for raptor lake series and IRISxe integrated graphics card.
For the most part processors and GPU’s are never written from scratch nowadays, they follow a template that reamins fairly common across generations, the only factors that change is introduction of newer parameters/options availability. Something else that might change is how the template is being handled at the backend.
Say for GPU’s, modern Intel GPU’s like IRISxe and ARC, use gallium drivers, it is a core part of MESA library’s 3D project, fairly newer ones like IRISxe handles these gallium calls via OpenGL.
The gallium3D architecture was introduced in 2008 by Tungsten graphics to modernize MESA 3D project, so its like a protocol. Older Intel GPUs relied on i965 driver, so the community ported the older drivers to gallium via crocus project, because those drivers were hard to maintain.So from Intel’s Gen8 (Broadwell) to current IRISxe these use iris drivers based on gallium3D project. Now vulkan is a different case,it uses the Intel’s ANV driver. Gallium was developed to trace older API’s of OpenGL, but vulkan is low level, where engines need to manage their own memeory and scheduling. Vulkan drivers bypass the Gallium drivers to talk to the hardware directly.</p>

<p>Similarly this remains true across processors. All these generations are based on X86_64 ISA. Thus instruction set across them have to be the same, so they execute the same byte codes. What differs is the extended instruction set support, like AVX2, AVX-512, SIMD extensions. So say a binary compiled with AVX-512 will crash on older generation (SIGILL) which doesn’t have any such support. That differetiates compiler flags like -march=native and -march=x86-64-v2, the latter targetting feature level and former targeting a specific chip.
Another difference is microarchitecture and CPUID. The internal implementations like pipeline depth, cache sizes, branch predictor design, core/thread topology, these execute at different speeds, so performance and efficiency varies.
CPUID is the mechanism by which any software (OS, hypervisor and even userspace) queries what instructions a CPU has, something like a compiler or JIT calls CPUID to discover what is it running on, to choose the execution path.
Thats the sole reason a flag like -cpu host in qemu script is important.</p>

<p>So how is NetBSD able to boot as a VM but fails to boot from a live environment or I should rather say boot image, as NetBSD doesn’t really have a traditional linux like live environment,though users can use console by exiting the installer.
The fact being its well known to me the NetBSD media, fails to recognize my NVME disk, so clearly on bleeding edge hardware CPU never fails but its the peripherals, NetBSD’s tree just doesn’t have any drivers for these peripherals, any these prripherals can be anything from NVME disk controller, to wifi chipset, USB4/thunderbolt controller, exact ACPI quirk table, exact PCIe root table,also secure boot interactions. NetBSD’s media just is unable to parse ACPI on the table my device firmware emits, even possibility is install ,edia can’t get display output through the specific GPU’s boot time framebuffer path because of KMS/UEFI GOP mismatch.
Its just the kernel can’t talk to the actual hardware its trying to boot on. So by virtualization, the hypervizor like KVM/QEMU or Xen never expose these peripherals, unless we detect some peripherals are supported i.e the drivers exist in the tree/kernel, so we decide to do a PCI passthrough. They try to pass a decade old stable virtual chipset like QEMU’s q35/i440fx, emulated ICH9/PIIX4 AHCI disk controller (or virtio-blk), emulated e1000 NIC (or virtio-net), a standard VGA or virtio-gpu framebuffer for boot output.
Same goes with Xen, Xen HVM guests use qemu too, it just runs as qemu-dm inside dom0, providing the exact virtio* interfaces. Its a policy that Xen choose because maintaining such virtual peripherals is a huge ask, which QEMU already solved. While for Xen PV guests, which is Xen’s older mode, came before KVM, Xen uses its own seperate paravirt device protocol that involves Xen PV drivers, that has a frontend and a backend. Frontend in the guest and backend in dom0.
Architecturally similar to virtio(shared memory ring buffers + lightweight notification), it was Xen’s own independently designed protocol. QEMU’s virtio was created later and partially the design idea was influenced from Xen’s PV, to be hypervisor agnostic usable by KVM or Xen.
From my earlier output of:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>zgrep XEN /proc/config.gz

CONFIG_XEN_BLKDEV_FRONTEND/BACKEND
CONFIG_XEN_NETDEV_FRONTEND/BACKEND
<span class="nv">CONFIG_XEN_PVH</span><span class="o">=</span>y
</code></pre></div></div>
<p>Means we have those preconfigured.
Modern Xen deployments use PVH mode, which is enabled in our kernel config.</p>

<p>Most importantly if the hardware is supported, its better we utilise it directly to get native performance rather than using some vir* interface, the mechanism is PCI passthrough. Specifically in case of say CPU, we can use KVM/QEMU to run it natively via VT-x. The CPU has two modes VMX root(hypervisor mode) and VMX non-root(guest mode). When NetBSD executes a normal instruction like arithmetic or memory access, we can choose to run it directly on the physical Raptor Lake core, at native speed, that requires no translation via qemu’s TCG.
The CPU runs in some elevated mode while running KVM/QEMU, its lower than kernel mode but miles higher than user mode, so if the guest tries something that requires privileged like writing to a control register or doing raw I/O port access, touching interrupt controllers, the CPU trips up a trap or interrupt(non-maskable) to call a VM-exit. This then hands control to the hypervisor(Xen/KVM) which decides what to do, then resumes the guest(VM-entry). So its basically balancing between running on raw hardware and emulating when boundaries cross.
The way to implement the PCI passthrough differs. With KVM/QEMU it uses VFIO (Virtual function I/O) passthrough, Xen uses the same mechanism, but the policy differs. It doesn’t use Linux’s VFIO framework, but has its own implementation.
Xen has PCI passthrough configured in guest’s domain config file used by x1 create by the pci directive.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pci <span class="o">=</span> <span class="o">[</span> <span class="s1">'0000:01:00.0'</span> <span class="o">]</span>
</code></pre></div></div>
<p>Format being (bus:device.function of target device, same as lspci shows).
For KVM/QEMU the IOMMU (Input output memory management unit) lets a specific PCIe device be isolated into its own protection domain and mapped to guest’s address space. The guest talks to real device registers directly, with IOMMU enforcing that it can only DMA into memory which has been granted, so it protects the host from a misbehaving/malicious guest driver.
Requirement is IOMMU enabled in firmware, VT-d in UEFI.
On Intel we need to check:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>~]&gt; <span class="nb">sudo </span>dmesg | <span class="nb">grep</span> <span class="nt">-i</span> iommu

<span class="o">[</span>    0.077643] DMAR-IR: IOAPIC <span class="nb">id </span>2 under DRHD base  0xfed91000 IOMMU 1
<span class="o">[</span>    0.417408] pci 0000:00:02.0: DMAR: Skip IOMMU disabling <span class="k">for </span>graphics
<span class="o">[</span>    0.469648] iommu: Default domain <span class="nb">type</span>: Translated
<span class="o">[</span>    0.469648] iommu: DMA domain TLB invalidation policy: lazy mode
<span class="o">[</span>    0.588447] DMAR: Intel-IOMMU force enabled due to platform opt <span class="k">in</span>
<span class="o">[</span>    0.588687] pci 0000:00:02.0: Adding to iommu group 0
<span class="o">[</span>    0.588716] pci 0000:00:00.0: Adding to iommu group 1
<span class="o">[</span>    0.588723] pci 0000:00:04.0: Adding to iommu group 2
<span class="o">[</span>    0.588734] pci 0000:00:06.0: Adding to iommu group 3
<span class="o">[</span>    0.588743] pci 0000:00:07.0: Adding to iommu group 4
<span class="o">[</span>    0.588750] pci 0000:00:08.0: Adding to iommu group 5
<span class="o">[</span>    0.588760] pci 0000:00:0d.0: Adding to iommu group 6
<span class="o">[</span>    0.588766] pci 0000:00:0d.2: Adding to iommu group 6
<span class="o">[</span>    0.588774] pci 0000:00:0e.0: Adding to iommu group 7
<span class="o">[</span>    0.588781] pci 0000:00:12.0: Adding to iommu group 8
<span class="o">[</span>    0.588792] pci 0000:00:14.0: Adding to iommu group 9
<span class="o">[</span>    0.588798] pci 0000:00:14.2: Adding to iommu group 9
<span class="o">[</span>    0.588807] pci 0000:00:14.3: Adding to iommu group 10
<span class="o">[</span>    0.588817] pci 0000:00:15.0: Adding to iommu group 11
<span class="o">[</span>    0.588824] pci 0000:00:15.1: Adding to iommu group 11
<span class="o">[</span>    0.588832] pci 0000:00:16.0: Adding to iommu group 12
<span class="o">[</span>    0.588845] pci 0000:00:1f.0: Adding to iommu group 13
<span class="o">[</span>    0.588852] pci 0000:00:1f.3: Adding to iommu group 13
<span class="o">[</span>    0.588859] pci 0000:00:1f.4: Adding to iommu group 13
<span class="o">[</span>    0.588866] pci 0000:00:1f.5: Adding to iommu group 13
<span class="o">[</span>    2.176329] pci 10000:e0:06.0: Adding to iommu group 7
<span class="o">[</span>    2.177396] pci 10000:e1:00.0: Adding to iommu group 7

<span class="o">[</span>~]&gt; <span class="nb">sudo </span>lspci <span class="nt">-nnk</span>
0000:00:00.0 Host bridge <span class="o">[</span>0600]: Intel Corporation Raptor Lake-P/U 4p+8e cores Host Bridge/DRAM Controller <span class="o">[</span>8086:a707]
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: igen6_edac
        Kernel modules: igen6_edac
0000:00:02.0 VGA compatible controller <span class="o">[</span>0300]: Intel Corporation Raptor Lake-P <span class="o">[</span>Iris Xe Graphics] <span class="o">[</span>8086:a7a0] <span class="o">(</span>rev 04<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: i915
        Kernel modules: i915, xe
0000:00:04.0 Signal processing controller <span class="o">[</span>1180]: Intel Corporation Raptor Lake Dynamic Platform and Thermal Framework Processor Participant <span class="o">[</span>8086:a71d]
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: proc_thermal_pci
        Kernel modules: processor_thermal_device_pci
0000:00:06.0 System peripheral <span class="o">[</span>0880]: Intel Corporation RST VMD Managed Controller <span class="o">[</span>8086:09ab]
0000:00:07.0 PCI bridge <span class="o">[</span>0604]: Intel Corporation Raptor Lake-P Thunderbolt 4 PCI Express Root Port <span class="c">#0 [8086:a76e]</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: pcieport
        Kernel modules: shpchp
0000:00:08.0 System peripheral <span class="o">[</span>0880]: Intel Corporation GNA Scoring Accelerator module <span class="o">[</span>8086:a74f]
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
0000:00:0d.0 USB controller <span class="o">[</span>0c03]: Intel Corporation Raptor Lake-P Thunderbolt 4 USB Controller <span class="o">[</span>8086:a71e]
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: xhci_hcd
        Kernel modules: xhci_pci
0000:00:0d.2 USB controller <span class="o">[</span>0c03]: Intel Corporation Raptor Lake-P Thunderbolt 4 NHI <span class="c">#0 [8086:a73e]</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: thunderbolt
        Kernel modules: thunderbolt
0000:00:0e.0 RAID bus controller <span class="o">[</span>0104]: Intel Corporation RST Volume Management Device Controller <span class="o">[</span>8086:a77f]
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: vmd
        Kernel modules: vmd
0000:00:12.0 Serial controller <span class="o">[</span>0700]: Intel Corporation Alder Lake-P Integrated Sensor Hub <span class="o">[</span>8086:51fc] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: intel_ish_ipc
        Kernel modules: intel_ish_ipc
0000:00:14.0 USB controller <span class="o">[</span>0c03]: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller <span class="o">[</span>8086:51ed] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: xhci_hcd
        Kernel modules: xhci_pci
0000:00:14.2 RAM memory <span class="o">[</span>0500]: Intel Corporation Alder Lake PCH Shared SRAM <span class="o">[</span>8086:51ef] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
0000:00:14.3 Network controller <span class="o">[</span>0280]: Intel Corporation Raptor Lake PCH CNVi WiFi <span class="o">[</span>8086:51f1] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Intel Corporation Wi-Fi 6E AX211 160MHz <span class="o">[</span>8086:4090]
        Kernel driver <span class="k">in </span>use: iwlwifi
        Kernel modules: iwlwifi
0000:00:15.0 Serial bus controller <span class="o">[</span>0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller <span class="c">#0 [8086:51e8] (rev 01)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: intel-lpss
        Kernel modules: intel_lpss_pci
0000:00:15.1 Serial bus controller <span class="o">[</span>0c80]: Intel Corporation Alder Lake PCH Serial IO I2C Controller <span class="c">#1 [8086:51e9] (rev 01)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: intel-lpss
        Kernel modules: intel_lpss_pci
0000:00:16.0 Communication controller <span class="o">[</span>0780]: Intel Corporation Alder Lake PCH HECI Controller <span class="o">[</span>8086:51e0] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: mei_me
        Kernel modules: mei_me
0000:00:1f.0 ISA bridge <span class="o">[</span>0601]: Intel Corporation Raptor Lake LPC/eSPI Controller <span class="o">[</span>8086:519d] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
0000:00:1f.3 Multimedia audio controller <span class="o">[</span>0401]: Intel Corporation Raptor Lake-P/U/H cAVS <span class="o">[</span>8086:51ca] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: sof-audio-pci-intel-tgl
        Kernel modules: snd_soc_avs, snd_sof_pci_intel_tgl, snd_hda_intel
0000:00:1f.4 SMBus <span class="o">[</span>0c05]: Intel Corporation Alder Lake PCH-P SMBus Host Controller <span class="o">[</span>8086:51a3] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: i801_smbus
        Kernel modules: i2c_i801
0000:00:1f.5 Serial bus controller <span class="o">[</span>0c80]: Intel Corporation Alder Lake-P PCH SPI Controller <span class="o">[</span>8086:51a4] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: intel-spi
        Kernel modules: spi_intel_pci
10000:e0:06.0 PCI bridge <span class="o">[</span>0604]: Intel Corporation Raptor Lake PCI Express 4.0 Graphics Port <span class="o">[</span>8086:a74d]
        Subsystem: Dell Device <span class="o">[</span>1028:0c14]
        Kernel driver <span class="k">in </span>use: pcieport
        Kernel modules: shpchp
10000:e1:00.0 Non-Volatile memory controller <span class="o">[</span>0108]: Sandisk Corp PC SN740 NVMe SSD <span class="o">(</span>DRAM-less<span class="o">)</span> <span class="o">[</span>15b7:5015] <span class="o">(</span>rev 01<span class="o">)</span>
        Subsystem: Sandisk Corp PC SN740 NVMe SSD <span class="o">(</span>DRAM-less<span class="o">)</span> <span class="o">[</span>15b7:5015]
        Kernel driver <span class="k">in </span>use: nvme
        Kernel modules: nvme

</code></pre></div></div>
<p>So we have to find the vendor:devie ID, then bind it to vfio-pci, either using kernel driver ovverride at boot or driverctl/manual echo to /sys/bus/pci/drivers/vfio-pci/bind</p>

<p>Also IOMMU device groups matter, devices in the same group gets passed through together, there is no option to split them.
An example being</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~]&gt; <span class="nb">sudo </span>find /sys/kernel/iommu_groups/ <span class="nt">-maxdepth</span> 1 <span class="nt">-type</span> d
/sys/kernel/iommu_groups/
/sys/kernel/iommu_groups/7
/sys/kernel/iommu_groups/5
/sys/kernel/iommu_groups/13
/sys/kernel/iommu_groups/3
/sys/kernel/iommu_groups/11
/sys/kernel/iommu_groups/1
/sys/kernel/iommu_groups/8
/sys/kernel/iommu_groups/6
/sys/kernel/iommu_groups/4
/sys/kernel/iommu_groups/12
/sys/kernel/iommu_groups/2
/sys/kernel/iommu_groups/10
/sys/kernel/iommu_groups/0
/sys/kernel/iommu_groups/9
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/4]
└[~]&gt; <span class="nb">sudo ls</span> /sys/kernel/iommu_groups/12/devices
0000:00:16.0
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/4]
└[~]&gt; <span class="nb">sudo ls</span> /sys/kernel/iommu_groups/7/devices
0000:00:0e.0  10000:e0:06.0  10000:e1:00.0
</code></pre></div></div>
<p>The only qemu flag in need is -device vfio-pci,host=<bus:device.function>
In my case I can clearly see my IRISxe graphics card is in iommu_group0 and I'm not going to do a PCI passthrough for it, because I may loose my own display. Its a well known cavaet of using integrated graphics card, they share the VRAM with device RAM, PCI passthrough will handover the peripheral to the guest.
Same isn't true for CPU cores, they don't belong to iommu_groups. So no DMA and PCIe bus for them.
If we want more control or predictible behaviour over CPU then vCPU pinning is required. It makes use of taskset or QEMU's own -numa/CPU affinity options, which restricts which physical cores each vCPU can run on. Its solely for controlling performance.
So a peripheral that being used in PCI passthrough is inaccessible to the host for that time in case of KVM/QEMU and in case of Xen inaccessible to dom0.</bus:device.function></p>

<p>For writing the installer script, we need two bash scripts, one boots the NetBSD image into the QEMU disk, and second boots into the disk.
I call the 1st one boot_install.sh and 2nd one boot_normal.sh</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># create a qemu disk image to install the NetBSD image, I will allocate myself 100G</span>
<span class="nb">mkdir</span> <span class="nt">-p</span> ~/virtual-machines/NetBSD
<span class="nb">cd</span> ~/virtual-machines/NetBSD
qemu-img create <span class="nt">-f</span> qcow2 netbsd.img 100G
<span class="c"># qcow2 is qemu copy on write version 2</span>

<span class="nb">cat</span> ./boot_install.sh
<span class="c">#! /usr/bin/bash</span>

qemu-system-x86_64 <span class="se">\</span>
  <span class="nt">-m</span> 4G <span class="se">\</span>
  <span class="nt">-smp</span> 4 <span class="se">\</span>
  <span class="nt">-cdrom</span>  NetBSD-11.0-amd64.iso  <span class="se">\</span>
  <span class="nt">-drive</span> <span class="nv">file</span><span class="o">=</span>netbsd.img,format<span class="o">=</span>qcow2 <span class="se">\</span>
  <span class="nt">-boot</span> d <span class="se">\</span>
  <span class="nt">-enable-kvm</span> <span class="se">\</span>
  <span class="nt">-virtfs</span> <span class="nb">local</span>,path<span class="o">=</span>/home/honken/virtual-machines/NetBSD,mount_tag<span class="o">=</span>hostshare,security_model<span class="o">=</span>none <span class="se">\</span>
  <span class="nt">-netdev</span> user,id<span class="o">=</span>network-vm <span class="se">\</span>
  <span class="nt">-device</span> virtio-net-pci,netdev<span class="o">=</span>network-vm <span class="se">\</span>
  <span class="nt">-bios</span> /usr/share/edk2/OvmfX64/OVMF_CODE.fd <span class="se">\</span>
  <span class="nt">-nographic</span>


  <span class="nb">cat</span> ./boot_normal.sh
  <span class="c">#! /usr/bin/bash</span>

qemu-system-x86_64 <span class="se">\</span>
  <span class="nt">-m</span> 4G <span class="se">\</span>
  <span class="nt">-smp</span> 4 <span class="se">\</span>
  <span class="nt">-drive</span> <span class="nv">file</span><span class="o">=</span>netbsd.img,format<span class="o">=</span>qcow2 <span class="se">\</span>
  <span class="nt">-boot</span> c <span class="se">\</span>
  <span class="nt">-enable-kvm</span> <span class="se">\</span>
  <span class="nt">-virtfs</span> <span class="nb">local</span>,path<span class="o">=</span>/home/honken/virtual-machines/NetBSD,mount_tag<span class="o">=</span>hostshare,security_model<span class="o">=</span>none <span class="se">\</span>
  <span class="nt">-netdev</span> user,id<span class="o">=</span>network-vm,hostfwd<span class="o">=</span>tcp::2222-:22 <span class="se">\</span>
  <span class="nt">-device</span> virtio-net-pci,netdev<span class="o">=</span>network-vm <span class="se">\</span>
  <span class="nt">-bios</span> /usr/share/edk2/OvmfX64/OVMF_CODE.fd <span class="se">\</span>
  <span class="nt">-object</span> rng-random,filename<span class="o">=</span>/dev/urandom,id<span class="o">=</span>viornd0 <span class="se">\</span>
  <span class="nt">-device</span> virtio-gpu-gl-pci <span class="se">\</span>
  <span class="nt">-nographic</span>
</code></pre></div></div>
<p>Now we make them executable</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  <span class="nb">chmod</span> +x boot_install.sh
  <span class="nb">chmod</span> +x boot_normal.sh
</code></pre></div></div>

<p>Launch the installer, configure and then boot up the VM</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  ./boot_install.sh
  ./boot_normal.sh
</code></pre></div></div>]]></content><author><name>Pratyush Nandi</name></author><category term="Virtualization" /><summary type="html"><![CDATA[As I’m delving in NetBSD, I have encountered that perhaps NetBSD’s installer doesn’t recognise my NVME disk, also I’m pretty sure the hardware support for my latest Intel wifi cards, processor (generation of Raptor Lake, which is quite an enhanced version of alder lake), and then my IRISxe integrated graphics card is not on the supported device list. Its obvious though, NetBSD caters to older devices that needs an operating system that has lower baseline of memory footprint, smaller and cleaner sound server, and support for older obscure hardware. So, it becomes important to know ins and outs of virtualization techniques on a surface level. As I would be relying on nographics on initial stage, though I could have perfectly spun up a vm and then used ssh to get remote access, I don’t like the idea, because initally I want to understand the overall system layout, go and look through the kernel and its codebase, get more understanding on how the processor support works and what exactly stays same across various generations of Intel CPU’s and also similarliy with Intel’s graphics card, which are in most cases integrated. Then I’m more interested on the sound server and NetBSD’s implementation of it at kernel level, which is completely different from Linux ALSA framework. Next target would be bluetooth obviously, a painfully difficult technology to implement, and atlast graphics stack, getting hardware acceleration and more info on framebuffering mode. This post will mostly cover what exactly is qemu, then how do kvm and xen differ, also techniques like pcie forwarding of xen hypervisor and its equivalent of kvm.]]></summary></entry><entry><title type="html">Porting android device to PostmarketOS (Part-II)</title><link href="https://nandiprh.github.io/blog/2026/08/02/Porting-journey-2/" rel="alternate" type="text/html" title="Porting android device to PostmarketOS (Part-II)" /><published>2026-08-02T00:00:00+00:00</published><updated>2026-08-02T00:00:00+00:00</updated><id>https://nandiprh.github.io/blog/2026/08/02/Porting-journey-2</id><content type="html" xml:base="https://nandiprh.github.io/blog/2026/08/02/Porting-journey-2/"><![CDATA[<p>Earlier in the 1st part, the focus was purely on toolchain setup, and get the project working directory up-to-date. This part i.e 2nd part is intended to verify and correct the default outputs generated by initial pmbootstrap init,
as well as get a concrete working plan. This also includes resolving the existing shipped source tree for gta4l, and understand the vendor specific naming of device models, to get complete idea of the board slapped on top of qualcomm SM6115 Snapdragon 662.
Last time we missed an important step which is to verify boot offsets from an extracted boot.img file of the android device. If any fixes are to be done we edit the device info.</p>

<p>Second stage is to write sm6115-samsung-gta4l.dts, though this may sound simple, but the most horrific part is the vendor actually never provides a single file dts for T505(specific model), and hence we used dtc(Open Firmware device tree compiler), to get 
a working dts straight out of the dtbo image provided by the bootloader to the kernel on system boot. Well the issue is, dtc is based on reverse engineering, and the whole basis of reverse engineering is assumption based on behaviour.
Not to say that the extracted dts is going to be inaccurate, but it means it has chances of being incomplete.</p>

<p>Then we move to the 3rd stage, where we will use the written dts file(mainline compatible) and store it locally on pmaports kernel package.
Step 4 will be generate pmbootstrap builds using linux-postmarketos-qcom-sm6115 (mainline kernel), the DTB compiled from the DTS we write and Alpine rootfs(As pmos is based on ALpine linux).
Step 5 will be pmbootstrap packaging everything into boot.img(kernel + DTB + pmos initramfs), here we may have to tackle partition space related issues.
Step 6 will be flashing via heimdall(Samsung device,odin protocol implemented at hardware level, so we don’t have much realistic chance of bricking).</p>

<p>If step 3,4 and 5 are a success, we replicate it by booting,check dmesg, and iterating to build a complete DTS, as the plan is to move in accordance with peripheral priority.
P1: UFS + USB + serial console (boot critical)
P2: Regulators (supporting everything above and below)
P3: Display + touch + power keys (usability)
P4: WiFi + BT + modem (connectivity)</p>

<p>Before moving it is important we get a heavy theoritical grasp of whats inside the chasis and what behaviour to expect.
As we know SM6115 is supported in mainline kernel, so we do have SoC base, but if SoC is supported it doesn’t mean a specific device using the SoC has a mainline dts.
The SoC clock drivers,regulators and core peripherals work flawlessly but the board specific DTS for gta4l doesn’t exist upstream yet, so we will be writing it.</p>

<p>The pmos wiki lists “Display broken”, a broken display might refer to “black screen” i.e kernel can’t initialise the DSI panel, so we will need serial UART or pstore to debug.
Serial UART( Universal asynchronous receiver-transmitter ),Hardware protocol for serial communication. “Asynchronous” means no shared clock between sender and receiver — they agree on baud rate (115200 in this case,we got it from the extracted dts file) beforehand and that’s how they stay in sync.
For a hardware serial port on qcomm devices its ttyMSM0. The kernel sends all boot messages to it in real time, before display initializes,before USB comes up or any other mechanism.</p>

<p>Our cmdline has the parameter:</p>
<pre><code class="language-txt">console=ttyMSM0,115200n8
earlycon=msm_geni_serial,0x4a90000
</code></pre>
<p>Hence the kernel will output to UART from the very first boot message,the issue being to actually read it we need a physical UART adapted connected to test pads on the PCB(printed circuit board - it is the physical board inside the tablet on which all the chips are soldered).
UART test pads are small copper pads on the PCB that the manufacturer uses during factory testing to read serial output. On most consumer devices Samsung doesn’t expose them as a proper connector,they’re just bare pads you’d need to solder thin wires to and connect to a USB-UART adapter to read the serial output on our PC.
PStore stands for persistent storage,A kernel subsystem that writes the last kernel log to persistent storage (reserved RAM or flash) before a crash. After a reboot you can read what the kernel printed just before it panicked.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> /sys/fs/pstore/dmesg-ramoops-0

<span class="c"># this is how we read and debug a kernel panic that reboots the device before we can even read the dmesg.</span>
</code></pre></div></div>
<p>pstore is wired in via the ramoops node, we will include it,as it costs nothing and saves us if the kernel panics on first boot.
Also, “Oops” is kernel terminology for a non-fatal kernel error/crash. ramoops = RAM-based oops logger.</p>

<p>We also take a close look at the android stack
Android apps(APK’s) –&gt; Android frameworks(ART,Binder,..)–&gt; Android HALs –&gt; Linux Kernel(with qcomm downstream patches).</p>

<p>In case of pmos, the stack looks like
Alpine linux userspace(apk(alpine package) packages,musl,..) –&gt; Linux kernel(downstream/mainline).</p>

<p>Downstream kernels are easier to work with because the vendor distributed android version was in some way compatible with that Linux major version, as Linux doesn’t have a stable ABI, the pattern changes drastically.
On the PCB, SoC is the main chip, it integrates CPU,GPU,modem,ISP,DSP,memory controller, and peripheral controllers(like I2C,SPI,UART,USB) everything on it.
So SoC has it dts already defined in the mainline in our case, so the difference between SoC and device board(for gta4l) is</p>

<p>SoC (SM6115) — same across all devices using it
    Kryo 260 CPU cores
    Adreno 610 GPU
    Qualcomm modem (LTE)
    QCA BT/WiFi controller
    Peripheral buses (I2C, SPI, UART…)  <br />
    Clock/regulator controllers</p>

<p>Board (Samsung gta4l) — unique per device
    Which I2C bus the touchscreen is on
    Which GPIO resets the display
    Which PMIC regulator powers what
    Panel type (DSI, timing parameters)
    Battery charger IC model
    Physical routing of all the above</p>

<p>Hence we know that SoC drivers are upstream, the clock,the regulators, the adreno 610 GPU driver. What isn’t present is the board DTS(device tree source) for gta4l specifically. This DTS file knows the touch screen is located on say I2C bus 3,panel reset on GPIO 47, display DSI timing is X, and so on.
We know there is gta4l sibling gta4lwifi, even if it had mainline support we simply couldn’t use it because the board might be the same but peripherals might be connected or communicate to a different bus.
Though it would be miles easier to take it as reference to create the DTS.
Downstream kerenl isn’t just older kernel, its a fork of an older kernel with a massive out of tree patches from qcomm and vendor specific patches from samsung 
that never made it up for mainline submission/merge. The reason might be vendor gatekeeping or not satisfying the kernel standards, or android specific interfaces like ION allocator, sync fences built into drivers.
Mainline is what we refer to as Linus’s tree, where the same hardware gets implemeted cleanly. The hardware specific code there follows kernel subsystem APIs, which is approved by maintainers.
Thus downstream kernel is static support, as its built on top of older kernel with massive out of tree blobs, it has no continuation like the mainline counterpart that receives constant support because of ongoing development.</p>

<p>One of the main distinction is the android specific downstream kernel code, the actual drivers which are written in C, can’t be simply reused because</p>
<ul>
  <li>Kernel ABI isn’t stable - Linux doesn’t have any stable ABI, which is an intentional well documented policy. So struct layouts might change,function signature changes, entire subsystem gets rewritten.</li>
  <li>The interfaces themselves don’t exist - Downstream drivers might call android specific kernel APIs that mainline might have removed.
As a refernce eg,
    <pre><code class="language-txt">// downstream code uses:
ion_alloc()           // Android ION allocator - removed from mainline
sync_fence_create()   // Android sync framework - replaced by dma-fence
mdss_fb_*             // Samsung display subsystem - not in mainline
</code></pre>
    <p>So what we understand is the drivers in the kernel exist to pass control to the hardware, which is a binary, commonly referred to as device firmware. What isn’t cleanly portable is the driver itself.</p>
  </li>
</ul>

<p>Another important distinction is the dts and dtsi.
From the mainline tree, we can look it from the cloned linux repo,</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">arch</span>/arm64/boot/dts/qcom/sm6115.dtsi     <span class="c"># file exists</span>
</code></pre></div></div>
<p>This direcotry holds CPU nodes,Adreno 610 DRM/KMS driver, btqca driver,clock controller(gcc-sm6115),interconnect nodes, USB,I2C and SPI controllers.
Hence our job is writing the sm6115-samsung-gta4l.dts, The .dtsi (i = include) defines all SoC-level nodes like CPU, clocks, interconnects, peripheral controllers, all of which ,with status = “disabled” by default.
Our board .dts enables the ones our device uses and fills in board-specific properties.</p>

<p>Another important aspect is the booting criteria -:
Android devices handle process and wakelocks differently because they were meant for handheld devices.
For eg, say Lineage os holds “Boot” and “userdata” partition, the boot contains the android kernel(we refer it as downstream) + android ramdisk(loads the minimal kernel into memory).
Whereas userdata partition holds the android userspace which is ART and framworks along with apps.</p>

<p>After say a theoritical pmos flash, boot partition holds the mainline kernel + pmos initramfs, the userdata partition holds alpine linux rootfs(in our case musl, blueZ, systemd ..).
What we don’t dare to touch is the bootloader, the bootloader is layered and holds a hardware level watchdog, so if accidently a different image is flashed, after a certain amount of time the device enters bootloader(samsung refers it as download mode).</p>

<p>Hence the full chain of android booting looks like -:</p>
<pre><code class="language-txt">XBL (Qualcomm bootloader)
    → ABL (Android bootloader)
        → reads BOOT partition
            → loads your pmOS kernel + DTB into RAM
                → kernel boots, reads DTB, initializes hardware
                    → mounts Alpine rootfs from USERDATA
                        → systemd starts
</code></pre>

<p>The main question is where does our superstar the DTS actually resides?
There is dual possibility, path A - local(inside pmsports kernel package directory,pmbootstrap compiles it and includes it in the boot image).
path B - we submit it to mainline kernel tree as a proper patch. It then resides in “arch/arm64/boot/dts/qcom/sm6115-samsung-gta4l.dts” .
Well the tracersal path is A to B in this case, we iterate with A as we are going to build the dts in stages with priority(as mentioned earlier).</p>

<p>More info on the 2 stage bootloader and the watchdog - If a broken DTS is built into the boot.img and flashed, the qcomm bootloader(XBL -&gt; ABL) does not validate the dtb contents at all.
So we don’t get thrown to the download mode, the bootloader boots successfully but peripherals/components remain dysfunctional.
The bootloader behaviour is also reliant on how wrong the DTS was, which generated the DTB.</p>

<p>Case-1:</p>
<pre><code class="language-txt">Wrong compatible string
.kernel boots, driver doesn't bind, device just absent
.dmesg shows - no driver found
.everything else works fine
</code></pre>
<p>Case-2:</p>
<pre><code class="language-txt">Wrong GPIO number for display reset
.kernel boots, display stays black
.SSH in via USB networking, read dmesg,we fix it
</code></pre>
<p>Case-3:</p>
<pre><code class="language-txt">Wrong regulator reference
.kernel panics during probe, or device reboots
.flash corrected boot.img, we try again
</code></pre>
<p>Case-4:</p>
<pre><code class="language-txt">Completely malformed DTS syntax
.DTB compilation fails at build time
.pmbootstrap won't even produce boot.img
.never reaches the device
</code></pre>

<p>The safety net here is USB networking.
pmOS initramfs brings up USB networking automatically even before the rootfs mounts. 
So even with black screen, no touch, nothing working, we can always</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Device shows up as USB ethernet on our PC</span>
ssh user@&lt;ip address&gt;

<span class="c"># Then read kernel log</span>
dmesg | <span class="nb">grep</span> <span class="nt">-i</span> <span class="s2">"error</span><span class="se">\|</span><span class="s2">fail</span><span class="se">\|</span><span class="s2">panic"</span>
</code></pre></div></div>

<p>Thus earlier we had choosen none as UI and dropbear for a minimal ssh client.Console over ssh is our debugging interface.
The only case where a reflash might be needed is , kernel panics at boot and device reboots into download mode after watchdog timeout.Then we just reflash the fixed boot.img. Minimal chances of bricking.
Watchdog is in hardware, its a timer register in the SoC itself,qcomm refers it as APPS_WDOG.Completely independent of the vendor or any samsung firmware or security policy.
Watchdog will work independent of the OS, it resides at the silicon level itself.</p>

<p>The last part being the PIT, a partition table, it describes where partitions live on eMMC(Embedded Multimedia Card),its essentially a soldered-on SD card.
Flash storage (NAND) with a controller chip, packaged together and soldered directly to the PCB. The “embedded” means it’s not removable like a regular SD card.
No boot conditions are stored in the PIT. These are qcomm firmware partitions, which remain same as stock and are untouched like XBL,TZ,ABL,..</p>]]></content><author><name>Pratyush Nandi</name></author><category term="Porting" /><category term="documentation" /><summary type="html"><![CDATA[Earlier in the 1st part, the focus was purely on toolchain setup, and get the project working directory up-to-date. This part i.e 2nd part is intended to verify and correct the default outputs generated by initial pmbootstrap init, as well as get a concrete working plan. This also includes resolving the existing shipped source tree for gta4l, and understand the vendor specific naming of device models, to get complete idea of the board slapped on top of qualcomm SM6115 Snapdragon 662. Last time we missed an important step which is to verify boot offsets from an extracted boot.img file of the android device. If any fixes are to be done we edit the device info.]]></summary></entry><entry><title type="html">Porting android device to Postmarket OS (Part - I)</title><link href="https://nandiprh.github.io/blog/2026/08/01/Porting-journey/" rel="alternate" type="text/html" title="Porting android device to Postmarket OS (Part - I)" /><published>2026-08-01T00:00:00+00:00</published><updated>2026-08-01T00:00:00+00:00</updated><id>https://nandiprh.github.io/blog/2026/08/01/Porting-journey</id><content type="html" xml:base="https://nandiprh.github.io/blog/2026/08/01/Porting-journey/"><![CDATA[<p>Lately, I’ve been trying to port my android tablet to Postmarket OS, well PostmarketOS (from here on I will refer it as pmos) is a Linux distribution intended for mobile phones.
Well pmos lets a user run mainstream linux kernel along with the utilities used by common Linux distributions ranging from init system like systemd to complete desktop environments.
Though these utilities are tweaked heavily to suit mobile phone layouts, like Phosh (maintained by pmos community) basically works like gnome for phones, there exists others like plasma-mobile and many window managers.
This blog is meant for documenting my journey of my current ongoing work on porting my samsung galaxy tab A7, codenamed : gta4l to postmarket OS.</p>

<p>First, i would define some terminologies that basically defines the whole underlying technology that makes android different from mainstream Linux based distributions.
Starting from bootloader and partitions, most of the desktop os, lets you define partitions that includes a UEFI/BIOS partition, / (root partition), and an optional swap partition. This is usually a common use pattern, though a user can split the partitions based on utility, like creating a separate tmpfs, if a machine has
low memory and is suited for a compilation heavy environment. A separate /var if intended for a mail server. But android intended for handheld devices works in a heavy environment of embedded systems.
Thus it includes multiple partitions that holds binary blobs for hardware like camera, flash light, speakers and multiple such embedded hardware. 
Another example being bluetooth, Android uses its own bluetooth stack (Fluoride/Gabeldorsche), talking to hardware via a vendor HAL. Whereas pmos uses bluez. As linux distributions expect every code to exist in either the kernel or as loadable modules, this behaviour creates conflicts, and so lot of times peripherals just don’t work in pmos. While BlueZ,which talks to hardware via HCI (Host Controller Interface),the standard protocol. The chip itself speaks HCI regardless of OS.
Therefore when a utility/software requires a camera access, the android kernel consists of the device driver, that has the ability to interact with the binary blob (firmaware) situated in the partition, these drivers then pass on the control to the binary, which performs the action.
Other than that android has another defining concept of slots, older devices and even many lower end devices make use of single slot mechanism (A slot), while latest and higher end devices make use of dual slots (A/B) to manage upgrades.</p>

<p>While in general the android environment seems more inaccessible to changes compared to desktop counterparts, its actually the opposite. Android devices lets a super user have complete access including the bootloader, which if undergoes modification or accidental deletion makes the system unbootable, commonly referred as “hard bricking”.
While soft bricking is recoverable, which includes flashing the wrong boot image. But scenarios exist where hard bricking is possible if a user flashes a wrong recovery and boot images. MOst important defining concept in android ecosystem being three images, vbmeta, dtbo, recovery.img and boot.img.
vbmeta checks for signature of boot.img, so if a wrong/unrealted device boot.img is flashed, android will refuse to boot and will take to recovery partition.
Next comes dtbo, which is a binary file, produced from dts (device tree source), it defines how the entire board is defined on the SoC(System on Chip).
As android being part of embedded system, it is meant to be space efficent. This dts tells the kernel, how the board is defined, which peripheral is connected to which port.
As Linux kernel is highly portable, it runs on many embedded hardware, so the concept of dts is not alien to the OS itself, the issue lies in dts naming conventions.</p>

<p>Here, I will define two kernel sources, upstream and downstream. Upstream being the latest branch of linux kernel or a kernel compatible with kerenl.org’s releases. Whereas downstream being the AOSP based kernel shipped by the vendor.
So the dts file structure defining is what decides portability. Understanding of the device board thats slapped on top of the SoC is crucial.</p>

<p>So to get the images, kernel source tree and dts files(though most of the vendors rarely release this, vendors mostly try to release as less as possible without violating the GPL licenced parts of Android).
Well we can always extract these images from a running system using adb(android debug bridge). Most vendors have a dedicated channel for releasing these software components, here we are trying to port a samsung galaxy tab A7, model : SM-T505, device codename : gta4l.
For samsung the dedicated release channel is :</p>
<pre><code class="language-txt">https://opensource.samsung.com/
</code></pre>
<p>As I’m running Lineage OS currently on this tablet, its comparatively easier, as I can get all the sources from Lineage’s git repo. This also has a massive advantage, that everytime I need not rely on odin/heimdall instead I can use fastbootd.</p>
<pre><code class="language-txt">https://wiki.lineageos.org/devices/gta4l/
https://github.com/LineageOS/lineage_wiki/blob/main/_data/devices/gta4l.yml
</code></pre>
<p>The gta4l.yml file contains device specification and Lineage maintainer details, as Lineage provides complete working custom ROM for official devices, these config are highly reliable source.</p>
<div class="language-yml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">architecture</span><span class="pi">:</span> <span class="s">arm64</span>
<span class="na">battery</span><span class="pi">:</span> <span class="pi">{</span><span class="nv">capacity</span><span class="pi">:</span> <span class="nv">7040</span><span class="pi">,</span> <span class="nv">removable</span><span class="pi">:</span> <span class="nv">false</span><span class="pi">,</span> <span class="nv">tech</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Li-Po'</span><span class="pi">}</span>
<span class="na">before_install</span><span class="pi">:</span> <span class="pi">{</span><span class="nv">instructions</span><span class="pi">:</span> <span class="s1">'</span><span class="s">needs_specific_android_fw'</span><span class="pi">,</span> <span class="nv">lineage_version</span><span class="pi">:</span> <span class="nv">20</span><span class="pi">,</span> <span class="nv">version</span><span class="pi">:</span> <span class="s1">'</span><span class="s">12'</span><span class="pi">}</span>
<span class="na">before_recovery_install</span><span class="pi">:</span> <span class="s">samsung_qcom</span>
<span class="na">bluetooth</span><span class="pi">:</span> <span class="pi">{</span><span class="nv">profiles</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">A2DP</span><span class="pi">],</span> <span class="nv">spec</span><span class="pi">:</span> <span class="s1">'</span><span class="s">5.0'</span><span class="pi">}</span>
<span class="na">cameras</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="pi">{</span><span class="nv">flash</span><span class="pi">:</span> <span class="nv">None</span><span class="pi">,</span> <span class="nv">info</span><span class="pi">:</span> <span class="s1">'</span><span class="s">8</span><span class="nv"> </span><span class="s">MP</span><span class="nv"> </span><span class="s">(Primary)'</span><span class="pi">}</span>
  <span class="pi">-</span> <span class="pi">{</span><span class="nv">flash</span><span class="pi">:</span> <span class="nv">None</span><span class="pi">,</span> <span class="nv">info</span><span class="pi">:</span> <span class="s1">'</span><span class="s">5</span><span class="nv"> </span><span class="s">MP</span><span class="nv"> </span><span class="s">(Front</span><span class="nv"> </span><span class="s">Facing)'</span><span class="pi">}</span>
<span class="na">codename</span><span class="pi">:</span> <span class="s">gta4l</span>
<span class="na">cpu</span><span class="pi">:</span> <span class="s">Kryo </span><span class="m">260</span>
<span class="na">cpu_cores</span><span class="pi">:</span> <span class="s1">'</span><span class="s">8'</span>
<span class="na">cpu_freq</span><span class="pi">:</span> <span class="s">4 x 2.0 GHz + 4 x 1.8 GHz</span>
<span class="na">current_branch</span><span class="pi">:</span> <span class="m">23.2</span>
<span class="na">dimensions</span><span class="pi">:</span> <span class="pi">{</span><span class="nv">depth</span><span class="pi">:</span> <span class="nv">7</span><span class="pi">,</span> <span class="nv">height</span><span class="pi">:</span> <span class="nv">157.4</span><span class="pi">,</span> <span class="nv">width</span><span class="pi">:</span> <span class="nv">247.6</span><span class="pi">}</span>
<span class="na">download_boot</span><span class="pi">:</span> <span class="s">With the device powered off, hold &lt;kbd&gt;Volume Down&lt;/kbd&gt; + &lt;kbd&gt;Volume Up&lt;/kbd&gt; then connect USB cable to PC.</span>
<span class="na">firmware_update</span><span class="pi">:</span> <span class="s">firmware_update_samsung_gta4l</span>
<span class="na">gpu</span><span class="pi">:</span> <span class="s">Qualcomm Adreno </span><span class="m">610</span>
<span class="na">image</span><span class="pi">:</span> <span class="s">gta4l.png</span>
<span class="na">install_method</span><span class="pi">:</span> <span class="s">samloader_rs</span>
<span class="na">kernel</span><span class="pi">:</span> <span class="pi">{</span><span class="nv">repo</span><span class="pi">:</span> <span class="nv">android_kernel_samsung_sm6115</span><span class="pi">,</span> <span class="nv">version</span><span class="pi">:</span> <span class="s1">'</span><span class="s">4.19'</span><span class="pi">}</span>
<span class="na">maintainers</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">chrmhoffmann</span><span class="pi">]</span>
<span class="na">models</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">SM-T505</span><span class="pi">,</span> <span class="nv">SM-T505C</span><span class="pi">,</span> <span class="nv">SM-T505N</span><span class="pi">,</span> <span class="nv">SM-T507</span><span class="pi">]</span>
<span class="na">name</span><span class="pi">:</span> <span class="s1">'</span><span class="s">Galaxy</span><span class="nv"> </span><span class="s">Tab</span><span class="nv"> </span><span class="s">A7</span><span class="nv"> </span><span class="s">10.4</span><span class="nv"> </span><span class="s">2020</span><span class="nv"> </span><span class="s">(LTE)'</span>
<span class="na">network</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">2G GSM</span><span class="pi">,</span> <span class="nv">2G CDMA</span><span class="pi">,</span> <span class="nv">3G UMTS</span><span class="pi">,</span> <span class="nv">4G LTE</span><span class="pi">]</span>
<span class="na">peripherals</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">3.5mm jack</span><span class="pi">,</span> <span class="nv">Accelerometer</span><span class="pi">,</span> <span class="nv">Compass</span><span class="pi">,</span> <span class="nv">GPS</span><span class="pi">,</span> <span class="nv">Gyroscope</span><span class="pi">,</span> <span class="nv">Light sensor</span><span class="pi">,</span> <span class="nv">Proximity sensor</span><span class="pi">,</span> <span class="nv">USB OTG</span><span class="pi">]</span>
<span class="na">quirks</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">ims</span><span class="pi">]</span>
<span class="na">ram</span><span class="pi">:</span> <span class="s">3 GB</span>
<span class="na">recovery_boot</span><span class="pi">:</span> <span class="s">Reboot and immediately hold &lt;kbd&gt;Volume Up&lt;/kbd&gt; + &lt;kbd&gt;Power&lt;/kbd&gt; while the device is connected to a PC via USB cable.</span>
<span class="na">recovery_partition_name</span><span class="pi">:</span> <span class="s">recovery</span>
<span class="na">release</span><span class="pi">:</span> <span class="s">2020-09</span>
<span class="na">screen</span><span class="pi">:</span> <span class="pi">{</span><span class="nv">resolution</span><span class="pi">:</span> <span class="s1">'</span><span class="s">2000x1200'</span><span class="pi">,</span> <span class="nv">size</span><span class="pi">:</span> <span class="nv">10.4</span><span class="pi">,</span> <span class="nv">technology</span><span class="pi">:</span> <span class="s1">'</span><span class="s">TFT</span><span class="nv"> </span><span class="s">LCD'</span><span class="pi">}</span>
<span class="na">sdcard</span><span class="pi">:</span> <span class="pi">{</span><span class="nv">size_max</span><span class="pi">:</span> <span class="s1">'</span><span class="s">1</span><span class="nv"> </span><span class="s">TB'</span><span class="pi">}</span>
<span class="na">soc</span><span class="pi">:</span> <span class="s">Qualcomm SM6115 Snapdragon </span><span class="m">662</span>
<span class="na">storage</span><span class="pi">:</span> <span class="s">32 GB</span>
<span class="na">tree</span><span class="pi">:</span> <span class="s">android_device_samsung_gta4l</span>
<span class="na">type</span><span class="pi">:</span> <span class="s">tablet</span>
<span class="na">vendor</span><span class="pi">:</span> <span class="s">Samsung</span>
<span class="na">vendor_short</span><span class="pi">:</span> <span class="s">samsung</span>
<span class="na">versions</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">20</span><span class="pi">,</span> <span class="nv">21</span><span class="pi">,</span> <span class="nv">22.1</span><span class="pi">,</span> <span class="nv">22.2</span><span class="pi">,</span> <span class="nv">23.0</span><span class="pi">,</span> <span class="nv">23.2</span><span class="pi">]</span>
<span class="na">wifi</span><span class="pi">:</span> <span class="s">802.11 a/b/g/n/ac</span>
</code></pre></div></div>

<p>For now the priority is to get a bootable image with display and touch sensors working, once we get to that stage, next focus would be on audio, bluetooth and getting a complete desktop environment working.
From the yml file, the SoC is “Qualcomm SM6115 Snapdragon 662”.Thats clearly a good thing, because a SoC based on Qualcomm is most likely to have the device tree in linux mainline kernel, unlike mediatek which seems to be bit opaque or rather say uninterested.
So here I will list all the links that I will commonly refer to create and understand valid dts files and as well as look into its sibling devices that may be supported.</p>
<pre><code class="language-txt">https://wiki.postmarketos.org/wiki/Samsung_Galaxy_Tab_A7_(samsung-gta4lwifi)
https://wiki.postmarketos.org/wiki/Qualcomm_Snapdragon_460/662_(SM4250/SM6115)
</code></pre>

<p>Though pmos doesn’t list any active user for T505 itself, but its sibling the gta4lwifi has some work in progress, which is a good sign.
So now we setup the pmbootstrap , which is the central command-line application for postmarketOS development. Among other things, it allows building packages, creating installation images and flashing them to your device.</p>

<p>Installing pmbootstrap from GURU repository in Gentoo:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>emerge <span class="nt">-avq</span> dev-util/pmbootstrap
</code></pre></div></div>
<p>pmbootstrap working directory is</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$HOME</span>/.local/var/pmbootstrap/cache_git/pmaports
</code></pre></div></div>
<p>Also I will create another directory in my home, to have easy access to the source files and organising the project directory</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> ~/postmarketos
<span class="nb">cd</span> ~/postmarketos
</code></pre></div></div>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/4] <span class="o">[</span>main]
└[~/postmarketos]&gt; pmbootstrap init
<span class="o">[</span>19:33:21] Location of the <span class="s1">'work'</span> path. Multiple chroots <span class="o">(</span>native, device <span class="nb">arch</span>, device rootfs<span class="o">)</span> will be created <span class="k">in </span>there.
<span class="o">[</span>19:33:21] Work path <span class="o">[</span>/home/honken/.local/var/pmbootstrap]:
<span class="o">[</span>19:33:23] Location of the <span class="s1">'pmaports'</span> path, containing package definitions.
<span class="o">[</span>19:33:23] pmaports path <span class="o">[</span>/home/honken/.local/var/pmbootstrap/cache_git/pmaports]:
<span class="o">[</span>19:33:25] Choose the postmarketOS release channel.
<span class="o">[</span>19:33:25] Available <span class="o">(</span>13<span class="o">)</span>:
<span class="o">[</span>19:33:25] <span class="k">*</span> edge: Rolling release / Most devices / Occasional breakage: https://postmarketos.org/edge
<span class="o">[</span>19:33:25] <span class="k">*</span> v25.12: Latest release / Recommended <span class="k">for </span>best stability
<span class="o">[</span>19:33:25] <span class="k">*</span> v25.06: Old release <span class="o">(</span>unsupported<span class="o">)</span>
<span class="o">[</span>19:33:25] Channel <span class="o">[</span>edge]:
<span class="o">[</span>19:33:26] Choose your target device vendor <span class="o">(</span>either an existing one, or a new one <span class="k">for </span>porting<span class="o">)</span><span class="nb">.</span>
<span class="o">[</span>19:33:26] Available vendors <span class="o">(</span>107<span class="o">)</span>: acer, alcatel, amazon, amediatech, amlogic, apple, ark, arrow, asus, ayaneo, ayn, bananapi, barnesnoble, beelink, blackberry, bq, clockworkpi, cubietech, cutiepi, dell, dongshanpi, epson, essential, fairphone, finepower, fly, fxtec, generic, goclever, google, gp, hisense, hp, htc, huawei, inet, infocus, jolla, khadas, klipad, kobo, lark, leeco, lenovo, lg, librecomputer, linksys, lynx, mangopi, medion, meizu, microsoft, mnt, mobvoi, motorola, nextbit, nobby, nokia, nothing, nvidia, odroid, oneplus, oppo, ouya, pine64, planet, pocketbook, postmarketos, powkiddy, purism, qcom, qemu, qualcomm, radxa, raspberry, realme, rockchip, samsung, semc, sharp, <span class="nb">shift</span>, sipeed, solidrun, sony, sourceparts, sqfmi, starway, surftab, t2m, thundercomm, tokio, tolino, trekstor, valve, vernee, vivo, volla, wd, wexler, wiko, wileyfox, xiaomi, xunlong, yu, zhihe, zte, zuk
<span class="o">[</span>19:33:26] Vendor <span class="o">[</span>qemu]: samsung
<span class="o">[</span>19:33:32] Devices are categorised as follows, from best to worst:
<span class="k">*</span> Main: ports where mostly everything works.
<span class="k">*</span> Community: often mostly usable, but may lack important functionality.
<span class="k">*</span> Testing: anything from <span class="s2">"just boots in some sense"</span> to almost fully functioning ports.
<span class="k">*</span> Downstream: ports that use a downstream kernel — very limited functionality. Not recommended.

Available devices by codename <span class="o">(</span>42<span class="o">)</span>: a32 <span class="o">(</span>downstream<span class="o">)</span>, a51 <span class="o">(</span>downstream<span class="o">)</span>, chagallwifi <span class="o">(</span>testing<span class="o">)</span>, codina <span class="o">(</span>testing<span class="o">)</span>, codina-tmo <span class="o">(</span>testing<span class="o">)</span>, coreprimevelte <span class="o">(</span>community<span class="o">)</span>, e7 <span class="o">(</span>testing<span class="o">)</span>, espresso10 <span class="o">(</span>community<span class="o">)</span>, espresso7 <span class="o">(</span>community<span class="o">)</span>, expressatt <span class="o">(</span>testing<span class="o">)</span>, exynos7 <span class="o">(</span>testing<span class="o">)</span>, exynos9820 <span class="o">(</span>testing<span class="o">)</span>, fortuna <span class="o">(</span>testing<span class="o">)</span>, fortunaltezt <span class="o">(</span>testing<span class="o">)</span>, gavini <span class="o">(</span>testing<span class="o">)</span>, golden <span class="o">(</span>testing<span class="o">)</span>, grandmax <span class="o">(</span>testing<span class="o">)</span>, gt510 <span class="o">(</span>testing<span class="o">)</span>, gt58 <span class="o">(</span>testing<span class="o">)</span>, i9100 <span class="o">(</span>testing<span class="o">)</span>, j3ltetw <span class="o">(</span>testing<span class="o">)</span>, j4lte <span class="o">(</span>downstream<span class="o">)</span>, j5 <span class="o">(</span>testing<span class="o">)</span>, j5x <span class="o">(</span>testing<span class="o">)</span>, janice <span class="o">(</span>testing<span class="o">)</span>, jflte <span class="o">(</span>testing<span class="o">)</span>, klimtlte <span class="o">(</span>testing<span class="o">)</span>, kona <span class="o">(</span>testing<span class="o">)</span>, kyle <span class="o">(</span>testing<span class="o">)</span>, loganrelte <span class="o">(</span>testing<span class="o">)</span>, lt01 <span class="o">(</span>testing<span class="o">)</span>, lt03lte <span class="o">(</span>testing<span class="o">)</span>, m0 <span class="o">(</span>community<span class="o">)</span>, m20lte <span class="o">(</span>downstream<span class="o">)</span>, m3 <span class="o">(</span>testing<span class="o">)</span>, n1awifi <span class="o">(</span>testing<span class="o">)</span>, n2awifi <span class="o">(</span>testing<span class="o">)</span>, p4note <span class="o">(</span>testing<span class="o">)</span>, rossa <span class="o">(</span>testing<span class="o">)</span>, skomer <span class="o">(</span>testing<span class="o">)</span>, starqltechn <span class="o">(</span>community<span class="o">)</span>, v1awifi <span class="o">(</span>testing<span class="o">)</span>
<span class="o">[</span>19:33:32] Device codename: gta4l
<span class="o">[</span>19:33:46] The specified device <span class="o">(</span><span class="s1">'samsung-gta4l'</span><span class="o">)</span> could not be found <span class="k">in </span>existing ports.
If you<span class="s1">'re trying to select a device that is supported, check the following:

* Make sure you spelled the vendor name and codename correctly.
* Check if you'</span>re on the right release branch. Devices <span class="k">in </span>the <span class="s1">'downstream'</span> category are only available on the <span class="s1">'edge'</span> branch<span class="p">;</span> <span class="k">if </span>you selected a stable branch, run pmbootstrap init again and <span class="k">select</span> <span class="s1">'edge'</span><span class="nb">.</span>
<span class="k">*</span> If the device is supported by a generic port, <span class="nb">type </span><span class="k">in </span>the vendor and codename of the generic port.

If you want to create a new device port, follow the guide at &lt;https://postmarketos.org/porting/&gt;.
<span class="o">[</span>19:33:46] Do you want to create a new device port? <span class="o">(</span>y/n<span class="o">)</span> <span class="o">[</span>y]: y
<span class="o">[</span>19:34:13] What <span class="nb">type </span>of port are you creating?
<span class="o">[</span>19:34:13] <span class="k">*</span> mainline: Port using upstream/mainline kernel, compatible with upstream user space.
<span class="o">[</span>19:34:13] <span class="k">*</span> downstream: Port using downstream kernel, using the original <span class="o">(</span>e.g. Android<span class="o">)</span> kernel sources, at least partially incompatible with upstream user space.
<span class="o">[</span>19:34:13] Type? <span class="o">(</span>mainline/downstream<span class="o">)</span>: mainline
<span class="o">[</span>19:34:27] Generating new aports <span class="k">for</span>: samsung-gta4l...
<span class="o">[</span>19:34:27] Device architecture <span class="o">(</span>x86/loongarch64/s390x/riscv64/armv7/ppc64le/aarch64/x86_64<span class="o">)</span> <span class="o">[</span>aarch64]:
<span class="o">[</span>19:34:32] Who produced the device <span class="o">(</span>e.g. LG<span class="o">)</span>?
<span class="o">[</span>19:34:32] Manufacturer: samsung
<span class="o">[</span>19:34:38] What is the official name <span class="o">(</span>e.g. Google Nexus 5<span class="o">)</span>?
<span class="o">[</span>19:34:38] Name: Samsung Galaxy Tab A7
<span class="o">[</span>19:34:56] In what year was the device released <span class="o">(</span>e.g. 2012<span class="o">)</span>?
<span class="o">[</span>19:34:56] Year: 2020
<span class="o">[</span>19:35:01] What <span class="nb">type </span>of device is it?
<span class="o">[</span>19:35:01] Valid types are: desktop, laptop, convertible, server, tablet, handset, watch, embedded, vm
<span class="o">[</span>19:35:01] Leave empty <span class="k">if </span>this property is defined elsewhere, e.g. <span class="k">in </span>Devicetree or ACPI
<span class="o">[</span>19:35:01] Chassis: tablet
<span class="o">[</span>19:35:12] Does the device have a sdcard or other external storage medium? <span class="o">(</span>y/n<span class="o">)</span> <span class="o">[</span>n]: y
<span class="o">[</span>19:35:17] Which flash method does the device support?
<span class="o">[</span>19:35:17] Flash method <span class="o">(</span>0xffff/fastboot/heimdall/mtkclient/none/rkdeveloptool/uuu<span class="o">)</span> <span class="o">[</span>none]: fastboot
<span class="o">[</span>19:38:10] You can analyze a known working boot.img file to automatically fill out the flasher information <span class="k">for </span>your deviceinfo file. Either specify the path to an image or press <span class="k">return </span>to skip this step <span class="o">(</span>you can <span class="k">do </span>it later with <span class="s1">'pmbootstrap bootimg_analyze'</span><span class="o">)</span><span class="nb">.</span>
<span class="o">[</span>19:38:10] Path:
<span class="o">[</span>19:38:35] <span class="k">***</span> pmaport generated: /home/honken/.local/var/pmbootstrap/cache_git/pmaports/device/testing/device-samsung-gta4l
<span class="o">[</span>19:38:35] Username <span class="o">[</span>user]: nandiprh
<span class="o">[</span>19:39:00] Available providers <span class="k">for </span>postmarketos-base-ui-audio-backend <span class="o">(</span>2<span class="o">)</span>:
<span class="o">[</span>19:39:00] <span class="k">*</span> pulseaudio: Use pulseaudio as the audio backend. <span class="o">(</span>default<span class="o">)</span>
<span class="o">[</span>19:39:00] <span class="k">*</span> pipewire: Use pipewire as the audio backend. <span class="o">(</span>but may not work with all devices<span class="o">)</span>
<span class="o">[</span>19:39:00] Provider <span class="o">[</span>default]: pipewire
<span class="o">[</span>19:39:50] Available providers <span class="k">for </span>postmarketos-base-ui-wifi <span class="o">(</span>2<span class="o">)</span>:
<span class="o">[</span>19:39:50] <span class="k">*</span> wpa_supplicant: Use wpa_supplicant as the WiFi backend. <span class="o">(</span>default<span class="o">)</span>
<span class="o">[</span>19:39:50] <span class="k">*</span> iwd: Use iwd as the WiFi backend <span class="o">(</span>but may not work with all devices<span class="o">)</span>
<span class="o">[</span>19:39:50] Provider <span class="o">[</span>default]: iwd
<span class="o">[</span>19:40:23] Available providers <span class="k">for </span>postmarketos-usb-moded-default-profile <span class="o">(</span>2<span class="o">)</span>:
<span class="o">[</span>19:40:23] <span class="k">*</span> developer: Make <span class="s1">'developer mode'</span> the default usb-moded profile <span class="o">(</span>always enables usb networking<span class="o">)</span> <span class="o">(</span>default<span class="o">)</span>
<span class="o">[</span>19:40:23] <span class="k">*</span> charging: Make <span class="s1">'charging mode'</span> the default usb-moded profile <span class="o">(</span>usb networking must be manually enabled<span class="o">)</span>
<span class="o">[</span>19:40:23] Provider <span class="o">[</span>default]:
<span class="o">[</span>19:40:49] Available user interfaces <span class="o">(</span>17<span class="o">)</span>:
<span class="o">[</span>19:40:49] <span class="k">*</span> none: Bare minimum OS image <span class="k">for </span>testing and manual customization. The <span class="s2">"console"</span> UI should be selected <span class="k">if </span>a graphical UI is not desired.
<span class="o">[</span>19:40:49] <span class="k">*</span> buffyboard: Plain framebuffer console with modern touchscreen keyboard support
<span class="o">[</span>19:40:49] <span class="k">*</span> console: Console environment, with no graphical/touch UI
<span class="o">[</span>19:40:49] <span class="k">*</span> fbkeyboard: Plain framebuffer console with touchscreen keyboard support
<span class="o">[</span>19:40:49] <span class="k">*</span> gnome: <span class="o">(</span>Wayland<span class="o">)</span> Gnome Shell
<span class="o">[</span>19:40:49] <span class="k">*</span> gnome-mobile: <span class="o">(</span>Wayland<span class="o">)</span> Gnome Shell patched to adapt better to phones <span class="o">(</span>Experimental<span class="o">)</span>
<span class="o">[</span>19:40:49] <span class="k">*</span> i3wm: <span class="o">(</span>X11<span class="o">)</span> Tiling WM <span class="o">(</span>keyboard required<span class="o">)</span>
<span class="o">[</span>19:40:49] <span class="k">*</span> lxqt: <span class="o">(</span>X11<span class="o">)</span> Lightweight Qt Desktop Environment <span class="o">(</span>stylus recommended<span class="o">)</span>
<span class="o">[</span>19:40:49] <span class="k">*</span> mate: <span class="o">(</span>X11<span class="o">)</span> MATE Desktop Environment, fork of GNOME2 <span class="o">(</span>stylus recommended<span class="o">)</span>
<span class="o">[</span>19:40:49] <span class="k">*</span> openbox: <span class="o">(</span>X11<span class="o">)</span> A highly configurable and lightweight X11 window manager <span class="o">(</span>keyboard required<span class="o">)</span>
<span class="o">[</span>19:40:49] <span class="k">*</span> os-installer: UI <span class="k">for </span>installing postmarketOS
<span class="o">[</span>19:40:49] <span class="k">*</span> plasma-bigscreen: <span class="o">(</span>Wayland<span class="o">)</span> 10-feet variant of Plasma, made <span class="k">for </span>big screen TVs
<span class="o">[</span>19:40:49] <span class="k">*</span> plasma-desktop: <span class="o">(</span>Wayland<span class="o">)</span> KDE Desktop Environment <span class="o">(</span>works well with tablets<span class="o">)</span>
<span class="o">[</span>19:40:49] <span class="k">*</span> shelli: Plain console with touchscreen gesture support
<span class="o">[</span>19:40:49] <span class="k">*</span> sxmo-de-dwm: Simple Mobile: Mobile environment based on SXMO and running on dwm
<span class="o">[</span>19:40:49] <span class="k">*</span> sxmo-de-i3: Simple Mobile: Mobile environment based on SXMO and running on i3
<span class="o">[</span>19:40:49] <span class="k">*</span> windowmaker: <span class="o">(</span>X11<span class="o">)</span> Window manager inspired by the NeXTSTEP user interface <span class="o">(</span>stylus recommended<span class="o">)</span>
<span class="o">[</span>19:40:49] <span class="k">*</span> xfce4: <span class="o">(</span>X11<span class="o">)</span> Lightweight desktop <span class="o">(</span>stylus recommended<span class="o">)</span>
<span class="o">[</span>19:40:49] NOTE: 13 UIs are hidden because <span class="s2">"deviceinfo_drm"</span> is not <span class="nb">set</span> <span class="o">(</span>see https://postmarketos.org/deviceinfo<span class="o">)</span><span class="nb">.</span>
<span class="o">[</span>19:40:49] User interface <span class="o">[</span>console]: none
<span class="o">[</span>19:42:58] WARNING: systemd requires kernel version 5.4. Installing systemd with older kernel may result <span class="k">in </span>non-bootable system. Get more information <span class="k">for </span>systemd requirements at https://github.com/systemd/systemd/blob/main/README
<span class="o">[</span>19:42:58] Based on your UI selection, <span class="s1">'default'</span> will result <span class="k">in </span>not installing systemd.
<span class="o">[</span>19:42:58] Install systemd? <span class="o">(</span>default/always/never<span class="o">)</span> <span class="o">[</span>default]: systemd
<span class="o">[</span>19:43:30] ERROR: Input did not pass validation <span class="o">(</span>regex: ^<span class="o">(</span>default|always|never<span class="o">)</span><span class="nv">$)</span><span class="nb">.</span> Please try again.
<span class="o">[</span>19:43:30] Install systemd? <span class="o">(</span>default/always/never<span class="o">)</span> <span class="o">[</span>default]: always
<span class="o">[</span>19:43:40] Additional options: extra free space: 0 MB, boot partition size: 256 MB, parallel <span class="nb">jobs</span>: 16, ccache per <span class="nb">arch</span>: 5G, <span class="nb">sudo </span>timer: False, mirror: http://mirror.postmarketos.org/postmarketos/
<span class="o">[</span>19:43:40] Change them? <span class="o">(</span>y/n<span class="o">)</span> <span class="o">[</span>n]: y
<span class="o">[</span>19:44:06] Set extra free space to 0, unless you ran into a <span class="s1">'No space left on device'</span> error. In that <span class="k">case</span>, the size of the rootfs could not be calculated properly on your machine, and we need to add extra free space to make the image big enough to fit the rootfs <span class="o">(</span>pmbootstrap#1904<span class="p">)</span><span class="nb">.</span> How much extra free space <span class="k">do </span>you want to add to the image <span class="o">(</span><span class="k">in </span>MB<span class="o">)</span>?
<span class="o">[</span>19:44:06] Extra space size: 0
<span class="o">[</span>19:45:36] What should be the boot partition size <span class="o">(</span><span class="k">in </span>MB<span class="o">)</span>?
<span class="o">[</span>19:45:36] Boot size <span class="o">[</span>256]:
<span class="o">[</span>19:45:40] How many <span class="nb">jobs </span>should run parallel on this machine, when compiling?
<span class="o">[</span>19:45:40] Jobs <span class="o">[</span>16]:
<span class="o">[</span>19:45:56] We use ccache to speed up building the same code multiple times. How much space should the ccache folder take up per architecture? After init is through, you can check the current usage with <span class="s1">'pmbootstrap stats'</span><span class="nb">.</span> Answer with 0 <span class="k">for </span>infinite.
<span class="o">[</span>19:45:56] Ccache size <span class="o">[</span>5G]:
<span class="o">[</span>19:46:01] pmbootstrap does everything <span class="k">in </span>Alpine Linux chroots, so your host system does not get modified. In order to work with these chroots, pmbootstrap calls <span class="s1">'sudo'</span> internally. For long running operations, it is possible that you<span class="s1">'ll have to authorize sudo more than once.
[19:46:01] Enable background timer to prevent repeated sudo authorization? (y/n) [n]: y
[19:46:16] Selected mirror: http://mirror.postmarketos.org/postmarketos/
[19:46:16] Change mirror? (y/n) [n]: y
[19:46:23] Download https://postmarketos.org/mirrors.json
[19:46:24] list of available mirrors:
[19:46:24] [1]  mirror.postmarketos.org (Falkenstein, Germany)
[19:46:24] [2]  postmarketos.craftyguy.net (Santa Clara, CA, USA)
[19:46:24] [3]  mirror.sajattack.xyz (Victoria, BC, Canada)
[19:46:24] [4]  mirror.math.princeton.edu (Princeton, NJ, USA)
[19:46:24] [5]  mirrors.aliyun.com (Hangzhou, China)
[19:46:24] [6]  mirrors.tuna.tsinghua.edu.cn (Beijing, China)
[19:46:24] [7]  mirrors.bfsu.edu.cn (Beijing, China)
[19:46:24] [8]  mirrors.ustc.edu.cn (Anhui, China)
[19:46:24] [9]  mirror.nju.edu.cn (Nanjing, Jiangsu, China)
[19:46:24] [10] alpine.sakamoto.pl (Warsaw, Poland)
[19:46:24] [11] distrohub.kyiv.ua (Kyiv, Ukraine)
[19:46:24] [12] mirror-sg.mainlining.org (Singapore, Singapore)
[19:46:24] [13] ftp.halifax.rwth-aachen.de (Aachen, Germany)
[19:46:24] choose '</span>best<span class="s1">' to select the one closest to you
[19:46:24] Select a mirror [1]:
[19:46:37] Additional packages that will be installed to rootfs. Specify them in a comma separated list (e.g.: vim,file) or "none"
[19:46:37] Extra packages [none]: vim,dropbear,nano,strace,evtest,usbutils,tree
[19:48:15] Your host timezone: Asia/Kolkata
[19:48:15] Use this timezone instead of GMT? (y/n) [y]: y
[19:48:20] Choose your preferred locale, like e.g. en_US. Only UTF-8 is supported, it gets appended automatically. Use tab-completion if needed.
[19:48:20] Locale [en_US]:
[19:48:25] Device hostname (short form, e.g. '</span>foo<span class="s1">') [samsung-gta4l]:
[19:48:29] SSH public keys found (2):
[19:48:29] * /home/honken/.ssh/id_ed25519.pub
[19:48:29] * /home/honken/.ssh/id_ed25519.pub.pub
[19:48:29] See https://postmarketos.org/ssh-key-glob for more information.
[19:48:29] Would you like to copy these public keys to the device? (y/n) [n]: y
[19:48:36] After pmaports are changed, the binary packages may be outdated. If you want to install postmarketOS without changes, reply '</span>n<span class="s1">' for a faster installation.
[19:48:36] Build outdated packages during '</span>pmbootstrap <span class="nb">install</span><span class="s1">'? (y/n) [y]: y
[19:49:04] DONE!
</span></code></pre></div></div>
<p>The above selections are based on my preferences, iwd is modern and integrates better with systemd, I choose pipewire because it was designed with bluetooth in mind from start, and bluetooth is a must for me.
The above extra packages are for basic utilities like vim and nano for text editing, dropbear for a lighweight ssh client, strace syscalls a process makes, highly useful when a daemon fails silently without providing any errors.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>strace daemon_name     <span class="c"># shows what a daemon is doing at kernel level</span>
</code></pre></div></div>
<p>evtest reads raw inputs from /dev/input/event* devices, evtest detects if kernel is receiving any input before any UI layer is involved.</p>

<p>After pmbootstrap init completes, check the status.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~/postmarketos]&gt; pmbootstrap status
Channel: systemd-edge <span class="o">(</span>pmaports: main, dirty<span class="o">)</span>
Device:  samsung-gta4l <span class="o">(</span>aarch64<span class="o">)</span>
UI:      none
systemd: <span class="nb">yes</span> <span class="o">(</span><span class="s1">'always'</span> selected <span class="k">in</span> <span class="s1">'pmbootstrap init'</span><span class="o">)</span>
</code></pre></div></div>
<p>Then check if the device info is intact, and hasn’t undergone any accidental changes.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~/postmarketos]&gt; <span class="nb">cat</span> ~/.local/var/pmbootstrap/cache_git/pmaports/device/testing/device-samsung-gta4l/deviceinfo
<span class="c"># Reference: &lt;https://postmarketos.org/deviceinfo&gt;</span>
<span class="c"># Please use double quotes only. You can source this file in shell</span>
<span class="c"># scripts.</span>

<span class="nv">deviceinfo_format_version</span><span class="o">=</span><span class="s2">"0"</span>
<span class="nv">deviceinfo_name</span><span class="o">=</span><span class="s2">"samsung Samsung Galaxy Tab A7"</span>
<span class="nv">deviceinfo_manufacturer</span><span class="o">=</span><span class="s2">"samsung"</span>
<span class="nv">deviceinfo_codename</span><span class="o">=</span><span class="s2">"samsung-gta4l"</span>
<span class="nv">deviceinfo_year</span><span class="o">=</span><span class="s2">"2020"</span>
<span class="nv">deviceinfo_dtb</span><span class="o">=</span><span class="s2">""</span>
<span class="nv">deviceinfo_arch</span><span class="o">=</span><span class="s2">"aarch64"</span>

<span class="c"># Device related</span>
<span class="nv">deviceinfo_chassis</span><span class="o">=</span><span class="s2">"tablet"</span>
<span class="nv">deviceinfo_external_storage</span><span class="o">=</span><span class="s2">"true"</span>

<span class="c"># Bootloader related</span>
<span class="nv">deviceinfo_flash_method</span><span class="o">=</span><span class="s2">"fastboot"</span>
<span class="nv">deviceinfo_kernel_cmdline</span><span class="o">=</span><span class="s2">""</span>
<span class="nv">deviceinfo_generate_bootimg</span><span class="o">=</span><span class="s2">"true"</span>
<span class="nv">deviceinfo_flash_pagesize</span><span class="o">=</span><span class="s2">"2048"</span>
<span class="nv">deviceinfo_bootimg_qcdt</span><span class="o">=</span><span class="s2">"false"</span>
<span class="nv">deviceinfo_dtb_second</span><span class="o">=</span><span class="s2">"false"</span>
</code></pre></div></div>
<p>For now this looks fine to me, also above I choose fastboot as flashing method rather than heimdall because my device currently runs lineage os, so I do have access to userspace level fastbootd, which is much simpler and faster. 
Though in most cases heimdall should be preferred because its intended to be used for samsung devices,as samsung devices use their own odin protocol.</p>

<p>So here we are done with the initial setup, and we can now setup the working directory to clone the mainline kernel, install any required packages, inspect the device partitions and extract the dts files. Though for my device I can simply refer to the LineageOS tree, I will include every option that might be useful for future use cases.
Now we need is adb and the device to be ported need to have debugging enabled in developer options. Also great to have rooted usb debugging to be enabled, by default LineageOS ships with this option enabled in its kernel.</p>

<p>Now we can extract the dtbo image</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>~]&gt; adb devices
<span class="k">*</span> daemon not running<span class="p">;</span> starting now at tcp:5037
<span class="k">*</span> daemon started successfully
List of devices attached
R9ZR502N5LJ     unauthorized

┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/3]
└[~]&gt; adb root
restarting adbd as root
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/3]
└[~]&gt; <span class="nb">cd </span>postmarketos
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/3] <span class="o">[</span>main]
└[~/postmarketos]&gt; adb pull /sys/firmware/fdt ~/postmarketos/gta4l_extracted.dtb
/sys/firmware/fdt: 1 file pulled, 0 skipped. 20.0 MB/s <span class="o">(</span>817870 bytes <span class="k">in </span>0.039s<span class="o">)</span>
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/3] <span class="o">[</span>main ⚡]
└[~/postmarketos]&gt; <span class="nb">ls
</span>gta4l_extracted.dtb


<span class="c"># If adb root is unavailable, make use of </span>
<span class="nv">$ </span>adb shell su <span class="nt">-c</span> <span class="s2">"cat /sys/firmware/fdt"</span> <span class="o">&gt;</span> gta4l_extracted.dtb
</code></pre></div></div>
<p>Currently we have the merged DTB the bootloader passed to the kernel at boot. Base SoC dtb and device specific dtbo overlay applied, hence the complete hardware description.
As earlier stated we need is the DTS file, but we do have the binary generated from it ,the dtc (Open Firmware device tree compiler).</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>emerge <span class="nt">-av</span> sys-apps/dtc

└[~/postmarketos]&gt; dtc <span class="nt">-I</span> dtb <span class="nt">-O</span> dts <span class="nt">-o</span> ~/postmarketos/gta4l_extracted.dts ~/postmarketos/gta4l_extracted.dtb
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>label_is_string<span class="o">)</span>: /soc/qcom,cam_smmu/msm_cam_smmu_ope:label: property is not a string
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l1@4000:reg: property has invalid length <span class="o">(</span>4 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l2@4100:reg: property has invalid length <span class="o">(</span>4 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l3@4200:reg: property has invalid length <span class="o">(</span>4 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l4@4300:reg: property has invalid length <span class="o">(</span>4 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l5@4400:reg: property has invalid length <span class="o">(</span>4 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l6@4400:reg: property has invalid length <span class="o">(</span>4 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l7@4400:reg: property has invalid length <span class="o">(</span>4 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/lpi_pinctrl@ac40000:reg: property has invalid length <span class="o">(</span>8 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/va-macro@a730000:reg: property has invalid length <span class="o">(</span>8 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/rx-macro@a600000:reg: property has invalid length <span class="o">(</span>8 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>reg_format<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/tx-macro@a620000:reg: property has invalid length <span class="o">(</span>8 bytes<span class="o">)</span> <span class="o">(</span><span class="c">#address-cells == 2, #size-cells == 1)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /memory: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/wake-gic: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,cpufreq-hw: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/ref_gnd: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/vref_1p25: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/die_temp: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/vph_pwr: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/vcoin: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/xo_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/pa_therm0: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/quiet_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/camera_flash_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/vadc@3100/emmc_ufs_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/adc_tm@3500/pa_therm0: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/adc_tm@3500/quiet_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/adc_tm@3500/xo_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/adc_tm@3400/camera_flash_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pm6125@0/adc_tm@3400/emmc_ufs_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/ref_gnd: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/vref_1p25: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/die_temp: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/vph_pwr: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/vbat_sns: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/usb_in_i_uv: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/usb_in_v_div_16: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/chg_temp: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/bat_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/bat_therm_30k: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/bat_therm_400k: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/bat_id: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/i_parallel: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/v_i_int_ext: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/v_i_parallel: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/conn_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/vadc@3100/skin_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@2/adc_tm@3500/skin_therm: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@3/qcom,pwms@b300/lpg@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@3/qcom,pwms@b300/lpg@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,spmi@1c40000/qcom,pmi632@3/qcom,pwms@b300/lpg@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/tpdm@8a26000: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/tpdm@899c000: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/ad-hoc-bus: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/spi@4a80000/novatek@0/novatek-mp-criteria-720C@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/spi@4a80000/novatek@0/novatek-mp-criteria-720E@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/spi@4a80000/novatek@0/novatek-mp-criteria-720F@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/spi@4a80000/novatek@0/novatek-mp-criteria-7215@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,kgsl-3d0@5900000/qcom,gpu-cx-ipeak/qcom,gpu-cx-ipeak@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,kgsl-3d0@5900000/qcom,gpu-cx-ipeak/qcom,gpu-cx-ipeak@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/msm_cdc_pinctrl@18: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/va-macro@a730000/va_swr_master/wcd937x-tx-slave: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/rx-macro@a600000/rx_swr_master/wcd937x-rx-slave: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_dsi0_pll: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_td4330_truly_v2_cmd/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_td4330_truly_v2_cmd/qcom,mdss-dsi-display-timings/timing@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_td4330_truly_v2_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_td4330_truly_v2_video/qcom,mdss-dsi-display-timings/timing@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_nt36525_truly_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_r66451_hd_plus_90hz_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_r66451_hd_plus_90hz_cmd/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102_inx_fhd_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_sim_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_inx_fhd_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_txd_inx_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_hlt_auo_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_txd_auo_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_nt36523_lce_panda_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_nt36523_hlt_auo_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_txd_auo_al_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_lide_hsd_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_nt36523_lide_hsd_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_nt36523_txd_inx_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_ft8201ab_lide_hsd_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_tianma_tianma_al_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_hx83102e_djn_jdi_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_mdp/qcom,mdss_dsi_ft8201ab_tianma_tianma_video/qcom,mdss-dsi-display-timings/timing@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_rotator: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_dsi0_ctrl: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,mdss_dsi_phy0: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,csiphy0: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,csiphy1: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,csiphy2: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,cci0: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/msm_cdc_pinctrl@92: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/msm_cdc_pinctrl@106: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,wb-display@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,msm_notifier@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,camera-flash@0: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,camera-flash@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/qcom,camera-flash@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/sn_fuse: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /soc/sec_boot_fuse: node has a reg or ranges property, but no unit name
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@1/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@1/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@1/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@1/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@2/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@2/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@2/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@2/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@3/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@3/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@3/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@3/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@4/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@4/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@4/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@4/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@5: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@5/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@5/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@5/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@5/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@6: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@6/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@6/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@6/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@6/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@7: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@7/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@7/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@7/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@7/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@8: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@8/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@8/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@8/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@8/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@9: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@9/inputbooster,resource/resource@1: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@9/inputbooster,resource/resource@2: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@9/inputbooster,resource/resource@3: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_vs_reg<span class="o">)</span>: /input_booster/booster_key@9/inputbooster,resource/resource@4: node has a unit name, but no reg or ranges property
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_format<span class="o">)</span>: /soc/ssusb@4e00000/qcom,usbbam@0x04f04000: unit name should not have leading <span class="s2">"0x"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_format<span class="o">)</span>: /soc/ssusb@4e00000/qcom,usbbam@0x04f04000: unit name should not have leading 0s
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_format<span class="o">)</span>: /soc/kgsl-smmu@0x59a0000/gfx_0_tbu@0x59c5000: unit name should not have leading <span class="s2">"0x"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_format<span class="o">)</span>: /soc/apps-smmu@0xc600000/anoc_1_tbu@0xc785000: unit name should not have leading <span class="s2">"0x"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_format<span class="o">)</span>: /soc/apps-smmu@0xc600000/mm_rt_tbu@0xc789000: unit name should not have leading <span class="s2">"0x"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_format<span class="o">)</span>: /soc/apps-smmu@0xc600000/mm_nrt_tbu@0xc78d000: unit name should not have leading <span class="s2">"0x"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unit_address_format<span class="o">)</span>: /soc/apps-smmu@0xc600000/cdsp_tbu@0xc791000: unit name should not have leading <span class="s2">"0x"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>pci_device_reg<span class="o">)</span>: Failed prerequisite <span class="s1">'reg_format'</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>pci_device_bus_num<span class="o">)</span>: Failed prerequisite <span class="s1">'reg_format'</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>simple_bus_reg<span class="o">)</span>: Failed prerequisite <span class="s1">'reg_format'</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>i2c_bus_reg<span class="o">)</span>: Failed prerequisite <span class="s1">'reg_format'</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>spi_bus_reg<span class="o">)</span>: Failed prerequisite <span class="s1">'reg_format'</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l1@4000: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l1@4000: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l2@4100: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l2@4100: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l3@4200: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l3@4200: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l4@4300: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l4@4300: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l5@4400: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l5@4400: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l6@4400: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l6@4400: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l7@4400: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/i2c@4a84000/qcom,pm8008@9/qcom,pm8008-regulator/qcom,pm8008-l7@4400: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/lpi_pinctrl@ac40000: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/lpi_pinctrl@ac40000: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/va-macro@a730000: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/va-macro@a730000: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/rx-macro@a600000: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/rx-macro@a600000: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/tx-macro@a620000: Relying on default <span class="c">#address-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_default_addr_size<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/tx-macro@a620000: Relying on default <span class="c">#size-cells value</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>avoid_unnecessary_addr_size<span class="o">)</span>: Failed prerequisite <span class="s1">'avoid_default_addr_size'</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>unique_unit_address<span class="o">)</span>: Failed prerequisite <span class="s1">'avoid_default_addr_size'</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>gpios_property<span class="o">)</span>: /soc/i2c@4a84000/wsa881x-i2c-codec@e: Missing property <span class="s1">'#gpio-cells'</span> <span class="k">in </span>node /soc/qcom,msm-audio-apr/qcom,q6core-audio/msm_cdc_pinctrl@18 or bad phandle <span class="o">(</span>referred from qcom,wsa-analog-clk-gpio[0]<span class="o">)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>gpios_property<span class="o">)</span>: /soc/i2c@4a84000/wsa881x-i2c-codec@e: Missing property <span class="s1">'#gpio-cells'</span> <span class="k">in </span>node /soc/msm_cdc_pinctrl@106 or bad phandle <span class="o">(</span>referred from qcom,wsa-analog-reset-gpio[0]<span class="o">)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>gpios_property<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/lpi_pinctrl@ac40000: Missing property <span class="s1">'#gpio-cells'</span> <span class="k">in </span>node /soc/qcom,rpm-smd/rpm-regulator-ldoa17/regulator-l17 or bad phandle <span class="o">(</span>referred from qcom,num-gpios[0]<span class="o">)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>gpios_property<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/va-macro@a730000: Missing property <span class="s1">'#gpio-cells'</span> <span class="k">in </span>node /soc/wake-gic or bad phandle <span class="o">(</span>referred from qcom,is-used-swr-gpio[0]<span class="o">)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>gpios_property<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/va-macro@a730000: Missing property <span class="s1">'#gpio-cells'</span> <span class="k">in </span>node /soc/qcom,msm-audio-apr/qcom,q6core-audio/va_swr_clk_data_pinctrl or bad phandle <span class="o">(</span>referred from qcom,va-swr-gpios[0]<span class="o">)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>gpios_property<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/bolero-cdc/rx-macro@a600000: Missing property <span class="s1">'#gpio-cells'</span> <span class="k">in </span>node /soc/qcom,msm-audio-apr/qcom,q6core-audio/rx_swr_clk_data_pinctrl or bad phandle <span class="o">(</span>referred from qcom,rx-swr-gpios[0]<span class="o">)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>gpios_property<span class="o">)</span>: /soc/qcom,msm-audio-apr/qcom,q6core-audio/sound: Missing property <span class="s1">'#gpio-cells'</span> <span class="k">in </span>node /soc/msm_cdc_pinctrl_pri or bad phandle <span class="o">(</span>referred from qcom,pri-mi2s-gpios[0]<span class="o">)</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@2: graph node unit address error, expected <span class="s2">"1"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@3: graph node unit address error, expected <span class="s2">"2"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@4: graph node unit address error, expected <span class="s2">"3"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@5: graph node unit address error, expected <span class="s2">"4"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@6: graph node unit address error, expected <span class="s2">"5"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@7: graph node unit address error, expected <span class="s2">"6"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9800000/ports/port@8: graph node unit address error, expected <span class="s2">"7"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@9832000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@9862000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@98c0000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@9810000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8a04000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8944000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8861000/ports/port@2: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8861000/ports/port@3: graph node unit address error, expected <span class="s2">"1"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@2: graph node unit address error, expected <span class="s2">"1"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@3: graph node unit address error, expected <span class="s2">"5"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@4: graph node unit address error, expected <span class="s2">"7"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@5: graph node unit address error, expected <span class="s2">"8"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@6: graph node unit address error, expected <span class="s2">"a"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@7: graph node unit address error, expected <span class="s2">"c"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@8: graph node unit address error, expected <span class="s2">"d"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tpda@8004000/ports/port@9: graph node unit address error, expected <span class="s2">"f"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8005000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8005000/ports/port@2: graph node unit address error, expected <span class="s2">"6"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8005000/ports/port@3: graph node unit address error, expected <span class="s2">"5"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8005000/ports/port@4: graph node unit address error, expected <span class="s2">"5"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8041000/ports/port@1: graph node unit address error, expected <span class="s2">"5"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8041000/ports/port@2: graph node unit address error, expected <span class="s2">"6"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8041000/ports/port@3: graph node unit address error, expected <span class="s2">"7"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8042000/ports/port@5: graph node unit address error, expected <span class="s2">"6"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8045000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/funnel@8045000/ports/port@2: graph node unit address error, expected <span class="s2">"1"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/tmc@8047000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_port<span class="o">)</span>: /soc/replicator@8046000/ports/port@1: graph node unit address error, expected <span class="s2">"0"</span>
/home/honken/postmarketos/gta4l_extracted.dts: Warning <span class="o">(</span>graph_child_address<span class="o">)</span>: Failed prerequisite <span class="s1">'graph_port'</span>
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/3] <span class="o">[</span>main ⚡]
└[~/postmarketos]&gt; <span class="nb">ls
</span>gta4l_extracted.dtb  gta4l_extracted.dts
</code></pre></div></div>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~/postmarketos-old]&gt; <span class="nb">ls</span> ~/.local/var/pmbootstrap/cache_git/pmaports/device/testing/device-samsung-gta4l/

<span class="c"># Should contain:</span>
<span class="c"># APKBUILD</span>
<span class="c"># deviceinfo</span>
APKBUILD  deviceinfo  modules-initfs
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/1]
└[~/postmarketos-old]&gt; <span class="nb">cat</span> ~/.local/var/pmbootstrap/cache_git/pmaports/device/testing/device-samsung-gta4l/deviceinfo <span class="p">;</span> <span class="nb">cat</span> ~/.local/var/pmbootstrap/cache_git/pmaports/device/testing/device-samsung-gta4l/APKBUILD
<span class="c"># Reference: &lt;https://postmarketos.org/deviceinfo&gt;</span>
<span class="c"># Please use double quotes only. You can source this file in shell</span>
<span class="c"># scripts.</span>

<span class="nv">deviceinfo_format_version</span><span class="o">=</span><span class="s2">"0"</span>
<span class="nv">deviceinfo_name</span><span class="o">=</span><span class="s2">"samsung Samsung Galaxy Tab A7"</span>
<span class="nv">deviceinfo_manufacturer</span><span class="o">=</span><span class="s2">"samsung"</span>
<span class="nv">deviceinfo_codename</span><span class="o">=</span><span class="s2">"samsung-gta4l"</span>
<span class="nv">deviceinfo_year</span><span class="o">=</span><span class="s2">"2020"</span>
<span class="nv">deviceinfo_dtb</span><span class="o">=</span><span class="s2">""</span>
<span class="nv">deviceinfo_arch</span><span class="o">=</span><span class="s2">"aarch64"</span>

<span class="c"># Device related</span>
<span class="nv">deviceinfo_chassis</span><span class="o">=</span><span class="s2">"tablet"</span>
<span class="nv">deviceinfo_external_storage</span><span class="o">=</span><span class="s2">"true"</span>

<span class="c"># Bootloader related</span>
<span class="nv">deviceinfo_flash_method</span><span class="o">=</span><span class="s2">"fastboot"</span>
<span class="nv">deviceinfo_kernel_cmdline</span><span class="o">=</span><span class="s2">""</span>
<span class="nv">deviceinfo_generate_bootimg</span><span class="o">=</span><span class="s2">"true"</span>
<span class="nv">deviceinfo_flash_pagesize</span><span class="o">=</span><span class="s2">"2048"</span>
<span class="nv">deviceinfo_bootimg_qcdt</span><span class="o">=</span><span class="s2">"false"</span>
<span class="nv">deviceinfo_dtb_second</span><span class="o">=</span><span class="s2">"false"</span>
<span class="c"># Reference: &lt;https://postmarketos.org/devicepkg&gt;</span>
<span class="nv">maintainer</span><span class="o">=</span><span class="s2">""</span>
<span class="nv">pkgname</span><span class="o">=</span>device-samsung-gta4l
<span class="nv">pkgdesc</span><span class="o">=</span><span class="s2">"samsung Samsung Galaxy Tab A7"</span>
<span class="nv">pkgver</span><span class="o">=</span>1
<span class="nv">pkgrel</span><span class="o">=</span>0
<span class="nv">url</span><span class="o">=</span><span class="s2">"https://postmarketos.org"</span>
<span class="nv">license</span><span class="o">=</span><span class="s2">"MIT"</span>
<span class="nb">arch</span><span class="o">=</span><span class="s2">"aarch64"</span>
<span class="nv">options</span><span class="o">=</span><span class="s2">"!check !archcheck"</span>
<span class="nv">depends</span><span class="o">=</span><span class="s2">"
        linux-CHANGEME
        mkbootimg
        postmarketos-base
"</span>
<span class="nv">makedepends</span><span class="o">=</span><span class="s2">"devicepkg-dev"</span>
<span class="nb">source</span><span class="o">=</span><span class="s2">"
        deviceinfo
        modules-initfs
"</span>

build<span class="o">()</span> <span class="o">{</span>
        devicepkg_build <span class="nv">$startdir</span> <span class="nv">$pkgname</span>
<span class="o">}</span>

package<span class="o">()</span> <span class="o">{</span>
        devicepkg_package <span class="nv">$startdir</span> <span class="nv">$pkgname</span>
<span class="o">}</span>

<span class="nv">sha512sums</span><span class="o">=</span><span class="s2">"(run 'pmbootstrap checksum device-samsung-gta4l' to fill)"</span>
</code></pre></div></div>

<p>We shall now get a look of the partition table</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>└[~/postmarketos]&gt; fastboot getvar all
<span class="o">(</span>bootloader<span class="o">)</span> battery-part-status:unsupported
<span class="o">(</span>bootloader<span class="o">)</span> cpu-abi:arm64-v8a
<span class="o">(</span>bootloader<span class="o">)</span> super-partition-name:super
<span class="o">(</span>bootloader<span class="o">)</span> battery-voltage:4364
<span class="o">(</span>bootloader<span class="o">)</span> is-force-debuggable:no
<span class="o">(</span>bootloader<span class="o">)</span> treble-enabled:true
<span class="o">(</span>bootloader<span class="o">)</span> is-userspace:yes
<span class="o">(</span>bootloader<span class="o">)</span> max-fetch-size:0x10000000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:userdata:0x577C7BE00
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:cache:0xC800000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:rpm:0x80000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:storsec:0x20000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:mdtp:0x2000000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:ssd:0x40000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:mmcblk0:0x747C00000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:recovery:0x62C0000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:misc:0x100000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:vbmeta:0x10000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:super:0x157000000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:metadata:0x1000000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:dtbo:0x1800000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:boot:0x6000000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:system:0x5F4C9000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:vendor:0x213F0000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:product:0x97757000
<span class="o">(</span>bootloader<span class="o">)</span> partition-size:odm:0x1A0000
<span class="o">(</span>bootloader<span class="o">)</span> version-vndk:
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:userdata:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:cache:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:rpm:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:storsec:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:mdtp:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:ssd:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:mmcblk0:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:recovery:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:misc:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:vbmeta:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:super:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:metadata:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:dtbo:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:boot:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:system:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:vendor:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:product:raw
<span class="o">(</span>bootloader<span class="o">)</span> partition-type:odm:raw
<span class="o">(</span>bootloader<span class="o">)</span> battery-serial-number:unsupported
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:userdata:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:cache:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:rpm:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:storsec:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:mdtp:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:ssd:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:mmcblk0:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:recovery:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:misc:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:vbmeta:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:super:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:metadata:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:dtbo:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:boot:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:system:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:vendor:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:product:no
<span class="o">(</span>bootloader<span class="o">)</span> has-slot:odm:no
<span class="o">(</span>bootloader<span class="o">)</span> security-patch-level:2026-07-01
<span class="o">(</span>bootloader<span class="o">)</span> vendor-fingerprint:samsung/gta4leea/gta4l:12/SP1A.210812.016/T505XXS8CXG1:user/release-keys
<span class="o">(</span>bootloader<span class="o">)</span> hw-revision:0
<span class="o">(</span>bootloader<span class="o">)</span> current-slot:
<span class="o">(</span>bootloader<span class="o">)</span> serialno:R9ZR502N5LJ
<span class="o">(</span>bootloader<span class="o">)</span> product:gta4l
<span class="o">(</span>bootloader<span class="o">)</span> version-os:16
<span class="o">(</span>bootloader<span class="o">)</span> first-api-level:29
<span class="o">(</span>bootloader<span class="o">)</span> slot-count:0
<span class="o">(</span>bootloader<span class="o">)</span> max-download-size:0x10000000
<span class="o">(</span>bootloader<span class="o">)</span> version:0.4
<span class="o">(</span>bootloader<span class="o">)</span> version-baseband:
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:userdata:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:cache:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:rpm:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:storsec:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:mdtp:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:ssd:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:mmcblk0:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:recovery:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:misc:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:vbmeta:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:super:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:metadata:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:dtbo:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:boot:no
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:system:yes
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:vendor:yes
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:product:yes
<span class="o">(</span>bootloader<span class="o">)</span> is-logical:odm:yes
<span class="o">(</span>bootloader<span class="o">)</span> battery-soc:100
<span class="o">(</span>bootloader<span class="o">)</span> secure:yes
<span class="o">(</span>bootloader<span class="o">)</span> dynamic-partition:true
<span class="o">(</span>bootloader<span class="o">)</span> system-fingerprint:samsung/gta4leea/gta4l:12/SP1A.210812.016/T505XXS8CXG1:user/release-keys
<span class="o">(</span>bootloader<span class="o">)</span> version-bootloader:T505XXS8CXG1
<span class="o">(</span>bootloader<span class="o">)</span> unlocked:yes
all:
Finished. Total <span class="nb">time</span>: 0.278s
</code></pre></div></div>
<p>I’m not pasting the heimdall print-pit output, because its not viable here, but we will extract it and it will remain a good source of comparison</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>heimdall print-pit
</code></pre></div></div>

<p>Now we need to clone some important repos, for reference, the device tree from lineage and the android kernel common to the snapdragon 6115.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/LineageOS/android_device_samsung_gta4l
git clone https://github.com/LineageOS/android_kernel_samsung_sm6115
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git <span class="nt">--depth</span><span class="o">=</span>1 <span class="nt">--no-checkout</span>

<span class="c"># Also as this a work spanning across months, its reccommended to run "git pull" once a while to ensure we are working with the latest developments.</span>

</code></pre></div></div>

<p>I would end the part-I with referencing fastboot, adb and heimdall sources, also providing some essential commands.</p>

<pre><code class="language-txt">Official docs:
https://developer.android.com/tools/adb

Source:
https://android.googlesource.com/platform/packages/modules/adb
Official docs:
https://developer.android.com/tools/fastboot

Protocol spec:
https://android.googlesource.com/platform/system/core/+/refs/heads/main/fastboot/README.md

Fastbootd (userspace fastboot) specifically:
https://source.android.com/docs/core/architecture/bootloader/fastbootd

Official repo (Henrik Grimler's maintained fork):
https://gitlab.com/BenjaminDobell/Heimdall

reference:
https://gitlab.com/BenjaminDobell/Heimdall/-/blob/master/README.md 

Flashing guide:
https://wiki.postmarketos.org/wiki/Flashing

Samsung specific:
https://wiki.postmarketos.org/wiki/Samsung_Galaxy_flashing

Samsung Odin protocol (Heimdall is its open implementation):
https://wiki.postmarketos.org/wiki/Odin

PIT file format:
https://wiki.postmarketos.org/wiki/Partition_Information_Table

</code></pre>
<p>Android protocol, runs from recovery (fastbootd) requires LineageOS recovery to be present, Samsung removes it from their vendor distributed/ stock ROM
Fastboot operations-(top choice)</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>fastboot getvar all          <span class="c"># reading partition table</span>
fastboot flash boot boot.img    <span class="c"># flashing boot image</span>
fastboot flash recovery recovery.img  <span class="c"># flashing recovery image</span>
fastboot devices  <span class="c"># device detection</span>
fastboot reboot
fastboot reboot recovery
fastboot reboot bootloader    <span class="c"># reboots to download mode </span>
fastboot get_staged dtbo.img   <span class="c"># needs inquiry from my end</span>
fastboot flash <span class="nt">--read</span> dtbo.img  <span class="c"># needs inquiry</span>
</code></pre></div></div>
<p>Fastboot doesn’t support reading partitions(This oeration is like extracting images and not to be confused with reading partition table, which gives the info of disk structure)</p>

<p>Heimdall is reverse engineered based on Samsung’s Odin protocol, Download mode, always available at hardware level, independent of installed OS
Heimdall operations</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Needs to be in download mode, or else heimdall operations don't work.</span>
heimdall print-pit   <span class="c"># print partition-table</span>
heimdall flash <span class="nt">--BOOT</span> boot.img   <span class="c"># flash boot partition</span>
heimdall flash <span class="nt">--RECOVERY</span> recovery.img    <span class="c"># recovery partition</span>
heimdall download <span class="nt">--BOOT</span> lineage_boot.img   <span class="c"># extracting a partition</span>
heimdall download <span class="nt">--DTBO</span> dtbo.img   <span class="c"># reading dtb partition, heimdall cannot extract dtb from a live running kernel, only adb can do so</span>
heimdall detect   <span class="c"># detect devices</span>
</code></pre></div></div>

<p>Android Debug Bridge, normal boot or recovery requires USB debugging enabled or recovery ADB</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>adb root
adb pull /dev/block/by-name/boot lineage_boot.img

<span class="c"># adb with su</span>
adb shell su <span class="nt">-c</span> <span class="s2">"dd if=/dev/block/by-name/boot of=/sdcard/boot.img"</span>
adb pull /sdcard/boot.img lineage_boot.img

<span class="c"># extracting dtb fom live running kernel</span>
adb pull /sys/firmware/fdt gta4l_extracted.dtb

<span class="c"># ADB with root</span>
adb shell su <span class="nt">-c</span> <span class="s2">"dd if=/dev/block/by-name/DTBO of=/sdcard/dtbo.img"</span>
adb pull /sdcard/dtbo.img <span class="nb">.</span>

adb devices <span class="c"># device detection</span>
</code></pre></div></div>

<p>With this we have setup the toolchain required, and this will mark the end of Part-I from my end.
I’m planning to actually write next on the detection of board configuration from the gta4l tree. Then gather more sources on dts writing conventions of android and linux.
After that we will start writing the dts file for mainline linux kernel, for which we will consider a reference device listed on linus branch, as there are devices that make use of 6115.dts</p>

<p>My idea is to divide the components or peripherals in a hierarchy/priority
p1.Critical-like ufs storage, serial console and usb
p2.usability-touchscreen, display, power keys,..
p3.connectivity-wifi,bluetooth,modem,..
p4.supporting cast-regulators,cast,..</p>

<p>Well its already too long,I shall close it here.</p>

<p>Thankyou !</p>]]></content><author><name>Pratyush Nandi</name></author><category term="Porting" /><category term="documentation" /><summary type="html"><![CDATA[Lately, I’ve been trying to port my android tablet to Postmarket OS, well PostmarketOS (from here on I will refer it as pmos) is a Linux distribution intended for mobile phones. Well pmos lets a user run mainstream linux kernel along with the utilities used by common Linux distributions ranging from init system like systemd to complete desktop environments. Though these utilities are tweaked heavily to suit mobile phone layouts, like Phosh (maintained by pmos community) basically works like gnome for phones, there exists others like plasma-mobile and many window managers. This blog is meant for documenting my journey of my current ongoing work on porting my samsung galaxy tab A7, codenamed : gta4l to postmarket OS.]]></summary></entry><entry><title type="html">Comprehensive guide to Nix on non-nixos systems</title><link href="https://nandiprh.github.io/blog/2026/07/26/Introducing-Nix/" rel="alternate" type="text/html" title="Comprehensive guide to Nix on non-nixos systems" /><published>2026-07-26T00:00:00+00:00</published><updated>2026-07-26T00:00:00+00:00</updated><id>https://nandiprh.github.io/blog/2026/07/26/Introducing-Nix</id><content type="html" xml:base="https://nandiprh.github.io/blog/2026/07/26/Introducing-Nix/"><![CDATA[<p>So lately I’ve been getting more interested in android, its layout and its handling of packages. 
I remember 2 years back when I stepped into the worlld of programming, I was enthusiastic about OS, and eventually I discovered NixOS. The fact being I really liked the idea of the OS being declarative, reproducible and upgrades being atomic.
But I ran into serious learning curve quite early, with problems being most of the projects I tried running had their own compiling instructions, and those expected shared libraries via UNIX FHS(File hierarchy system).
Well the Nix community had the answers in the form of a dedicated flake file that described the entire build environment along with the nixpkgs required.
But well it works great if had I been fluent in Nix and the template it followed.</p>

<p>Eventually I ditched NixOS and distrohopped a lot, in this process I grasped some of the Linux specific concepts, along with multitudes of applications that bundled with the Linux kernel to make it usable as a distribution.
So I adopted a hybrid approach, using Nix in Gentoo !
The fact being all the system level packages being installed by portage via Gentoo repo and user level applications via Nixpkgs. This let me access nix shell, nix build and nix develop, but also the tradeoff being loosing the Nixos generation rollbacks and a good level of declarativity that was only possible in NixOS.
But the plus point being gaining access to the FHS again.
For the very fact I switched from Openrc to systemd to gain more of nix automation of declaring daemons, as nix being tightly coupled with systemd as an init system.</p>

<p>For a multi user installation, it is important for every user to have access to a main nix conf which is situated in /etc/nix/nix.conf , further user level changes can be invoked in ~/.config/nix for a single user.
Also nix never gives a user permit to build nixpkgs or a better term would be nix derivations. It is handled by nix builders, the number of nix builders can be defined in nix.conf to tightly couple it with available cpu cores, or else the default builders remain 8 in number.
Unlike Gentoo’s portage whose historial behaviour has been compiling from source, nix uses cachix to rather install nixpkgs via cache.nixos.org .</p>

<p>Well a very important distinction is to separate the fact that rather than treating nix as a package manager it is foremost a buil system in my opinion, and thus nix doesn’t really have a concept of package distribution via repositories. Rather the conventional method is to use nix channels and define one of either the current release of NixOS or the unstable one.
For users who choose to proceed via flakes (has been experimental since a decade, but around 70%(rough estimate, source: trust me bro!) of users utilise this feature), which introduces a great concept of lock file along with flake registry to decide the input and output.
The lock file makes reproducibility pinned via version locking with the help of flake.lock (auto generated via flake.nix, and must be treated as a readonly file.), well this was inspired by Rust’s cargo , and the way it pinned versions of crates in a toml file.</p>

<p>The nix.conf file I use in my system.</p>

<div class="language-nix highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">build-users-group</span> <span class="o">=</span> <span class="nv">nixbld</span>
<span class="nv">experimental-features</span> <span class="o">=</span> <span class="nv">nix-command</span> <span class="nv">flakes</span>

<span class="nv">max-jobs</span> <span class="o">=</span> <span class="nv">auto</span>                                         <span class="c"># use all cores for parallel builds</span>
<span class="nv">cores</span> <span class="o">=</span> <span class="mi">0</span>                                               <span class="c"># 0 = use all cores per job</span>
<span class="c">#build-dir = /tmp/nix-build                             # build on tmpfs if you have RAM to spare</span>

<span class="nv">builders-use-substitutes</span> <span class="o">=</span> <span class="kc">true</span>

<span class="nv">min-free</span> <span class="o">=</span> <span class="mi">1073741824</span>                                   <span class="c"># trigger GC when &lt; 1GB free (in bytes)</span>
<span class="nv">max-free</span> <span class="o">=</span> <span class="mi">5368709120</span>                                   <span class="c"># stop GC when 5GB is free</span>
<span class="nv">auto-optimise-store</span> <span class="o">=</span> <span class="kc">true</span>                              <span class="c"># hardlink identical files in store</span>

<span class="nv">sandbox</span> <span class="o">=</span> <span class="kc">true</span>
<span class="nv">sandbox-fallback</span> <span class="o">=</span> <span class="kc">false</span>                                <span class="c"># don't silently disable sandbox on failure</span>
<span class="nv">extra-sandbox-paths</span> <span class="o">=</span> <span class="sx">/etc/ssl/certs</span> <span class="sx">/etc/resolv.conf</span>   <span class="c"># network builds need these</span>

<span class="nv">allow-import-from-derivation</span> <span class="o">=</span> <span class="kc">false</span>                    <span class="c"># stricter, catches impure eval patterns</span>
<span class="nv">pure-eval</span> <span class="o">=</span> <span class="kc">false</span>                                       <span class="c"># set true per-command if you want strictness</span>
<span class="nv">restrict-eval</span> <span class="o">=</span> <span class="kc">false</span>

<span class="nv">log-lines</span> <span class="o">=</span> <span class="mi">50</span>                                          <span class="c"># show more context on build failure</span>
<span class="nv">show-trace</span> <span class="o">=</span> <span class="kc">true</span>                                       <span class="c"># full eval trace on errors (very useful)</span>

<span class="nv">keep-outputs</span> <span class="o">=</span> <span class="kc">true</span>                                     <span class="c"># keep build deps (useful for dev shells)</span>
<span class="nv">keep-derivations</span> <span class="o">=</span> <span class="kc">true</span>                                 <span class="c"># keep .drv files for debugging</span>

<span class="nv">ssl-cert-file</span> <span class="o">=</span> <span class="sx">/etc/ssl/certs/ca-certificates.crt</span>

</code></pre></div></div>

<p>But this file just cannot handle every nix feature, the ni ecosystem has to offer. Sure this is enough to invoke and install packages via the traditional method of nix-env -iA <pkgname> or using nix profile, but we need is a mechanism that allows it tobe declarative.
On non-nixos system the best way to handle this is home-manager module, but before that we need to setup is a flake registry, that defines the sources from where the nix expressions would be allowed for a user.</pkgname></p>

<p>In my system I prefer to define both the flake registry and home-manager file in a single directory, which is ~/.config/home-manager, though it can be defined in any directory the user decides to.</p>

<p>My complete flake registry</p>

<div class="language-nix highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span>
  <span class="nv">description</span> <span class="o">=</span> <span class="s2">"Home Manager configuration of Pratyush"</span><span class="p">;</span>

  <span class="nv">inputs</span> <span class="o">=</span> <span class="p">{</span>
    <span class="c"># Specify the source of Home Manager and Nixpkgs.</span>
    <span class="nv">nixpkgs</span><span class="o">.</span><span class="nv">url</span> <span class="o">=</span> <span class="s2">"github:nixos/nixpkgs/nixpkgs-unstable"</span><span class="p">;</span>

    <span class="nv">home-manager</span> <span class="o">=</span> <span class="p">{</span>
      <span class="nv">url</span> <span class="o">=</span> <span class="s2">"github:nix-community/home-manager"</span><span class="p">;</span>
      <span class="nv">inputs</span><span class="o">.</span><span class="nv">nixpkgs</span><span class="o">.</span><span class="nv">follows</span> <span class="o">=</span> <span class="s2">"nixpkgs"</span><span class="p">;</span>
    <span class="p">};</span>

    <span class="nv">nixgl</span> <span class="o">=</span> <span class="p">{</span>
      <span class="nv">url</span> <span class="o">=</span> <span class="s2">"github:nix-community/nixGL"</span><span class="p">;</span>
      <span class="nv">inputs</span><span class="o">.</span><span class="nv">nixpkgs</span><span class="o">.</span><span class="nv">follows</span> <span class="o">=</span> <span class="s2">"nixpkgs"</span><span class="p">;</span>
    <span class="p">};</span>

     <span class="nv">nur</span> <span class="o">=</span> <span class="p">{</span>
      <span class="nv">url</span> <span class="o">=</span> <span class="s2">"github:nix-community/NUR"</span><span class="p">;</span>
      <span class="nv">inputs</span><span class="o">.</span><span class="nv">nixpkgs</span><span class="o">.</span><span class="nv">follows</span> <span class="o">=</span> <span class="s2">"nixpkgs"</span><span class="p">;</span>
    <span class="p">};</span>

    <span class="nv">caelestia-shell</span> <span class="o">=</span> <span class="p">{</span>
      <span class="nv">url</span> <span class="o">=</span> <span class="s2">"github:caelestia-dots/shell"</span><span class="p">;</span>
      <span class="nv">inputs</span><span class="o">.</span><span class="nv">nixpkgs</span><span class="o">.</span><span class="nv">follows</span> <span class="o">=</span> <span class="s2">"nixpkgs"</span><span class="p">;</span>
    <span class="p">};</span>

  <span class="p">};</span>

  <span class="nv">outputs</span> <span class="o">=</span>
    <span class="nv">inputs</span><span class="o">@</span><span class="p">{</span> <span class="nv">nixpkgs</span><span class="p">,</span> <span class="nv">home-manager</span><span class="p">,</span> <span class="nv">nixgl</span><span class="p">,</span> <span class="nv">nur</span><span class="p">,</span> <span class="nv">caelestia-shell</span><span class="p">,</span> <span class="o">...</span> <span class="p">}:</span>
    <span class="kd">let</span>
      <span class="nv">pkgs</span> <span class="o">=</span> <span class="kr">import</span> <span class="nv">nixpkgs</span> <span class="p">{</span>
        <span class="nv">system</span> <span class="o">=</span> <span class="s2">"x86_64-linux"</span><span class="p">;</span>
        <span class="c">#pkgs = nixpkgs.legacyPackages.${system};</span>
        <span class="nv">overlays</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">nixgl</span><span class="o">.</span><span class="nv">overlay</span> <span class="p">];</span>
      <span class="p">};</span>
    <span class="kn">in</span>
    <span class="p">{</span>
      <span class="nv">homeConfigurations</span><span class="o">.</span><span class="nv">honken</span> <span class="o">=</span> <span class="nv">home-manager</span><span class="o">.</span><span class="nv">lib</span><span class="o">.</span><span class="nv">homeManagerConfiguration</span> <span class="p">{</span>
        <span class="kn">inherit</span> <span class="nv">pkgs</span><span class="p">;</span>

        <span class="c"># Specify your home configuration modules here, for example,</span>
        <span class="c"># the path to your home.nix.</span>
        <span class="nv">modules</span> <span class="o">=</span> <span class="p">[</span> <span class="sx">./home.nix</span> <span class="p">];</span>

        <span class="nv">extraSpecialArgs</span> <span class="o">=</span> <span class="p">{</span> <span class="kn">inherit</span> <span class="nv">inputs</span><span class="p">;</span> <span class="p">};</span>
      <span class="p">};</span>
    <span class="p">};</span>
<span class="p">}</span>

</code></pre></div></div>

<p>One of the special inputs thats defined here is it defines unstable channel as the nixpkg input source. The home manager module and NUR(nix user repository), and nixgl.
The biggest caveat most of the standalone nix users face is that cli applications run flawlessly like any native package, but the gui applications abort due to non availability of openGL related sources, that are utilised via shared libs in a traditional distriubution.Since every nixpkg is isolated in /nix, there isn’t a streamlined way to share them among each other in the nix sandboxed environment, without creating a flake that defines a particular environment.
The NixGL project works as a wrapper to this gui applications to let the nixpkgs access the graphics driver of the system. This can be defined as a generic graphics driver or particularly for Intel via the mesa-opengl, nvidia and even AMD.</p>

<p>More info here: https://github.com/nix-community/nixgl</p>

<p>In a nix shell, the wrapper can be passed along with a gui application say xyz, in the form of nixGL xyz (For applications utilising openGL) or nixVulkan xyz (for modern applications utilising vulkan).</p>

<p>But the issue being home manager being declarative, and usually doesn’t allow direct bindings as such, thus it requires a wrapper script be defined.</p>

<div class="language-nix highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span> <span class="nv">config</span><span class="p">,</span> <span class="nv">pkgs</span><span class="p">,</span> <span class="nv">inputs</span><span class="p">,</span><span class="o">...</span> <span class="p">}:</span>

<span class="kd">let</span>
  <span class="nv">nixGLWrap</span> <span class="o">=</span> <span class="nv">pkg</span><span class="p">:</span> <span class="nv">pkgs</span><span class="o">.</span><span class="nv">runCommand</span> <span class="s2">"</span><span class="si">${</span><span class="nv">pkg</span><span class="o">.</span><span class="nv">name</span><span class="si">}</span><span class="s2">-nixgl"</span> <span class="p">{}</span> <span class="s2">''</span><span class="err">
</span><span class="s2">    mkdir -p $out/bin $out/share/applications</span><span class="err">
</span><span class="s2">    for bin in </span><span class="si">${</span><span class="nv">pkg</span><span class="si">}</span><span class="s2">/bin/*; do</span><span class="err">
</span><span class="s2">      binname=$(basename $bin)</span><span class="err">
</span><span class="s2">      cat &gt; $out/bin/$binname &lt;&lt; EOF</span><span class="err">
</span><span class="s2">#!/bin/sh</span><span class="err">
</span><span class="s2">exec </span><span class="si">${</span><span class="nv">pkgs</span><span class="o">.</span><span class="nv">nixgl</span><span class="o">.</span><span class="nv">nixGLIntel</span><span class="si">}</span><span class="s2">/bin/nixGLIntel $bin "\$@"</span><span class="err">
</span><span class="s2">EOF</span><span class="err">
</span><span class="s2">      chmod +x $out/bin/$binname</span><span class="err">
</span><span class="s2">    done</span><span class="err">
</span><span class="s2">    if [ -d </span><span class="si">${</span><span class="nv">pkg</span><span class="si">}</span><span class="s2">/share/applications ]; then</span><span class="err">
</span><span class="s2">      for d in </span><span class="si">${</span><span class="nv">pkg</span><span class="si">}</span><span class="s2">/share/applications/*.desktop; do</span><span class="err">
</span><span class="s2">        sed "s|Exec=</span><span class="si">${</span><span class="nv">pkg</span><span class="si">}</span><span class="s2">/bin/|Exec=$out/bin/|g" $d \</span><span class="err">
</span><span class="s2">          &gt; $out/share/applications/$(basename $d)</span><span class="err">
</span><span class="s2">      done</span><span class="err">
</span><span class="s2">    fi</span><span class="err">
</span><span class="s2">  ''</span><span class="p">;</span>
<span class="kn">in</span>

<span class="p">{</span>
  <span class="nv">home</span><span class="o">.</span><span class="nv">username</span> <span class="o">=</span> <span class="s2">"honken"</span><span class="p">;</span>
  <span class="nv">home</span><span class="o">.</span><span class="nv">homeDirectory</span> <span class="o">=</span> <span class="s2">"/home/honken"</span><span class="p">;</span>
  <span class="nv">home</span><span class="o">.</span><span class="nv">stateVersion</span> <span class="o">=</span> <span class="s2">"26.05"</span><span class="p">;</span>

  <span class="nv">nixpkgs</span><span class="o">.</span><span class="nv">config</span><span class="o">.</span><span class="nv">allowUnfree</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

  <span class="nv">home</span><span class="o">.</span><span class="nv">packages</span> <span class="o">=</span> <span class="kn">with</span> <span class="nv">pkgs</span><span class="p">;</span> <span class="p">[</span>
    <span class="nv">ripgrep</span>
    <span class="nv">fd</span>
    <span class="nv">btop</span>
    <span class="nv">htop</span>
    <span class="nv">thunderbird</span>
    <span class="p">(</span><span class="nv">nixGLWrap</span> <span class="nv">librepods</span><span class="p">)</span>
    <span class="nv">gimp</span>
    <span class="nv">opencode</span>
    <span class="nv">weechat</span>
    <span class="nv">aria2</span>
    <span class="nv">elinks</span>
    <span class="nv">dconf</span>
    <span class="nv">qutebrowser</span>
    <span class="nv">yt-dlp</span>
    <span class="nv">gallery-dl</span>
    <span class="p">(</span><span class="nv">nixGLWrap</span> <span class="nv">brave</span><span class="p">)</span>
    <span class="nv">alpaca</span>
    <span class="nv">blanket</span>
    <span class="nv">libreoffice</span>
    <span class="p">(</span><span class="nv">nixGLWrap</span> <span class="nv">jellyfin-desktop</span><span class="p">)</span>
    <span class="nv">baobab</span>
    <span class="nv">showtime</span>
    <span class="nv">decibels</span>
    <span class="p">(</span><span class="nv">nixGLWrap</span> <span class="nv">chromium</span><span class="p">)</span>
    <span class="nv">proton-pass</span>
    <span class="nv">gnome-firmware</span>
    <span class="nv">gnome-calendar</span>
    <span class="nv">gnome-clocks</span>
    <span class="nv">gnome-system-monitor</span>
    <span class="nv">gnome-weather</span>
    <span class="p">(</span><span class="nv">nixGLWrap</span> <span class="nv">sushi</span><span class="p">)</span>
    <span class="p">(</span><span class="nv">nixGLWrap</span> <span class="nv">obs-studio</span><span class="p">)</span>
    <span class="p">(</span><span class="nv">nixGLWrap</span> <span class="nv">vlc</span><span class="p">)</span>
    <span class="nv">gowall</span>
   <span class="c"># fdroidserver</span>
    <span class="nv">android-studio</span>
    <span class="nv">halloy</span>
  <span class="p">];</span>

  <span class="c"># Git</span>
  <span class="nv">programs</span><span class="o">.</span><span class="nv">git</span> <span class="o">=</span> <span class="p">{</span>
    <span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="nv">settings</span><span class="o">.</span><span class="nv">user</span> <span class="o">=</span> <span class="p">{</span>
        <span class="nv">name</span> <span class="o">=</span> <span class="s2">"Pratyush"</span><span class="p">;</span>
        <span class="nv">email</span> <span class="o">=</span> <span class="s2">"nandipratyush1917@gmail.com"</span><span class="p">;</span>
        <span class="p">};</span>
  <span class="p">};</span>

  <span class="c"># Shell</span>
  <span class="nv">programs</span><span class="o">.</span><span class="nv">zsh</span> <span class="o">=</span> <span class="p">{</span>
      <span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
      <span class="nv">autosuggestion</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
      <span class="nv">syntaxHighlighting</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

      <span class="nv">oh-my-zsh</span> <span class="o">=</span> <span class="p">{</span>
      <span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
      <span class="nv">plugins</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"git"</span> <span class="s2">"docker"</span> <span class="p">];</span>
      <span class="nv">theme</span> <span class="o">=</span> <span class="s2">"darkblood"</span><span class="p">;</span>
      <span class="p">};</span>
  <span class="p">};</span>

  <span class="c"># Enable fzf and automatically hook it into Zsh</span>
  <span class="nv">programs</span><span class="o">.</span><span class="nv">fzf</span> <span class="o">=</span> <span class="p">{</span>
    <span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="nv">enableZshIntegration</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="p">};</span>

  <span class="nv">wayland</span><span class="o">.</span><span class="nv">windowManager</span><span class="o">.</span><span class="nv">sway</span> <span class="o">=</span> <span class="p">{</span>
      <span class="nv">systemd</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
      <span class="nv">xwayland</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="p">};</span>

  <span class="nv">programs</span><span class="o">.</span><span class="nv">home-manager</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="nv">targets</span><span class="o">.</span><span class="nv">genericLinux</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="nv">xdg</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="nv">xdg</span><span class="o">.</span><span class="nv">mime</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="nv">targets</span><span class="o">.</span><span class="nv">genericLinux</span><span class="o">.</span><span class="nv">gpu</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="nv">targets</span><span class="o">.</span><span class="nv">genericLinux</span><span class="o">.</span><span class="nv">nixGL</span><span class="o">.</span><span class="nv">defaultWrapper</span> <span class="o">=</span> <span class="s2">"mesa"</span><span class="p">;</span>
  <span class="nv">targets</span><span class="o">.</span><span class="nv">genericLinux</span><span class="o">.</span><span class="nv">nixGL</span><span class="o">.</span><span class="nv">vulkan</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="nv">systemd</span><span class="o">.</span><span class="nv">user</span><span class="o">.</span><span class="nv">sessionVariables</span> <span class="o">=</span> <span class="nv">config</span><span class="o">.</span><span class="nv">home</span><span class="o">.</span><span class="nv">sessionVariables</span><span class="p">;</span>

  <span class="c"># For electron apps to use wayland server instead of xwayland</span>
  <span class="nv">home</span><span class="o">.</span><span class="nv">sessionVariables</span> <span class="o">=</span> <span class="p">{</span>
  <span class="nv">NIXOS_OZONE_WL</span> <span class="o">=</span> <span class="s2">"1"</span><span class="p">;</span>
  <span class="p">};</span>

  <span class="nv">qt</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
  <span class="nv">gtk</span><span class="o">.</span><span class="nv">enable</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

<span class="p">}</span>

</code></pre></div></div>

<p>To apply changes</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>home-manager switch <span class="nt">--flake</span> ~/.config/home-manager#honken
</code></pre></div></div>
<p>The standard command is “home-manager switch –flake &lt;directory name(can be relative or absolute)&gt;#<user>"
Note: Read the output of home-manager switch properly, you may also choose to backup the file with the -b parameter. During home manager switching a lot of times adding newer gui applications requires the graphics driver to be updated.
That is relayed by home-manager which is usually "sudo <path to="" nix="" store="">".</path></user></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/3]
└[~]&gt; home-manager switch <span class="nt">--flake</span> ~/.config/home-manager#honken
warning: Git tree <span class="s1">'/home/honken/.config/home-manager'</span> is dirty
evaluation warning: <span class="s1">'system'</span> has been renamed to/replaced by <span class="s1">'stdenv.hostPlatform.system'</span>
Starting Home Manager activation
Activating checkExistingGpuDrivers
GPU drivers require an update, run
  <span class="nb">sudo</span> /nix/store/cpj89f3jpz68dg8yrj89qgf2k2jr4mli-non-nixos-gpu/bin/non-nixos-gpu-setup
Activating checkFilesChanged
Activating checkLinkTargets
Please <span class="k">do </span>one of the following:
- In standalone mode, use <span class="s1">'home-manager switch -b backup'</span> to back up files automatically.
- When used as a NixOS or nix-darwin module, <span class="nb">set </span>either
  - <span class="s1">'home-manager.backupFileExtension'</span>, or
  - <span class="s1">'home-manager.backupCommand'</span>,
  to move the file to a new location <span class="k">in </span>the same directory, or run a custom command.
- Set <span class="s1">'force = true'</span> on the related file options to forcefully overwrite the files below. eg. <span class="s1">'xdg.configFile."mimeapps.list".force = true'</span>
Existing file <span class="s1">'/home/honken/.config/user-dirs.dirs'</span> would be clobbered
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/3] <span class="o">[</span>1]
└[~]&gt;  <span class="nb">sudo</span> /nix/store/cpj89f3jpz68dg8yrj89qgf2k2jr4mli-non-nixos-gpu/bin/non-nixos-gpu-setup
</code></pre></div></div>

<p>As a particular note, unlike NixOS, on non-nixos systems it cannot replicate system level fuctionalities, because other users cannot access the nixpkgs installed by another user, which is a part of nix security framework.
Though every package resides in /nix, these are hashed, alongwith the fact that in NixOS, /etc is just a symlink to a file in defined in the nix store.
Therefore it limits functionalities like a full fledged desktop environment or running systemd service via elevated privileges.</p>

<p>A rather common example is ssl/tls cert error.
In my Gentoo system, after a long time update, ssl and tls certs need manual update,as it gives choices to preserve either the old certs, merge them or completely discard them.
A better way of dealing with such errors are:</p>

<p>An example error -</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
└[~]&gt; nix shell nixpkgs#mpv
warning: unable to download <span class="s1">'https://channels.nixos.org/flake-registry.json'</span>: Problem with the SSL CA cert <span class="o">(</span>path? access rights?<span class="o">)</span> <span class="o">(</span>77<span class="o">)</span> error adding trust anchors from file: /etc/ssl/certs/ca-certificates.crt<span class="p">;</span> using cached version
error:
       … <span class="k">while </span>fetching the input <span class="s1">'https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz'</span>
       error: Failed to open archive <span class="o">(</span>Source threw exception: error: unable to download <span class="s1">'https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz'</span>: Problem with the SSL CA cert <span class="o">(</span>path? access rights?<span class="o">)</span> <span class="o">(</span>77<span class="o">)</span> error adding trust anchors from file: /etc/ssl/certs/ca-certificates.crt<span class="o">)</span><span class="nb">.</span>  

</code></pre></div></div>

<p>To resolve this:</p>
<ol>
  <li>check if the newer certs exist and if they aren’t empty</li>
  <li>list all the certs available</li>
  <li>get info about the certificates</li>
  <li>Check if the certs work via curl</li>
</ol>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>honken@Pratyush-PC] <span class="o">[</span>/dev/pts/0]
└[~]&gt; <span class="nb">ls</span> <span class="nt">-la</span> /etc/ssl/certs/ca-certificates.crt
<span class="nb">wc</span> <span class="nt">-l</span> /etc/ssl/certs/ca-certificates.crt
<span class="nt">-rw-r--r--</span> 1 root root 0 Jul 26 15:44 /etc/ssl/certs/ca-certificates.crt
0 /etc/ssl/certs/ca-certificates.crt
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/0]
└[~]&gt; equery list ca-certificates
 <span class="k">*</span> Searching <span class="k">for </span>ca-certificates ...
<span class="o">[</span>IP-] <span class="o">[</span>  <span class="o">]</span> app-misc/ca-certificates-20260223.3.112.4-r1:0
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/0]
└[~]&gt; <span class="nb">stat</span> /etc/ssl/certs/ca-certificates.crt
  File: /etc/ssl/certs/ca-certificates.crt
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 0,37    Inode: 33467139    Links: 1
Access: <span class="o">(</span>0644/-rw-r--r--<span class="o">)</span>  Uid: <span class="o">(</span>    0/    root<span class="o">)</span>   Gid: <span class="o">(</span>    0/    root<span class="o">)</span>
Access: 2026-07-11 21:49:58.032469032 +0530
Modify: 2026-07-26 15:44:46.262194686 +0530
Change: 2026-07-26 15:44:46.262194686 +0530
 Birth: 2026-07-11 21:49:58.032469032 +0530
┌[honken@Pratyush-PC] <span class="o">[</span>/dev/pts/0]
└[~]&gt; curl <span class="nt">-v</span> https://channels.nixos.org/flake-registry.json <span class="nt">-o</span> /dev/null
<span class="k">*</span> Host channels.nixos.org:443 was resolved.
<span class="k">*</span> IPv6: 2a04:4e42:25::347
<span class="k">*</span> IPv4: 151.101.209.91
<span class="k">*</span> HTTPS-RR: 0 <span class="nb">.</span>
<span class="k">*</span>   Trying <span class="o">[</span>2a04:4e42:25::347]:443...
<span class="k">*</span> ALPN: curl offers h2,http/1.1
<span class="o">}</span> <span class="o">[</span>5 bytes data]
<span class="k">*</span> TLSv1.3 <span class="o">(</span>OUT<span class="o">)</span>, TLS handshake, Client hello <span class="o">(</span>1<span class="o">)</span>:
<span class="o">}</span> <span class="o">[</span>1564 bytes data]
<span class="k">*</span> SSL Trust Anchors:
<span class="k">*</span> error adding trust anchors from file: /etc/ssl/certs/ca-certificates.crt
<span class="k">*</span> SSL Trust Anchors:
<span class="k">*</span> error adding trust anchors from file: /etc/ssl/certs/ca-certificates.crt
<span class="k">*</span> closing connection <span class="c">#0</span>
curl: <span class="o">(</span>77<span class="o">)</span> error adding trust anchors from file: /etc/ssl/certs/ca-certificates.crt
</code></pre></div></div>

<p>In gentoo linux, the upstream solution is to update ca-certificates manually or use dispatch-conf to edit changes in /etc . In general dispatch-conf method is bound to fail here as these certificates are distriburted by Mozilla.
So to check if the certs are actually installed</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">ls</span> /usr/share/ca-certificates/mozilla/ | <span class="nb">wc</span> <span class="nt">-l</span>
</code></pre></div></div>
<p>If the above number is non-zero that means the certs exist, and are available for the system.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>update-ca-certificates
</code></pre></div></div>
<p>Then the existence and working can be verified via</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>~]&gt; <span class="nb">wc</span> <span class="nt">-l</span> /etc/ssl/certs/ca-certificates.crt
curl <span class="nt">-sI</span> https://channels.nixos.org/flake-registry.json
3532 /etc/ssl/certs/ca-certificates.crt
HTTP/2 200
cache-control: max-age<span class="o">=</span>300
content-security-policy: default-src <span class="s1">'none'</span><span class="p">;</span> style-src <span class="s1">'unsafe-inline'</span><span class="p">;</span> sandbox
content-type: text/plain<span class="p">;</span> <span class="nv">charset</span><span class="o">=</span>utf-8
etag: <span class="s2">"1aafb6e6c07c1dd62e0e90683d9a5b9ac410cb9628e1cca8f4c8fd275e48e875"</span>
strict-transport-security: max-age<span class="o">=</span>31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1<span class="p">;</span> <span class="nv">mode</span><span class="o">=</span>block
x-github-request-id: 16E6:261A5D:2A575D:6C7756:6A65FBBD
via: 1.1 varnish, 1.1 varnish
x-timer: S1785068479.888953,VS0,VE216
cross-origin-resource-policy: cross-origin
x-fastly-request-id: d951300431378566cb74e4bebad996b6f8698dee
expires: Sun, 26 Jul 2026 12:26:19 GMT
source-age: 0
access-control-allow-origin: <span class="k">*</span>
accept-ranges: bytes
age: 0
<span class="nb">date</span>: Sun, 26 Jul 2026 12:21:19 GMT
x-served-by: cache-bom-vanm7210037-BOM, cache-bom-vanm7210051-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
vary: Authorization,Accept-Encoding
content-length: 9653
</code></pre></div></div>

<p>Thankyou !</p>]]></content><author><name>Pratyush Nandi</name></author><category term="networking" /><category term="security" /><summary type="html"><![CDATA[So lately I’ve been getting more interested in android, its layout and its handling of packages. I remember 2 years back when I stepped into the worlld of programming, I was enthusiastic about OS, and eventually I discovered NixOS. The fact being I really liked the idea of the OS being declarative, reproducible and upgrades being atomic. But I ran into serious learning curve quite early, with problems being most of the projects I tried running had their own compiling instructions, and those expected shared libraries via UNIX FHS(File hierarchy system). Well the Nix community had the answers in the form of a dedicated flake file that described the entire build environment along with the nixpkgs required. But well it works great if had I been fluent in Nix and the template it followed.]]></summary></entry><entry><title type="html">Just starting afresh a bit organised</title><link href="https://nandiprh.github.io/blog/2026/07/01/starting/" rel="alternate" type="text/html" title="Just starting afresh a bit organised" /><published>2026-07-01T00:00:00+00:00</published><updated>2026-07-01T00:00:00+00:00</updated><id>https://nandiprh.github.io/blog/2026/07/01/starting</id><content type="html" xml:base="https://nandiprh.github.io/blog/2026/07/01/starting/"><![CDATA[<p>I kind of started this blog for using it as notes honestly, as time passed I felt its really better to document it on github, so on a new machine I don’t need to scratch my head around for finding sources and documentation. 
For others if they are reading it, honestly I don’t intend to explain in depth, its meant for my understanding and I usually enjoy doing this stuff.But please reach out if you find any errors, we can connect on mastodon !</p>

<p>well currently Im going to document porting guides and system level optimisations for gentoo along with scripts I use with nix package manager.Which includes compiler optimisations via llvm/clang and using GCC as fallback if aggressive optimisations alongwith other linkers break package compilation.</p>

<p>Porting guides include the porting of my galaxy tablet A7 to derfest(a popular custom ROM) and most importantly my work on progress of porting it to postmarketOS running via mainline kernel, which drastically differs from running via downstream kernel.</p>

<p>My Interests lie towards systems programming honestly, tho currently Im learning it on my own, but you may check out my review papers and the respective source codes of the simulators and programs Ive used for demonstration.</p>

<p>Thankyou !</p>]]></content><author><name>Pratyush Nandi</name></author><category term="meta" /><summary type="html"><![CDATA[I kind of started this blog for using it as notes honestly, as time passed I felt its really better to document it on github, so on a new machine I don’t need to scratch my head around for finding sources and documentation. For others if they are reading it, honestly I don’t intend to explain in depth, its meant for my understanding and I usually enjoy doing this stuff.But please reach out if you find any errors, we can connect on mastodon !]]></summary></entry></feed>