android init exits at executing /system/etc/partition_permission.sh

Bug #1625916 reported by You-Sheng Yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Unassigned
lxc-android-config (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

In init.mt8163.rc:

  on fs
      write /proc/bootprof "INIT:Mount_START"
      mount_all /fstab.mt8163
      setprop ro.crypto.state unencrypted
      #change partition permission
      exec /system/etc/partition_permission.sh
      #change partition permissions
      exec /system/bin/chmod 0640 /dev/block/platform/mtk-msdc.0/by-name/boot
      ...

In dmesg:

[ 7.570313] .(3)[1111:init]init: command 'setprop ro.crypto.state unencrypted' action=fs status=0 (/init.mt8163.rc:71)
[ 7.570358] .(3)[1111:init]init: argv[0]= exec
[ 7.570375] .(3)[1111:init]init: argv[1]= /system/etc/partition_permission.sh

then no further message is printed.

lxc log says:

NOTICE lxc_start - start.c:post_start:1447 - '/init' started with pid '1111'
...
DEBUG lxc_start - start.c:signal_handler:342 - container init process exited
DEBUG lxc_start - start.c:__lxc_start:1392 - unknown exit status for init: 9
DEBUG lxc_start - start.c:__lxc_start:1397 - Pushing physical nics back to host namespace
DEBUG lxc_start - start.c:__lxc_start:1400 - Tearing down virtual network devices used by container
INFO lxc_error - error.c:lxc_error_set_and_log:55 - child <1111> ended on signal (9)

Tags: systemd

Related branches

Revision history for this message
You-Sheng Yang (vicamo) wrote :

So I placed a 'exit 0' inside that script, and it quits with 0 as expected, but then init still quits at the next exec command. Probably means permission to chown/chmod those block devices is not granted.

Changed in canonical-devices-system-image:
milestone: none → x1
Revision history for this message
You-Sheng Yang (vicamo) wrote :

So I disable the lxc container at boot, but launch it manually in shell access, then we have the OOBE screen and final log into Apps page successfully.

WiFi is not working. Most other click apps (calculator, gallery, sudoku) do. Clock is not working. Quits right away.

Even I disabled alsactl for bug 1626012, camera (front & back, picture and recording) and shutter sound both work.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

WiFi/Bluetooth works at 2nd boot.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Appended systemd.log_level=debug to boot param to observe what's going on for systemd.

It turns out I changed lxc-start argument -F to -d in systemd service file to align with its upstart one. And that certainly means lxc-start will quit right away after android init starting up. Then systemd considers that mean the main process of this service dies because its type is unspecified and defaults to simple, so it begin to kill the cgroup and all the processes belong to. Since I changed its argument to -d, so the systemd service type should also be assigned to forking, and now the system boots to GUI directly.

If we keep -F flag as it is, systemd receives SIGCHLD somehow and the begin to kill android container processes, too. So keeping -F shouldn't be the right solution here.

You-Sheng Yang (vicamo)
no longer affects: android-tools (Ubuntu)
You-Sheng Yang (vicamo)
Changed in lxc-android-config (Ubuntu):
status: New → In Progress
Changed in canonical-devices-system-image:
importance: Undecided → Critical
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc-android-config - 0.230+16.10.20161004-0ubuntu1

---------------
lxc-android-config (0.230+16.10.20161004-0ubuntu1) yakkety; urgency=medium

  [ You-Sheng Yang ]
  * Align to current upstart setup and run android container in the
    background. (LP: #1625916)
  * Add systemd upstart-local-bridge service (LP: #1627613)
  * Add writable path for systemd. (LP: #1625445)
  * Disable alsa-restore, alsa-state when lxc-android-config installed
    (LP: #1626012)

 -- Łukasz Zemczak <email address hidden> Tue, 04 Oct 2016 08:15:25 +0000

Changed in lxc-android-config (Ubuntu):
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.