Category Archives: librism

Android without Google and GNU/Linux with APK

Android will move from Linux kernel and open specs APK format to a more closed package format and to their closed source Fuschia kernel going away from Free Open Source software (FOSS) that make Google, Android, ChromeOS grow, but also that are used on most of the internet servers, on most of supercomputer in the world, on most spacecrafts, on most internet boxes, TVboxes, etc…

GNU/Linux on your phone now

At the same time GNU/Linux distributions for mobile grow a lot the 2 recent years, thanks to availability of PinePhone for developers for about 2 years. There are now at least 15 Linux distributions for phone and applications maturated a lot, including since few month MegaPixels hardware accelerted camera application, that use GL and other processor to accelerate rendering/computing of what camera receive.

PostMarketOS is a GNU/Linux distribution available for a bunch of available market phones, but not everything is managed an all devices.

GNU/Linux with Android APK compatibility layer

Just like there is Wine to run Windows application on GNU/Linux, there are also several systems allowing to run Android APK on your phone if needed. Jusr as Wine, beside the possibility of running Android in a qemu VM, you can also run these application inside your the standard GNU system.

AnBox allow to run APK/Android application inside a snap packaged container.

Google goes away from FOSS, afraid by the lost of market share, and they probably loose a lot from this, as Microsoft does by the past. Chinese company, thanks to Trump restrictions, embrace more FOSS.

Huawei the maker of the probably highest quality phones, that was going in first seller position just ahead Samsung, when Trump blocked it, already very active in Linux kernel and community for years, made HarmonyOS for their devices, a system, that continue tu uses Linux kernel for their power devices, and LiteOS for their low end/old devices. LiteOS is a FOSS embedded devices oriented light kernel. They keep the EMUI User Interface they used previously on Android, moving step by step away from it, and at the same time keep a compatibility layer with current APK open-source format.

Another Chinese company, JingOS, made high quality tablets, based on GNU/Linux distribution, that derivates from Ubuntu, with KDE tools and Android APK application compatibility using Anbox. And they are active with KDE and open source communities. Few demos here and here.

Removing closed source spywares from your current Android system as a transition phase

Beside long time F-droid Free software apk app repository (I use it for year as main source of APK).

You can remove Android pre-installed (memory+cpu+bandwidth thieves) applications, including NSA compliant one like Google, Amazon, FaceBook, Microsoft ones using from a computer with adb. This allowed me to have less bloated phone and to gain few more days of on-battery usage.

List packages:

adb shell pm list packages

See which one are related to facebook:

adb shell pm list packages facebook

For easier copy paste and have only the package name without package: prefix

adb shell pm list packages | cut -d: -f 2

The corresponding application, can be checked by using in a web browser, this does not work for some system applications, for example, for

Remove never at least first seen, never used application:

# FaceBook spyware

adb shell pm uninstall --user 0 com.facebook.katana
adb shell pm uninstall --user 0 com.facebook.system
adb shell pm uninstall --user 0 com.facebook.appmanager

# Microsoft stuff
adb shell pm uninstall --user 0
adb shell pm uninstall --user 0
adb shell pm uninstall --user 0
adb shell pm uninstall --user 0
adb shell pm uninstall --user 0 # data thief

adb shell pm uninstall --user 0 # Google Drive (data thief)
adb shell pm uninstall --user 0 # Google photos (data thief)
adb shell pm uninstall --user 0 # Google Search box (behavior thief)
adb shell pm uninstall --user 0 # GMail
adb shell pm uninstall --user 0 # Hangouts
adb shell pm uninstall --user 0 # Google Play Music
adb shell pm uninstall --user 0 # Google Play Film & Series
adb shell pm uninstall --user 0 # Youtube application

To be checked

adb shell pm uninstall --user 0 # Services Google Play

adb shell Dumpsys a dumper and debugger

adb shell dumpsys allow to dump application before removing them and reinstalling it after that.

I still didn’t tried that, will update it after my tests

adb shell dumpsys package # dump package state
adb pm enable —user 0 nom_de_paquet

RISC-V overall progress

WordPress is so cumbersome (brut long text in SQL DB and other misconception (WTF?), buggy (especially to multilingual content missing) and hard to maintain on long term that I didn’t posted for long time I want to migrate. You can test the new log engine (here specialised in TIC-80 256 bytes code on

I continued my travel toward RISC-V I started as said in a previous post in may 2018.

RISC-V Benefits

Among the benefit of RISC-V beside other implementations:
* Open source and without license fee availability, allowing everyone to participate, implement and have full specifications
* Highest modularity for a processor in specifications, You can reduce the core to only the set of functions you want for a specific tasks, allowing less transistor/more compact specialized cores, and then multiply cores with some specialized in some kind of tasks.
* Vector extension

As example of specific task oriented cores:
* You don’t need a SIMD if you have a more powerful DSP unit, and you can implement this DSP unit using a RISC-V core with Vector extension, that is more efficient that a simple SIMD for this kind of task.
* JIT extension could be useful for some dynamic web server using scripting language (as PHP, Ruby, JS), but less useful for static web server (PCRE-jit computation in servers like nginx is marginal a core could be dedicated on a processor with many cores without this extension). Alibaba Group (Chinese Amazon) developed it’s own RISC-V implementation for its web servers).
* The European processor Initiative started in 2018, with first goal to uses United Kingdom made ARM core for main processor (at this time ARM had solid build/compilation/system ecosystem) with several kind of computing accelerators based on RISC-V, called EPAC (European Processor Accelerators)( It is developed at Barcelone with several partners inside European Union(, Sadly as most European union project it will help USA industry for manufacturing, (GlobalFoundries) instead of maintain, sustain and develop local knowledge, experience and workforce for independence, employment and smaller carbon footprint shipments (as China and United-States do). The first test version is a 22nm FPGA, the production one will be 12nm ASIC, and among the objectives, there will be to highest throughput while not going above the 1GHz top barrier, to achieve higher energy efficiency.

Operating System working on RISC-V in June 2021

First efforts with toward embedded operating systems as first available RISC-V chips was in this domain. As the RISC-V embedded market is mature, more effort are made toward mobile and desktop Operating Systems.

Several Linux distribution already work on RISC-V now. Next Debian Bulleye (january 2022 release, already in beta), Fedora have a RISC-V flavor already working on the BeagleV Starlight open-source board and its StarFive JH7100 processor, and there is a port of Yocto.

For reference, here is instructions about making the RISCV64 virtual machine on Debian Wiki, and a more general guide to make Linux run on Qemu, RISC-V.

You can find the Debian RISC-V system image on this page, just click on to download (direct link). This image is made with Debian Quick Image Baker (dqib)

To run it, you also need OpenSBI (Open Source Supervisor Binary Interface) needed to load the bootloader (Documentation, Prebuild deb packages) I used deb package on Archlinux:

ar x ../opensbi_0.9-1_all.deb
(cd /; sudo tar xf "$SBIPATH/data.tar.xz")

And the Uboot for Qemu. I personally just extract and the directory that also contain, the “artifacts” Debian image.

By default image is in Qcow format, that is more compact for unused blocks, but also really slower.
You can convert it easily by:

qemu-img convert -f qcow2 -O raw image.qcow2 image.raw

Here is the to launch it (you can replace image.raw by image.qcow2, if you have a verypowerfull system and only place count: I use 2 cores and 512M of RAM. For huge compilation I restart it with more mem (1536M is generally enough, but more means more cache and faster compilation).

qemu-system-riscv64 -machine virt -cpu rv64 -smp ${cores} -m ${mem} \
  -device virtio-blk-device,drive=hd -drive file=image.raw,if=none,id=hd \
  -device virtio-net-device,netdev=net -netdev user,id=net,hostfwd=tcp::2222-:22 \
  -bios /usr/riscv64-linux-gnu/lib/opensbi/generic/fw_jump.elf \
  -kernel ../qemu-riscv64_smode/uboot.elf \
  -object rng-random,filename=/dev/urandom,id=rng -device virtio-rng-device,rng=rng \
  -nographic -append "root=LABEL=rootfs console=ttyS0"

The login/pass are root/root.

you can connect by ssh:

ssh -p 2222 root@

and rsync files via:

rsync -a --rsh="ssh -p 2222" root@ .

I already managed to compile TIC-80 on it and run it on Qemu:


There is also BareDOOM a port of DOOM that run on RISC-V emulated in TinyEmu (source code in the same page, there is also a fork with additional features on GitHub, a system emulator for the RISC-V and x86 architectures), JSLinux allow to run it in a browser (There is also a Quake port on RISC-V K210 microcontroller based Sipeed Maix Bit board). There is also a patched version of buildroot for K210 (no-mmu), for building Linux on this platform.

There is an important Note in system images from Fabrice Bellard site to make binary working with TinyEMU:

- TinyEMU only supports raw boot loader and kernel images. So after
  building riscv-pk or the Linux kernel, you must convert the ELF
  image to a raw image with:

  riscv64-unknown-linux-gnu-objcopy -O binary bbl bbl.bin
  riscv64-unknown-linux-gnu-objcopy -O binary vmlinux kernel.bin

A port of Haiku has already well progressed, also use TinyEMU for the port.

Update 2 July 2021: Another RISC-V (RV32 only) emulator is Nemu (github) it is a part of XiangShan (香山) RISC-V open processor from Chinese Academy of Sciences (OpenXiangShan (Gitee)) made by Chinese Academy of Sciences, the processors should have the performances of an ARM Cortex-A72/A73 in july 2021 with a 28nm process in first batch (Yanqi hu / Yanqi Lake / 雁栖湖), and performances of an Intel i9-10900K in second batch ( Nanhu / South Lake / 南湖) in fall 2021, with 14nm process, both manufactured by TSMC, and it already run GNU/Linux distribution Debian. See also(中文).

Another Virtual Machine emulator for RISC-V is JuiceVM supporting RV64IMASU. It is lightweight, support small UART serial I/O and MMU

Available RISC-V Hardware in June 2021

Several developers have received a first beta version of BeagleV RISC-V board. Here are demos (on youtube sadly) of first tries of different devs at beginning of may "BeagleV RISC-V Computer (Beta)" (unboxing), "BeagleV from Fedora image Live Booting - 1" (booting), now BeagleV give a prepared Fedora with XFCE working on HDMI.

I have now 2 embedded microcontroller oriented RISC-V Board from Sipeed, one 32bits and one MaixDuino SipeedM1 (microPython (by default), dual-core 64bits+AI module) of the young hackers, Shenzhen based, SiPeed company. The last one support lot of embedded systems including default MicroPython based MaixDuino system (and cool interface, Arduino, PlatformIO, microPython, OpenMV, FreeRTOS, et TensorFlow, etc..

The Nezha board of SiPeed, is a bit more expansive and with lower specs in first version, but very promising for the future Nezha: Your first RV64 Linux SBC for IoT~ (video Youtube).

Huawei Hi3861 is oriented toward their LiteOS kernel that is used in their new Android compatible HarmonyOS.

The BL602/BL604 de Bouffalo Lab (RISC-V WiFi & Bluetooth 5.0 LE) based on ESP32-C (RISC-V variant of ESP32, pin2pin compatible) is a 100 % open source BootLoader & driver (no blob needed), thanks to the work of Lup Yuen Lee (李立源). He wrote lot of interesting articles about the process of making the driver and a book about this chip, and several article around Ecosystem, including using Rust, How to simulate it in WebAssembly, etc.

China Science Academy is currently working on optimizing Firefox (SpiderMonkey) and Chrome/ium (Webkit) engines for RISC-V 2000 laptops with equivalent power of a Cartex-A78 should be available at then end of 2022

At the same time the port of true GNU/Linux on embedded devices like phones progress fast, on ARM architecture, with specialized distributions like PostMarket OS (and it's derivative Alpine Linux), or more general distributions, including Debian, Manjaro (ArchLinux derivative) etc. Port of KDE Plasma and GTK4/GNOME40 (especially GTK4.1+ with very efficient OpenGL acceleration, are of great help in this area. PinePhone from community is really an active and efficient hub for these ports. This phone (developer oriented in current state) is at the same time cheap (<200€) have hard switch for all network features, and every part can be easily changed. Those project are all ready to be ported on RISC-V versions of this kind of devices. Pine64 is already working on RISC-V opensource bl602 driver (see above) and a RISC-V (GD32VF103TB) running a smart/programmable iron solderer, and a future RISC-V based mother board to replace the current ARM one on the PinePhone could be totally realistic. See also LINux on MOBile for news on the port of Linux on Mobile devices.

An interesting post (and blog) about RISC-V assembly programming from Stephen Marz, another blog about RISC-V assembly from Daniel Mangun and one from Build a RISC-V CPU From Scratch. A simple HelloWorld example, with deep explanations, including Linux RISC-V Application Binary Interface (ABI), to start with RISC-V assembly, based on GNU Assembler (support RV32 & RV64). There is also a Python made, limited, RISC-V assembler. A complete tutorial in French for starting with the Sipeed Longan Nano, (available for ~5 € with LCD screen).

HTML5 RISC-V Interpreter/simulator. There is also RARS a really slow/unusable Java RISC-V simulator (pacaur -S rars), jupiter (with link to other simulators) (pacaur -S jupiter) is another one, and spike (pacman -S spike) is a c made simulator. Ripes (pacaur -S ripes-git) is a very advanced one, with multiple level of pipe, data/instruction cache states, etc... Venus with online simulator in Kotlin language.

Tutorial serie about designing RISC-V processor in VHDL.

I hope that with progress I made in real-time programming and different new programming languages in last few years (Lua, some bit of RISC-V assembly, JavaScript), I will make quickly some RISC-V demo on embedded board.

Tester un système Linux RISC-V avec qemu sur ARM et ArchLinuxARM

There is also an english tutorial with more informations here

Pour cela, on peut utiliser la distribution Busybear-linux, très limitée, mais déjà bien pour un premier test de Qemu avec RISC-V (Site officiel, le CPU à sources ouvertes et sous license libre). il a l’avantage de fournir un système pré-compilé, prêt à l’emploi ici :

Les deux fichiers indispensables sont :
* bbl.bz2 = boot
* busybear.bin.bz2 = système

Récupérer les fichiers de busybear et les décompresser :

bzcat bbl.bz2 >bbl
bzcat busybear.bin.bz2 >busybear.bin

Les explications que j’ai récupéré viennent du le wiki d’arch pour le périphérique réseau : // car BusyBear donne des instruction pour des anciens systèmes Debian/Ubuntu (avant le passage à Netplan).

Sur archlinux(ARM) nous avons donc besoin d’uml_utilities qui se trouve dans la grande yaourtière.

tar xf uml_utilities.tar.gz
cd uml_utilities
makepkg -A # ignore l'architecture définie dans le PKGBUILD

Il faut ensuite passer en root (ou avoir mis des droits sudo globaux à l’utilisateur pour installer ce paquet :

su - root
cd dossier_de_l'archive
pacman -U uml_utilities*.pkg.tar.xz

Profiter d’être en root pour préparer l’interface réseau pour qemu (remplacer alarm par l’utilisateur de votre choix :

tunctl -u alarm -t tap0
ifconfig tap0 netmask up

Puis se deloguer de root par logout ou exit.

Dans le dossier où sont placer les deux fichiers préalablement décompressés :

qemu-system-riscv64 \
  -nographic -machine virt -kernel bbl \
  -append "root=/dev/vda ro console=ttyS0" \
  -drive file=busybear.bin,format=raw,id=hd0 \
  -device virtio-blk-device,drive=hd0 \
  -net nic -net tap,ifname=tap0,script=no

Le boot sur busybear/RiscV va alors commencer. Il se bloc pendant quelques secondes sur le logo RISC-V en ASCII-art :

qemu-system-riscv64: warning: hub port hub0port0 has no peer
qemu-system-riscv64: warning: vlan 0 with no nics
qemu-system-riscv64: warning: netdev hub0port0 has no peer
qemu-system-riscv64: warning: requested NIC (anonymous, model unspecified) was not created (not supported by this machine?)
rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvv
rr                vvvvvvvvvvvvvvvvvvvvvv
rr            vvvvvvvvvvvvvvvvvvvvvvvv      rr
rrrr      vvvvvvvvvvvvvvvvvvvvvvvvvv      rrrr
rrrrrr      vvvvvvvvvvvvvvvvvvvvvv      rrrrrr
rrrrrrrr      vvvvvvvvvvvvvvvvvv      rrrrrrrr
rrrrrrrrrr      vvvvvvvvvvvvvv      rrrrrrrrrr
rrrrrrrrrrrr      vvvvvvvvvv      rrrrrrrrrrrr
rrrrrrrrrrrrrr      vvvvvv      rrrrrrrrrrrrrr
rrrrrrrrrrrrrrrr      vv      rrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrr          rrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrr      rrrrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrrrr  rrrrrrrrrrrrrrrrrrrrrr


On voit aux message du kernel que c’est encore un noyau assez simple :

[   10.190000] This architecture does not have kernel memory protection.

On arrive enfin au prompt où pour se connecter il faut utiliser :
* Identifiant : root
* Mot de passe : busybear.

Et voilà !

ucbvax login: root
    ____                   ____                     __    _
   / __ )__  _________  __/ __ )___  ____ ______   / /   (_)___  __  ___  __
  / __  / / / / ___/ / / / __  / _ \/ __ `/ ___/  / /   / / __ \/ / / / |/_/
 / /_/ / /_/ (__  ) /_/ / /_/ /  __/ /_/ / /     / /___/ / / / / /_/ />  <
/_____/\__,_/____/\__, /_____/\___/\__,_/_/     /_____/_/_/ /_/\__,_/_/|_|
root@ucbvax:~# cat /proc/cpuinfo
hart    : 0
isa     : rv64imafdcsu
mmu     : sv48

Pour configurer le réseau :

ifconfig sit0 netmask up

On peut aussi le modifier dans /etc/hosts/interfaces pour qu'il soit pris en compte au reboot :

auto lo
iface lo inet loopback

auto sit0
iface sit0 inet static

!!! Attention, les cache/resolever DNS par défaut dans /etc/resolv.conf sont ceux de Google !!! Changer par un de votre réseau ou de votre fournisseur d'accès. Ceux de Google :

root@ucbvax:~# cat /etc/resolv.conf 

Vrai départ pour les pilotes libres pour les GPU Mali

Si les premiers pilotes amorcés en 2012 avaient étés abandonnées un peu plus d’un an plus tard, depuis l’été 2017 des nouveaux pilotes ; Lima Driver pour l’architecture Utgard (Mali-400 et 450) et Panfrost, pour architecture Midgard (Mali-Txxx) et Bitfrost, sont tous deux partis en flèche, au point d’effectuer les fonctions basiques et de bientôt pouvoir rejoindre le noyau Linux et la bibliothèque Mesa.

Luc Verhaegen (libv) avait commencé le premier pilote libre pour le processeur graphique ARM Mali-400 (architecture ugard) aux alentours de 2012, pour l’abandonner aux alentours de 2013. Les pilotes étaient restés figés depuis, à part quelques mises à jour minimes avortées. Mais depuis l’été 2017, Qiang Yu à relancé le projet et suit au plus près le noyaux Linux (aujourd’hui 4.17rc) et Mesa (aujourd’hui 18), pour une intégration rapide à ceux-ci.

D’un autre côté, Panfrost est un pilote réunissant le travail de Connor Abbott (qui avait fait un début de pilote en 2013 également pour l’architecture Midgard (Mali-T6xx et supérieur), créé un désassembleur de shaders, puis différents outils (compilateur Lima) pour l’architecture Midgard et Bitfrost (Mali-Gxx). Toujours au même moment, Alyssa Rosenzweig, qui a commencé le développement pour l’architecture Midgard avec le pilot Chai, coordonne ses travaux avec ceux de Connor Abbott dans un projet nommé Panfrost. Les progrès sont très rapide comme pour le nouveau pilote Lima. Les auteurs prévoient d’utiliser LLVMpipe pour l’émulation Logicielle des parties non encore intégrées pendant leur progression. en mai 2018, le test du cube utilisant des shaders initialement produit pour le pilote Freedreno, fonctionne parfaitement. Les shaders passent par NIR (une représentation intermédiaire des langages de shaders (comme glsl) dont le but est de faciliter la compilation dans le langage du processeur lui même), de Jason Ekstrand.

Vous pouvez suivre leur progrès :
* Sur le blog d’Alyssa Rosenzweig pour Panfrost (et les sources sur GitLab).
* Sur le compte dépôt git des sources de Qiang Yu pour Lima sur (linux-lima (pilote noyau DRM) et mesa-lima (pilote OpenGL ES/Gallium pour Mesa))
* Compte GitHub de Connor Abbott.

The nightmare of Samsung, progressive regression of basic usefull functions. (Corrected on Galaxy A after april 2 & 23, 2016 updates)

This entry was first published in mid-February 2016. April 2, 2016 system update correct the problem. Now, device can be used as MTP and PTP device.
April 23, 2016 system update correct the second problem. Now, USB mass storage device (lke usb keys) can be used trhough a USB-OTG wire.

Samsung doesn’t want anymore customers… at least with the Galaxy A series.
* Now, there is no more support for MTP/PTP (mass storage was already removed some years ago), so, you can’t anymore connect via USB on any computer and exchange files…
* Worst, USB mass storage media (like USB keys) are not recognised by USB-OTG wire :(. Why do they remove this basic functionnalities found on any Android devices, including 20$ chinese ones.
* Fuckin/Suckin Microsoft applications are added, as Samsung and Google overload was not enough, reducing battry lifetime to nearly nothing. You need lot of work to disable most of them (in settings, applications submenues), and rooting device to have really peace and battry life.

I was very used to buy Samsung phones with Samsung processors, as there was not US ones, because of current wars in several Asian (Irak, Afghanistan…) and African (Libya, etc…) countries. No Us even add lot of money (with their France, Germany, and Saudian Arabia partnerrs) to Daech, as if libyan was not enough. And as Samsung is a weaponry partner of US (like LG and Daewoo). And their are anti electronic-freedom, I will make everything to avoid them…

At the same time, chineses companies make nice phones, like Huawei with their own processors, Xiaomi, but with US, Snapdragon processors, Meizu, and taiwan chineses like Asus or some other made some too. In this area I really prefer Rockchip that work openly with the internationally made Linux kernel, and I hope to found smartphones with those fine processors. Their new generation RK3399 seems really promising for best computing and energy efficient performances. That’s definitivly last time I buy a Samsung phone :(.