[DISCLAIMER]
have no idea if this interferes with system updates!
[/DISCLAIMER]
I see 2 ways to get the /etc/hosts file to be used in AD/AAS.
- Add the script /usr/libexec/appsupport/alien-generate-extra-config.sh
with this:
lxc.mount.entry = /etc/hosts system/etc/hosts none bind,create=file 0 0. Make it executable. Didn't test this one, though. - Patch /usr/libexec/appsupport/prepare-aliendalvik.sh. After …"$CONTAINER_CONFIG_PATH/10-bsp_config" put echo “lxc.mount.entry = /etc/hosts system/etc/hosts none bind,create=file 0 0” >> “$CONTAINER_CONFIG_PATH/10-bsp_config” This has been used by several people, including me.
Verify:
devel-su appsupport-attach cat /etc/hosts
(this changed in 4.5, see https://docs.sailfishos.org/Develop/Platform/Testing_Advice/#android-apps)
references:
sfos-4-5-feedback-thread: #229, #256
Patch (I hope there wasn't loss characters...):
--- /usr/libexec/appsupport/prepare-aliendalvik.org.sh 2023-01-25 20:52:12.000000000 +0000
+++ /usr/libexec/appsupport/prepare-aliendalvik.sh 2023-02-11 23:47:29.737036812 +0000
@@ -121,6 +121,7 @@
/usr/libexec/appsupport/alien-generate-rootfs-config.sh "$CONTAINER_CONFIG_PATH/40-rootfs_config"
/usr/libexec/appsupport/appsupport-generate-config --type lxc --user-id "$ALIEN_USER_ID" --instance "$INSTANCE_NAME" --base-uid "$ALIEN_BASE_UID" "$CONTAINER_CONFIG_PATH/10-bsp_config" || exit 32
+echo "lxc.mount.entry = /etc/hosts system/etc/hosts none bind,create=file 0 0" >> "$CONTAINER_CONFIG_PATH/10-bsp_config"
/usr/libexec/appsupport/alien-generate-net-config.sh $PRIVILEGED "$CONTAINER_CONFIG_PATH/30-net_config"