Handling hardware solely from the android img files

Registered by Oliver Grawert on 2014-03-10

The Ubuntu Touch rootfs should be as generic as it can get by moving all hardware specific files into the android system image.
This also requires having a mechanism to overlay the hardware specific device configurations inside the rootfs on boot (by copying or by bind mounting the properly configured files on top from /system/...)

Blueprint information

Status:
Not started
Approver:
Michael Frey
Priority:
Undefined
Drafter:
Oliver Grawert
Direction:
Approved
Assignee:
Oliver Grawert
Definition:
Approved
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

currently used files:
* /lib/udev/rules.d/70-android.rules (currently bind-mounted by the touch initrd script from /usr/lib/lxc-android-config/70-$device.rules)
* /lib/modules (currently bind-mounted from /system/lib/modules by the touch initrd script)
* /usr/share/alsa/ucm/$sounddevice (shipped by alsa-lib, we used to try to keep these bits in the package for easier upstreaming as we usually do for this package)
* /etc/ubuntu-touch-session.d/* (shipped by ubuntu-touch-session for defining resolution and webkit scaling factor per device.
* /usr/share/powerd/device_configs/config-$device.xml (shipped by powerd as is)
* /usr/share/apparmor/hardware/graphics.d/apparmor-easyprof-ubuntu_$device (currently shipped as-is by lxc-android-config)
* /etc/init/boot-hooks/set-display-mir.conf (hardcoded whitelist of devices to enable Mir by default, probably easiest to just drop this and always default to Mir (shipped as is by lxc-android-config))
* everything related to bluetooth ... while we have some basic bringup running inside the container we still need upstart jobs for bringing up per-device BT configs on the Ubuntu side)
* /usr/share/apparmor/hardware/video.d/apparmor-easyprof-ubuntu_$device (not sure the files there are still needed, if so, we definitely miss some arches here (shipped as is by apparmor-easyprof-ubuntu))

---

A proposal:

Ship an ubuntu "Shadow filesystem" in the android system.img that is used to overlay the files on the rootfs and processed from the initrd script with something similar to:

for file in $(find /system/ubuntu-shadow); do
    target=$(echo $file|sed -e 's/^/system/ubuntu-shadow//')
    source=$file

    # make sure target files and dirs exist etc ...

    mount --bind $source $target
done

(?)

Work Items