UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Fuseteam
    Offline
    • Profile
    • Following 0
    • Followers 2
    • Topics 3
    • Posts 59
    • Groups 0

    Fuseteam

    @Fuseteam

    71
    Reputation
    40
    Profile views
    59
    Posts
    2
    Followers
    0
    Following
    Joined
    Last Online
    Email fuseteam@duck.com
    Website fuseteam.github.io
    Location Paramaribo, Suriname

    Fuseteam Unfollow Follow

    Best posts made by Fuseteam

    • Snap Crackle and Pop! Readwrite rootfs is overrated

      Hi my name is fuseteam but some of you may know from telegram as Tobiyo Kuujikai. this will be my first topic, i've been thinking how to write this up for a while. no, i'm not japanese i suppose i should start at the beginning.

      When i first heard of ubuntu touch i was pretty excited to see a OS i could be in control of, as i never like how android worked and such. heh i only switched to android from symbian when my trusty old nokia 5800 just didn't hold enough battery anymore. like many the idea of using my phone as a "PC" really fascinated me, especially since at the time i had a laptop with 3GB of RAM and smartphone were beginning to get just as much RAM. you can imagine my disappointment when canonical announced the drop..... as i was a information technology and having a (fairly amateurish) understanding of programming i grew desperate and began searching for how to get in contact and do something. i eventually stumbled upon the unity8 telegram group and from there i found the other ubports groups. after some activity and getting to know the community i was eventually offered a device to get to know the os and the rest is (telegram) history.

      now why am I talking about all this? what up with the title?
      my expectation was that this will enable a "PC in my pocket" a "palmtop" at this point i had some experience with ubuntu on the desktop, i attempted to apply my meager experience to ubuntu touch and see what i can do. you can imagine my surprise when things didn't work as i had come to know it. as i got to know more of the community i found way to do what i wanted to do and have had a lot of fun with it. i even ended up editing the keyboard on the device with vim, breaking and fixing things. one of my goto method to restore things when things go "really bad" has become ssh in and run sudo system-image-cli -b 0 --progress=dots. i have used this more times then i can count. and that on its allowed the readonly rootfs to grow on me, even to such a degree i somewhat want it on desktop xD

      but as i was doing some things in a unsupported way there were some caveats, every time i refreshed my rootfs i lost all my favorite commandline utilities! but i can't complain right? apt is not supported, i get to keep the pieces..... as time went on however it does start to become tedious to reinstall things but hey i can't complain i am doing unsupported things, enter nix. someway somehow i stumbled on nix and from there i talked with quite a few regular contributors such as NotKit, Jonatan, Myii, Kugi, Dalton, Kugi and probably many more and learn quite a lot
      did you know that while the rootfs is readonly, some paths are actually writable: for example /home is completely writable. in hindsight it has to be, how else would our userdata survive refreshes and ota updates! it turns out there is a file (that isn't writable) that mounts basically keeps track of all those paths in /etc/system-image/writable_paths this file is processed in dash mounting the folders and thus preserving /userdata! from there i discovered nix is actually pretty easy to set up!

      • remount readwrite
      • create the directories /nix and /etc/nix
      • add the paths to /etc/system-image/writable
      • remount readonly
      • reboot
        everytime it disappears just readd the paths, recreate the directories and reboot, easy yes? wait nix is missing title, this post isn't about nix........is there caveat? yes zero packages for armhf! nix would compile the packages which could take hours, and lots of space. heck i have this sneaking suspicion it even trying to compile a new kernel! surely there must a different way! and there is, from there there's the possibilities to package the apps in a click and ship everything it needs, but that that worked! but it still felt messy, it would create a bunch of stub apps which literally just tells the user to add a certain path to PATH to be able to run the application........ it works! but we can do better! at that point i began toying with the idea to build an app but then it hit me. i learn deb packages are archives, that apt has a download-only option that apt can be configured to work independent from the rootfs and that dpkg can extract debs to any arbitrary directory, crackle was born.

      orginally i intended to propose a path like /home/pkgs to be a standard PATH as to have some sort of eventual multi user config, but with growing security concerns and little push from some in the community it now installs in the xdg home directories: ~/.cache, ~/.config and ~/.local/share

      so will this be a replacement for libertine? no. a lot of work has been put into libertine, years of work. a little bash script surely can't replace that! so what is my goal? in my experience and understanding libertine doesn't cut it..... why not? libertine is a whole desktop ubuntu container 1.5 GB just to run little old vim and given i use vim to experiment on device, the isolation from rootfs is little much. so my initial goal was to be able to install the utilities i use to hack on the phone and preserve them all on a readonly rootfs. But given how similar many utitliies function this extends beyond vim but probably not all the way to gui applications, those are really complicated. it is however possible to fetch a package and all its dependencies with this tool however to make it "self-contained" possibly make a crude click of out of it but that a whole other beast. well that was a mouth full lemme try to keep the rest short with the question i can already hear:

      sooo what packages already work?

      according reports and my own (crude) tests the following packages appear to work:

      • vim
      • git
      • nmap
      • htop
      • mc
      • transmission-cli
      • shellcheck
      • xz-utils
      • curl
      • tmux
      • byobu
      • patchelf
      • tree
      • sshfs

      packages that don't work

      • man
      • locate
      • many others i have yet to test 😛

      does it really not work with gui applications?

      well it can work but it very fiddly and mostly unusable 😛
      it would be better to try those in libertine or at least bundled in click and access properly through xmir (xwayland one day)

      wait slow down why is it called crackle?

      the name is play on physics which itself is reference to a very old commercial
      in physics snap is a derivative of jerk which is a derivative of acceleration, i guess the "acceleration" of acceleration 😛
      pop is the "acceleration" of snap
      but wait about the "speed" of snap? well that's crackle!
      what? is all greek? no worries have this nice video instead: https://www.youtube.com/watch?v=q6TIsxTdrCU

      will this work for all commandline utitlities?

      no idea, probably not. it comes down to what the utitlity needs, sshfs for example fails because of "operation not permitted" (likely related to the way fuse should be setup) while man fails because it just has to have its config file in /etc it just refuses otherwise and probably the way it wants to be setup, locate also has a similar issue with it just wanting the certain files in certain locations. i'm only one little guy i can only test and use so many applications

      where is the sauce?

      the source is at https://github.com/tuxecure/crackle, its also on gitlab at https://gitlab.com/tuxecure/crackle-apt/crackle. the github is a mirror of gitlab. the scripts used to setup the environment and such is at https://gitlab.com/tuxecure/crackle-apt/cracklebin

      so can i do anything i can do with apt with it?

      uhhhhhhhh no at this stage the following commands are available

      • crackle install <package>
      • crackle download <package>
      • crackle clean
      • crackle show <package>
      • crackle search <package>
      • crackle update
        yes that complete when it comes to apt like commands, there is no way to upgrade or remove packages at this stage, tho i suppose you could use crackle install to upgrade single packages it also has a couple of unique commands
      • crackle setup this is used to "install" crackle and setup up its initial environment more details in the next section
      • crackle crack <package> this can be used to extract a package and its dependencies in /home/phablet/packages/<package>

      How do i get crackle?

      currently you can get a hold of it by downloading the literally downloading the code (as a zip) from github or gitlab and extract it. then you cd into the folder and run ./crackle setup note this will use crackle (recursive!) to install both git and patchelf
      git to download the scripts from cracklebin and patchelf so those scripts can patch binaries where needed. git can also be used to fetch newer version with git pull later 😛

      much bugs, where report?

      for now bugs can be reported on gitlab 😉
      or you can contact me on telegram @fuseteam

      so wait why is readwrite rootfs overrated?

      for me i made it unnecessary to remount the rootfs. As crackle made it possible to "install" 90% of the utilities i tend to use in the terminal without remounting the rootfs, so for me a readwrite rootfs is overrated 😛 granted i do still remount to readwrite to hack on the os 😆 crackle might not be suited for your use, but it doesn't mean there is not way, there is always libertine and if that doesn't suit your fancy i would like to encourage you to either help improve libertine, or to explore what options are out there and how to get it working on Ubuntu Touch 😉 I believe there are a lot of possibilties 🙂 and with that this post is way too long, so i'll sign off here 😛

      posted in General
      FuseteamF
      Fuseteam
    • snap pop crackle! ....and nix!? The future of crackle

      Hey there, i'm fuseteam, but you may know me better as Tobiyo Kuujikai on Telegram.

      Almost 4 years ago i made post https://forums.ubports.com/topic/6283/snap-crackle-and-pop-readwrite-rootfs-is-overrated
      ...oh wow 11th of june, that was exactly 4 years and 5 days ago— gosh time sure flew

      At the time i was looking for way to run my favorite command line tools on UT, as i wrote back then it started with remounting as readwrite. As i'm sure many of you are quite aware that is not permanent, it gets overwritten by OTA updates, and there is a chance things will not break cue white screen of death

      So my motivation was, rather than fighting with the OS why don't i work with the OS and the journey at some point i past by nix, it looked perfect, if it was for it actually building the linux kernel on device to setup the thing— So i gave up on that.

      Now if you listened to the Q&A last saturday the sharp eared among you may have heard something related to nix was merged— yes that was me, nix finally does not need to compile packages it can actually install packages now! Wait so what's crackle about?

      Well. as nix wasn't viable at the time i search for other things. Did you know that .deb files are actually tar balls? that is you can extract them.....and the tools to do that are on UT

      so i played with that, it turns out you can download from the repository with apt without installing and you can tell apt where to download it. It hit me what what is actually doing in simplfied terms. maybe if i illustrate it, it will seem stupidly simple to you too— here's the firefox deb from upstream extracted:

      e6cb53b3-5e78-4722-bfc6-1d6d465a761f-image.png

      .....do you see it? Does the structure look familiar to you? where did we see that usr folder before— that's right in your / directory.....

      Yes, what you're guessing is correct, all apt really does, in simplified terms, is download the deb files, and extract it over your system. So how hard can it be to extract to somewhere else? Very easy, that is how ufirefox came about— we download the deb, we extract deb, we package de folder as click; yes click too is tar bal, in fact it is based on the deb format.....or so i am told.

      The challenge is telling the binaries to not look in / but somewhere else— but where? well there is specification from freedesktop (https://www.freedesktop.org/software/systemd/man/file-hierarchy.html#Home Directory) that we could use so i made mapping:

      /var/cache/           -> $XDG_CACHE_HOME  ($HOME/.cache/)
      /etc/                 -> $XDG_CONFIG_HOME ($HOME/.config/)
      {/usr}/bin/           -> $HOME/.local/bin/
      {/usr}/lib/{arch-id/} -> $HOME/.local/lib/{arch-id/} 
      /usr/share/           -> $XDG_DATA_HOME   ($HOME/.local/share/)      
      /var/log/             -> $XDG_STATE_HOME  ($HOME/.local/state/)
      

      and wrote a bash script, to move files to these locations, then i opted to move them to ~/.local/share/crackle and symlink them instead and then it worked— but libraries weren't loading.....and how do keep track of which files belong to which packages and ahhh— utlimately i did find solutions, but something else was also apparently, i was doing this mostly on my own, it took 3 years to figure out how to remove packages, not because it is difficult, but i didn't think of— giving each package their own directory and that didn't could clear unused libraries— after all those could be shared— and another year to spot a minor mistake which made linking the libraries properly a complete mess........ did mention that crackle was born....yeah that bash script is crackle: https://gitlab.com/tuxecure/crackle-apt/crackle

      At this point, i'm sure you can understand why, when i discovered that nix now no longer needs to build from scratch on arm64, i was both elated and sad
      elated because now i didn't need to deal with figuring out package managment, sad because i spend 4 years figure out package management.

      But all is not lost, crackle can still be used to build clicks— uh what else........ uh let's first get back to nix

      What is nix first of all? Nix is the package manager of nixos, it installs into /nix ok straighforward enough, it has 80k packages available— oh that's ni— 80000?! yes that's 4 zeros.
      my measily, in the four years crackle was out i've accumalate 16 packages that were test 😂 (https://gitlab.com/tuxecure/crackle-apt/cracklebin)

      And they work.......ok fine there are some limitations. first of all it cannot do system systemd services, you know the thing that goes in /etc/systemd/system, we'd have to write those manually.

      Now back to what was merged last week: as of right now /nix is writable by a phablet— that's about it. yes it is that simple, and that's all it took to make Nix installable— almost
      You see nix has 2 modes, multi-user mode and single-user mode.

      As we don't support multiple users on UT (yet) i opted for the simpler single user mode and that only needs /nix to be writable.......and adds the limitation of not being able to sudo vim— but you know.....i ran into this aswell with crackle.......the solution? make a symlink to /root/.local/bin which means i can sudo su and then vim just works— now sudo -i vim also works.

      But i'm rambling....point is i added function to crackle to do that— and this is still usable with nix.

      Wait did i say nix is almost installable? uh yeah about that, to install it we need both curl and xz......both of which are not shipped by default, and I don't want to increase the rootfs size— hey both of these work with crackle......

      I now took crackle apart once again and made a new bash script to install nix:

      #!/usr/bin/env bash
      # Configuration for Apt
      APTCACHE=${APTCACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/apt};
      APTSTATE=${APTSTATE:-${XDG_STATE_HOME:-$HOME/.local/state}/apt};
      DPKGSTATE=${DPKGSTATE:-${XDG_STATE_HOME:-$HOME/.local/state}/dpkg};
      APTCONFIG=${APTCONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/crackle};
      
      # Configuration for Crackle
      PKG_PATH=${PKG_PATH:-${XDG_DATA_HOME:-$HOME/.local/share}/crackle};
      PKGS_DIR=${PKGS_DIR:-$PKG_PATH/$PKG};
      CRACKLERC=$APTCONFIG/cracklerc;
      CRACKLEENV=$APTCONFIG/environment;
      CRACKLECMP=${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions;
      CRACKDIR=${CRACKDIR:-$HOME/packages/$PKG};
      CRACKLEBIN="https://gitlab.com/tuxecure/crackle-apt/cracklebin/-/archive/master/cracklebin-master.tar.gz"
      PKG_PREFIX=${PKG_PREFIX:-$HOME/.local}
      
      # Configuration for Sudo -i
      SUDO_CONFIG=/root/.config
      SUDO_BIN=/root/.local/bin
      SUDO_STATE=/root/.local/state
      
      # Set up aliases for apt commands
      APTCONF="-o Dir::Etc=$APTCONFIG";
      APT_GET="apt-get -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE $APTCONF"
      APT_CACHE="apt-cache -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE -o Dir::Etc=$APTCONFIG"
      
      function pkgsetup(){
          [[ -d "$DPKGSTATE" ]] || {
              mkdir -p "$DPKGSTATE";
                  cp /var/lib/dpkg/status $DPKGSTATE/status;
              }
      
          [[ -d "$APTCACHE" ]] || mkdir -p "$APTCACHE";
          [[ -d "$APTSTATE" ]] || mkdir -p "$APTSTATE";
      
          [[ -d "$APTCONFIG" ]] || {
              mkdir -p $APTCONFIG/sources.list.d $APTCONFIG/preferences.d $APTCONFIG/trusted.gpg.d;
      
          ln -s /etc/apt/sources.list $APTCONFIG;
          [[ -n "$(ls /etc/apt/trusted.gpg.d)" ]] && ln -s /etc/apt/trusted.gpg.d/* $APTCONFIG/trusted.gpg.d/;
      }
      }
      
      urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
      
      function get_pkg_info () {
          pkg="$(basename "$1")";
          pkgname="${pkg%%_*}";
          pkgversion="${pkg%_*}";
          pkgversion="${pkgversion#*_}";
          pkgversion="$(urldecode $pkgversion)";
      }
      
      function link_path(){
          pkg_path="$1";
          xdg_lib_path="$2"
          while read file_path
          do
              ln -s $file_path $xdg_lib_path;
          done < <(find $pkg_path -type f -maxdepth 1)
      }
      
      function bin_install () {
          PKGS_DIR=${PKG_PATH}/${pkgname}
          mkdir -p ${PKGS_DIR} $PKG_PREFIX/bin;
          dpkg-deb -x "${package}" "${PKGS_DIR}";
          [ -d "$PKGS_DIR/usr/bin" ] && link_path $PKGS_DIR/usr/bin $PKG_PREFIX/bin;
      }
      
      function setup_curlxz () {
          $APT_GET update
          $APT_GET install --download-only curl xz-utils;
          while read package
          do
              get_pkg_info $package;
              bin_install;
          done < <(ls "$APTCACHE"/archives/*.deb);
      }
      
      function setup_home_manager (){
          sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --no-daemon
          nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
          nix-channel --update
          nix-shell '<home-manager>' -A install
      }
      
      function pkgunset(){
          rm -r $APTCACHE $APTSTATE $APTCONFIG $PKG_PATH;
          find "$PKG_PREFIX/bin" -xtype l -exec rm {} +;
      }
      
      pkgsetup;
      setup_curlxz;
      setup_home-manager;
      pkgunset;
      

      ok this has more cruft than it should.....but there is a reason for this.

      You see now i have crackle which has functions that make command line utils usable, on the other hand we have nix with way more usable packages.

      So what's the plan?

      The plan is take crackle apart for useful parts and build it around nix instead.

      So the goal for next iteration of crackle is

      • crackle click should continue to able to build click packages from apt
      • crackle setup should set up nix home-manager utilizing curl and xz from apt
      • crackle sudo should continue to be able to enable sudo usage with user installed packages
      • crackle sudok should continue to undo crackle sudo

      The above script installs curl and xz the crackle way, then sets up nix home-manager and then removes them again and wll serve as the base to build out the features anew

      If you made it this far in my post— thank you for reading my post despite its length! Feel free to use the above script to install nix on the latest focal devel and go wild. See what works and see what does not. And if something doesn't work— share logs, debug, explore options! I doubt i alone can solve these issues, but together as a community we can surely find solutions— if not maybe i'll post another rant in 4 years and 5 days 😛

      posted in General
      FuseteamF
      Fuseteam
    • RE: Community UBports its future

      honestly i don't think we should only focus on what users can donate. there are more ways to contribute, as already mentioned, including volunteering to lessen the load on "the core team".

      As Dalton mentioned in the last Q & A "i've seen the mentality change from 'what can we do together?' to 'what can the foundation do for me?'" "foundation" can also be replaced with "the core team" the meaning is the same. If we want to grow we need to adopt the mentality that brought us this far which is "What can we do together?" and there's more we can do that just technical things like contributing code or donating money, we can also promote the project and perhaps interest companies with the same value to become sponsors, like volla, smoose and pine64, or ways to collaborate on the system. The field of ways we can help is huge, let's utilize it! 😉

      posted in General
      FuseteamF
      Fuseteam
    • RE: Alternative Browser apps?

      ok i think i generalized the firefox repo to the limit;

      • the meat of the builder is in builder.sh.
      • the template files are placed in the correct location with the specific name while the environment for building is setup with prebuild.sh (hmmm maybe i can move that to build.sh)
      • the package specific stuff are saved in pkg.d
      • the actual package to build is specificied in clickable.json any package in the ubuntu repos can be specified, no command line apps tho those won't magically launch in the terminal (i ain't a magician sorry :P)
      • package maintainer info can be set in manifest.json, the package name will be set with prebuild.sh
      • apparmore permissions can be set in apparmor.json

      Limitations:

      • as mentioned earlier it needs to be unconfined due to needing xmir, as such only the xmir branch has an actual working click, the master branch would launch on wayland but this particular version has broken wayland support, if the package has wayland support confined may be possible
      • any package which has an all package as a dependency will fail to build, cause i'm a noob 😛
      • no command line apps! we have crackle for that nudge nudge
      • no touch (so far), no OSK (so far), no content hub, no media hub
      • no per device scaling, currently scaling is set with the environment variable GDK_DPI_SCALE=2
      • i have no idea how to handle the above 2 😛
      • i also have no idea how to handle settings schema's at all 😛
      posted in App Development
      FuseteamF
      Fuseteam
    • RE: snap pop crackle! ....and nix!? The future of crackle

      ok final last word; you may run into this error on focal devel:

      35b520fd-fc7d-40f1-8ab9-a45a76eb20cc-image.png

      don't worry it is noisy, but it harmless

      It will be fixed in noble see https://gitlab.com/ubports/development/core/hybris-support/tls-padding/-/merge_requests/4
      and possibly in focal soon™

      posted in General
      FuseteamF
      Fuseteam
    • RE: Alternative Browser apps?

      ah the cat's out of the bag; i wouldn't even call what i have a beta at this point, it is an pre-alpha click package.
      basically i'm downloading the firefox deb package with apt, extracting it and packaging that result as a click.

      It does not pop up the keyboard, it has no touch support out of the box and it does not integrate at all with the os. it just launches and the interface is somewhat scaled.
      It is also unconfined due to needing xmir atm, which not available to confined apps.

      to get the keyboard to pop up we need to either get maliit-inputcontext-gtk3 working in the click or ship it with the rootfs.

      i'm currently more focused on generalizing my work so others can benefit of it. the build script is based off work by mateo salta, maciek sopyło and my crackle script altered to fit the needs of a custom clickable builder

      the firefox click can be found at gitlab.com/debclick/ufirefox.
      i created the debclick group to organize all similar experiments under one umbrella, if anyone wants access hit me up

      the clicks build from the master branch do not launch as they lack proper wayland support.
      the clicks from the xmir branch do launch and are unconfined, and suffers from all the issues associated with xmir

      posted in App Development
      FuseteamF
      Fuseteam
    • RE: snap pop crackle! ....and nix!? The future of crackle

      Oh before i go, you may be wondering how to use this home manager

      well it's simple really.

      after running the script in the above post you should have a file in ~/.config/home-manager/home.nix

      in there you will find a section like this:

      # The home.packages option allows you to install Nix packages into your
        # environment.
        home.packages = [
          # # Adds the 'hello' command to your environment. It prints a friendly
          # # "Hello, world!" when run.
          # pkgs.hello
      
          # # It is sometimes useful to fine-tune packages, for example, by applying
          # # overrides. You can do that directly here, just don't forget the
          # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
          # # fonts?
          # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
      
          # # You can also create simple shell scripts directly inside your
          # # configuration. For example, this adds a command 'my-hello' to your
          # # environment:
          # (pkgs.writeShellScriptBin "my-hello" ''
          #   echo "Hello, ${config.home.username}!"
          # '')
        ];
      

      you can see the comment there explains what to put there, you here's how i edited mine

      # The home.packages option allows you to install Nix packages into your
        # environment.
        home.packages = [
          pkgs.vim
          pkgs.pipx
          pkgs.cargo
          pkgs.plasma5Packages.kdeconnect-kde
          pkgs.tailscale
          pkgs.gnumake
          pkgs.gcc
          pkgs.gdb
          pkgs.strace
          pkgs.valgrind
          # # Adds the 'hello' command to your environment. It prints a friendly
          # # "Hello, world!" when run.
          # pkgs.hello
      
          # # It is sometimes useful to fine-tune packages, for example, by applying
          # # overrides. You can do that directly here, just don't forget the
          # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
          # # fonts?
          # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
      
          # # You can also create simple shell scripts directly inside your
          # # configuration. For example, this adds a command 'my-hello' to your
          # # environment:
          # (pkgs.writeShellScriptBin "my-hello" ''
          #   echo "Hello, ${config.home.username}!"
          # '')
        ];
      

      then when done you run home-manager switch, and off you go

      It is switch because it is atomic, you can go back to a previous configuration— but it'll let you explore home-manager --help for the other options

      and yes, if i've tested all those, they all.....work expect for kdeconnect:

      12e1028e-3746-4e3e-8c9d-7f928eb434f0-image.png

      This is must closer than i got with crackle tho, i imagine there will be similar errors with other GUI apps, but CLI apps ought to work—

      posted in General
      FuseteamF
      Fuseteam
    • RE: Alternative Browser apps?

      @flohack who what where how when? 👁

      posted in App Development
      FuseteamF
      Fuseteam
    • RE: Wishes, Dreams, and Unicorns

      always based on the latest LTS

      if it's any help, the work on rebasing on 20.04 is underway was we speak 😉

      Documentaion is everywhere, not centralized, I think we should have a place where you can get all the documentation, including known working APN settings

      the centralized documentation is at docs.ubports.com if something is missing there it can be added by submitting a merge request at https://github.com/ubports/docs.ubports.com
      granted APN settings are very carrier-specific not sure how to organize such a documentation

      posted in General
      FuseteamF
      Fuseteam
    • RE: uWolf (LibreWolf)

      Do note that some of these issues are due to integration of the desktop browser into UT, not necessarily something that can be solved in the packaging.

      Some of these bugs will have to be taken up with upstream (e.g. menu and tabs going offscreen and setting pages not fitting the screen), others will have to solved in UT (e.g. right side being unusable in landscape)

      Some are being looked into e.g. right side being usable will afaict be fixed by https://gitlab.com/ubports/development/core/lomiri/-/merge_requests/207 and the settings page not fitting might be improve the new design lands: https://connect.mozilla.org/t5/discussions/firefox-settings-design-share-your-input/m-p/66629/highlight/true#M23625

      While i am sure that donations are appreciated, do keep in mind this won't brings fixes faster as there is only so much we can do.

      Have ideas how firefox (and by extension librewolf) can be improved for us? share ideas to upstream, but be nice and be mindful these things takes time* to fix and may not be their current priority. Showing genuine interest, doing research if something has been proposed before and sharing ideas so they may gain traction is highly appreciated

      * to help shape perspective It took 3 years (compare the date on https://connect.mozilla.org/t5/discussions/arm64-armhf-firefox-binary-tarballs-for-packaging-for-ubuntu/m-p/12847 with https://www.mozilla.org/en-US/firefox/136.0/releasenotes/) for them to finally package for arm64 in their own apt repo, in part because it took that long of sharing for it take traction but also in part due to changes they had to made

      posted in App Development
      FuseteamF
      Fuseteam

    Latest posts made by Fuseteam

    • RE: snap pop crackle! ....and nix!? The future of crackle

      thanks to the help of @ChromiumOS-Guy crackle is now not only able to set up nix home-manager, but also install, update, remove and list packages using nix home-manager:

      https://github.com/tuxecure/crackle/releases/tag/v0.5.2

      for cli applications they all seem to work so far, sans minor warnings (looking at you tailscale)
      for gui applications i have not figured out how to get it be picked up by the drawer, but early reports show them launching fine from the terminal so far

      So for anyone wanting to test it out, now the time to test out and see how far we can push the boundaries

      posted in General
      FuseteamF
      Fuseteam
    • RE: snap pop crackle! ....and nix!? The future of crackle

      @ChromiumOS-Guy thanks again, i'll take a look and test it out further

      posted in General
      FuseteamF
      Fuseteam
    • RE: snap pop crackle! ....and nix!? The future of crackle

      actually now i think about it, updates are easy enough with home-manager:

      nix-channel --update
      home-manager switch
      

      The "challenge" is more in figuring out how we add and remove entries under home.packages in ~/.config/home-manager/home.nix

      posted in General
      FuseteamF
      Fuseteam
    • RE: snap pop crackle! ....and nix!? The future of crackle

      @ChromiumOS-Guy said in snap pop crackle! ....and nix!? The future of crackle:

      @Fuseteam first let me say this is awesome, second if you want help I want to contribute to this.
      I used nixos for while before switching to FreeBSD is has been a joy, so I say this with confidence this is finally the point where we can actually use UT as a full on linux distribution, the influx of packages here will be amazing.

      if you don't mind aside from reading up on the code, I will make a UI QML app so end users can just pick and install/uninstall primitive but any UI is better then terminal when walking.

      looking forward to seeing a repo on gitlab.

      thanks, the script above is all that's needed to setup nix on UT on the latest focal devel.

      I agree with the UI idea, i believe it would be best if we add a plug in system-settings like so: https://gitlab.com/ubports/development/core/lomiri-system-settings/-/merge_requests/437

      if you rather see the setup script on gitlab you can find it here: https://gitlab.com/tuxecure/crackle-apt/crackle/-/blob/v0.5/crackle

      note that that's the only file i have so far, i'll be building that out further, based on the earlier iteration which can be found in the bash branch= but that's just for a cli interface

      I'm unsure atm how we will handle actual package management throught the UI tho but i'd say we can worry about that after we can at least setup nix via the UI

      posted in General
      FuseteamF
      Fuseteam
    • RE: snap pop crackle! ....and nix!? The future of crackle

      ok final last word; you may run into this error on focal devel:

      35b520fd-fc7d-40f1-8ab9-a45a76eb20cc-image.png

      don't worry it is noisy, but it harmless

      It will be fixed in noble see https://gitlab.com/ubports/development/core/hybris-support/tls-padding/-/merge_requests/4
      and possibly in focal soon™

      posted in General
      FuseteamF
      Fuseteam
    • RE: snap pop crackle! ....and nix!? The future of crackle

      Oh before i go, you may be wondering how to use this home manager

      well it's simple really.

      after running the script in the above post you should have a file in ~/.config/home-manager/home.nix

      in there you will find a section like this:

      # The home.packages option allows you to install Nix packages into your
        # environment.
        home.packages = [
          # # Adds the 'hello' command to your environment. It prints a friendly
          # # "Hello, world!" when run.
          # pkgs.hello
      
          # # It is sometimes useful to fine-tune packages, for example, by applying
          # # overrides. You can do that directly here, just don't forget the
          # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
          # # fonts?
          # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
      
          # # You can also create simple shell scripts directly inside your
          # # configuration. For example, this adds a command 'my-hello' to your
          # # environment:
          # (pkgs.writeShellScriptBin "my-hello" ''
          #   echo "Hello, ${config.home.username}!"
          # '')
        ];
      

      you can see the comment there explains what to put there, you here's how i edited mine

      # The home.packages option allows you to install Nix packages into your
        # environment.
        home.packages = [
          pkgs.vim
          pkgs.pipx
          pkgs.cargo
          pkgs.plasma5Packages.kdeconnect-kde
          pkgs.tailscale
          pkgs.gnumake
          pkgs.gcc
          pkgs.gdb
          pkgs.strace
          pkgs.valgrind
          # # Adds the 'hello' command to your environment. It prints a friendly
          # # "Hello, world!" when run.
          # pkgs.hello
      
          # # It is sometimes useful to fine-tune packages, for example, by applying
          # # overrides. You can do that directly here, just don't forget the
          # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
          # # fonts?
          # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
      
          # # You can also create simple shell scripts directly inside your
          # # configuration. For example, this adds a command 'my-hello' to your
          # # environment:
          # (pkgs.writeShellScriptBin "my-hello" ''
          #   echo "Hello, ${config.home.username}!"
          # '')
        ];
      

      then when done you run home-manager switch, and off you go

      It is switch because it is atomic, you can go back to a previous configuration— but it'll let you explore home-manager --help for the other options

      and yes, if i've tested all those, they all.....work expect for kdeconnect:

      12e1028e-3746-4e3e-8c9d-7f928eb434f0-image.png

      This is must closer than i got with crackle tho, i imagine there will be similar errors with other GUI apps, but CLI apps ought to work—

      posted in General
      FuseteamF
      Fuseteam
    • snap pop crackle! ....and nix!? The future of crackle

      Hey there, i'm fuseteam, but you may know me better as Tobiyo Kuujikai on Telegram.

      Almost 4 years ago i made post https://forums.ubports.com/topic/6283/snap-crackle-and-pop-readwrite-rootfs-is-overrated
      ...oh wow 11th of june, that was exactly 4 years and 5 days ago— gosh time sure flew

      At the time i was looking for way to run my favorite command line tools on UT, as i wrote back then it started with remounting as readwrite. As i'm sure many of you are quite aware that is not permanent, it gets overwritten by OTA updates, and there is a chance things will not break cue white screen of death

      So my motivation was, rather than fighting with the OS why don't i work with the OS and the journey at some point i past by nix, it looked perfect, if it was for it actually building the linux kernel on device to setup the thing— So i gave up on that.

      Now if you listened to the Q&A last saturday the sharp eared among you may have heard something related to nix was merged— yes that was me, nix finally does not need to compile packages it can actually install packages now! Wait so what's crackle about?

      Well. as nix wasn't viable at the time i search for other things. Did you know that .deb files are actually tar balls? that is you can extract them.....and the tools to do that are on UT

      so i played with that, it turns out you can download from the repository with apt without installing and you can tell apt where to download it. It hit me what what is actually doing in simplfied terms. maybe if i illustrate it, it will seem stupidly simple to you too— here's the firefox deb from upstream extracted:

      e6cb53b3-5e78-4722-bfc6-1d6d465a761f-image.png

      .....do you see it? Does the structure look familiar to you? where did we see that usr folder before— that's right in your / directory.....

      Yes, what you're guessing is correct, all apt really does, in simplified terms, is download the deb files, and extract it over your system. So how hard can it be to extract to somewhere else? Very easy, that is how ufirefox came about— we download the deb, we extract deb, we package de folder as click; yes click too is tar bal, in fact it is based on the deb format.....or so i am told.

      The challenge is telling the binaries to not look in / but somewhere else— but where? well there is specification from freedesktop (https://www.freedesktop.org/software/systemd/man/file-hierarchy.html#Home Directory) that we could use so i made mapping:

      /var/cache/           -> $XDG_CACHE_HOME  ($HOME/.cache/)
      /etc/                 -> $XDG_CONFIG_HOME ($HOME/.config/)
      {/usr}/bin/           -> $HOME/.local/bin/
      {/usr}/lib/{arch-id/} -> $HOME/.local/lib/{arch-id/} 
      /usr/share/           -> $XDG_DATA_HOME   ($HOME/.local/share/)      
      /var/log/             -> $XDG_STATE_HOME  ($HOME/.local/state/)
      

      and wrote a bash script, to move files to these locations, then i opted to move them to ~/.local/share/crackle and symlink them instead and then it worked— but libraries weren't loading.....and how do keep track of which files belong to which packages and ahhh— utlimately i did find solutions, but something else was also apparently, i was doing this mostly on my own, it took 3 years to figure out how to remove packages, not because it is difficult, but i didn't think of— giving each package their own directory and that didn't could clear unused libraries— after all those could be shared— and another year to spot a minor mistake which made linking the libraries properly a complete mess........ did mention that crackle was born....yeah that bash script is crackle: https://gitlab.com/tuxecure/crackle-apt/crackle

      At this point, i'm sure you can understand why, when i discovered that nix now no longer needs to build from scratch on arm64, i was both elated and sad
      elated because now i didn't need to deal with figuring out package managment, sad because i spend 4 years figure out package management.

      But all is not lost, crackle can still be used to build clicks— uh what else........ uh let's first get back to nix

      What is nix first of all? Nix is the package manager of nixos, it installs into /nix ok straighforward enough, it has 80k packages available— oh that's ni— 80000?! yes that's 4 zeros.
      my measily, in the four years crackle was out i've accumalate 16 packages that were test 😂 (https://gitlab.com/tuxecure/crackle-apt/cracklebin)

      And they work.......ok fine there are some limitations. first of all it cannot do system systemd services, you know the thing that goes in /etc/systemd/system, we'd have to write those manually.

      Now back to what was merged last week: as of right now /nix is writable by a phablet— that's about it. yes it is that simple, and that's all it took to make Nix installable— almost
      You see nix has 2 modes, multi-user mode and single-user mode.

      As we don't support multiple users on UT (yet) i opted for the simpler single user mode and that only needs /nix to be writable.......and adds the limitation of not being able to sudo vim— but you know.....i ran into this aswell with crackle.......the solution? make a symlink to /root/.local/bin which means i can sudo su and then vim just works— now sudo -i vim also works.

      But i'm rambling....point is i added function to crackle to do that— and this is still usable with nix.

      Wait did i say nix is almost installable? uh yeah about that, to install it we need both curl and xz......both of which are not shipped by default, and I don't want to increase the rootfs size— hey both of these work with crackle......

      I now took crackle apart once again and made a new bash script to install nix:

      #!/usr/bin/env bash
      # Configuration for Apt
      APTCACHE=${APTCACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/apt};
      APTSTATE=${APTSTATE:-${XDG_STATE_HOME:-$HOME/.local/state}/apt};
      DPKGSTATE=${DPKGSTATE:-${XDG_STATE_HOME:-$HOME/.local/state}/dpkg};
      APTCONFIG=${APTCONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/crackle};
      
      # Configuration for Crackle
      PKG_PATH=${PKG_PATH:-${XDG_DATA_HOME:-$HOME/.local/share}/crackle};
      PKGS_DIR=${PKGS_DIR:-$PKG_PATH/$PKG};
      CRACKLERC=$APTCONFIG/cracklerc;
      CRACKLEENV=$APTCONFIG/environment;
      CRACKLECMP=${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions;
      CRACKDIR=${CRACKDIR:-$HOME/packages/$PKG};
      CRACKLEBIN="https://gitlab.com/tuxecure/crackle-apt/cracklebin/-/archive/master/cracklebin-master.tar.gz"
      PKG_PREFIX=${PKG_PREFIX:-$HOME/.local}
      
      # Configuration for Sudo -i
      SUDO_CONFIG=/root/.config
      SUDO_BIN=/root/.local/bin
      SUDO_STATE=/root/.local/state
      
      # Set up aliases for apt commands
      APTCONF="-o Dir::Etc=$APTCONFIG";
      APT_GET="apt-get -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE $APTCONF"
      APT_CACHE="apt-cache -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE -o Dir::Etc=$APTCONFIG"
      
      function pkgsetup(){
          [[ -d "$DPKGSTATE" ]] || {
              mkdir -p "$DPKGSTATE";
                  cp /var/lib/dpkg/status $DPKGSTATE/status;
              }
      
          [[ -d "$APTCACHE" ]] || mkdir -p "$APTCACHE";
          [[ -d "$APTSTATE" ]] || mkdir -p "$APTSTATE";
      
          [[ -d "$APTCONFIG" ]] || {
              mkdir -p $APTCONFIG/sources.list.d $APTCONFIG/preferences.d $APTCONFIG/trusted.gpg.d;
      
          ln -s /etc/apt/sources.list $APTCONFIG;
          [[ -n "$(ls /etc/apt/trusted.gpg.d)" ]] && ln -s /etc/apt/trusted.gpg.d/* $APTCONFIG/trusted.gpg.d/;
      }
      }
      
      urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
      
      function get_pkg_info () {
          pkg="$(basename "$1")";
          pkgname="${pkg%%_*}";
          pkgversion="${pkg%_*}";
          pkgversion="${pkgversion#*_}";
          pkgversion="$(urldecode $pkgversion)";
      }
      
      function link_path(){
          pkg_path="$1";
          xdg_lib_path="$2"
          while read file_path
          do
              ln -s $file_path $xdg_lib_path;
          done < <(find $pkg_path -type f -maxdepth 1)
      }
      
      function bin_install () {
          PKGS_DIR=${PKG_PATH}/${pkgname}
          mkdir -p ${PKGS_DIR} $PKG_PREFIX/bin;
          dpkg-deb -x "${package}" "${PKGS_DIR}";
          [ -d "$PKGS_DIR/usr/bin" ] && link_path $PKGS_DIR/usr/bin $PKG_PREFIX/bin;
      }
      
      function setup_curlxz () {
          $APT_GET update
          $APT_GET install --download-only curl xz-utils;
          while read package
          do
              get_pkg_info $package;
              bin_install;
          done < <(ls "$APTCACHE"/archives/*.deb);
      }
      
      function setup_home_manager (){
          sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --no-daemon
          nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
          nix-channel --update
          nix-shell '<home-manager>' -A install
      }
      
      function pkgunset(){
          rm -r $APTCACHE $APTSTATE $APTCONFIG $PKG_PATH;
          find "$PKG_PREFIX/bin" -xtype l -exec rm {} +;
      }
      
      pkgsetup;
      setup_curlxz;
      setup_home-manager;
      pkgunset;
      

      ok this has more cruft than it should.....but there is a reason for this.

      You see now i have crackle which has functions that make command line utils usable, on the other hand we have nix with way more usable packages.

      So what's the plan?

      The plan is take crackle apart for useful parts and build it around nix instead.

      So the goal for next iteration of crackle is

      • crackle click should continue to able to build click packages from apt
      • crackle setup should set up nix home-manager utilizing curl and xz from apt
      • crackle sudo should continue to be able to enable sudo usage with user installed packages
      • crackle sudok should continue to undo crackle sudo

      The above script installs curl and xz the crackle way, then sets up nix home-manager and then removes them again and wll serve as the base to build out the features anew

      If you made it this far in my post— thank you for reading my post despite its length! Feel free to use the above script to install nix on the latest focal devel and go wild. See what works and see what does not. And if something doesn't work— share logs, debug, explore options! I doubt i alone can solve these issues, but together as a community we can surely find solutions— if not maybe i'll post another rant in 4 years and 5 days 😛

      posted in General
      FuseteamF
      Fuseteam
    • RE: uWolf (LibreWolf)

      Do note that some of these issues are due to integration of the desktop browser into UT, not necessarily something that can be solved in the packaging.

      Some of these bugs will have to be taken up with upstream (e.g. menu and tabs going offscreen and setting pages not fitting the screen), others will have to solved in UT (e.g. right side being unusable in landscape)

      Some are being looked into e.g. right side being usable will afaict be fixed by https://gitlab.com/ubports/development/core/lomiri/-/merge_requests/207 and the settings page not fitting might be improve the new design lands: https://connect.mozilla.org/t5/discussions/firefox-settings-design-share-your-input/m-p/66629/highlight/true#M23625

      While i am sure that donations are appreciated, do keep in mind this won't brings fixes faster as there is only so much we can do.

      Have ideas how firefox (and by extension librewolf) can be improved for us? share ideas to upstream, but be nice and be mindful these things takes time* to fix and may not be their current priority. Showing genuine interest, doing research if something has been proposed before and sharing ideas so they may gain traction is highly appreciated

      * to help shape perspective It took 3 years (compare the date on https://connect.mozilla.org/t5/discussions/arm64-armhf-firefox-binary-tarballs-for-packaging-for-ubuntu/m-p/12847 with https://www.mozilla.org/en-US/firefox/136.0/releasenotes/) for them to finally package for arm64 in their own apt repo, in part because it took that long of sharing for it take traction but also in part due to changes they had to made

      posted in App Development
      FuseteamF
      Fuseteam
    • RE: Is there a better browser somewhere?

      @paulcarroty said in Is there a better browser somewhere?:

      uFirefox is still far from having an android-style mobile experience

      Still the best browser for modern websites on UT.

      I wouldn't call it the "best" given how the settings pages aren't convergent xd

      posted in Support
      FuseteamF
      Fuseteam
    • RE: Is there a better browser somewhere?

      @uxes said in Is there a better browser somewhere?:

      @domubpkm well sure, but not every latest build is allright
      https://gitlab.com/debclick/uFirefox/-/jobs/7676432640/artifacts/browse this should be pretty ok

      Oh wow this is really old, for clarity the latest artifact on the xmir-focal branch should be alright
      here's for firefox 136: https://gitlab.com/debclick/uFirefox/-/jobs/9342376608/artifacts/browse/build/aarch64-linux-gnu/app/

      posted in Support
      FuseteamF
      Fuseteam