Skip to content

Commit

Permalink
Switch from ubports-boot to halium-boot (with extras) (#107)
Browse files Browse the repository at this point in the history
* Switch from ubports-boot to halium-boot (with extras)

* Update translation sources

* Fix spacing and shuffle sections for readability

* Update translation sources

* We don't use rootstock any more

* A proposed

* Send locales back to upstream to avoid conflicts

* Requested changes
  • Loading branch information
UniversalSuperBox authored and doniks committed Jun 14, 2018
1 parent 92cfbed commit a7d6c45
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 134 deletions.
44 changes: 44 additions & 0 deletions porting/building-halium-boot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Building halium-boot
=====================

Halium-boot is a new proposed boot image in the Halium project, replacing hybris-boot. We will be building and using it for Ubuntu Touch.

Fix mounts
----------

Halium-boot's ``mount`` is not aware of SELinux contexts. If your device's ``fstab`` file includes any contexts, the partition that they are on will fail to mount and your port will not work correctly.

The first step to this process is figuring out where your fstab actually is. For most, this is inside ``BUILDDIR/device/MANUFACTUER/CODENAME/rootdir/etc`` and it is named either ``fstab.qcom`` or ``fstab.devicename``. Open the file for editing.

If the type of the 'data' or 'userdata' partition is ``f2fs``, it is required to change it to ``ext4``.

With the file open, remove all ``context=`` options from all block devices in the file. The option will start at the text ``context=`` and end at the comma following it.

For example, the line ``ro,nosuid,nodev,context=u:object_r:firmware_file:s0,barrier=0`` should become ``ro,nosuid,nodev,barrier=0``

Save and exit.

Edit kernel config
------------------

Ubuntu Touch requires a slightly different kernel config than Halium, including enabling Apparmor. Luckily, we have a nice script for this purpose, ``check-kernel-config``. It's included in the halium-boot repository. Simply run it on your config as follows::

./halium/halium-boot/check-kernel-config path/to/my/defconfig -w

You may have to do this twice. It will likely fix things both times. Then, run the script without the ``-w`` flag to see if there are any more errors. If there are, fix them manually. Once finished, run the script without the ``-w`` flag one more time to make sure everything is correct.

Build the image
---------------

Once halium-boot is in place, you can build it quite simply. You will also need to rebuild system.img due to our changes.

1. ``cd`` to your Halium BUILDDIR
2. ``source build/envsetup.sh``
3. Run ``breakfast`` or ``lunch``, whichever you use for your device
4. ``mka halium-boot``
5. ``mka systemimage``

Continue on
-----------

Now that you have halium-boot built, you can move on to :doc:`installing-16-04`.
98 changes: 0 additions & 98 deletions porting/building-ubports-boot.rst

This file was deleted.

51 changes: 51 additions & 0 deletions porting/common-problems-install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
..
This document does not follow normal style guides. The flat heading
structure means that it displays nicely in the toctree on the page that
links to it, installing-16-04.rst
Common installation problems
----------------------------

This page details problems commonly faced while following the :doc:`installing-16-04` page.

SSH hangs when trying to connect
--------------------------------

The SSH connection may hang indefinitely when trying to connect. Attempts to stop the connection with Control-C may or may not return you to a shell prompt. If you run ``ssh -vvvv phablet@10.15.19.82``, you only get the following output before the program stops::

debug1: Connecting to 10.15.19.82 [10.15.19.82] port 22.
debug1: Connection established.
[...]
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH[...]

This seems to be a common error on arm64 devices with kernel 3.10 when rsyslogd is enabled. If you have this error, please add your voice to `ubports/ubuntu-touch#560`_ and then try the following workaround:

#. Reboot the device to recovery and connect with ``adb shell``
#. Run the following commands to disable rsyslogd::

mkdir /a
mount /data/rootfs.img /a
echo manual |tee /a/etc/init/rsyslog.override
umount /a
sync

You may now reboot the device. You should be able to connect to SSH once it comes back online.

Device reboots after a minute
-----------------------------

The device may reboot cleanly after about a minute of uptime. If you are logged in when the reboot occurs, you will see the following message::

Broadcast message from root@ubuntu-phablet
(unknown) at 16:00 ...

The system is going down for reboot NOW!

This happens because ``lightdm``, the Ubuntu Touch display manager, is crashing repeatedly. The system watchdog process sees this and reboots the device.

To fix this problem, log in before the reboot occurs and run the following command::

sudo stop lightdm

.. _ubports/ubuntu-touch#560: https://github.com/ubports/ubuntu-touch/issues/560
89 changes: 89 additions & 0 deletions porting/common-problems-run.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Common problems when running Ubuntu Touch
-----------------------------------------

This page details problems commonly faced while following the :doc:`running-ut` page.

Nothing shows on screen
-----------------------

If nothing is showing on screen even after adding udev rules to your port, it is likely that you have a problem with graphical applications crashing. See `Mir servers crash`_ for more information.

Mir servers crash
-----------------

Mir servers crashing can be caused by many different problems with the port. To troubleshoot more, you can try the following:

Is the Android container running?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If the Android container is not running, many parts of Ubuntu Touch will not work. Run this command to check on the container's status::

sudo lxc-info -n android

If you get output similar to the following, the Android container is running and you can move on to the next troubleshooting step::

Name: android
State: RUNNING
PID: 1194
IP: 10.15.19.82

If you do not get ``State: RUNNING``, the container is stopped. You can run ``sudo start lxc-android-config`` to attempt to start it. If the container does not start after that, you can run ``sudo lxc-start -n android -F`` to get a more detailed log of why it has failed.


Are all of the Android partitions mounted?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If some partitions used for Android drivers are not mounted, the container may start but not work correctly.

To check the mounted Android partitions, run ``ls /android``. At least the following folders should be contained within::

data
system
firmware
persist

If any of these are missing, run ``dmesg`` to get the kernel log. Mounting Android partitions will start after the following line::

initrd: checking fstab [...] for additional mount points

Try to diagnose and fix any mounting errors that you find in the log for the partitions listed above.

.. note::

Some devices have a ``vendor`` partition that contains proprietary libraries and executables required to run Android. If your device has this partition, make sure that it is mounted in addition to the others listed above.


Getting more Mir logs
^^^^^^^^^^^^^^^^^^^^^

If the Android container is running and all of its partitions seem to be mounted, you will need to get a few more logs before enlisting community help.

First, stop the display manager if it is not already::

sudo stop lightdm

If you have Wi-Fi working (See `the Halium docs for Wi-Fi`_), install the ``libc6-dbg`` package first::

sudo apt update
sudo apt install libc6-dbg

Then, run the following commands to get all of the needed logs::

sudo unity-system-compositor --debug-without-dm &> ~/usc.log
sudo gdb -ex 'set confirm off' -ex 'run' -ex 'bt full' -ex quit --args unity-system-compositor --debug-without-dm &> ~/usc-gdb.log
sudo /system/bin/logcat -d &> ~/usc-logcat.log

Use ``scp`` or a similar program to copy the ``usc.log``, ``usc-gdb.log``, and ``usc-logcat.log`` files from phablet's home folder to your computer. Then, post the content of these files to `paste.ubuntu.com`_, Pastebin, GitHub Gists, or a similar service so the people helping you can view them easily.

Programs hang before crashing
-----------------------------

Sometimes processes will hang for a very long time and then abort or segfault. The reason for the hang is apport, which attempts to collect useful information about the crash before allowing the program to stop.

If you don't need apport's information and would rather have the programs crash faster while troubleshooting, issue the following commands::

sudo stop apport
sudo stop whoopsie

.. _the halium docs for wi-fi: http://docs.halium.org/en/latest/porting/debug-build/wifi.html
.. _paste.ubuntu.com: https://paste.ubuntu.com

0 comments on commit a7d6c45

Please sign in to comment.