Day 20
HADK guide,
7.1 Creating Repositories for a New Device
(Skipping sparse/var/lib/environment/compositor/droid-hal-device.conf - it is already present in droid-configs-device/sparse/var/lib/environment/compositor/droid-hal-device.conf, without the touchscreen device part.)
After creating the three repos droid-hal-sake, droid-config-sake, droid-version-sake and I also check in PLATFORM_SDK$
(sfossdk command)
-
cat /etc/os-release
gives me 4.3.0.15, which is minimum supported
-
sdk-assistant tooling list
contains 4.4.0 (which I want to target) and ‘latest’
-
sdk-assistant target list
contains… xiaomi-tucana
I need to create a new target - I download Sailfish_OS-4.4.0.58-Sailfish_SDK_Target-aarch64.tar.7z and run sdk-assistant target create asus-sake-aarch64
.
But how will the next commands know that they should use this new target?
There’s a footnote in the HADK doc that says:
mb2 looks for a directory named .mb2, where it stores some of its state. It is created implicitly by mb2 … build and you can also
create it explicitly with mb2 -t $VENDOR-$DEVICE-$PORT_ARCH build-init
Indeed, I now see that cat .mb2/target
has asus-sake-aarch64.default
. So I can proceed without breaking my previous target.
Next, execute commands from “7.2.1 Building the droid-hal-device packages” HADK doc.
rpm/dhd/helpers/build_packages.sh --droid-hal
The first command fails while checking CONFIG_DUMMY (should be n
), CONFIG_UEVENT_HELPER_PATH and CONFIG_FW_LOADER_USER_HELPER (should be n
).
I think my “minimal changes” kernel will probably not work with these checks.
Either I have to a). disable the checks “temporarily” or b). switch back to the initial branch that passed through all the kernel checkers.
Of course I go with b). initially. I always wanted to test hybris-recovery with that anyway:)
The kernel “works” in the same way meaning that it “reboots when I say so”, but still no telnet.
It seems to pass the --droid-hal
check, which now complains that cannot stat './out/target/product/sake/hybris-updater-script'
That one seems to be missing from the fact that there is no /boot detected when I make hybris-hal (that is, kernel and boot images):
/boot appears to live on
/data appears to live on /dev/block/bootdevice/by-name/userdata
It definitely doesn’t “Live on”:). That was supposed to be a device path.
The hybris-boot/Android.mk presents me with the challenge to understand Perl.
/usr/bin/perl -w -e '$$fs=shift; if ($$ARGV[0]) { while (<>) { next unless /^$$fs\s|\s$$fs\s/;for (split) {next unless m(^/dev); print "$$_\n"; }}} else { print "ERROR: *fstab* not found\n";}' /boot $HYBRIS_FSTABS | sort -u
It’s one line, how hard can it be ;)). HYBRIS_FSTABS
is a list of fstab files.
So, the perl expression is using shift
which probably means it read the first argument (which is /boot
) then for the ‘next first argument’ ARGV[0] it uses some while spaceship (probably iterating through each fstab path?) where next
is called (continue
?) unless that $fs is matching at the beginning or between \s some \s and then split and for next unless /dev…
Anyway, enough perl, I didn’t have a /dev
path in the fstab that listed /boot.
The build_packages.sh --droid-hal
seems to start the real work now.
Meanwhile mal explains what to do with dynamic partitions. Right on time:) Telegram: Contact @sailfishos_porters
So I need to skip generating some systemd mounts in droid-hal spec file.
%define makefstab_skip_entries /odm /product /system /system_ext /vendor
Also I get this complaint from --droid-hal
build above:
error: Installed (but unpackaged) file(s) found: /bugreports /cache /d /sdcard
Which I resolve by adding %define straggler_files ..
with that list above.
Building of droid-hal-sake finished successfully.
Next is rpm/dhd/helpers/build_packages.sh --configs
That already installs some packages in the target (bluez5 etc) but works.
Next is rpm/dhd/helpers/build_packages.sh --mw
mmmiddleware… La crème.
Nothing to do.
Build libhybris? [Y/n/all]
If I remember correctly it asks for each one of the packages. So I’ll go with “all”
That takes some time but finishes alright
Next is rpm/dhd/helpers/build_packages.sh --gg
Please build droidmedia as per HADK instructions
!! Failed to pack_source_droidmedia-localbuild.sh
Well, let’s TEMPORARY_DISABLE_PATH_RESTRICTIONS=true make -j$(nproc --all) droidmedia
one more time, I didn’t since a couple of days.
ninja: no work to do.
Still the same error.
touch external/droidmedia/droidmedia.cpp
Doesn’t build anything either. There is no out/target/product/sake/system/lib*/libdroidmedia*
either,
Looking at external/droidmedia/Android.mk
I see LOCAL_MODULE := libdroidmedia
(along others). Let’s make
that…?
Actually, I think I know what’s going on. I checked out the 0.20220929.0
tag for 4.5.0 as in hadk-hot and for 4.4.0 the 0.20211101.0
tag was supposed to be used.
But I get the same error. I need to understand where droidmedia
target is.
Grepping the *.mk files again, I find it in … hybris-boot:
droidmedia: $(shell external/droidmedia/detect_build_targets.sh $(PORT_ARCH) $(TARGET_ARCH))
If I manually run that command I get the list of targets libdroidmedia minimediaservice minisfservice libminisf
from external/droidmedia.
I’ll just make
all of those and assume that me making hybris-hal without droidmedia marked that shell target generation as ‘done’ and it doesn’t get evaluated again \o/
It completes.
Next is rpm/dhd/helpers/build_packages.sh --version
Check /home/vlad/hadk/hybris/droid-hal-version-sake.log for full log.
!! building of package failed
Checking that log reveals:
File /etc/ofono/binder.conf
from install of
droid-config-sake-1-202303222304.aarch64 (dir:/home/vlad/hadk/hybris/droid-hal-version-sake/.mb2/filtered-output-dir)
conflicts with file from package
ofono-configs-binder-1.0.2-1.1.1.jolla.aarch64 (@System)
File conflicts happen when two packages attempt to install files with the same name but different contents. If you continue, conflicting files will be replaced losing the previous content.
Which means that I need to make a change to droid-config-sake spec.
Hadk-hot has the solution for that readily available,
Provides: ofono-configs
Obsoletes: ofono-configs-mer
Adding those, re-building --configs
, then --version
…
While building I remembered that Lineage /data is going to get wiped for the next test.
I install Open Camera and notice that if you switch to Camera 2 API, there are settings for Edge Detection and Noise reduction.
Cranking the Edge detection down (off) and Noise reduction to “High Quality” I get similar results to my Mi Note 10 that has a larger sensor but tends to not sharpen but to aggressively remove noise. The Camara 1 API shots on ASUS are however very sharpened by default. It is good to know that just changing the API adds access to those options. Of course, Noise reduction should be minimal too 
Hmm. same error in hybris/droid-hal-version-sake.log
.
A quest for tomorrow:)