Table of Contents
1###### # # # #
2# # # #### #### # # ## ## # # # ###### #####
3# # # # # # # # # # # # # # # # # #
4###### # #### # ##### # # # # # # ## ##### # #
5# # # # # # # # # # ## # #####
6# # # # # # # # # # # # # # # # #
7# # # #### #### # # # # # # ###### # #
2025-10-03: Preventing Clusterfucks and whatnots #
The Hidden Gift #
There was a hidden gem saved for me by this tablet, and it only pried it’s little head up until this very moment. There is a dependency clusterfuck for the VPU driver. Which explains why that little bastard was schreeching during the upgrade. As it turns out the VPU driver was compiled with a different version kernel than the one provided for me with this tablet, AND neither the kernel nor the driver are available on StarFive’s repository way over there in Hong Kong.
1You might want to run 'apt --fix-broken install' to correct these.
2Unsatisfied dependencies:
3 vpu-modules-6.6.20 : Depends: linux-image-6.6.20-starfive (= 6.6.20-starfive-98SF) but 6.6.20-starfive-103SF is installed
4Error: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
The devel is in the details. The string "98SF" more than likely represents the 98th build of StarFive components, and "103SF" probably refers to the 103rd build of StarFive components. Which means they are five builds apart.
Yet in the repository, the version available prior to "103SF" is "41SF", which would make them a fuck ton of builds apart, basically "41SF" is the legacy version of kernel 6.6.20.
1sudo apt show -a linux-image-6.6.20-starfive
2Package: linux-image-6.6.20-starfive
3Version: 6.6.20-starfive-103SF
4Status: install ok installed
5Priority: optional
6Section: kernel
7Source: linux-upstream
8Maintainer: buildserver <buildserver@buildserver-OptiPlex-7080>
9Installed-Size: 34.1 MB
10Depends: vf2-linux-config, u-boot-menu
11Homepage: https://www.kernel.org/
12Download-Size: unknown
13APT-Manual-Installed: yes
14APT-Sources: /var/lib/dpkg/status
15Description: Linux kernel, version 6.6.20-starfive
16 This package contains the Linux kernel, modules and corresponding other
17 files, version: 6.6.20-starfive.
18
19Package: linux-image-6.6.20-starfive
20Version: 6.6.20-starfive-41SF
21Priority: optional
22Section: kernel
23Source: linux-upstream
24Maintainer: root <root@leo-virtual-machine.localdomain>
25Installed-Size: 26.3 MB
26Depends: vf2-linux-config,u-boot-menu
27Homepage: https://www.kernel.org/
28Download-Size: 12.4 MB
29APT-Sources: https://debianrepo.starfivetech.com VisionFive2/contrib riscv64 Packages
30Description: Linux kernel, version 6.6.20-starfive
31 This package contains the Linux kernel, modules and corresponding other
32 files, version: 6.6.20-starfive.
Either way you split the mustard (or whatever the phrase is called), the broken package will need to be cleaned in order to move forward, and this action will probably result in removal. So, here we go.
1sudo apt --fix-broken install
2Correcting dependencies... Done
3The following packages were automatically installed and are no longer required:
4 apg gnome-accessibility-themes libblockdev-part2 libfuse3-3 libgtk2.0-bin libmagickcore-6.q16-6 libpoppler123 libtag1v5-vanilla libxklavier16 python3-pkg-resources
5 bind9-host gnome-backgrounds libblockdev-swap2 libgail-common libgtk2.0-common libmagickcore-6.q16-6-extra libpostproc56 libtiff5 libyelp0 python3-requests
6 bind9-libs gnome-themes-extra libblockdev-utils2 libgail18t64 libgupnp-igd-1.0-4 libmagickwand-6.q16-6 libpthread-stubs0-dev libtirpc-dev libzxingcore1 python3-six
7 chrome-gnome-shell gnome-themes-extra-data libblockdev2 libgcc-12-dev libicu72 libmaxminddb0 libpython3.10 libtsan2 ncat python3-typeguard
8 cpp-12 gsfonts libcbor0.8 libgcc-14-dev libitm1 libmbedcrypto7 libpython3.10-minimal libupnp13 network-manager-gnome python3-typing-extensions
9 gcc-14-base gtk2-engines-pixbuf libclang-common-15-dev libgccjit0 libixml10 libmozjs-102-0 libpython3.10-stdlib liburcu8t64 python3-autocommand python3-urllib3
10 gdisk libabsl20220623 libclang-cpp15 libgdata-common libjemalloc2 libmpdec3 libsdl-image1.2 libusbmuxd6 python3-certifi python3.10
11 gir1.2-gck-1 libasan8 libdbus-glib-1-2 libgdata22 libjim0.81 libnfs13 libsdl1.2debian libwebrtc-audio-processing1 python3-chardet python3.10-minimal
12 gir1.2-gcr-3 libassuan0 libecal-2.0-2 libglapi-mesa liblc3-0 libnsl-dev libsigsegv2 libwget0 python3-charset-normalizer tracker
13 gir1.2-gnomedesktop-3.0 libavdevice59 libflac12 libgnomekbd-common libldap-2.5-0 libopenh264-7 libsnapd-glib-2-1 libwinpr2-2 python3-idna tracker-miner-fs
14 gir1.2-handy-1 libavfilter8 libfreerdp-server2-2 libgnomekbd8 libllvm15 libpaper1 libsoup2.4-1 libwireplumber-0.4-0 python3-inflect
15 gir1.2-json-1.0 libblockdev-crypto2 libfreerdp2-2 libgoa-backend-1.0-1 liblsan0 libpcre3 libsoup2.4-common libwpe-1.0-1 python3-jaraco.context
16 gir1.2-nma-1.0 libblockdev-loop2 libfstrm0 libgspell-1-2 liblua5.2-0 libplacebo208 libswscale6 libwpebackend-fdo-1.0-1 python3-jaraco.functools
17 gkbd-capplet libblockdev-part-err2 libfuse2 libgtk2.0-0t64 liblua5.3-0 libplist3 libtag1v5 libxcb-dri2-0 python3-more-itertools
18Use 'sudo apt autoremove' to remove them.
19
20REMOVING:
21 vpu-modules-6.6.20
22
23Summary:
24 Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 15
25 1 not fully installed or removed.
26 Space needed: 0 B / 103 GB available
27
28Continue? [Y/n] y
29(Reading database ... 114526 files and directories currently installed.)
30Removing vpu-modules-6.6.20 (6.6.20-starfive-98SF-vf2) ...
Now we can move forward.
Christmas in October #
So, while I was reading up on how to build debian from scratch, I came across StarFive’s Github
repository for debian. Which appears to have a
release specifically for the PineTab-V, and it
appears to be a newer release then I am currently on. These files appear to be similar to those tucked away inside
/root
. Although, it is unclear exactly where the source code is located, or how it is supposed to be obtained. This
entails some investigating is in order to resolve this issue.
Giving Apt some priorities. #
In my experience, prioritizing repositories is a practice more common in Red Hat varients of linux. This is because of Red Hats dedication to providing a "enterprise class" operating system. So, in order to get the newest of updates, you end up having to add several third party repositories, then these repositories end up conflicting from each other, because RPM does not have the dependency resolution it should. Debian seems to not have this problem, and a lot of that has to do with their universal approach.
For our build, we need to ensure the tablet’s manufacturer’s packages are given priority over the distributional repositories. Furthermore, we need to ensure specifically the graphical driver’s repository is given a higher priority over the manufacturer’s kernel repository. This later requirement is to ensure the driver’s dependencies are met.
Acquiring a dump of the current priority settings. #
This is done with the command apt-cache policy
, and the output is included below. What is important to notice is that
every repository has the same priority of "500". The other thing to notice is the set of latin characters (o,a,n,c,b,l)
followed by an equal sign and a label on the second line of every repository listing. These are "Release Attribute
Tags", and they make about as much sense as putting Abraham Lincoln in a school bus and rocketing him to the moon. We
will discuss those in the next section.
1Package files:
2 100 /var/lib/dpkg/status
3 release a=now
4 500 https://debianrepo.starfivetech.com VisionFive2/restricted riscv64 Packages
5 release o=StarFive Debian,a=sid,n=VisionFive2,c=restricted,b=riscv64
6 origin debianrepo.starfivetech.com
7 500 https://debianrepo.starfivetech.com VisionFive2/contrib riscv64 Packages
8 release o=StarFive Debian,a=sid,n=VisionFive2,c=contrib,b=riscv64
9 origin debianrepo.starfivetech.com
10 500 https://debianrepo.starfivetech.com starfive-debian/main riscv64 Packages
11 release o=StarFive Debian,a=sid,n=starfive-debian,l=starfive,c=main,b=riscv64
12 origin debianrepo.starfivetech.com
13 500 https://mirrors.ocf.berkeley.edu/debian sid/non-free-firmware riscv64 Packages
14 release o=Debian,a=unstable,n=sid,l=Debian,c=non-free-firmware,b=riscv64
15 origin mirrors.ocf.berkeley.edu
16 500 https://mirrors.ocf.berkeley.edu/debian sid/non-free riscv64 Packages
17 release o=Debian,a=unstable,n=sid,l=Debian,c=non-free,b=riscv64
18 origin mirrors.ocf.berkeley.edu
19 500 https://mirrors.ocf.berkeley.edu/debian sid/contrib riscv64 Packages
20 release o=Debian,a=unstable,n=sid,l=Debian,c=contrib,b=riscv64
21 origin mirrors.ocf.berkeley.edu
22 500 https://mirrors.ocf.berkeley.edu/debian sid/main riscv64 Packages
23 release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=riscv64
24 origin mirrors.ocf.berkeley.edu
25Pinned packages:
Creating a preferences file #
The directory /etc/apt/preferences.d
should be empty, if not then open up the files that are there and examine the
priority settings. We are going to want to create a preferences file for each repository that needs to be prioritized
above or below the default value of "500". We will take it step by step.
Prioritize a package, set of packages, or all packages. #
Unless you want to pin a solitary package or group of packages set this to the "*" wildcard expression, which means you want to apply the preferences to all packages in the repository.
1Package: *
Pin the Repository Attribute Label and Definition #
This line will begin with the tag Pin:
, to inform apt what needs to be pinned. Then we will use the "Release" label to
inform apt that we will be pinning packages based on the "Release" attribute of every packages, and finally we will need
to decipher those release attribute tags we referred to earlier. To do this, I took way too much time to create a
diagram to explain what every one of those tags meant. So, you better enjoy it.
The entire principle is to pin the desired release attribute tag which both encompases what you desire to prioritize and excludes what you do. Take the following example.
1 # Repo A
2 500 https://debianrepo.starfivetech.com VisionFive2/contrib riscv64 Packages
3 release o=StarFive Debian,a=sid,n=VisionFive2,c=contrib,b=riscv64
4 origin debianrepo.starfivetech.com
5
6 # Repo B
7 500 https://debianrepo.starfivetech.com starfive-debian/main riscv64 Packages
8 release o=StarFive Debian,a=sid,n=starfive-debian,l=starfive,c=main,b=riscv64
9 origin debianrepo.starfivetech.com
10
11 # Repo C
12 500 https://mirrors.ocf.berkeley.edu/debian sid/non-free-firmware riscv64 Packages
13 release o=Debian,a=unstable,n=sid,l=Debian,c=non-free-firmware,b=riscv64
14 origin mirrors.ocf.berkeley.edu
Now using the table below, examine how the use of different release attribute tags would effect whether the priority setting will apply to repository or not.
Release Tag | Repo A | Repo B | Repo C | # Inc. | # Exc. | |
---|---|---|---|---|---|---|
o=StarFive Debian | Yes | Yes | No | 2 | 1 | <-- This is more Specific |
a=sid | Yes | Yes | No | 2 | 1 | <-- Than This. Know why? |
n=sid | No | No | Yes | 1 | 2 | |
n=VisionFive2 | Yes | No | No | 1 | 2 | |
c=contrib | Yes | No | No | 1 | 2 | |
c=non-free-firmware | No | No | Yes | 1 | 2 | |
l=starfive | No | Yes | No | 1 | 2 | |
o=Debian | No | No | Yes | 1 | 2 | |
b=riscv64 | Yes | Yes | Yes | 3 | 0 | Architecural Tag |
So, in order to prioritize Repo B over Repo C and Repo A over both Repo B & C, we should create two files in the
/etc/apt/preferences.d/
folder. One for "VisionFive2", and the other for "starfive-debian". Then we will assign Repo A
a priority of 700, and Repo B a priority of 600. So, both will be prioritized over Repo C, and Repo A over Repo B.
You caught that right?
Adding the pinning designation and the priorty to the preferences files. #
1# File: visionfive2
2Package: *
3Pin: Release n=VisionFive2
4Pin-Priority: 700
5
6# File: starfive
7Package: *
8Pin: Release n=starfive-debian
9Pin-Priority: 600
Now we have prioritized the repositories to prevent package conflicts in the future.
The End of Part 3.
References #
Random and meaningless references: