HADK - Hot
hybris-20 WIP
/usr/sbin/dummy_compositor: unrecognized option '--hwc-restart'
2023.04.14
sdk-assistant maintain $VENDOR-$DEVICE-$PORT_ARCH zypper se kf5bluezqt-bluez4 > /dev/null
ret=$?
if [ $ret -eq 104 ]; then
buildmw -u "https://github.com/sailfishos/kf5bluezqt.git" \
-s rpm/kf5bluezqt-bluez4.spec || die
# pull device's bluez4 configs correctly
sdk-assistant maintain $VENDOR-$DEVICE-$PORT_ARCH zypper remove bluez-configs-mer
fi
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -R -m sdk-install zypper in ccache
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper rm bluez5-configs-mer
grep --include=_apiurl -rl build.merproject.org . | xargs sed -i 's/build.merproject.org/build.sailfishos.org/g'
grep --include=_apiurl -rl api.merproject.org . | xargs sed -i 's/api.merproject.org/build.sailfishos.org/g'
* 'zypper ref' doesn't really check whether url is correct or even reachable. It doesn't even mention failed refresh metadata for unavailable repositories. It seems to be related to ssu repository plugin.
hybris-18
kernel: loop_set_status: loop0 () has still dirty pages (nrpages=
kernel: print_req_error: I/O error, dev loop1, sector 0
kernel: Buffer I/O error on dev loop1, logical block 0, async page read
apexd: Failed to LOOP_SET_BLOCK_SIZE: Try again
* Starting ueventd can be caused by failure of some important services with reboot_on_failure option like apexd. This should be fixed in hybris-patches to ease early debugging.
Unknown class service_manager
2021.07.20
- For hybris-17:
2023.07.12
2023.02.05: Release specific issues
- 4.5.0.18
- 4.4.0.64:
- 4.3.0.12:
- 4.2.0.x:
- 4.0.1.x:
- Read https://github.com/mer-hybris/hadk-faq#android-base-specific-fixes before you start building
- sailfishos-porters channel logs search: https://piggz.co.uk/sailfishos-porters-archive/index.php. It's case sensitive!
- Latest sdk target url usually points to not latest sailfish release so always use versioned target url when preparing sdk:
- HADK pdf:
- For android 8-10 devices which use system-as-root without separate recovery you need to disable skip_initramfs handling so kernel can use hybris-boot initramfs. In kernel init/initramfs.c history find 2 following commits and revert them: "call free_initrd() when skipping init" and "Add skip_initramfs command line option". Alternatively, you can force in source code do_skip_initramfs = 0.
- mer-kernel-check: do not enable OPTIONAL filesystems unless you plan to use them.
- * If you do not package '/system' partition like in Sailfish X build instructions then you must have actual files instead symlinks in sparse/etc/selinux otherwise you will get: Servicemanager: add_service Permission denied.
- Make sure that after making hybris-hal, you have fstab* and ueventd*rc in out/target/product/$DEVICE/root/: https://github.com/mer-hybris/droid-hal-device/blob/53e6b3018148e4cc2a73e816ae979af8c5d2bfaa/droid-hal-device.inc#L498
-
Generally it is a system partition with init files (part of ramdisk) and with another /system directory and if mounted incorrectly strange looking symlinks like /system/etc -> /system/etc. This should be handled automatically by droid-hal scripts provided your android's fstab in out/ contains proper entry for system partition. In that case system partition is mounted to /system_root and /system_root/system is mounted to /system. Some devices which use system-as-root uses '/system' mountpoint for system partition entry in fstab instead '/' which needs to be changed to get correct systemd mount units generated: system_root.mount and system.mount.
-* Since android 8 some partitions can be mounted very early based on entries from devicetree instead android's fstab. Make sure you have all these partitions mounted in sailfish. For example samsung exynos7420.dtsi devicetree have defined efs partition which may be required to get wifi working correctly:It can be checked also on device in:/proc/device-tree/firmware/android/fstab/-* For some devices ueventd*rc file do not contains all needed rules. Common missing rule is /dev/ion but can be anything else. In that case, copy ueventd*rc somewhere from /vendor partition or /system_root as ueventd.$DEVICE.rc to appropriate place in out/ directory.* Format /data partition before flashing sailfish to remove full disk encryption (FDE) or file based encryption (FBE) which will cause permission issues later (failed: Required key not available)gzip instead bunzip: https://piggz.co.uk/sailfishos-porters-archive/index.php?log=2023-04-13.txt#line293. Do not forget to update local repo metadata.- When creating local manifest add device specific repositories from device/*/*/{cm,lineage}.dependencies files
- * Updating and building droidmedia:
git
gitfetch, pullorand checkout to specific revision
- make droidmedia (in HABUILD)
- build_packages.sh --gg
Be careful if you use not recommended version for particular release. These steps will build only droidmedia but not droidmedia-devel which is used during gst-droid build done on jolla's servers- To access scratchbox target as root: sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R
- To access scratchbox target for building manually (cmake, make,..): sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-build
- HABUILD 'sudo: account validation failure, is your account locked?'
- Latest ubuntu sdk do not have cpio installed which is required to create initramfs
- build_packages.sh fails with: "usage: mb2 [global-opts] <command> [command-opts]": update platform sdk to >= 4.3.0.15
- journal: 'systemd: Failed to create /user.slice/user-100000.slice/user@100000.service/init.scope control group: Permission denied
- Sailfish browser use now gmp-droid instead gst-droid. If you used "dont-use-droid-convert" quirk or have some playback issues then you probably need:
- build_packages.sh fails: 'File /etc/ofono/ril_subscription.conf
- droid-hal-version-$DEVICE.log: Problem: the to be installed droid-config-$DEVICE-1-202111031520.armv7hl requires '$DEVICE-bluez-configs', but this requirement cannot be provided:
- No vibration:
- Check what driver your device use. For memless driver evdev_trace command (from mce-tools package) should prints device with FF_RUMBLE or other supported effects.
- ' max77843-fuelgauge: driver failed to report `status' property: -22' this kind of spam in dmesg is usually caused by broken drivers which reports property which they do not support. Suppresing error printing in power_supply_sysfs.c can lead to several issues so real bug must be fixed in particular driver. For example following driver pretends to support status property:
- USB cable detection is handled by usb-moded. It expects online/present and type events from power_supply devices for proper functioning. For debugging issues use 'udevadm monitor -p' and -D argument in /var/lib/environment/usb-moded/usb-moded-args.conf.
- * Some devices needs forcing the USB to start in peripheral mode otherwise there will be no sign of usb connection in dmesg:
- ofono plugin:
- pulseaudio plugin:
- sensorfw plugin:
- bluetooth:
- Random kernel <= 3.10 crash at:
- Some 3.4 kernels requires vfs patches to get systemd working. They can be found in 2 following places:
- ohmd failing twice or more with error: 'ohmd.service: Failed at step NAMESPACE spawning /usr/sbin/ohmd: No such file or director' is caused by mising namespace options from mer-kernel-check and CONFIG_USER_NS
SomeUpdateddevicespromote.pyneedsforforcing the USB to start in peripheral mode otherwise there will be no sign of usb connection in dmesg:python3:- * Alternative to lipstick-hack (aka surfaceflinger-hack): https://wiki.merproject.org/wiki/Adaptations/faq-hadk#Alternative_to_lipstick-hack_.28aka_surfaceflinger-hack.29
- binder-list from libgbinder-tools package:
- Check in .config, zcat /proc/config.gz or dmesg whether selinux is set up correctly. When you build kernel, defconfig is used as source from which out/target/product/$DEVICE/obj/KERNEL_OBJ/.config is generated. If you forgot about dependencies in defconfig then it will not match generated .config. Sometimes defconfig is stripped from some configs so it's good to regenerate it: build kernel without any hybris changes in defconfig, copy generated .config back to defconfig and commit that change. Disabling CONFIG_AUDIT which is part of CONFIG_SECURITY_SELINUX dependencies is common mistake.
- Search for "droid mount" in journal and make sure /system and other partitions are mounted
- Search for firmware loading failure. If particular driver needs firmware before partitions are mounted and droid-load-firmware.sh is not triggered then building driver as module and creating systemd service (like for wlan) which will modprobe it might help.
- droid-hal-init (modified android init) must not fail and usually can't be started twice unless it fails on early stage or you clean up some files it created before starting it again. If you want to strace it then mask service and reboot: 'systemctl mask droid-hal-init'. logcat can be used only after droid-hal-init started.
- compositor used by sailfish is called lipstick. For debugging gui issues use 'systemctl mask user@100000' and reboot device. This will prevent lipstick starting/failing and ease test_hwcomposer/minimer use.
- To test android part, mask user@100000, reboot an start surfaceflinger:
***sudo pwck -q --root "$PLATFORM_SDK_ROOT"/sdks/ubuntu***systemd: Failed to allocate manager object: Permission deniedsystemd: Failed to create cgroup /user.slice/user-100000.slice/user@100000.service/*: Permission denied'Apply "Remove /dev/cg2_bpf cgroup device" patch: https://github.com/mer-hybris/hybris-patches/commit/54008fe9fc67c13eff6d3d48f78bb268af7883be.If that doesn't help then add systemd.legacy_systemd_cgroup_controller=yes to kernel command line*Now gecko-camera-droid-plugin?*from install ofdroid-config-$DEVICE-1* (local-$DEVICE-hal)conflicts with file from packageofono-configs-mer-* (@System)'or similar for 'File /etc/ofono/binder.conf' and ofono-configs-binder conflictsAdd https://github.com/mer-hybris/droid-config-sony-nile/blob/master/droid-config-common.inc#L11-L12 to droid-config-$DEVICE.spec, build packages and then:DEVICE'sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper --plus-repo $ANDROID_ROOT/droid-local-repo/$DEVICE in droid-config-$
DEVICE'*sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper --plus-repo $ANDROID_ROOT/droid-local-repo/$DEVICE in droid-config-$DEVICE*For driver with sysfs based interface (timed_output) update your $ANDROID_ROOT/system/core:Also make sure permissions are not overwritten by some other init*rc files in /system or /vendor partitionuser is no longer in system group: https://github.com/mer-hybris/droid-hal-device/commit/1dac6f1ff3b58215003af61ba52bd91c5b177219Change *_rotator group to graphics in: device/$VENDOR/*/ueventd.*.rc:/dev/*_rotator 0664 system graphicsSet QT_OPENGL_NO_BGRA=1 in 99-qtscenegraph.conf: https://github.com/mer-hybris/droid-config-sony-nile/blob/master/sparse/var/lib/environment/nemo/99-qtscenegraph.conferror: cannot open Packages index using db4 - (-30971)error: cannot open Packages database in /var/lib/rpm':sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R rm -rf /var/lib/rpm/__db.00*
- can be skipped now.*Updated promote.py for python3:https://pastebin.com/KC4LKydz. Make sure you use right "apiurl =https://build.sailfishos.org" in ~/.oscrcbluez4 was dropped:https://github.com/mer-hybris/droid-hal-configs/pull/245* Alternative to lipstick-hack (aka surfaceflinger-hack):https://wiki.merproject.org/wiki/Adaptations/faq-hadk#Alternative_to_lipstick-hack_.28aka_surfaceflinger-hack.29but clearly status is not handled neither in max77843_fg_get_property nor in max77843_fg_set_property. Removing POWER_SUPPLY_PROP_STATUS should fix issue for this particular driver but other drivers might require different fixes. Fixing one bug might reveal another:'max77843-fuelgauge: driver failed to report `charge_full' property': It support setter but not getter so add 'return -ENODATA in appropriate get_property function''bq51221-charger: driver failed to report `current_now' property'Becarefulcareful: these are just examples and you are dealing with Li-Ion related drivers.*Some devices doesn't send online/present udev events on usb connection/disconnection but still set this parameters: /sys/class/power_supply/*/{uevent,present,online,type}. In that case adding power_supply_changed(<usb power_supply pointer>) to driver might be enough to get everything working:Alternative way is tracking ext_con or android_usb devices: https://github.com/sailfishos/usb-moded/pull/12* Plugins: which one you should use is really device and adaptation/stock android versionsepcificspecific-ofono-ril-plugin <= android 7ofono-ril-binder-plugin <= android 10ofono-binder-plugin >= android 10: binder-list -d /dev/hwbinder | grep IRadioAdditionally you need configuration files in sparse/etc/ofono, different for each plugin. See sony droid-config repos https://github.com/mer-hybris?q=droid-config- to figure out correct configs for plugin.-pulseaudio-modules-droid-jb2q <= android 10pulseaudio-modules-droid >= android 11-If you device have only 32bit audio library e.g. /vendor/lib/hw/audio.primary.universal7420.so but without 64bit version e.g. /vendor/lib64/hw/audio.primary.universal7420.so then hidl_compat wrapper may help you:Make sure android.hardware.audio.service is not disabled in disabled_services.rc. Currentl it may not work with non jb2q modules-hybris-libsensorfw-qt5: >=android 8: binder-list -d /dev/hwbinder | grep ISensorshybris-libsensorfw-qt5-hal <= android 7: test_sensors-On recent android bases you need to install bluedroid and enable HCIVHCI and some other configs:*'fs/sysfs/dir.c' called by sysfs_remove_dir: BUG_ON(sd->s_flags & SYSFS_FLAG_REMOVED);Apply "kobject: grab an extra reference on kobject->sd to allow duplicate deletes" patch:***https://review.lineageos.org/c/LineageOS/android_device_xiaomi_sm6150-common/+pastebin.com/KC4LKydz. Make sure you use right "apiurl = https:/291494/4/build.sailfishos.org" in ~/.oscrc* bluez4 was dropped: https://github.com/sailfishos-on-sake/hybris-boot/blob/fa1ec67d3e8cfa564f61f6c1a0f65caf7c64fbfa/init-script#L197-L199mer-hybris/droid-hal-configs/pull/245* 4.2.0.x: gst-droid: upgrade-4.2.0 (if you have recording issue then try to revert last commit and report it)-------------------------------------------------------------------------------------------------------------2022.07.31: Generating logs:
-w (live log, not supported on very old kernels)Arguments:--no-pager (shows everything without paging)--no-tail -f (shows everything and continuously prints new messages)-b0 (only from current boot, useful if you have persisten logging enabled) -b-1 (from previous boot)*binder-list binder-list -d /dev/hwbinder binder-list -d /dev/vndbinder
-------------------------------------------------- --------------------------------------------------------I have telnet but not gui:
*
*
*
*
*
/system/bin/surfaceflinger
# On android >= 11 you may also need:ANDROID_ROOT="/system" /system/bin/bootanimation-------------------------------------------------- --------------------------------------------------------2022.02.23: OBS (build.sailfishos.org) tips and tricks
Useful OBS Notes:https://github.com/sailfishos-chum/main/blob/main/GettingStarted.md* Follow fp2-sibon example repos and adapt for your device: https://build.sailfishos.org/project/show/nemo:devel:hw:fairphone:fp2-sibon and https://build.sailfishos.org/project/show/nemo:testing:hw:fairphone:fp2-sibonblocked:blocked for very long time with following message: "downloading 1 dod packages". Ping OBS maintainerEXTRA_NAME="extra"
sudo mic create fs --arch=$PORT_ARCH \--tokenmap=ARCH:$PORT_ARCH,RELEASE:$RELEASE,EXTRA_NAME:$EXTRA_NAME \--record-pkgs=name,url \--outdir=sfe-$DEVICE-$RELEASE$EXTRA_NAME \--pack-to=sfe-$DEVICE-$RELEASE$EXTRA_NAME.tar.bz2 \$ANDROID_ROOT/Jolla-@RELEASE@-$DEVICE-@ARCH@.ks #--verbose --debugBack to top
*
*If they are not there and you are using old android base then 'make modules' (on hybris-18 use 'allmod') can help figuring out name of modules you need and build it like: 'make fstab.qcom ueventd.rc'. If there are no such modules or files are still not copied to out/ directory then do it manually. Read $ANDROID_ROOT/droid-hal-$DEVICE.log to confirm that mount units for /system and other partitions are created. If android's fstab do not include '/system' (or '/' in case of system-as-root), '/vendor' or '/boot' entry then you might need to add them manually.
2023.05.28: General info and various issues
WRITE
˓→ALL IN ONE LINE(:'