Αναζήτηση αυτού του ιστολογίου

Installing Linux/Ubuntu 16.04 on Toshiba Radius 11 "2in1" convertible laptop

To install Ubuntu together with win10 on Toshiba Radius 11 L10WC10C Convertible Laptop

Radius 11 L10W Specs: http://www.notebookcheck.net/Toshiba-Satellite-Radius-11-L10W-C-108-Notebook-Review.156893.0.html

PS: Youtube has a lot of tutorials for installing ubuntu as dual boot with Win10.
Download latest ISO image ubuntu release (LTS - Long Term Support) Follow instructions from ubuntu web site to make a live CD using Rufus software
Create a partition by windows disk manager (you have to shrink your main partition first in order to make space).

Leave the new partition unassigned - unformatted . Will be handled by Ubuntu Set up utility.

On the first live run, select the empty partition (manual installation of ubuntu - not automated like "Install ubuntu alongside with windows) and create a new small partition (press the + sign) of size equal to your ram (i.e 4 Gb) and select "swap" for this use.


Then select the rest remaining as to be your main "ext4" partition to install ubuntu (normally ext4 is selected by default).

Assign "/" = root.

Regarding bootmanager option in this very first screen, i selected the main hdd (sda) and not the linux partition (i.e hdd\sda7).

This probably means that Grub boot Manager has been installed in my HDD MBR (Master Boot Record) and not in sda1 = efi boot partition or sda7 - ubuntu partition.

That gave me a failed to boot result due to bios . I had to go into bios (hold F2 while power on - release after a while) and disable bios secure boot options. Now boot is OK.


More about EFI Bios : 
http://linuxontoshiba.blogspot.gr/2014/05/getting-ubuntu-1404-to-boot-from.html


Uninstall 
Apparently uninstall should be easy. You log in to Win10, go to disk management, delete ubuntu partitions (swap and ext4) and then expand the win10 partition to the empty space left.

The problem seem to be the uninstalling of ubuntu grub boot manager, especially in my case that i installed grub in the MBR (Master Boot Record) of hdd (/sda) and not in the ubuntu partition (/sda7).

PS: With grub customizer tool you can reduce the boot time to 1 sec but not to zero. If zero time is entered as an option, then the default 10 second timer is used.But you can try 0.5 or 0.1

Check these outs:
http://linuxontoshiba.blogspot.gr/2014/05/getting-ubuntu-1404-to-boot-from.html
http://www.cyberciti.biz/faq/linux-how-to-uninstall-grub/
https://bbs.archlinux.org/viewtopic.php?id=119702
http://linuxbsdos.com/2015/09/05/how-to-delete-grub-files-from-a-boot-efi-partition-in-windows-10/
http://askubuntu.com/questions/429610/uninstall-grub-and-use-windows-bootloader
http://neosmart.net/EasyBCD/

Things to do after the first installation

Update your system: 
sudo apt-get update, sudo apt-get upgrade, sudo apt-get dist-upgrade

Install the unity tweak tool . 

Enable one click minimize, and move left sided launch bar to the bottom if you like. (command line: sudo apt install unity-tweak-tool)

Install Chrome for a nice touch support during surfing

Usually google provided deb package installs Chrome in Ubuntu without problems.

In some cases can fail due to missing dependencies like this:
http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
(i had also this situation)

In this case enable Universe repository
sudo add-apt-repository universe

Or you can enable all repos :
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted
sudo apt-get update

Next step : sudo apt-get install libgconf2-4 libnss3-1d libxss1

If still not ok, go to downloads folder , try sudo apt-get update, sudo apt-get upgrade -> will fail and will prompt to use -f . Do it. You should be ready.

Also check here http://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line

Install grub-customizer and move windows boot option on the top of the grub and also change timeout for auto boot in 4-5 secs instead of default 10 seconds. 

This will make your wife happy in a common/shared computer.
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

Fix Realtek Wifi Problems (wifi freeze, disconnect, etc)

Rememebr the problem with the WiFi adapter (Realtech 8723be - trl8723be) on the new toshiba radius 11 ultrabook.

Follow these instructions : http://www.dedoimedo.com/computers/ubuntu-trusty-realtek.html but trl8723be is obsolete and you need to change git to rtlwifi_new.

$ sudo apt-get install linux-headers-generic build-essential git
$ git clone http://github.com/lwfinger/rtl8723be -> obsolete.
$ git clone http://github.com/lwfinger/rtlwifi_new

Compile the code:
$ cd rtl8723be (obsolete) - cd rtlwifi_new
$ make clean
$ sudo make install
$ sudo modprobe rtl8723be - this seems to be the the same command even with the new git rtlwifi_new. ...

PS1: Is possible that modprobe command will not work if the module is already loaded in memory. So you should disconnect from internet first, remove the driver (modprobe -r rtl8723be) from memory, and then compile.

After you're confident, you can add the removal line into your script as the first line or such. Just be careful.

PS2: verify that rtl8723 is loaded. Go on the top panel, click on "wifi" , select "Details" / "Information" about active connection.

The pop up window provide details of the loaded driver. You should read rtl8723be. I'm just not sure if this is the old rtl8723.be driver (which cause frequent disconnects) or the new updated driver from the git. Hot to find out....?

GDebi and Synaptic: 

http://www.webupd8.org/2016/04/things-to-do-after-installing-ubuntu-1604-lts-xenial-xerus.html

GDebi is used for deb files and can fix missing dependencies automatically.

Synaptic is a package manager with search for apps/programms in all repositories.

sudo apt install synaptic and sudo apt install gdebi. 

Or do it from the Ubuntu Software Center - works nice in my 16.04 Ubuntu.

Ubuntu Tweak Utility

https://launchpad.net/~tualatrix/+archive/ubuntu/ppa
sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ubuntu-tweak

Install Codecs, java and all the most known plugins using ubuntu-restricted-extras
sudo apt install ubuntu-restricted-extras
sudo apt install libavcodec-extra

Check this sources:http://www.webupd8.org/2016/04/things-to-do-after-installing-ubuntu-1604-lts-xenial-xerus.html
http://www.makeuseof.com/tag/11-tweaks-perform-ubuntu-installation/

Check for Unity Themes - Really cool stuff available.Try Gnome 3.18 or even 3.20.
Check this out: http://www.debugpoint.com/2016/04/install-classic-gnome-flashback-in-ubuntu-16-04-replacing-unity/
http://askubuntu.com/questions/358989/install-gnome-3-10-in-ubuntu-13-10-without-breaking-unity

Restore Unity
If you need to restore unity panel then see this: http://askubuntu.com/questions/204428/unity-missing-cant-see-top-or-side-panels

Ubuntu Shell - bash - scriptsCreate a .sh file with gedit. put all the terminal commands in there but make sure that first line is #!/bin/bash

Τhen from terminal you need to change .sh file to be executable : $chmod +x myscript.sh

You can run your script by terminal by typing $./myscript.sh (be carefull to start with ./ in the beginning.

If you want to run the scrip by double click - gui - then there is a bug: double click on the .sh opens the file instead of running it.

To change this double click behavior, go on the file manager (i.e open a location), edit - preferences - behavior, and you will find an option "run text files".

Currently this option is set to "open text files".
Obviously if the text file attribute is not set to +x (executable) double click will still open / edit the file instead of running it since has not "execute" properties.

In my case, i did the .sh for keyboard lock/unlock (xinput diasble 11 and xinput enable 11)

I also included a command to pop up a window in my dekstop informing that "KeyBoard is Locked" using zenity commands.

(PS: Zenity used to be third party old days, but now it is included in the default packages of 16.04 Ubuntu)

script commang : zenity --info --text="KeyBoard Locked". Works fine but you need to press "OK".
Tip : Try zenity --notification --text="KeyBoard Locked".

Alternative pop ups: notify-send "KeyBoard Locked" - also try alert and xmessage

More about handling pop ups in a script:
https://stackoverflow.com/questions/7035/how-to-show-a-message-box-from-a-bash-script-in-linux/35920711#35920711

You can use zenity for many powerfull windows ... entering values, options, etc.

Zenity manual and commands: https://help.gnome.org/users/zenity/stable/index.html.el#dialogs

Customization for tablet mode

Intro:
It seems that Ubuntu 16.04 with Kernel 4.4.0.22 supports basic touchscreen commands out of the box (scrolling, left click), but there are some functions not supported "out of the box":

* On Screen Keyboard - is provided and is called OnBoard. Is fully customizable, with many options (automatic appear on text box, auto hide, size, layout, etc).

* Built in FireFox is not supporting (in my case at least) touchscreen commands / gestures (two finger zoom & scrolling). 
On the other hand , Chrome works perfect with touch screen "out of the box", except the on screen keyboard which is not auto shown (i.e onboard) and needs an extension.

About firefox: In FF , onboard comes up - auto show - when needed so this is great. 
About the missing touch gestures see this post: https://support.mozilla.org/el/questions/1091627
There are also FF extensions/pluging that can enable Touch screen scroll but not zoom.

* Automatic Screen Rotation when screen is folded / reverted / turn left or right.
* Automatic Internal laptop keyboard disable / lock when screen is folded.
This in my case it seems that happens automatically. Is some how a bios feature and not operating system feature. If you boot and grub comes up, and your screen is folded, you will not be able to scroll boot entries in grub 
with up/down keyboard key=keyboard is disabled.

* Mouse Right Click on the touch screen is a headache for Ubuntu Unity, but was working correctly with Ubuntu 16.04 + Gnome 3.18 (=default ubuntugnome package).

Using scripts and xinput commands you can manually disable keyboard and/or rotate the screen.

I tend to believe that the whole "automated story" had to do with limited capability of the kernel to handle various accelerometes/magnetometer sensors that have gone popular nowdays in all convertible laptops.

It turned out that auto screen rotation is actually a missing feature of Unity. Installing Ubuntu Gnome 16.04 auto screen rotation worked out of the box. People say that even in other distros auto rotate work ok with latest relaease of XFCE. Depending on the distro included libs you may need to install application to communicate with acceleremoter (iio-sensor-proxy) . In Ubuntu Gnome this app is included by default in the initial installation.

Keyboard Disable / lock for tablet mode

Partially Solved (done with bash script, and not automatically)
http://askubuntu.com/questions/325546/how-to-disable-and-enable-keyboard-in-ubuntu
http://askubuntu.com/questions/160945/is-there-a-way-to-disable-a-laptops-internal-keyboard

$ xinput --list 
Once you find your Keyboard ID, then
sleep 0.1 ; xinput set-prop 9 'Device Enabled' 0 ; sleep 5 ; xinput set-prop 9 'Device Enabled' 1

PS: sleep 5 most probably is the number of seconds. If this works, then you could make two scripts (similar to .batch files) one for keyboard disable/one for keyboard enable. Moreover you could add these scripts in the magick rotation source code, meaning that if screen is rotated you can lock keyboard.

Or for permanent disable (without sleep timer)
$ xinput set-int-prop 2 "Device Enabled" 8 0
$ xinput set-int-prop 2 "Device Enabled" 8 1
More options / switches for xinput -> http://linux.die.net/man/1/xinput or $xinput --help

Key Lock Software for babies: http://linux.softpedia.com/get/Utilities/Lock-keyboard-for-Baby-23745.shtml

Solution : Done more easily at Ubuntu 16.04 by using command $xinput --disable 11 (my keyboard id) or $xinput --enable 11.


Update : Although i noticed just yesterday 01.06.2016, that folding the screen in tablet mode (folding completely) Ubuntu (or bios...?) disables physical keyboard and touchpad completely! When you sweetch back to "pc" mode, unfolding your screen, the keyboard goes active again. Time was a little bit enough though (i.e could take up to 1 minute to disable/enable the physical keyboard. 

Considering the fact that when i unfolded my screen and returned to classic laptop use, the xinput --enable did nothing, this makes me think that the automatic keyboard enable/disable on screen folding must be something like bios feature and not Ubuntu. But i'm not sure. 

Next Task : Right Click Finetune on touch screen.
Right click seems to work ok within Chrome.
Although in Chrome left click and especially when you need to select plain text on screen is not working good.

I enabled "secondary click" option acc to this info, using Dconf Editor.
http://askubuntu.com/questions/26106/make-long-click-act-like-a-right-click

Dconf Editor. -> 
Go to org gnome , desktop , a11y, mouse, check secondary-click-enabled.

Still not works ok in desktop or Unity left side quick launch bar.

OnBoard virtual keyboard provides buttons that simulate right click. With onboard key , right click works ok.
https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1212736
http://plippo.de/p/twofing.htm
http://ubuntuforums.org/showthread.php?t=1871051

Also look in Software Center for gesture utilities working with touchscreen. 
You could probably apply a gesture in your screen to simulate the right click (i.e three taps, another tap combination, a "Z" or "N" gesture, etc. These are only assumptions - not tested yet.

Automatic Screen Rotation
You can try Magick Rotation. 
http://linux.softpedia.com/get/Multimedia/Graphics/Magick-Rotation-63418.shtml
PS: Even following the manual instructions and installed Python 2, i was not able to make this utility run in Ubuntu 16.04.


Handling screen orientation with xinput set-prop and xrandr commands seems easy

Using xrandr the command is $ xrandr --output eDP1 --rotate left, normal, inverted, etc

Apply your device name in --output (run $xrandr -q to see all the devices - you need the one reported as "connected").

Also see these shell scripts which handle xrandr screen rotation and touchpad transormation:
https://gist.github.com/mildmojo/48e9025070a2ba40795c
http://askubuntu.com/questions/405628/touchscreen-input-doesnt-rotate-lenovo-yoga-13-yoga-2-pro
https://gist.github.com/rubo77/daa262e0229f6e398766

For auto rotation you need data from accelerometer.... and this involves maybe the kernel or special drivers built from the manufacturer or Microsoft.


Experimenting in accelerometer handling and auto rotation: 
Source : http://ubuntuforums.org/showthread.php?t=2196628

Fact 1 : ELAN Touchscreen is actually considered to be a MOUSE.

There are not accelerometer properties / function in the touchscreen itself. 
Accelerometer is a sensor somewhere in your motherboard and it may or may not has been recognized by your Ubuntu (in my case seems that has been recognized).

Fact2: lsmod and modinfo provide details about the loaded modules/DRIVERS. 
If you run lsmod and/or $modinfo hid* (accelerometer modules start with hid) you will see that Ubuntu has a large set of drivers loaded. 
But this is useless if the accelerometer real sensor is not recognized as a device.

Fact3: Each input device appears at Ubuntu like input XX . 
You can list out the available input devices with the associated event numbers assigned by Ubuntu using:
$cat /proc/bus/input/devices | grep "Name\|Sysfs"
$cat /proc/bus/input/devices
$lsinput
PS: Also try $hardinfo for GNU hardware manager and $hwinfo or $lshw

You could also try $evtest tool (install it with $sudo apt-get install evtest). 
Evtest displays a list with all input devices (lid switch, power button, touchscreen, keyboard, mouse, touchpad, etc) , waits user to enter device number, and displays in real time on the terminal screen the changes in this event (!).
For example by selecting the event number that corresponds in your touch screen and touch somewhere in the screen, you will see in the terminal the details / coordinates of your touch. But rotating the screen will give nothing in this event- no state change - since touchscreen is just a mouse, and accelerometer sensors is not registered in the inpust devices and doesn't appear in the input/devices or the evtest.
PS: This means maybe that accelerometer is not an input device...? Could be .

On the other hand, running $lsusb i got my accelerometer.
Bus 001 Device 005: ID 048d:8350 Integrated Technology Express, Inc. 

By running $lsusb -v (verbose) i get even more details about this device 005:
.......
idVendor           0x048d Integrated Technology Express, Inc.
idProduct          0x8350 
bcdDevice          10.17
iManufacturer      1 ITE Tech. Inc.

iProduct           2 ITE Device(8350)
.........

PS: You can also confirm that ITE 8350 is loaded during boot by $dmesg |grep "8350"

Going to /sys/bus/iio/devices/ you will see directories like iio:device0, iio:device1, etc.
Entering in iio:device0 directory , you will see file like is_accel_x_raw, uevent, name etc. This is the complete listing (ls -l):
Path : /sys/bus/iio/devices/iio:device0 (or device1 - changes randmoly during start up)
drwxr-xr-x 2 root root    0 Ιούν  2 01:09 buffer
-r--r--r-- 1 root root 4096 Ιούν  2 01:09 dev
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 in_accel_hysteresis
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 in_accel_offset
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 in_accel_sampling_frequency
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 in_accel_scale
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 in_accel_x_raw
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 in_accel_y_raw
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 in_accel_z_raw
-r--r--r-- 1 root root 4096 Ιούν  2 01:09 name
drwxr-xr-x 2 root root    0 Ιούν  2 01:09 power
drwxr-xr-x 2 root root    0 Ιούν  2 01:09 scan_elements
lrwxrwxrwx 1 root root    0 Ιούν  2 01:09 subsystem -> ../../../../../../../../../../bus/iio
drwxr-xr-x 2 root root    0 Ιούν  2 01:09 trigger
-rw-r--r-- 1 root root 4096 Ιούν  2 01:09 uevent

 By "catting" the uevent, name and dev files you will actually see that this device0 directory refers to accel-3d sensor data !!! Voila! 
PS1: raw data obviously refer to the raw data sent by ITE accelerometer. 
PS2: Switching to iio:device1 directory, cat uevent and name report "gyro-3d", obviously the gyroscopic sensor with different files inside this directory, also gathering "raw" data from the sensor.

 According to this post and workaround (https://github.com/pfps/yoga-laptop/issues/30)  by using $cat in_accel_*_raw will display the values of the three files (x,y,z _raw). 
The output of this cat command should look (acc to github) something like this:
1
64821
64822

Values should be different when you are turning your laptop and cat again, indicating a change in the x-y-z.

The strange cat vs gedit bug in this raw files:
In my case using cat (as root = sudo -i) of in_accel_*_raw files i always got 1-1-1000 and these values never change if i rotate the netbook. 

BUT when i open those x-y-z raw files with gedit (normal user not root) i see different values than the cat! 
All values shown by gedit are something like 65811, etc as suggested by the github.

Moreover i can see changes during screen rotation - orientation change - screen folding.

Workarounds:
Check the iio-sensor-proxy that works with ITE 8350 devices: 
https://launchpad.net/ubuntu/+source/iio-sensor-proxy 
Installed OK, and works somehow ok. After installation by running $monitor-sensor you will see the initial message "Bottom is normal". Twist your laptop in the left and you will "Bottom Right is up". To identify that this software recognizes accelerometer changes you should see in terminal the corresponding messages once you rotate the screen. Interupt with Ctrl+C.

This means that iio-sensor-proxy detects the accelerometer / screen orientation correctly but Unity still does not autorotate the screen. Obviously a missing Unity feature.


*Instead of CAT try $tail -n +1 /sys/bus/iio/devices/iio:device*/*raw

*Google ITE Device(8350) you will see that a lot of modern netbooks are equipped with this accelerometer, and in particular ThinkPad 8 and Yoga laptop 3

* Check this github https://github.com/pfps/yoga-laptop which provides workaround to make the yoga laptop 2 work correctly (screen auto rotation, ambient light detection, etc). Notice that yoga 2 has NOT an ITE 8350 device. 
Althought the discussion / comments on this project has some good points to check and a nice patch to apply in the kernel in particular for this ITE Device.

* Also check this guy, that provides various tools for laptops: https://github.com/rickysarraf


*Google "[PATCH] Add quirk for Lenovo Yoga 2 with ITE Chips" and you will find a lot of sources to play with. 
Also check here how to patch the Kernel. and in Ubuntu Help : 
https://help.ubuntu.com/community/Kernel/Compile


More resources to look:
google "bash script for handling accelerometer" or similar.
https://wiki.archlinux.org/index.php/STMicroelectronics_LSM303DLH_Accelerometer/Magenetometer
Spin Utility : https://github.com/wdbm/spin
https://github.com/martin-ueding/thinkpad-scripts/issues/113
http://askubuntu.com/questions/367963/ubuntu-on-lenovo-yoga-2-pro/485632#485632
http://www.krizka.net/projects/autorotate/

Win 10 accelerometer java script class.
Neverball game : A ball game that you normally roll a ball by tilting the netbook. Good in order to check if your Ubuntu netbook understands/handles accelerometer data (not in my case - ball rolls only with mouse or keyboard)

Kernel Identify and Update

To identify your kernel version in a terminal window $uname -r
In my case of Ubuntu 16.04, came with kernel version 4.4.0.22 and it was automatically updated to version 4.4.0.23 without problems (using $sudo apt-get dist-updrage).


Main kernel are modified / enriched by Ubuntu team to match Ubuntu releases and different names are given. This table shows the cross reference bettwen Ubuntu Kernel and Main Line Kernel: http://people.canonical.com/~kernel/info/kernel-version-map.html


To update Kernel:

https://wiki.ubuntu.com/Kernel/MainlineBuilds
The easy way: Download all deb packages from your browser in a temp folder, go in the temp folder and run $sudo dpkg -i *.deb. All will be done automatically. Check for errors and warning that may arise in the terminal.

PS: Unless kernel is officially distributed by Ubuntu team (dist-upgrade) in most cases, new kernels require patching and may be to disable all propierty drivers (non ubuntu / free source drivers but locked drivers provided by manufacturers).

Other instructions:
http://linuxdaddy.com/blog/install-kernel-4-6-on-ubuntu/

Notice that you need three packages for a complete installation : kernel imageamd64, kernel speicific headers amd64, and kernel generic headers for both amd64 and i386.

Installation of the kernel image modifies the grub boot loader accordingly. 

Usually new kernel install never removes the old kernels. You will find them under "advanced" options on your boot screen.

To uninstal kernel:
https://wiki.ubuntu.com/Kernel/MainlineBuilds
http://ubuntuhandbook.org/index.php/2016/05/remove-old-kernels-ubuntu-16-04/
$ sudo apt-get remove linux-headers-4.6* linux-image-4.6*


Tip: I uninstall daily trial kernels usign $dpkg --purge option as a root , starting from the image file first, and then remove the header files.
To see all the kernel modules available run $dpkg -l | grep "Linux"
Removing the image file is also updating the grub boot loader (remove the new entries).
For root access either run all commands starting with sudo or sudo -i to get a root shell or sudo bash to get a root bash shell.

Kernel 4.6 Upgrade bug in my Ubuntu 16.04 at Toshiba Radius 11 L10W
Ubuntu 16.04 came with kernel 4.4.022. 
I upgraded to 4.6 manually, and rebooted.
For the first 5-10 minutes everything was running ok, including touchscreen scrolling, touching.
After 10 minutes screen freezes completely. Touchpad is not operating.
It turned out that keyboard works. Caps lock goes on/off and also kernel keyboard commands (alt + sysrq) also works.
Also found that switching to other tty was also permitted ctrl + alt +fn1 or 2. But you need to wait some time.


Crash Handling and Debugging tips:
Debugging System Crash . 
During crash press alt+SysRq / prtscrn + 8 and then alt-sysrq-t.  
PS: First make sure that $ cat /proc/sys/kernel/sysrq value is set to 1. See how bellow.

If your keyboard has not a dedicated SysRq button, then print screen button should do the job. If not , you need to find the key with code 99.

This worked for me. It writes to kernel buffer/kernel log all the crash data.
Enable a seperate tty (i.e ctrl+alt+fn2) or reboot in recovery mode and run $dmesg > crash.txt immediatelly. dmesg will be your debugging partner to built up reports and see what is going wrong causing the crash.

PS1: For safe reboot use alr+sysrq+r, e, i, s, u, b in this order and do not ommit any key. Read the REISUB explanation in wikipedia. (r gets keyboard, e terminates and i kill processes, s syncs / flush data to disks from buffer, u for unmount , b for reboot)


PS2: If you are going to repeat the crash (i.e you know the crash is going to happen again), you can clear the kernel buffer using $ dmesg -C (capital C) to be ready to accept the crash messages + sysrq T messages


Crash Dump Recipe if kernel completely locked your system

More about sysrq key 

http://unix.stackexchange.com/questions/105295/what-numeric-key-codes-do-i-need-to-send-for-the-magic-sysrq-functionality-in-a
Sysrq is the kernel magic key that gives you access directly to the kernel if the system hungs, taken into consideration that kernel is alive and not in "panic".

$ cat /proc/sys/kernel/sysrq  ---> if output is 1 then sysrq is enabled.

In my case output was 176, meanig bitmapped : 
128 for power off / reboot + 32 (remount read only) + 16 (sync command). 
This practically means that only sysrq s,u and b works. 
Sysrq commands are logged into the kernel buffer and can be viewed with dmesg.

If /proc/sys/kernel/sysrq output is 0 , enable sysrq like this: 

$ echo 1 > /proc/sys/kernel/sysrq

In case of access denied error, you have to login as root either entering $su and login with root user/pass or $ sudo bash and use your user pass as you do with any sudo command (opens bash shell as root. Symbol changed from $ to #)


It has been noted that enabling sysrq using echo is not a permanent solution. 

For permanent solution add this entry to /etc/sysctl.conf: kernel.sysrq = 1 
or $ echo kernel.sysrq = 1 >> /etc/sysctl.conf (as root)

Send a command by terminal instead of keyboard combo: 

$ echo t > /proc/sysrq-trigger  (replace t with the command you want).
PS: Community says that you can combine this command with | tee file.txt command to drive the output in a file, but this didn't worked ok for me. 

In any case seems that output is dumped to $ dmesg or  $ cat /proc/kmsg

.

Output header is usually printed on the console and not the whole stuff. 

For the whole output to be printed on the console alt-sysrq-8 or $ echo 8 > /proc/sysrq-trigger is required.

About log levels 0-9:

Log levels 0 to 9 are affecting only the console (terminal?). 
It seems that setting level to 0 you get only the very important errors, when setting log level to 9 you get everything (=flood).
In reality kernel has it's own log level rating as shown in this post and also in this file.
When the kernel level is lower than the log level set on console, then the message is printed on your console. Acc to kernel levels, the console log level 8 is enough to print everything.

All above are nicely explained in bellow link together with all sysrq combos and howtos:

https://www.kernel.org/doc/Documentation/sysrq.txt   


Reporting Kernel Bugs according to ubuntu wiki guides :

https://wiki.ubuntu.com/Kernel/Bugs

One command show: $ ubuntu-bug linux
This is the preferred method for reporting a bug against the Ubuntu kernel. 
It will automatically file an Ubuntu kernel bug in ubuntu Launchpad. 
https://bugs.launchpad.net/ubuntu/+source/linux/+bugs
More importantly, it will automatically gather and attach important system information to the bug report.

If you did not follow the $ubuntu-bug linux command, then:


$ apport-collect -p linux

$ uname -a > uname-a.log
$ cat /proc/version_signature > version.log
$ dmesg > dmesg.log
$ sudo lspci -vvnn > lspci-vvnn.log
These four files should be attached separately to the bug report (not pasted into comments or tar and zipped). 
Please note that dmesg output should be captured as early as possible after bootup to avoid extraneous output.
Ubuntu kernel team will rebase the Ubuntu kernel with the upstream mainline kernel.
The upstream kernel has its own bug tracking system at http://bugzilla.kernel.org
If you know your bug exists upstream, you should also report your bug to the upstream kernel bug tracker.

Reporting Kernel Bugs Upstream acc to kernel.org 

https://www.kernel.org/pub/linux/docs/lkml/reporting-bugs.html
* Software (output of the ver_linux script here)
Run the ver_linux script included as scripts/ver_linux, which reports the version of some important subsystems.  Run this script with the command "sh scripts/ver_linux"
ver_linux script source : 
http://lxr.free-electrons.com/source/scripts/ver_linux
https://sourceforge.net/p/ltp/git/ci/b185f2281d0e8767db4c1270280ec160b9fa097b/tree/ver_linux

* Processor information (from /proc/cpuinfo)  = cat /proc/cpuinfo

Also see $lscpu . Has been reported to have differences.

* Loaded Module information (from /proc/modules) -> cat /proc/modules. 
RedHat claims that lsmod is providing "most of this information". This could mean that lsmod is not showing all modules. Use $lsmod - $lsmod >> file.txt (append)  or >file.txt (new file / overwrite file). 

* Loaded driver and hardware information (/proc/ioports, /proc/iomem)


* PCI information ('lspci -vvv' as root) (sudo?)

[gv]: If many devices are shown as unknown (e.g. "Unknown device 2830 (rev 02)), issuing the command 'update-pciids' will usually correct this [/gv]


* SCSI information (from /proc/scsi/scsi) - includes also SATA devices.

[gv]: other information that can be sent for bug tracking:
ps:better run all comands as root = gksu or sudo. For example dmidecode is not working without sudo/gksu

SysLog files -> $zip -r log.zip /var/log

This way you get the whole log directory of your pc, including apt, ditribution , kernel logs etc.

Crash Log Files $zip -r log.zip /var/crash 
$lsusb
$dmesg (prints the message buffer of the kernel)
PS: During crash (alt+sysrq+1 and then alt+sysrq+t. Run dmesg immediately after booting in recovery mode.
$ sudo dmidecode (bios info) 
$ lsscsi
$ xinput list
$ xrandr
$hwinfo (and $lshw = subset of hwinfo) : It is the modern Ubuntu way to print all available hardware data : http://www.linuxintro.org/wiki/Hwinfo

The normal hwinfo (no switches run) provides info about:
/proc/cmdline, /proc/ioports, /proc/interrupts, /proc/dma, /proc/cpuinfo,/proc/sys/dev/cdrom/info, /proc/partitions, /proc/modules, /proc/bus/input/devices

bios data ,and bios setup
exec: "/sbin/rmmod lp", exec: "/sbin/rmmod parport_pc", exec: "/sbin/rmmod parport"
sysfs driver list (id 0x3d6aaae7afd5435c), sysfs pci data, get sysfs block dev data
PCI raw data
exec: "/sbin/modprobe sg ", exec: "/sbin/modprobe evdev ", exec: "/sbin/modprobe edd " 
udevinfo, soft raid devices
kernel log
and many other usefull informations.

You can also include more proc available data like:

proc/ide , proc/irq, proc/scsi, proc/bus/usb or pci /devicer or drivers

All Proc data are good explained by redhat: 
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s2-proc-meminfo.html

Reporting Tip : Use a Script 
Once you download / create the ver_linux script, you can add the commands you want to run (i.e cat /proc/modules) in the last lines of the script. 

In this situation you have only to run the script like this 

$./ver_linux >textfile.txt. 
All the "echo" commands of the ver_linux script will be written to the textfile and you can view/send the textfile to kernel bugzilla web site.

Example of adding scipt lines at the end of ver_linux:

echo
echo '---------------------------------------'
echo 'executing command: cat /proc/cpuinfo' (or whatever command you will run afterwards)
echo
cat /proc/cpuinfo or lsusb or lspci -vvv or whatever you want to include.
echo '---------end of cat/proc/cpuinfo command------------'

On text file, you will see the output of each command executed seperated by dashes and with the command name in the beginnig. 


PS: $hwinfo seems to covers most of the required informations. So you can modify the ver_linux script as following:

first the ver_linix commands
then $hwinfo
Then you can include the commands suggested by kernel team (i.e cat proc/modules) just to avoid possible filtering of the hwifno command in the output data of the raw commands.
Do not print on this text file the log files. Zip the logs and send them zipped.

General remark : It seems that debuggers don't like zip files and prefer seperate files. In bugzilla it seems that you can upload only one file at the beginning of the bug, but you can add more files when the bug id is created.

Kernel.org vs Kernel.Ubuntu.com 

Kernel.org is the big duddy. kernel.ubutnu is the daddy's little boy.
You can download latest kernels (i.e 4.6) from kernel.ubuntu ppa, but if the new kernel has not been bundled within an existed ubuntu distro then it is quite possible not to be fully operational in your system out of the box. 

If the kernel exists in the distro seems that is beeter to install / upgrade the ubuntu distro than upgrading just the kernel.


It seems that ubuntu team gets the latest kernels and "modifies" them to suit the ubuntu features.

http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.6-yakkety, 

As a result if you need to report a bug for kernels including in ubuntu distro the the right place to go is https://bugs.launchpad.net/ubuntu/+source/linux/+bugs.


But if the kernel is not included in any ubuntu distro, then your bugs should be sent to 

https://bugzilla.kernel.org/show_bug.cgi?id=118921.

Even if you try to execute $ ubuntu-bug linux, you will get a message that since you are using a mainline kernel, report the bugs to the bid duddy and not to the ubuntu team.

Possible crash solution for i915 crash:
Turned out that cause of crash acc to dmesg is this:
[drm] stuck on render ring
[drm] GPU HANG: ecode 8:0:0xfffffffe, in Xorg [818], reason: Ring hung, action: reset
[drm] GPU crash dump saved to /sys/class/drm/card0/error
[drm:i915_set_reset_status [i915]] *ERROR* gpu hanging too fast, banning!

drm/i915: Resetting chip after gpu hang

You can try these hints:
Check that you have not disabled Intel by using any modprobe blacklisting within /etc/modprobe.d/ or /usr/lib/modprobe.d/.

Create a Xorg configuration file (usually not required in modern ubuntu kernels).

/etc/X11/xorg.conf.d/20-intel.conf

Section "Device"

   Identifier  "Intel Graphics"

   Driver      "intel"

EndSection
PS: Additional options are added by the user on new lines below Driver.

You may need to indicate Option "AccelMethod" "sna" even just to set it to the default method otherwise, X may crash.


If sna crashes, then try to use UXA:  Option      "AccelMethod"  "uxa"

Other suggestions for freezes: (https://wiki.archlinux.org/index.php/Intel_graphics#SNA_issues)
Option "NoAccel" "True"
Alternatively, try to disable the 3D acceleration only with the DRI option: 
Option "DRI" "False"


If you experience crashes and have Option "TearFree" "true" and Option "AccelMethod" "sna" in your configuration file, in most cases these can be fixed by adding i915.semaphores=1 to your boot parameters {(GRUB_CMDLINE_LINUX in /etc/default/grub) - tentative workaround}

Or add semaphores=1 to /etc/modprobe.d/i915.conf acc to this archlinux page about intel.

The final config file ($cat /etc/modprobe.d/i915.conf) should looks like this:
options i915 modeset=1 enable_rc6=1 enable_fbc=1 lvds_downclock=1 semaphores=1

According to this almost identical bug https://bugs.freedesktop.org/show_bug.cgi?id=94161, using i915.enable_rc6=0 as a kernel option, the problem disappear

Tip: Could the drm-intel kernels be a solution? We can try anyway!
I can see everyday releases....http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-nightly/ or drm-intel-next.
PS: What are those anyway...?

Reboot with sysrq: alt + sysrq + b. This is very hard, similar to power off button. Use sysrq s and sysrq u first to save data to disk, unmount disks and reboot (sub). Requires sysrq to be enabled (1 or at least 128).

managing hdaps - check gnome-hdaps-applet and other ways here: 

https://wiki.archlinux.org/index.php/Hard_Drive_Active_Protection_System

Clean kernel buffer : $ dmesg -C (capital C = read and clear)

Fixing installation problems and dependencies: sudo apt -f install


Verify screen mode: $xrandr

Cool linux projects: https://julien.danjou.info/projects/


Kill and restart window manager / unity
For ubuntu later than version 11: 
$ sudo service lightdm restart (or sddm restart - depends on the dm version of your distro)

Also try : 

Alt + F2, then type unity 
OR ctrl + alt +backspace 
OR Ctrl + PrtScr + K 
OR Ctrl + Alt + F1/ F2, then login , then $sudo service lightdm restart .

PS1: In my case the service lightdm restart , it did a restart but then it lead me in a frozen graphic enviroment with my credentials ....Propably this is due to the nature of the crash (gpu hang, i915 chip resset).


PS2: ctrl + alt +fn commands. switches tty monitors. if you try all FNs (1-2-3-4-5-etc) you will hit the graphic "hanged" tty. In my case was tty7 = ctrl + alt + FN7

Kill whatever you are permitted to kill: $ kill -9 -1


Manul fix disk: fdisk /dev/sdaX , X is the number of your linux system.

ps: After a serious crash has happened ubuntu to abort loading if file system is not "clean", meaning that contains broken - orphan file references.

Keyboard Shortcuts by ubuntu help: 

https://help.ubuntu.com/community/KeyboardShortcuts

Module Driver Details

if you want more details about specific drivers of a loaded module ($lsmod), run 
$ modinfo modulename (i.e modinfo bluetooth) 

Search files/outputs with grep

http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/
Use directly as $grep 'text' filename or indirectly as $lscpu | grep Model and cat /proc/cpuinfo | grep -i 'Model'
-i : ignore upper/lower case
-r : recursively - search all files
-hr : recursively but hide file names
-w : search for word only
-c : count word /pattern within file
-n: numbering the output
-v: inverts the match = not match

Search for a file :

$ locate -i process.txt 
PS: run sudo updatedb to update indexes but Ubuntu update it everyday via cron 

$ find / -name "process.txt" or -name proc*

This will search root = all directories for a file called process.txt (replace / with dot . searches the current directory).

Install software by ppa:
$ sudo add-apt-repository ppa:ne0sight/chrome-gnome-shell (or any other ppa)
$ sudo apt-get update

$ sudo apt-get install chrome-gnome-shell (application name)

Ubuntu 16.04 with Gnome 3.18
First i try to  remove ubity from my Ubuntu and install the Gnome 3.20 shell. 
At the end was running but the whole system was like a mess.  Too bugy.

Then i did a fresh install with the latest stable ubuntu-gnome available image (June 2016).
The ubuntu - gnome image contains by default the iio-sensor-proxy software which is installed automatically. 

I tried to install iio-sensor-proxy and i got the message already installed. 
I verified installation with $monitor-sensor which run directly. 
I tried to rotate the screen and voila! Screen rotation for Ubuntu Gnome worked "out-of-the-box" for my Toshiba Radius 11!!!!!

Other  first use remarks about Gnome 3.18 experience:

Whole Gnome3 issue looks like a classic tablet experience. 
We got hidden menus that pop up with swipping left to right, desktop works more like a "home screen" instead of classic desktop, as a result desktop shortcuts are disabled by default (can be enabled by gnome tweak tools) etc.

By clicking on "Activities" menu on the top left corner , you get a nice looking vertical launch bar on the left, you get an overview of all open apps, etc. 
I really enjoyed that look. I suppose this is built having tablets in mind instead of desktops.

All software installed is suitable / modified for Gnome 3.18 (gnome-tweak, gnome software center, gnome games, etc)

Gnome transparent on-screen keyboard (gok) sucks. (Ps : Is this caribou?)

If i'm not wrong OnBoard screen keyboard for Gnome is installed by Default.

FireFox included in UbuntuGnome installation sucks since doesn't support touch screen correctly (finger zoom in & zoom out does not work, touch screen scroll does not work without an extension). 
But FireFox supports onboard screen keyboard out of the box, and this is good.

I installed Chromium (it was an option given by the Gnome Software Center).
Chromium perfect synchronizes with my Google account and works exactly like Chrome. 
In reality Chrome was derived by Chromium. 
But i saw that in real life Chromium and Chrome are the same things. 
You install in Chromium , Chrome extensions, you do whatever you did with Chrome but under a slightly different name.

Touch screen works perfectly with Chrome/ium (zoom in & out, touch scrolling, etc) althought you might need to force "enable" the chrome://flags/#touch-events 

The only serious bug of Chrome/ium is that virtual keyboard (neither onboard nor gnome gok) doesn't pop up when i enter text in Chromium even if this feature is enabled in Onboard and gnome accesibility options. 
This bug is strange since onboard worked OK with Chrome in Ubuntu Unity installation (if i remember well....).

Workarounds for On Screen Keyboard on Chrome:

0. Once you install the OnBoard icon in the taskbar, you can tap the icon to write within Chrome. Works nice but needs user action.

1. You can install an extension such as Virtual Keyboard . Tested and works fine.

2. I have read about policies that force screen keyboard to appear , but no luck . Probably i'm doing something wrong.
PS: By the way if you go to chrome://policy and selecting to display policies if with no set vaule, you will get a list of the (propably supported by your browser) policies.

3. You can build an extension (or modify an existing one) that will call onboard application when a text box/input field has focus (PS: Too much advanced).

See this page on how to identify an html element by tag name (button, input box, etc) using document.activeElement.tagName: 
http://www.w3schools.com/jsref/prop_document_activeelement.asp


Since Chrome extensions are usally built with JScript, and since you can not execute shell commands from JScript (see details on bellow post about shell scripting) you migh found a work around with Chrome Native Messaging feature. and ConnectNative as well.

Maybe Chrome Extensions are somehow more relaxed (in terms of security) and allow you to execute shell scripts in your local machine, since you can enable/disable features and access on the manifest.json file. 

For example there are extensions that are allowed to store images / data in your local folders.  This guy is able to read local files by building a dedicated extension.
Chrom.FileSystem API to create, read, navigate, and write to the user's local file system
https://developer.chrome.com/apps/fileSystem

You could also play with node.js that it seems that works as a local java script app / programming language. 
Maybe with Node you could "catch" Chrome opened web pages and using JS you could force OnBoard to be shown when an input / text box has focus.

It is strange not to mention that FireFox on Linux and Chrome in Win10 Tablet mode sucesfully call the system on screen keyboard - onboard. 
Understanding how this is done in Win10 it could be a solution in our case. 
Is it a flag? Is it an extension? Is it a built in feature missing from the Linux Chrome or it is just  Win10 who detects that user need "OSK" to input data....?

Desktop / Start Up Screen Customization is made using Gnome extensions

https://extensions.gnome.org
Be sure to add in Chrome the Gnome Sheel Extension and also to install in Gnome the corresponding chrome-gnome-shell to be able Chrome to interact with your system.

Dash to Dock
Copies the nice vertical launch bar out from the "Activities" menu to the desktop.
Quite customizable. Launchbar can be placed left/right/bottom of the startup / desktop screen. Although in bottom placement interferes uggly with "OnBoard" keyboard (overlaps).

MMOD Panel
Similar to "Dash to Dock" . When configured to be shown in the bottom of the screen looks like a classic windows taskbar with tray icons.  If you also enable the desktop to work (since it is initially hidden - see gnome-tweak)  the overall look is like a classic windows desktop pc as can be seen here.
PS: Cooperation with onboard is good. There is no overlap of OnBoard on the launchbar.
PS2: Found to be buggy in my set up. Got frequent stucks - freezes and i remove it.

TaskBar:
Just another dock extension , but seems to be the best so far. You can add a bottom bar or you can show/hide/customize the default top bar to include open windows, favorites, to change size, color of the info provided in the top bar, etc. A lot of tweaking is available in this extension. Recommended.

OnBoard Integration:  Replace gok with onboard. Does not work in "Activities" screen .

On Screen KeyBoard Icon: Provides a button for showing virtual keyboard on the top launch bar. Link missing. - See bellow for the official way to show "onboard" icon.

Win Thumbnais: Provide a thumbnail toolbard on desktop - home screen  - could be interesting - didn't like it.

Minimize All Windows: 

Cairo Dock : Seems nice but is more like a complete replacement and not just extension. Maybe i have to try it (with care).

Official Support for Showing Onboard Icon on the top launch bar of Gnome3
Onboard 1.2.0 comes with an initial GNOME Shell extension that hides the default keyboard and shows an icon in the panel. In order to use it, first install the extension:
$ sudo apt-get install gnome-shell-extension-onboard
Then enable "Onboard Indicator" in $ gnome-shell-extension-prefs 
Restart GNOME Shell.

To have the GNOME default keyboard show up in Actvities and password dialogs, enable it in System settings -> Universal Access.