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
wheelgroup (an administration group, commonly used to give access to thesudoandsuutilities)useradd -m -G wheel -s /bin/bash <username> -
Specify the new user account’s password:
passwd <username> -
Edit
sudoerslist 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
wheelto login torootusingsucommand by edit/etc/pam.d/suand 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
rootaccount: edit/etc/ssh/sshd_config, change#PermitRootLogin yestonoand 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
suorsudoto do system administration. -
More details: Users and Groups, Security, Secure Shell
Set up Access Point on wlan0 interface
-
Install
hostapdpackagesudo pacman -S hostapd -
Create file
/etc/hostapd/hostapd.confinterface=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-8192cuin the AUR and replacedriver=nl80211withdriver=rtl871xdrvand removebridge=br0. See Install hostapd-8192cu package -
Install
dnsmasqpackage for DHCP serversudo pacman -S dnsmasq -
Edit
/etc/dnsmasq.confto:# 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
dnsmasqsudo dnsmasq -
Run
hostapdas 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_supplicantpackagesudo pacman -S wpa_supplicant -
Configure
wpa_supplicant.confsudo wpa_passphrase "<ssid>" "<password>" | tee /etc/wpa_supplicant/wpa_supplicant-wlan1.conf > /dev/null -
Turn on
wlan1interfacesudo ip link set dev wlan1 up -
Initialize
wpa_supplicantsudo wpa_supplicant -B -i wlan1 -c /etc/wpa_supplicant/wpa_supplicant-wlan1.conf -
Obtain IP Adress
sudo dhcpcd wlan1 -
Enable
systemdservices 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-develgroup packagesudo pacman -S --needed base-devel -
Create a build directory, for example
~/buildsmkdir ~/builds cd ~/builds -
Download
hostapd-8192tarball 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