← Back to team overview

ubuntu-phone team mailing list archive

Re: Developer mode ... the next steps, managing ssh

 

hi,
Am Mittwoch, den 20.08.2014, 16:35 +0200 schrieb Martin Pitt:
> Hello Oliver,
> 
> I installed your proposed adbd now, and now adbd shell is a phablet
> shell (user, not root) after setting a pin code. There still needs to
> be a testing mode for that, as during tests the only thing after
> flashing that we have is adb. Also, one now can't launch programs
> while the screen lock is on, so all tests fail until the pin is
> entered manually.
> 

> > phablet-network will use nmcli in the future landings for this are
> > pending
> 
> I doubt that nmcli can read the existing passwords for wifi
> connections? 
well, today we use sudo on the PC for reading the password ... nothing
on that side changes 

https://code.launchpad.net/~ogra/phablet-tools/pahblet-network-drop-root/+merge/230864
has the new phablet-network code

> 
> For testing we'll use either no password or "phablet" or anything
> well-known, so not a problem there ;-)
neither will work with the new adbd ... it requires a password to be in
place to allow any connections (well, actually to start adbd at all)

> 
> > > Also, will "adb reboot recovery" still work as non-root?
> > > 
> > yes, the privilege dropping only happens for adb shell ... the rest of
> > adb features still works as known 
> 
> Confirmed, that works. But that will again allow you to circumvent the
> PIN protection, as you don't need to enter the PIN to run that? I. e.
> boot to recovery, flash a new system (or use adb from there as root),
> and you are again in the system.
recovery wont have adb enabled by default, you need the equivalent of
"oem unlock" ... the device will completely be wiped if you do that ...
(similar to nexus), so all that "adb reboot recovery" will give you is
the ability to wipe the device from the recovery menu (i think reboot
and wipe are the planned options for recovery mode by default)

> 
> > > I suppose for both things we need a way to enable sudo when flashing
> > > the device. Will/does ubuntu-device-flash --developer-mode do that? I.
> > > e. we'll set up our test devices with that once, and from then on adb
> > > will stay root even after factory reset?
> > > 
> > we have sudo ... but it is very ugly to use programmatically if you have
> > send a password (adbd's tty handling essentially doesnt exist and we
> > cant hack it up easily without breaking other core behavior):
> > 
> > mypassword=1234
> > adb shell "echo $mypassword| sudo -S /usr/bin/foople"
> 
> Nah, that can be done. Create a little shell script /tmp/pwd with
> "echo s3kr1t", and run "SSH_ASKPASS=/tmp/pwd sudo -A foople".
well, thats not much different except that your password wont be visible
in the PC's process list ( i find both ways equally ugly)

> 
> > for all the bits that are used by phablet-tools the necessary dbus
> > backends are planned already ... if you do not use phablet-tools in your
> > scripts or test tools, please let me know what other dbus properties you
> > need ... 
> 
> autopkgtest's adb setup script does use phablet-config to disable the
> wizard, edges into, and dbus-probe. But there's no phablet-tools
> command for resetting to factory status and saving/restoring wifi
> connections before/after that, so the script has to do that by itself.
> But supposedly phablet-tools would have just as much difficulty with
> the above operations as autopkgtest.

well patches to phablet-tools (or dbus-property-service which is the
on-device side of this)  will indeed be happily accepted to add more
features ... my current focus is to get all of phablet-config,
phablet-shell and phablet-network to work as before, if you use anything
not in phablet-tools for your tests we should simply add support for it
to phablet-tools.

"phablet-config autopilot --dbus-probe {enable,disable}" definitely
works with my local code and will be merged right after traincon-0 

> In essence, what we need for testing:
> 
>  - Flash a device with latest image, with a magic option (or
>    post-flashing config) to enable ADB
this will work with the --developer-mode and --password options for
ubuntu-device-flash

>  - Enable sshd
already works via dbus, my changes to phablet-shell should show how
https://code.launchpad.net/~ogra/phablet-tools/pahblet-shell-dbus-support/+merge/230795

>  - For some tests we might need root access, so for those we need to
>    ename that through sudo
well, given that one requirement for the future is that tests have to
work on a read only image, why not start working on them to be run by
the phablet user under restrictions ....

> 
> It seems phablet-config also fails to enable the dbus-probe (that also
> needs root presumably).
code for this is ready and waiting for traincon-0 to be dropped
> 
> and all that without manual interaction or someone having to touch
> things or enter PINs.
this is what the planned --password option to ubuntu-device-flash does
> 
> So in summary, at the moment there is no way to run tests on a touch
> phone with that adbd :/
i know that paul successfully ran the smoke tests by simply dropping a
fully open sudoers in place, phablet-test-run for click packages will
definitely work, if you have anything that doesn't use phablet-tools (as
it should) please help enhancing phablet-tools for your use case.

ciao
	oli

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References