User:Ajh
From Openmoko
Page about my (ajh, tuyp200 on IRC) experimentation and use of the Openmoko Freerunner.
Contents |
ARMedslack
Installing ARMedslack on MicroSD
Setting up installation image
Here's instructions on how to get ARMedslack going on your Freerunner using an Andy-tracking kernel and Qi as bootloader. This describes my experiences and some pitfalls that I encountered. This is still work in progress.
First step of installing ARMedslack is to prepare your MicroSD card and installing Qi as bootloader. I had a working SHR-image on flash so I could use it to edit my images on the MicroSD card when problems arose. I prepared three primary partitions on the MicroSD card.
- /dev/mmcblk0p1 100MB type Linux ext2 (installation image, 40MB is enough though)
- /dev/mmcblk0p2 15GB type Linux ext3 (target partition)
- /dev/mmcblk0p3 900MB type Linux Swap
On your desktop computer, get installation image from ARMedslack website ftp://ftp.armedslack.org/armedslack/armedslack-12.2/isolinux/initrd-versatile.img
wget ftp://ftp.armedslack.org/armedslack/armedslack-12.2/isolinux/initrd-versatile.img rename g g.gz gunzip initrd-versatile.img.gz mkdir rootfs cd rootfs su -c "cpio -i <../initrd-versatile.img"
The next step is to modify the installation image a bit. On the desktop computer I cross-compiled an Andy-tracking kernel from the git repository which I used to boot up the installation image and later on to boot up the installed ARMedslack distribution. The kernel and modules are copied to the installation image as described later.
In the installation image, change etc/inittab so that sysinit directive is prefixed with the id of tty1 (a busybox init feature). This enables you to see what's going on in the init scripts during boot.
# /etc/inittab # Boot-time system configuration/initialization script. # This is run first except when booting in single-user mode. tty1::sysinit:/etc/rc.d/rc.S
Next I added the correct rootfs to etc/fstab
proc /proc proc defaults 0 0 /dev/mmcblk0p1 / ext2 defaults,rw 1 1
I added lines to the very beginning of etc/rc.d/rc.S to be sure that filesystems would be mounted and all the necessary modules would be loaded.
/bin/mount -n -t proc proc /proc /bin/mount -n -t sysfs sysfs /sys /bin/mount -n -o remount,noatime,rw / /sbin/modprobe ipv6 /sbin/modprobe ar6000 /sbin/modprobe btusb /sbin/modprobe s3cmci /sbin/modprobe l2cap /sbin/modprobe rfcomm /sbin/modprobe sco /sbin/modprobe hidp /sbin/modprobe bnep /sbin/modprobe bluetooth /sbin/modprobe slhc /sbin/modprobe ppp_generic /sbin/modprobe ohci_hcd /sbin/modprobe g_ether
Also, to get dropbear started before keymap selection, I added a line for it before the prompting for keyboard layout.
# Don't automatically blank the screen, or it will go black during the install # process when stray keystrokes might be dangerous: /bin/setterm -blank 0 # Added line to get dropbear early startup. /etc/rc.d/rc.dropbear start if ! cat /proc/cmdline | grep -q 'kbd=' 2> /dev/null ; then echo echo echo "<OPTION TO LOAD SUPPORT FOR NON-US KEYBOARD>"
I then added things to etc/rc.d/rc.inet1 just after the part where a local DHCP server is tried. I wanted a ssh shell over USB to get into the installation image once booted.
# In case we use udev - # Try to get information from a local DHCP server and store that for later: if ! grep -wq nodhcp /proc/cmdline ; then for EDEV in $(cat /proc/net/dev | grep ':' | sed -e "s/^ *//" | cut -f1 -d: | grep -v lo) ; do if grep -q $(echo ${EDEV}: | cut -f 1 -d :): /proc/net/wireless ; then continue # skip wireless interfaces fi /sbin/dhcpcd -t 10 -T $EDEV 1>$TMP/dhcpc/dhcpcd-${EDEV}.info 2>/dev/null & done fi # Added for USB networking. /sbin/ifconfig usb0 192.168.0.202 netmask 255.255.255.0 /sbin/route add -net 192.168.0.0 netmask 255.255.255.0 usb0
For dropbear to start early, one must create a etc/motd.net manually.
echo "Hello." >etc/motd.net
Then I copied the cross-compiled kernel and the modules to the image. uImage-moredrivers-GTA02_andy-tracking-973a41fce60e5f6e.bin to /boot/uImage-GTA02.bin and untar modules-GTA02_andy-tracking-973a41fce60e5f6e.tar.gz to / of the installation image. Create /boot/append-GTA02 with the line loglevel=8. Create a tar file of your installation image and untar it to your MicroSD card's first partition (/dev/mmcblk0p1).
The final step is to boot your Freerunner with Qi and USB cable attached to desktop computer. Hopefully you will see everything going well on the screen of your Freerunner and get a cdc_ether up in your desktop computer.
Installation
After booting up your Freerunner from the first partition on your MicroSD card you should ssh into your Freerunner as usual. This should now be a installer image that you are used to get when bootin the Slackware installation CD-ROM. Set up NAT on your desktop computer so that we can download packages straight from ftp://ftp.armedslack.org.
iptables -t nat -A POSTROUTING -s 192.168.0.202 \ -d ! 192.168.0.0/24 -j SNAT --to-source IP_ADDR_OF_DESKTOP echo 1 >/proc/sys/net/ipv4/ip_forward
Setup default gateway and nameservers on Freerunner.
route add default gw 192.168.0.200 echo "nameserver 208.67.222.222" >>/etc/resolv.conf echo "nameserver 208.67.220.220" >>/etc/resolv.conf
Modify the end of /sbin/probe so that we get our MicroSD partitions as targets for installation and swap.
else # old format and no RAID: if cat /proc/partitions | grep md 1> /dev/null 2> /dev/null ; then cat /proc/partitions | grep md | while read line ; do SMASHED_LINE=$line MAJOR=`echo $SMASHED_LINE | cut -f 1 -d ' '` if [ "$MAJOR" = "9" ]; then list_md `echo $SMASHED_LINE | cut -f 3 -d ' ' | tr -d '/'` \ `echo $SMASHED_LINE | cut -f 4 -d ' '` fi done fi # Added to get MicroSD cards to show up in setup. if cat /proc/partitions | grep mmcblk 1> /dev/null 2> /dev/null ; then cat /proc/partitions | grep mmcblk | while read line ; do SMASHED_LINE=$line MAJOR=`echo $SMASHED_LINE | cut -f 1 -d ' '` if [ "$MAJOR" = "179" ]; then list_md `echo $SMASHED_LINE | cut -f 3 -d ' ' | tr -d '/'` \ `echo $SMASHED_LINE | cut -f 4 -d ' '` fi done fi
Start setup as usual.
When asked for source media, choose HTTP/FTP site and enter server ftp://ftp.armedslack.org and enter path to packages as /armedslack/armedslack-12.2/slackware. When asked, do not install a kernel, instead copy the existing from the installation image to /mnt/boot/. Same goes for the modules and /lib/firmware/. Create /mnt/boot/append-GTA02 with an additional console parameter as loglevel=8 console=tty1.
To get ssh over USB networking to rock'n'roll on your newly installed ARMedslack to work properly you have to edit /mnt/etc/rc.d/rc.inet1.conf. Remember to add the name for the interface manually.
# Config information for eth0: IFNAME[0]="usb0" IPADDR[0]="192.168.0.202" NETMASK[0]="255.255.255.0" USE_DHCP="" DHCP_HOSTNAME=""
To be on the safe side of things I also added lines to load necessary modules in /mnt/etc/rc.d/rc.S.
# Mount sysfs next, if the kernel supports it: if [ -d /sys ]; then if grep -wq sysfs /proc/filesystems ; then if ! grep -wq sysfs /proc/mounts ; then /sbin/mount -v sysfs /sys -n -t sysfs fi fi fi # Added just in case. /sbin/modprobe ipv6 /sbin/modprobe ar6000 /sbin/modprobe btusb /sbin/modprobe s3cmci /sbin/modprobe l2cap /sbin/modprobe rfcomm /sbin/modprobe sco /sbin/modprobe hidp /sbin/modprobe bnep /sbin/modprobe bluetooth /sbin/modprobe slhc /sbin/modprobe ppp_generic /sbin/modprobe ohci_hcd /sbin/modprobe g_ether stty onlcr 0>&1
To get your newly installed ARMedslack to boot you must rename your kernel in /dev/mmcblk0p1 partitions /boot directory so that Qi skips to the next partition.
cd /boot rename 2 2-notinuse *
Getting Xorg to run
To be continued...