Hacker News new | ask | show | jobs
by tcrenshaw 703 days ago
It's possible to run postmarketos in a proot within termux on android if you'd like to try it out or just want a nice touch enabled Linux UI on your phone/tablet. There are some incomplete instructions for an older version of postmarketos on the termux subreddit, I'm currently working on an updated and cleaner version.
1 comments

Oh, cool; that would be really nice for lowering friction, and honestly it might be a nice thing to have in termux outright (even if you're still using Android on a long-term basis). I wonder how hard it would be to get postmarketos added as an official option through https://github.com/termux/proot-distro/tree/master - seems like it should be straightforward? There's already an Alpine config, and PMOS is pretty close to that
Okay, got curious and played with it... it seems like just this will do it?

    /data/data/com.termux/files/usr/etc/proot-distro/alpine-pmos.sh


    DISTRO_NAME="Alpine Linux with postmarketos added"
    DISTRO_COMMENT="Rolling release branch (edge)."

    TARBALL_URL['aarch64']="https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/aarch64/alpine-minirootfs-3.20.2-aarch64.tar.gz"
    TARBALL_SHA256['aarch64']="6ae4d30a75dacd5991a1c1ab13453a119b54a437d236b1680b6d844f015d141b"

    # based on https://github.com/termux/proot-distro/blob/master/distro-build/alpine.sh
    distro_setup() {
        mv ./etc/apk/repositories ./etc/apk/repositories.initial
        echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" > ./etc/apk/repositories
        echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> ./etc/apk/repositories
        echo "https://mirror.postmarketos.org/postmarketos/master" >> ./etc/apk/repositories
        run_proot_cmd wget -O /etc/apk/keys/build.postmarketos.org.rsa.pub https://gitlab.com/postmarketOS/pmbootstrap/raw/master/pmb/data/keys/build.postmarketos.org.rsa.pub
        run_proot_cmd apk upgrade
        run_proot_cmd apk add shadow-login
        #run_proot_cmd ln -sf /var/cache/apk /etc/apk/cache  # ?
    }
If you're talking about guides and cleanup and such, I'm concerned that I've missed something - is it not just that easy? If I was publishing a wiki page or something, literally the only things I'd include would be the initial step to install proot-distro in the first place, and fleshing out the rest of the tarball urls so it works on more than aarch64.