Thursday, June 4, 2015

Linux Kernel SysRq




SysRq key can be enabled with the following command:
echo 1 > /proc/sys/kernel/sysrq

causes a kernel panic 
echo c > /proc/sysrq-trigger


 equivalent to the key combination Alt+SysRq+B which reboots the machine.
echo b > /proc/sysrq-trigger

Thursday, January 29, 2015

routing table

from 192.168.1.x to 192.168.123.x

root@EbMajor:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.123.254 0.0.0.0         UG    0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.123.0   *               255.255.255.0   U     0      0        0 eth0

Wednesday, January 28, 2015

kernel device tree makefile

arch/arm/boot/dts/Makefile
dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb

Monday, October 20, 2014

ssh add user

~/.ssh/config

Host xxx.git.com
    HostName xxx.git.com
    Port xxxx
    User xxx
Host xxx-git
   Port xxxx
   User xxxx
  HostName xxx.git.com

Samba on Ubuntu 14.04 / 16.04

for 14.04
http://ubuntuhandbook.org/index.php/2014/05/ubuntu1404-file-sharing-samba/
add samba user
sudo smbpasswd -a username
for 16.04
https://www.linuxbabe.com/ubuntu/install-samba-server-file-share
https://ubuntu.com/tutorials/install-and-configure-samba#1-overview

ubuntu 14.04 - remote desktop - No security types supported

* Problem
- TightVNC
Server sent security types, but we do not support any of their

* Solution
type the command on Terminal
gsettings set org.gnome.Vino require-encryption false

Thursday, October 2, 2014

patch to upstream kernel, hostap, and wireless regdb

1. Seetup .gitconfig
a. Edit Home_root/.gitconfig (~/.gitconfig)
b. Check user email and name
c. Add sendemail
i. [sendemail]
ii. smtpserver = mail.xxx.com
iii. smtpdomain = mail.xxx.com
iv. from = xxx@xxx.com (email address)

2. Find the maintainer
a. scripts/get_maintainer.pl –f file
i. kernel/linux$ ./scripts/get_maintainer.pl -f xxx.c
Felipe Balbi <balbi@ti.com> (maintainer:USB GADGET/PERIPH...)
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:USB SUBSYSTEM)
linux-usb@vger.kernel.org (open list:USB GADGET/PERIPH...)
linux-kernel@vger.kernel.org (open list)
b. scripts/get_maintainer.pl  xxx.patch

3. pull down the code
a. git clone git://xxxxx/linux.git

4. make change/commit with useful description
a. git add –A
b. git commit -s
ex) xxx: xxxxx

5. Generate the patch
a. ath10k
git format-patch --patience -M -C --subject-prefix="PATCH" --to="ath10k@lists.infradead.org" --to="kvalo@qca.qualcomm.com" --cc="linux-wireless@vger.kernel.org" HEAD~

b. mac80211
git format-patch --patience -M -C --subject-prefix="PATCH" --to="linux-wireless@vger.kernel.org" --to="johannes@sipsolutions.net"  --cc="johannes.berg@intel.com" HEAD~
c. hostap
git format-patch --patience -M -C --subject-prefix="PATCH" --to="hostap@lists.infradead.org" HEAD~

d. usb
git format-patch --patience -M -C --subject-prefix="PATCH" --to="Greg Kroah-Hartman <gregkh@linuxfoundation.org>" --to="Felipe Balbi <balbi@ti.com>" --cc="linux-usb@vger.kernel.org" --cc="linux-kernel@vger.kernel.org" HEAD~

e. upload 2nd patch
git format-patch --patience -M -C --subject-prefix="PATCH v2" --thread --to="xxx"  --cc="xxxx" HEAD~

f. multiple patches with cover letter
git format-patch --cover-letter

git format-patch --patience -M -C --subject-prefix="PATCH v2" --thread --to="hostap@lists.infradead.org" HEAD~15 --cover-letter




g. wireless-regdb
git format-patch --patience -M -C --subject-prefix="PATCH" --to="wireless-regdb@lists.infradead.org" --cc="linux-wireless@vger.kernel.org" HEAD~


6. #sends off the mail
 a. install git-email: sudo apt-get install git-email
b. git send-email 0001-xxxx.patch
Who should the emails be sent to? //just enter
Message-ID to be used as In-Reply-To for the first email? //just enter

Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
c. to suppress confirmation message: git config --global sendemail.confirm auto


* command line example
git send-email --suppress-cc=all --smtp-server=mail.server.com --smtp-server-port=1234 --smtp-encryption=tls --smtp-user=ebmajor --to=receiver@mail.com --cc=ccee@mail.com 0001-fix-patch-file.patch

* multiple patch to send
git send-email *.patch

$ git config --global sendemail.smtpserver smtp.gmail.com
$ git config --global sendemail.smtpserverport 587
$ git config --global sendemail.smtpencryption tls
$ git config --global sendemail.smtpuser your_email@gmail.com
$ git config --global sendemail.smtppass your_password

--------------------

$ git show --format=fixes a66b98db570a638afd909459e1e6bfa272344bd3 | head -1
Fixes: a66b98db570a ("mac80211: fix rx->key NULL dereference during mic failure")

How to configure it is documented in SubmittingPatches:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes

*** trouble shooting
STARTTLS failed! SSL connect attempt failed error:1416F086:STARTTLS failed! SSL routines:tls_process_server_certificate:certificate verify failed at /usr/lib/git-core/git-send-email
- set  smtpsslcertpath = /etc/ssl/certs in git config (~/.gitconfig)