User:Libv

From linux-sunxi.org
Jump to navigation Jump to search

Hardware

A10

A13

A10s

A20

A23

A31

A33

A80

A83t

H3

Installation

Here i describe my own detailed installation routine, so i remember what steps i need to take for a fully working test system.

Kernel

Disable extensive versioning

Remove CONFIG_LOCALVERSION_AUTO or:

General Setup --->
    [ ] Automatically append version information to the version string

Rootfs

Select an Ubuntu Core Rootfs.

Serial access

Add etc/init/ttyS0.conf so that upstart starts a serial console on ttyS0:

# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc or RUNLEVEL=[12345]
stop on runlevel [!12345]

respawn
exec /sbin/getty -L 115200 ttyS0 vt102

To be able to log in as root later on, edit etc/shadow and change from:

root:*:15629:0:99999:7:::

to

root::15629:0:99999:7:::

This will get fixed once you run passwd.

Stop boot from waiting for ages for auto interfaces

Edit /etc/init/failsafe.conf, and reduce the script block to:

script
    exec initctl emit --no-wait failsafe-boot
end script

This gets you a terminal or desktop much, much faster in case usb is not attached.

Disable NetworkManager

This humongous heap of redhat shit always gets in the way, so kill it with fire...

echo "manual" > etc/init/network-manager.override

Add Ethernet

Edit etc/modules and add:

sunxi_gmac

Edit etc/network/interfaces and add:

auto eth0
iface eth0 inet dhcp

(OR) Add usb ethernet

Edit etc/modules and add:

g_ether

Edit etc/modprobe.d/g_ether.conf

options g_ether host_addr=22:AA:F2:BB:12:DB

Edit etc/network/interfaces and add:

auto usb0
iface usb0 inet static
    address 192.168.4.2
    netmask 255.255.255.0
    gateway 192.168.4.1

The latter line is to make sure that routing is setup.

Setup name resolution

echo "nameserver 192.168.1.1" > etc/resolv.conf

USB Host networking setup

So that our device can access the web through usb networking, we need to enable routing/nat on the host computer.

Enable forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Set up iptables, with usb1 the usb connection with the device, and eth1 the wlan adapter:

iptables -A FORWARD -i eth1 -o usb1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i usb1 -o eth1 -j ACCEPT

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

Initial setup

Now you should be able to boot this image and log into it through serial.

root password

Set a root password:

passwd

Hostname

Run:

echo "newname" > /etc/hostname

packages

First, add universe packages in /etc/apt/sources.list

Then run:

apt-get update
apt-get upgrade

Then, install some basics:

apt-get install ubuntu-minimal nano wireless-tools wpasupplicant usbutils

Depending on Ubuntu version you either need to run:

apt-get install openssh-utils

or

apt-get install openssh-server openssh-client

locale

locale-gen en_US.UTF-8

user

adduser user
adduser user video

Remove ondemand

Networking

Remove usb ether gateway

Remove:

    gateway 192.168.4.1

from etc/network/interfaces.

Add wifi

Edit /etc/modules and add:

8192cu

Edit /etc/network/interfaces and add:

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid ssid
    wpa-psk key

Desktop

Packages

First, make sure that the universe package repository is enabled in /etc/apt/sources.list.

Then, run:

apt-get update

again.

apt-get install xfce4 xubuntu-default-settings lightdm

Default login

Add the following to /etc/lightdm/lightdm.conf.d/10-xubuntu.conf, under the SeatDefaults section:

autologin-user=user