Set up Arch Linux on Cubieboard 2
Install Arch Linux
- http://archlinuxarm.org/platforms/armv7/allwinner/cubieboard-2
- https://github.com/edwardoid/cubieboard-arch-installer
Update to new kernel
pacman -Syu linux-armv7
Change hostname
hostnamectl set-hostname myhostname
Set up user account
-
Create an user account and add it to
wheel
group (an administration group, commonly used to give access to thesudo
andsu
utilities)useradd -m -G wheel -s /bin/bash <username>
-
Specify the new user account’s password:
passwd <username>
-
Edit
sudoers
list by typingvisudo
, look for the below line and uncomment it to allow wheel group to execute commands.%wheel ALL=(ALL) ALL
-
Allow only users in the group
wheel
to login toroot
usingsu
command by edit/etc/pam.d/su
and uncomment the line:# Uncomment the following line to require a user to be in the "wheel" group. auth required pam_wheel.so use_uid
-
Deny SSH login to
root
account: edit/etc/ssh/sshd_config
, change#PermitRootLogin yes
tono
and uncomment the line:PermitRootLogin no
-
Restart the SSH daemon:
systemctl restart sshd
-
Now we can only log in with the created user account and use
su
orsudo
to do system administration. -
More details: Users and Groups, Security, Secure Shell
Set up Access Point on wlan0 interface
-
Install
hostapd
packagesudo pacman -S hostapd
-
Create file
/etc/hostapd/hostapd.conf
interface=wlan0 bridge=br0 driver=nl80211 ssid=cubie1 hw_mode=g channel=11 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=3 wpa_passphrase=cubiepass wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
-
If you have a card based on RTL8192CU chipset, install
hostapd-8192cu
in the AUR and replacedriver=nl80211
withdriver=rtl871xdrv
and removebridge=br0
. See Install hostapd-8192cu package -
Install
dnsmasq
package for DHCP serversudo pacman -S dnsmasq
-
Edit
/etc/dnsmasq.conf
to:# disables dnsmasq reading any other files like /etc/resolv.conf for nameservers no-resolv # Interface to bind to interface=wlan0 # Specify starting_range,end_range,lease_time dhcp-range=10.0.0.3,10.0.0.20,12h # dns addresses to send to the clients server=8.8.8.8 server=8.8.4.4
-
Initial wlan0 configuration
sudo ifconfig wlan0 up 10.0.0.1 netmask 255.255.255.0
-
Run
dnsmasq
sudo dnsmasq
-
Run
hostapd
as backgroundsudo hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf 1> /dev/null
-
More details: Software Access Point, hostapd
Connect to a Wi-Fi on wlan1 interface
-
Install
wpa_supplicant
packagesudo pacman -S wpa_supplicant
-
Configure
wpa_supplicant.conf
sudo wpa_passphrase "<ssid>" "<password>" | tee /etc/wpa_supplicant/wpa_supplicant-wlan1.conf > /dev/null
-
Turn on
wlan1
interfacesudo ip link set dev wlan1 up
-
Initialize
wpa_supplicant
sudo wpa_supplicant -B -i wlan1 -c /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
-
Obtain IP Adress
sudo dhcpcd wlan1
-
Enable
systemd
services for connecting Wi-Fi at bootsudo systemctl enable wpa_supplicant@wlan1 sudo systemctl enable dhcpcd@wlan1
-
To customize start up script or look for more details, see: Wireless Network Configuration and WPA Suppliant
Install hostapd-8192cu package
-
Install
base-devel
group packagesudo pacman -S --needed base-devel
-
Create a build directory, for example
~/builds
mkdir ~/builds cd ~/builds
-
Download
hostapd-8192
tarball and extract itcurl -L -O https://aur.archlinux.org/packages/ho/hostapd-8192cu/hostapd-8192cu.tar.gz tar -xvf hostapd-8192cu.tar.gz cd hostapd-8192cu
-
Make the package
makepkg -s
-
A tarball should have been created with name
hostapd-8192cu-<application version number>-<package revision number>-<architecture>.pkg.tar.xz
-
Install the created package using
pacman
:sudo pacman -U hostapd-8192cu-0.8_rtw_r7475.20130812_beta-3-armv7h.pkg.tar.xz
-
More details: Arch User Repository, hostapd-8192cu