DebianTP
Note: This info historic and applies to the Android + Rooted Android + Debian Technical Preview 1 - 11/05/2018 release from Planet, it is left here for archive purposes (please use Debian Technical Preview 2).
Some notes on Flashing, including flash guides and alternative scatter files for other file-system disk space splits.
The Dualboot image lets you press the external key to boot Debian. If you downloaded the TP firmware prior to 6th March, then the keypress combination for Debian and Recover are swapped. If downloaded after then the silver external button launches Debian. Full info on key combinations Bootloader. The 11th May onwards downloads can be flashed with the kernels swapped to that you can default to linux, sliver button to Android.
The default user is 'gemini' with the password also 'gemini'.
I selected, lxqt - kwin.
The keyboard mapping is not yet setup correctly so you may want to connect to your local wifi and then ssh into the device to be able to type useful things like / or - as used in apt-get etc. I found that the 'Connman UI Setup' wifi password box had the ok/save button off the bottom of the screen. You can move oversized windows around by holding alt and dragging them. Once connected you can check the details tab for your local ip and ssh in from any other device on the network.
You can also connect over the USB cable:
ssh -Y gemini@10.15.19.82
- The "-Y" option allows X11 apps to tunnel to the local desktop over the ssh session. (Useful later.)
Optionally, for a more useful shell switch to bash:
exec bash -l
You will still need to provide a connection to the internet back out of the device, this can be done by USB, but I just connected to wifi with connman. This is where the X11 tunneling over ssh comes into play:
cmst
The gemini user has no default shell set:
sudo nano /etc/passwd
Add /bin/bash to the end of the line for the gemini user. Logout and login again.
The updated image has minimal head room so the first thing to do is to on-line resize your root file system to make use of the space:
df -h
Gives for example:
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p29 4.4G 4.1G 97M 98% /
Do the resize:
$ sudo resize2fs -p /dev/mmcblk0p29
Then check the free space again:
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p29 45G 4.1G 39G 10% /
I found that it was set to ftp.ru.debian.org in /etc/apt/sources.list.d/multistrap-debian.list so switched to my more local 'uk', it would make sense to pick a local debian mirror.
You should also enable security updates, they're missing from the current images.
sudo sh -c 'echo "deb [arch=arm64] http://security.debian.org/debian-security/ stretch/updates main contrib non-free" >>/etc/apt/sources.list.d/multistrap-debian.list'
sudo sh -c 'apt-get update && apt-get upgrade && apt-get dist-upgrade'
Audio won't work until you create some empty mount points and then reboot (probably leave the rebooting till you've updated the kernel - if it needs updating):
sudo mkdir /nvcfg
sudo mkdir /nvdata
To get the volume control to work you need to attach a mouse and right click on the volume control and select 'Configure "Volume Control"'. You need to keep the device as PulseAudio, but set it to 'Droid sink primary' for the output. Then set the External mixer to 'alsamixer'. (This option won't be available until after you've rebooted)
Locales are not installed so needs installing:
sudo apt-get install locales
sudo dpkg-reconfigure locales
You'll want to pick your language choice.UTF8 rather than the other options, eg en_GB.UTF-8.
After an apt-get update you'll have the keymaps available. We've mapped most of the fn+[picture] to the nearest appropriate action. This is tested and works under lxqt+kwin, it required the lxqt-globalkeys to be changed so that it can handle named keys (such as 'Print' and 'XF86Tools') on modifier function. There is the upstream assumption that if a key is mapped to these names then that is its sole function, before the fix the shortcut key grabber was taking the entire key rather than the level3 modified version (fn+ as per the key map).
If you want to use a desktop environment other than lxqt you need to fix or disable the shortcuts configured in your choice of desktop. Gemian team are focusing on one slice of usable Debian not supporting every option.
Once you've done the updates the sddm (the login screen) has in its top edge a dropdown so you can pick the keyboard layout. This will set the keyboard for the session. Settings from within lxqt may override this, best avoided. You only need to select the keyboard once upon first login then later logins the keyboard will the be default configured by X. This may not appear to be the case until your first keyboard interaction, as there is an upstream bug where the keyboard is unknown until it the first key is pressed.
We are still adding to the list of fn+[picture] buttons configured by default, to get the latest you need to remove your .config/lxqt/globalkeyshortcuts.conf
in your home directory and then logout and login again to get it to auto-repopulate with the new combinations. There is definitely something odd in the handling of this file in terms of keeping user customisations. Well tested patches welcome.
rm ~/.config/lxqt/globalkeyshortcuts.conf
This can now be set from the keyboard shortcuts, you just need to update/dist-upgrade and reset the shortcuts as above.
If you want to make new users you should first edit some config files to set the default's to ranges that avoid ID's used by android. /etc/adduser.conf
FIRST_UID=100000
LAST_UID=200000
FIRST_GID=100000
LAST_GID=200000
EXTRA_GROUPS="sudo audio video aid_system aid_graphics aid_input aid_audio aid_net_bt_admin aid_net_bt aid_inet aid_inet_raw aid_inet_admin"
ADD_EXTRA_GROUPS=1
Also /etc/login.defs
UID_MIN 100000
UID_MAX 200000
GID_MIN 100000
GID_MAX 200000
Add a new user:
sudo adduser username
Then before you login with x11 to your new user you need to copy the kwinrc file from the gemini user. If you don't do this you'll just get a black screen and mouse cursor.
Logout and login (remotely) to the new user then:
cp /home/gemini/.config/kwinrc ~/.config/
IMPORTANT NOTE: Without updated kernel (2018-03-26-H4 or newer) the sleep on lid close does not work !!!
NOTE[HAZARD WARNING]: If you've used the Gemini Partition Tool to swap your primary boot to linux then its its no longer possible to update your kernel in this way. You'll have to go back to the flashing tool. If your primary boot is Android, you can safely upgrade the kernel from the Gemini itself.
Gemian now includes a branch of xkb with some initial keyboard maps, these need a newer kernel, this can be done on device without going back to the flashing system:
wget https://gemian.thinkglobally.org/linux-boot-2018-03-26-H4.img
sudo dd if=linux-boot-2018-03-26-H4.img of=/dev/disk/by-partlabel/boot*
You can check your kernel version with a:
uname -a
After the update it should show:
Linux localhost 3.18.41+ #4 SMP PREEMPT Wed Mar 26 22:43:05 MSK 2018 aarch64 GNU/Linux
Probably best to check your version before updating it, the date stamp is the most reliable way of knowing what is newer, the build numbers randomly reset.
We've started work on adding kernel updates via apt. So instead of the above you can now:
sudo apt install gemini-kernel-image-3.18
Currently there is no way of knowing which kernel was used to boot the current boot so you have to manually install the kernel to the relevant partition (boot/boot2/boot3).
sudo dd if=/usr/share/kernel/linux-boot.img of=/dev/disk/by-partlabel/boot*
If you want to just try a one off version of a new kernel and you don't know if its going to work or not its best to pop it over the recovery partition, then boot holding the escape key (or whatever your boot loader normally gives you a dead android for)
sudo dd if=my-custom-linux-boot.img of=/dev/disk/by-partlabel/recovery
Note: This is only useful for 'smoke' testing a new kernel, the lk bootloader doesn't init the modem for recovery. Ideally we'd have another boot partition available as per Bootloader for experimenting or another OS. If it fails then you want to boot back to (~ recovery | a known good kernel ~) and check /proc/last_kmsg for any useful info.
sudo dpkg-reconfigure tzdata
sudo apt-get install iputils-ping systemd-sysv lximage-qt iproute2 dnsutils gucharmap bash-completion
sudo apt-get install repowerd xss-lock gemian-lock saytime
Then you need to add to your x-login session (lxqt configuration center -> session settings -> autostart -> add):
- Name: Screen Lock
- Command: xss-lock gemian-lock
So that it will get installed as your session screensaver. As a bonus the external silver button now tells you the time without having to open the device first.
Note: You really do need repowerd and gemian-lock working together for sleep to work at all, also WiFi being on is known to reduce sleep efficiency significantly more than it does on Android. This needs setting for the logged in user and means that sleep only works after you've logged in.
Link some libs so chromium will find them:
sudo ln -s /usr/lib/aarch64-linux-gnu/libhybris-egl/libEGL.so.1.0.0 /usr/lib/chromium/libEGL.so
sudo ln -s /usr/lib/aarch64-linux-gnu/libhybris-egl/libGLESv2.so.2.0.0 /usr/lib/chromium/libGLESv2.so
You can tell chromium to use open gl, add --use-gl=egl to the desktop file: /usr/share/applications/chromium.desktop
Exec=/usr/bin/chromium --use-gl=egl %U
So far it just supports caps lock:
sudo apt-get install gemian-leds
Re-link the moved lib (the rm may not be needed)
sudo rm /usr/lib/aarch64-linux-gnu/libGLESv2.so
sudo ln -s /usr/lib/aarch64-linux-gnu/libhybris-egl/libGLESv2.so.2.0.0 /usr/lib/aarch64-linux-gnu/libGLESv2.so
This is seriously experimental, these apps need some significant UI work.
A pre-requisite of audio working within calls is to update the android system image.
Updated mobile config is now on its own page: DebuggingMobile