Microcore a10Core-20120920
This page is about setting up wifi/ssh on mini-x, using the 20120920 test release of arm MicroCore. Some parts of this setup will be redundant and sub-optimal - it hasn't been refined at all. It's just something that works for me as a starting point, so that I can access the mini-x remotely.
Downloads
- Download
a10Core-20120920.img.gz
from http://distro.ibiblio.org/tinycorelinux/4.x/armv7/ and write it to micro-SD card (I used 8GB). - Download
allwinner-sunxi-v3.0.39-modules.tgz
from http://distro.ibiblio.org/tinycorelinux/4.x/armv7/ - Download a bunch of Debian Wheezy armhf packages - see tree listing further down this page - not all are required.
partitioning (using a linux machine)
- Use
cfdisk
and create a partition in the unused space at the end of the micro-SD card. - format the new partition with ext2 and label it as:
a10core
- something like this:
mkfs.ext2 -L a10core /dev/sdX2
- something like this:
boot script
- boot mini-x from the micro-SD card
mount /dev/nanda
mount /dev/mmcblk0p1
cp /mnt/nanda/script.bin /mnt/mmcblk0p1/
updbootcodes
and change kernel commandline to:setenv bootargs init=/init panic=10 rootwait loglevel=3 opt=LABEL=a10core/opt tce=LABEL=a10core/tce
setup some host keys & pubkey
I'm using a flashdrive mounted at /mnt/sda1
with various files I need. Extract some downloaded modules and dep file as per tree listing - see further down this page.
Copy public key and create ssh host keys:
mkdir -p /mnt/mmcblk0p2/tce/kmw/sshd
cd /mnt/mmcblk0p2/tce/kmw/sshd
cp /mnt/sda1/public_key.rsa.pub .
dropbearkey -t rsa -f dropbear_rsa_host_key
dropbearkey -t dss -f dropbear_dss_host_key
bootlocal script
Modify /opt/bootlocal.sh
to match this:
tc@box:~$ cat /opt/bootlocal.sh
#!/bin/sh
# put other system startup commands here
/mnt/mmcblk0p2/tce/kmw/bootlocal.sh
run this to save the bootlocal changes: filetool.sh -b
kmw chained bootlocal script
Create a script like this and make it executable.
tc@box:~$ cat /mnt/mmcblk0p2/tce/kmw/bootlocal.sh
#! /bin/sh
KMW=/mnt/mmcblk0p2/tce/kmw
cp $KMW/modules/net /lib/modules/3.0.39/kernel/drivers/ -a
cp $KMW/modules/modules.dep /lib/modules/3.0.39/ -af
modprobe 8192cu
cd /; for FN in $KMW/Debian_Wheezy/*.deb; do
ar p "$FN" data.tar.gz | tar zx
done
ifconfig wlan0 up
wpa_supplicant -B -Dwext -i wlan0 -c $KMW/wpa_supplicant.conf
#udhcpc -i wlan0
ifconfig wlan0 192.168.1.44
mkdir /home/tc/.ssh
cp $KMW/sshd/public_key.rsa.pub /home/tc/.ssh/authorized_keys
chown tc:staff -R /home/tc/.ssh
chmod 700 /home/tc/.ssh
chmod 600 /home/tc/.ssh/*
dropbear -d $KMW/sshd/dropbear_dss_host_key -r $KMW/sshd/dropbear_rsa_host_key
wpa_supplicant.conf
tc@box:/mnt/mmcblk0p2/tce/kmw$ cat wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=20
network={
ssid="myWifiSSID"
scan_ssid=1
key_mgmt=WPA-PSK
psk="mySecretWifiPassword"
}
blkid listing
tc@box:~$ blkid
/dev/nanda: SEC_TYPE="msdos" LABEL="Volumn" TYPE="vfat"
/dev/nandi: LABEL="PRIVATE" UUID="2023-07DA" TYPE="vfat"
/dev/nandk: LABEL="APOLLO" UUID="5EBB-07DA" TYPE="vfat"
/dev/mmcblk0p1: SEC_TYPE="msdos" UUID="4D79-11A5" TYPE="vfat"
/dev/mmcblk0p2: LABEL="a10core" UUID="04dbf9a9-31fa-4fbd-99e7-fda72249e8ff" TYPE="ext2"
/dev/nandh: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/sda1: LABEL="KEXECLOADER" UUID="32C2-5615" TYPE="vfat"
/dev/nandd: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/nande: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
tree listing
tc@box:/mnt/mmcblk0p2/tce/kmw$ tree
.
|-- Debian_Wheezy
| |-- debconf_1.5.46_all.deb
| |-- dropbear_2012.55-1_armhf.deb
| |-- gcc-4.7-base_4.7.1-7_armhf.deb
| |-- libc-bin_2.13-35_armhf.deb
| |-- libc6_2.13-35_armhf.deb
| |-- libdbus-1-3_1.6.0-1_armhf.deb
| |-- libgcc1_4.7.1-7_armhf.deb
| |-- libiw30_30~pre9-8_armhf.deb
| |-- libncurses5_5.9-10_armhf.deb
| |-- libnl-3-200_3.2.7-4_armhf.deb
| |-- libnl-genl-3-200_3.2.7-4_armhf.deb
| |-- libpcsclite1_1.8.4-1_armhf.deb
| |-- libreadline6_6.2-8+b1_armhf.deb
| |-- libssl1.0.0_1.0.1c-4_armhf.deb
| |-- lsb-base_4.1+Debian7_all.deb
| |-- ncurses-bin_5.9-10_armhf.deb
| |-- perl-base_5.14.2-12_armhf.deb
| |-- readline-common_6.2-8_all.deb
| |-- tar_1.26-4_armhf.deb
| |-- tree_1.6.0-1_armhf.deb
| |-- wireless-tools_30~pre9-8_armhf.deb
| |-- wpasupplicant_1.0-2_armhf.deb
| `-- zlib1g_1.2.7.dfsg-13_armhf.deb
|-- bootlocal.sh
|-- modules
| |-- modules.dep
| `-- net
| |-- tun.ko
| |-- usb
| | |-- asix.ko
| | |-- cdc_ether.ko
| | |-- cdc_ncm.ko
| | |-- cdc_subset.ko
| | |-- hso.ko
| | |-- ipheth.ko
| | |-- kaweth.ko
| | |-- net1080.ko
| | |-- pegasus.ko
| | |-- qf9700.ko
| | |-- usbnet.ko
| | `-- zaurus.ko
| `-- wireless
| `-- rtl8192cu
| `-- 8192cu.ko
|-- sshd
| |-- dropbear_dss_host_key
| |-- dropbear_rsa_host_key
| `-- public_key.rsa.pub
`-- wpa_supplicant.conf