Beagle Bone Black (BBB) Building a Custom Kernel – Deprecated – git://github.com/beagleboard/kernel.git

Last Modified 2015.04.09

Ubuntu 14.04.2 – Beagle Bone Black (BBB) Building a Custom Kernel – Deprecated – git://github.com/beagleboard/kernel.git

01. Install prerequisite software on BBB Ubuntu build system (Virtualbox VM install of Ubuntu 14.04.2 32bit Desktop):
$ sudo apt-get update
$ sudo apt-get install aptitude ssh
$ sudo aptitude full-upgrade –full-resolver
$ sudo aptitude install automake autoconf binfmt-support bridge-utils build-essential cpu-checker curl debootstrap fakeroot fuseext2 gawk gcc-arm-linux-gnueabi genext2fs gettext gnome-shell ubuntu-gnome-desktop gnome-tweak-tool elementary-icon-theme gnome-system-tools gobjc++-arm-linux-gnueabi hwdata kvm-ipxe libaio1 libfdt1 libglib2.0-dev libltdl-dev libncurses5-dev librados2 librbd1 libsdl1.2debian libssl-dev libtool libvde0 libvdeplug2 libwrap0-dev lzop make module-assistant msr-tools pkg-config python python-software-properties qemu-common qemu-keymaps qemu-kvm qemu-system qemu-user qemu-user-static qemu-utils seabios sshfs software-properties-common subversion sysfsutils u-boot-tools vde2 vgabios xmlto xmltoman
$ reboot
$ sudo apt-get install –install-recommends linux-generic-lts-utopic xserver-xorg-lts-utopic libgl1-mesa-glx-lts-utopic libegl1-mesa-drivers-lts-utopic
$ reboot

After reboot install virtualbox guest additions.

02. Install latest GIT:
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git git-core
$ git config –global user.email “rbianchi@kuttatech.com”

03. U-Boot:
$ cd /root
$ mkdir /root/beaglebone/ && mkdir /root/beaglebone/u-boot/
$ cd /root/beaglebone/u-boot/
$ wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2
$ tar -xjf u-boot-latest.tar.bz2
$ cd /root/beaglebone/u-boot/u-boot-2015.01
$ make sandbox_defconfig tools-only
$ sudo install tools/mkimage /usr/local/bin
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- am335x_boneblack_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

04. Compiling the BeagleBone Black Kernel:
$ cd /root/beaglebone/
$ git clone git://github.com/beagleboard/kernel.git
$ cd kernel
$ git checkout 3.14
$ ./patch.sh
$ cp configs/beaglebone kernel/arch/arm/configs/beaglebone_defconfig
$ wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O kernel/firmware/am335x-pm-firmware.bin
$ cd kernel

BBB Kernel 3.14 .config file:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- beaglebone_defconfig -j4

Edit the .config file to reflect your changes, if any:
$ nano /root/beaglebone/kernel/kernel/.config

You could also use menuconfig to edit the .config file:
$ cd /root/beaglebone/kernel/kernel
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

This step builds the kernel and may take 15-20 minutes or longer:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs LOADADDR=0x80008000 -j4

This step builds the kernel for the BBB:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage am335x-boneblack.dtb LOADADDR=0x80008000 -j4

This builds the kernel modules and may take 20 minutes or longer:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules -j4

The following steps assume you already have a working Ubuntu 14.04.2 MicroSD with boot and rootfs partitions.
http://www.armhf.com/boards/beaglebone-black/bbb-sd-install/

05. Update u-boot:
$ su
$ cd /root
$ mkdir boot
$ fdisk -l
$ mount /dev/sdX1 boot
$ cp /root/beaglebone/u-boot/u-boot-2015.01/MLO /root/boot
$ cp /root/beaglebone/u-boot/u-boot-2015.01/u-boot.img /root/boot
$ sync
$ cd /root
$ umount boot

06a. Update rootfs and zImage (kernel):
$ su
$ cd /root
$ mkdir rootfs
$ fdisk -l
$ mount /dev/sdX2 rootfs
$ cd /root/beaglebone/kernel/kernel
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/root/rootfs modules_install
$ cp /root/beaglebone/kernel/kernel/arch/arm/boot/zImage /root/rootfs/boot/vmlinuz-3.14.4.1-bone-armhf.com
$ cp /root/beaglebone/kernel/kernel/.config /root/rootfs/boot/config-3.14.4.1-bone-armhf.com
$ sync
$ cd /root
$ umount rootfs

Remove the MicroSD card from your adapter and boot into your custom kernel.

06b. Update rootfs and zImage (kernel) via SSH:
$ cd /root
$ mkdir sftpBBB
$ sshfs root@192.168.1.111:/ /root/sftpBBB
$ cd /root/beaglebone/kernel/kernel
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/root/sftpBBB modules_install
$ cp /root/beaglebone/kernel/kernel/arch/arm/boot/zImage /root/sftpBBB/boot/vmlinuz-3.14.4.1-bone-armhf.com
$ cp /root/beaglebone/kernel/kernel/.config /root/sftpBBB/boot/config-3.14.4.1-bone-armhf.com

Notes:
N01. Check current running kernel .config:
$ cat /proc/config.gz | gunzip > running.config

N02. Check UARTs:
$ ls -l /dev/ttyO*
N03. References:
https://github.com/beagleboard/kernel
http://dev.ardupilot.com/wiki/building-the-code/building-for-beaglebone-black-on-linux/#making_the_rt_kernel
http://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Building_Kernel
http://elinux.org/Building_BBB_Kernel

Ubuntu 14.04 Samba Write List Permission Only Works With Primary Group After Upgrade From 12.04 – Secondary Groups Not Working

Issues:
For example. User “user1”, has a primary group of “main-users”, and secondary group of “managers”. When “user1” tries to access a Samba folder(s) with “write list = @main-users” (their primary group) the permissions are applied properly and access granted, but when “user1” tries to access a Samba folder with “write list = @managers” (their secondary group) the folder(s) can not be accessed.

Solution:
01. You need to delete and then recreate the group(s) in Samba. This does not delete any group(s) from OpenLDAP or Linux permissions, only Samba.

I found the easy way to do this was through webmin ( https://localhost:10000/ ).
Servers->Samba Windows File Sharing->Samba Users-Samba Groups

02. After making the necessary changes on the server side, have the user(s) reboot their systems in order for the changes to take effect.

Cause:
I believe the issue is caused due to a possible de-linking of the OpenLDAP/Linux SIDs in Samba; recreating the groups in Samba re-links them to the correct domain group.

Ubuntu 12.04/14.04 x64 – Enabling Desktop Sharing Through SSH

Last Modified 2014.08.08 by Rick Bianchi

Ubuntu 12.04/14.04 x64 – Enabling Desktop Sharing Through SSH

01. SSH in to the remote system and add “X11UseLocalHost no” (without the quotes) to the bottom of file /etc/ssh/sshd_config and verify that X11Forwarding is yes:
$ sudo nano /etc/ssh/sshd_config

X11UseLocalHost no

X11Forwarding yes

$ sudo service ssh restart

02. Logout of the remote system, now verify that ForwardX11 is set to “yes” on your system /etc/ssh/sshd_config. If not, change it and restart SSH “$ sudo service ssh restart”:
$ cat /etc/ssh/sshd_config

X11Forwarding yes

03. Now, log out of the remote system, then log back in using trusted X11 forwarding (-Y). You need DBUS_SESSION_BUS_ADDRESS to be associated with your SSH session, or you will not be able to change gsettings:
Note: This has to be the account you need to Desktop Share with.
$ ssh -Y username@remotehostipaddress

04. List all configuration keys:
$ gsettings list-recursively org.gnome.Vino

05. Set following values:
$ gsettings set org.gnome.Vino notify-on-connect true
$ gsettings set org.gnome.Vino alternative-port “uint16 5900”
$ gsettings set org.gnome.Vino disable-background true
$ gsettings set org.gnome.Vino use-alternative-port false
$ gsettings set org.gnome.Vino icon-visibility ‘client’
$ gsettings set org.gnome.Vino use-upnp false
$ gsettings set org.gnome.Vino view-only false
$ gsettings set org.gnome.Vino enabled true
$ gsettings set org.gnome.Vino prompt-enabled false
$ gsettings set org.gnome.Vino disable-xdamage false
$ gsettings set org.gnome.Vino authentication-methods “[‘vnc’]”
$ gsettings set org.gnome.Vino network-interface ”
$ gsettings set org.gnome.Vino require-encryption true
$ gsettings set org.gnome.Vino mailto ”
$ gsettings set org.gnome.Vino lock-screen-on-disconnect true
$ gsettings set org.gnome.Vino vnc-password ‘keyring’

06. Reboot system to apply the new settings:
$ sudo reboot

Notes:
01. On some installs encryption needs to be set to false:
$ gsettings set org.gnome.Vino require-encryption false

Installing ReviewBoard 2.0.x on ubuntu 12.04.x

Last Modified on 2014.07.09 @ 09:00

Installing ReviewBoard 2.0.x on ubuntu 12.04.x

01. Install Prerequisites :

$ sudo aptitude install libapache2-mod-wsgi libcache-memcached-perl memcached patch python-dev python-ldap python-setuptools subversion python-svn python-subvertpy

 

02. Install ReviewBoard:

$ sudo easy_install ReviewBoard

 

03. Installing Database Bindings:

$ sudo easy_install mysql-python

 

04. Installing Development Tools (optional). If you plan to work on Review Board’s source code, there are a few additional packages you’ll need to install:

$ sudo easy_install nose Sphinx

 

05. Create MySQL database:

$ mysql -uroot -p

mysql> create database reviewboard;

mysql> grant all on reviewboard.* to ‘root’@’localhost’;

mysql> exit

 

06. Creating a Review Board Site:

$ sudo rb-site install /var/www/reviewboard

Domain Name: my.example.net

Root Path [/]: /

Note: While useful and portable, SQLite does not handle large loads with many concurrent users very well, use MySQL.

Database Type: 1

Database Name [reviewboard]: reviewboard

Database Server [localhost]: localhost

Database Username: root

Database Password: ROOTMySQLPASSWORD

Confirm Database Password: ROOTMySQLPASSWORD

Memcache Server [localhost:11211]: localhost:11211

Username [admin]: admin

Password: ENTERADMINPASSWORD

Confirm Password: ENTERADMINPASSWORD

E-Mail Address: me@example.net

 

07. Configure Apache2:

$ sudo nano /etc/apache2/sites-available/reviewboard-apache-wsgi.conf

 

** Start copying below this line **

 

<VirtualHost *:80>

ServerName your.servername.net

DocumentRoot “/var/www/reviewboard/htdocs”

 

# Error handlers

ErrorDocument 500 /errordocs/500.html

WSGIPassAuthorization On

WSGIScriptAlias “/” “/var/www/reviewboard/htdocs/reviewboard.wsgi/”

<Directory “/var/www/reviewboard/htdocs”>

AllowOverride All

Options -Indexes +FollowSymLinks

Allow from all

</Directory>

 

# Prevent the server from processing or allowing the rendering of

# certain file types.

<Location “/var/www/reviewboard/htdocs/media/uploaded”>

SetHandler None

Options None

AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp

AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb

<IfModule mod_php5.c>

php_flag engine off

</IfModule>

</Location>

# Alias static media requests to filesystem

Alias /media “/var/www/reviewboard/htdocs/media”

Alias /static “/var/www/reviewboard/htdocs/static”

Alias /errordocs “/var/www/reviewboard/htdocs/errordocs”

Alias /favicon.ico “/var/www/reviewboard/htdocs/static/rb/images/favicon.png”

</VirtualHost>

 

** Stop copying above this line **

 

08. Make link from sites-available to sites-enabled:

$ cd /etc/apache2/sites-available

$ sudo ln -s /etc/apache2/sites-available/reviewboard-apache-wsgi.conf /etc/apache2/sites-enabled/reviewboard-apache-wsgi.conf

 

09. Changing Permissions:

$ sudo chown -R www-data.www-data /var/www/reviewboard/htdocs/media/uploaded

$ sudo chown -R www-data.www-data /var/www/reviewboard/data

$ sudo chown -R www-data.www-data /var/www/reviewboard/htdocs/media/ext

$ sudo chown -R www-data.www-data /var/www/reviewboard/htdocs/static/ext

$ sudo chown -R www-data.www-data /var/www/reviewboard/htdocs/media/uploaded

$ sudo chmod -R 644 /var/www/reviewboard/htdocs/media/uploaded

$ sudo service apache2 restart

Gumstix Overo – Installing and Configuring Hostapd for PT-8811AU

Rev-1.2
Gumstix Overo – Installing and Configuring Hostapd for PT-8811AU

Running iw lists all of the wireless adapters abilities.

This was a part of the list:

Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point

1. Installed hostapd through the repositories:
$ sudo apt-get install hostapd

2. Compile and install the source hostapd from PremierTek.
Before you compile you will need to modify the Makefile:
$ cd ~/PT-8811AU/RTL8812AU_8821AU_linux_v4.2.3_8123.20130705/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8_rtw_r7048.20130424/hostapd
$ nano Makefile

Change:
install: all

mkdir -p $(DESTDIR)/usr/local/bin

for i in $(ALL); do cp -f $$i $(DESTDIR)/usr/local/bin/$$i; done

To:
install: all
mkdir -p $(DESTDIR)/usr/sbin
for i in $(ALL); do cp -f $$i $(DESTDIR)/usr/sbin/$$i; done

$ cd ~/PT-8811AU/RTL8812AU_8821AU_linux_v4.2.3_8123.20130705/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8_rtw_r7048.20130424/hostapd
$ make
$ make install

3. Give wlan0 a static IP:
$ sudo nano /etc/network/interfaces
auto wlan1
iface wlan1 inet static
address 10.0.0.1
netmask 255.255.255.0

Now, we need to edit some files.

4. Modify /etc/default/hostapd. The “DAEMON_CONF=” is configured by default.
$ sudo nano /etc/default/hostapd

# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF=”/etc/hostapd/hostapd.conf”
# Additional daemon options to be appended to hostapd command:-
# -d show more debug messages (-dd for even more)
# -K include key data in debug messages
# -t include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=””

5. Configure your hostapd.conf file:
$ sudo nano /etc/hostapd/hostapd.conf

##### hostapd configuration file ##############################################
interface=wlan1
ctrl_interface=/var/run/hostapd
ssid=GUMSTIX
channel=149
wpa=2
wpa_passphrase=12345678
#bridge=br0

##### Wi-Fi Protected Setup (WPS) #############################################
eap_server=1
# WPS state
# 0 = WPS disabled (default)
# 1 = WPS enabled, not configured
# 2 = WPS enabled, configured
wps_state=0
uuid=12345678-9abc-def0-1234-56789abcdef0

# Device Name
# User-friendly description of device; up to 32 octets encoded in UTF-8
# device_name=RTL8192CU

# Manufacturer
# The manufacturer of the device (up to 64 ASCII characters)
# manufacturer=Realtek

# Model Name
# Model of the device (up to 32 ASCII characters)
# model_name=RTW_SOFTAP

# Model Number
# Additional device description (up to 32 ASCII characters)
# model_number=WLAN_CU

# Serial Number
# Serial number of the device (up to 32 characters)
# serial_number=12345

# Primary Device Type
# Used format: —
# categ = Category as an integer value
# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
# default WPS OUI
# subcateg = OUI-specific Sub Category as an integer value
# Examples:
# 1-0050F204-1 (Computer / PC)
# 1-0050F204-2 (Computer / Server)
# 5-0050F204-1 (Storage / NAS)
# 6-0050F204-1 (Network Infrastructure / AP)

device_type=6-0050F204-1

# OS Version
# 4-octet operating system version number (hex string)
# os_version=01020300

# Config Methods
# List of the supported configuration methods
config_methods=label display push_button keypad

##### default configuration #######################################
driver=rtl871xdrv
#driver=nl80211
beacon_int=100
hw_mode=a
ieee80211n=1
wme_enabled=1
#ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][RS-STBC12]
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
max_num_sta=8
wpa_group_rekey=86400

Note: Hostapd does not have consistent comment handling. Any comments or black spaces after any parameters will cause hostapd to fail.

6. Installing and Configuring a DHCH server:
$ sudo apt-get install dnsmasq
$ sudo nano /etc/dnsmasq.conf

interface=wlan1 # To get dnsmasq to listen only on wlan1.
dhcp-range=10.0.0.2,10.0.0.5,255.255.255.0,12h # This sets the available range from 10.0.0.2 to 10.0.0.5
# It also sets the subnet mask to 255.255.255.0 and specifies a lease time of 12 hours.

After you have completed configuration restart dnsmasq and hostapd:

$ sudo service dnsmasq restart
$ sudo service hostapd restart

To troubleshoot hostapd run the following:
$ hostapd -dd /etc/hostapd/hostapd.conf

Gumstix Overo – Compile wireless driver for Asus USB-N53

Rev-1.7

Gumstix Overo – Compile wireless driver for Asus USB-N53

Soruce code for USB-N53:
Website: http://www.asus.com/us/Networking/USBN53/#support
Direct Link to source: http://dlcdnet.asus.com/pub/ASUS/wireless/USB-N53/Dr_USB_N53_10122_Linux.zip

Make sure in your headers “/usr/src/linux-headers-3.5.0-2-linaro-omap” there is the link named “source” that points back to you kernel source. More than likely there will be a link named source, but it will be broken, delete it and create the correct link.

Packages top install on source to compile:
$ sudo aptitude install sysfsutils libwrap0-dev gcc libglib2.0-dev libtool automake autoconf pkg-config libsysfs-dev libltdl-dev hwdata module-assistant gawk make

Make sure that the kernel includes support for modules in the .config file:
CONFIG_MODULES=y

1. Move .config into top level of kernel source
For Linaro = /usr/src/linux-omap-3.5
/home/gumstix/linaro/linux/.config

2. From top level of kernel source on the target: (for example, the Linaro build it is /usr/src/linux-omap-3.5)
$ make prepare
$ make scripts

3. Copy the “Module.symvers” file into the top leve of the respective kernel source.
For Linaro = /usr/src/linux-omap-3.5
/home/gumstix/linaro/linux/Module.symvers

4. Make sure that the “Makefile” is pointing to the correct source and modules folders, ~/USB-N53/Linux/2011_1003_RT3572_Linux_STA_v2.5.0.0.DPO/Makefile

5. From “~/USB-N53/Linux/2011_1003_RT3572_Linux_STA_v2.5.0.0.DPO” run the commands below, one at a time:
$ make
$ make install
$ modprobe rt3572sta

5. Added rt3572sta.ko to /etc/modules:
$ nano /etc/modules
rt3572sta

6. Add new wlan to /etc/network/interfaces
$ iwconfig # Get name of new wlan, for example wlan1

$ nano /etc/network/interfaces

auto ra0
iface ra0 inet static
address 10.0.0.1
netmask 255.255.255.0

Gumstix Overo – Compile wireless driver for RemierTek PT-8811AU (rtl8812AU 8821AU)

Rev-1.9

Gumstix Overo – Compile wireless driver for RemierTek PT-8811AU (rtl8812AU_8821AU)

Soruce code for PT-8811AU:
Website: http://www.premiertek.net/top/download.html
Direct Link to source: http://www.premiertek.net/support/PT-8811-AU_PT-8812AU/PT-8811_CD%2060G133000-04(330)_win81.rar
Git Master Repo: git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux

Make sure in your headers “/usr/src/linux-headers-3.5.0-2-linaro-omap” there is the link named “source” that points back to you kernel source. More than likely there will be a link named source, but it will be broken, delete it and create the correct link.

Packages needed to compile on source:
$ sudo aptitude install sysfsutils libwrap0-dev gcc libglib2.0-dev libtool automake autoconf pkg-config libsysfs-dev libltdl-dev hwdata module-assistant gawk make

Make sure that the kernel includes support for modules in the .config file:
CONFIG_MODULES=y

1. Move .config into top level of kernel source
For Yocto = /usr/src/kernel
/home/gumstix/yocto/build/tmp/sysroots/overo/usr/src/kernel/.config

For Linaro = /usr/src/linux-omap-3.5
/home/gumstix/linaro/linux/.config

2. From top level of kernel source on the target: (for example, the Linaro build it is /usr/src/linux-omap-3.5)
$ make prepare
$ make scripts

3. Copy the “Module.symvers” file into the top leve of the respective kernel source.
For Yocto = /usr/src/kernel
/home/gumstix/yocto/build/tmp/sysroots/overo/usr/src/kernel/Module.symvers

For Linaro = /usr/src/linux-omap-3.5
/home/gumstix/linaro/linux/Module.symvers

4. Make sure that the “Makefile” is pointing to the correct source and modules folders, ~/RTL8812AU_8821AU_linux_v4.2.3_8123.20130705/driver/rtl8812AU_8821AU_linux_v4.2.3_8123.20130705/Makefile

5. From “~/RTL8812AU_8821AU_linux_v4.2.3_8123.20130705/driver/rtl8812AU_8821AU_linux_v4.2.3_8123.20130705” run the commands below, one at a time:
$ make
$ make install
$ modprobe 8812au

6. Added 8812au.ko to /etc/modules:
$ nano /etc/modules
8812au

7. Add new wlan to /etc/network/interfaces
$ iwconfig # Get name of new wlan, for example wlan1

$ nano /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
down killall wpa_supplicant

auto wlan1
iface wlan1 inet static
address 192.168.1.1
netmask 255.255.255.0

$ service networking restart

Notes:
1. Make PT-8811AU use 5Ghz range:
$ iwconfig wlan0 freq 5G

2. Disable onboard wireless and bluetooth:
# disable wifi
$ echo 0 > /sys/class/gpio/gpio16/value
# disable bluetooth
$ echo 0 > /sys/class/gpio/gpio164/value

3. If you upgrade the kernel you will need to recompile the driver:
$ make
$ make install
$ modprobe 8812au