ipkg on a Familiar 0.7.2-based iPAQ, how to connect a linux desktop to an iPAQ through USB, or from here, how to connect your iPAQ to the Internet through masquerading plus some links to useful references. About those links: even if this page is mainly focused on Linux desktop users, I have found and compiled useful links for users using Linux + Opie iPAQs, but using Windows on their desktop.ipkg (or at least it will be easier) on recent iPAQs, and reordered/fixed/improved a little bit the optional steps to do after an installation & optional ipkg fix.usb0 USB interface on the PC side via hotplug.fbvncserver package is out there! As the previous ones, you must get it on Sourceforge, and its latest version number is 0.0.5-008 at the moment. Besides its new features (like 54xx iPAQs support), the 'VNC Server down' icon bug is fixed, so I removed the now unecessary fix line.ipkg fix paragraph: ipkg version 0.99.105 seem to work better on XScale-based iPAQs, like h39something or h55something, or even on the other iPAQs (StrongARM-based) with some recent Familiar images. Explained why and how you would still update ipkg then.ipkg fix paragraph: converted an "If you try to run ipkg install ipkg" to "Run ipkg install ipkg", since it really must be typed at this point.ipkg tool is pretty broken, so I wrote a very documented list of instructions to upgrade it cleanly to a working version, without upgrading all Familiar packages. This is also a sort of example-based tutorial to solve packages install problems :)apt-get install kernel-image-2.4-686, will be updated like other packages with apt-get update && apt-get upgrade, and are always up-to-date concerning important stuff like security fixes. Moreover, they contain all the modules you could need, including the PPP, USB-NET, or masquerading modules that are used to talk to your iPAQ. If you want to know, I run the following on different computers:2.6 linux kernel is installed, and it's optimised for 686 i.e. Pentium Pro, Celeron, Pentium II and above),2.4 linux kernel is installed and it's optimised for 686 as well),kernel-source* packages (though you can get them through kernel.org or maybe your Linux distribution), extract it in /usr/src, and compile it with make-kpkg. Here is how to recompile a kernel the Debian way. Among other things selected by default, you will have to compile the following modules (putting 'm' in front of the corresponding option):
bootldr can be choosen and downloaded, you really should read the Familiar v0.7.2 installation guide, or at least go to the Familiar v0.7.2 download page to choose and download the files suited to your iPAQ model and your GUI needs (Opie / GPE / no GUI).| Alias | Model | Tar archive with BootBlaster, bootldr, md5sums and jffs2 image | Linux kernel | Familiar version | Opie version (and Opie feed URL) | Boot loader |
|---|---|---|---|---|---|---|
| ip | 3970 | bootstrap-v0.7.2-h3900.tar | 2.4.19-rmk6-pxa1-hh30 | 0.7.2 | Opie unstable | bootldr-pxa-2.20.4.bin.gz |
| ipd | 3870 | bootstrap-v0.7.2-h3600.tar | Opie 1.1.4 | bootldr-sa-2.21.12.bin.gz |
minicom (terminal application to communicate through serial links). Some notes:
minicom only suggests the lrzsz package, but we must install it to speak to the iPAQ. So if you have a Debian, type apt-get install minicom lrzsz to get a working serial communications environment. If you are using another Linux distribution, you'll notice quickly too if something is missing, and it's probably a missing lrzsz as well :-)minicom -s as root to setup our connection. Options: Serial port, 115200 baud, no flow control, 8-N-1.minicom then set ymodem 1 to activate ymodem protocol (faster than xmodem, and uses CRC for error correction).pon ipaq as they say in the previous link, only once your user is a member of the dialout group).logread, especially when you are booting or when the output is too big for the 16K circular log buffer) with the following methods:
boot through a serial connection, or press the iPAQ button in front of the Boot FlashROM item.bootldr boot> prompt or permanently through /boot/params:
/boot/params, replacing the console=/dev/tts/1 bit by console=ttyS0. Important: this will work for each normal reboot, when you don't press the center of the joystick; indeed, a reboot through the bootloader mode don't bother with the boot params set in /boot/params!0.7.2 iPAQ and your Linux Desktop is pretty simple. The iPAQ comes already set up for this, you just have to configure the PC side a little. Your PC kernel must have usbnet support enabled (you will find good, developed information on Linux "usbnet" driver here), which is pretty common in most recent kernels.modprobe usbnet or insmod usbnet (if it does not work, get or recompile a kernel with USB Networking support enabled). Note: this will tell you if USB networking if really enabled in your Linux kernel, and launch your "usbnet" kernel driver; but you don't need to type this anymore since the driver will be automatically loaded when you'll connect your iPAQ to your PC.apt-get install hotplug (or use your Linux distribution way of installing packages to get hotplug, if you don't already have it)./sbin/ifconfig -a.
ifconfig usb0 192.168.0.200. Note: 192.168.0.200 is the gateway IP address as given in /etc/network/interfaces on the iPAQ; if you change this file you will have to type a different IP address, but rembember it's quite practical to leave it in the default configuration.ssh or scp for example), typing ping 192.168.0.202 on the desktop.
192.168.0.200 and 192.168.0.202 quite often, it's much easier to give them aliases through your desktop /etc/hosts file. You can do that typing, as root (using pc for the PC USB interface and ip for the iPAQ address): echo "192.168.0.202 ip" >> /etc/hosts && echo "192.168.0.200 pc" >> /etc/hosts. Then you can replace any command like ping 192.168.0.202 (to ping your iPAQ) by ping ip.ifconfig usb0 192.168.0.200 to restore the connection. If it was on its craddle on standby mode, unplug and plug it again before typing this command.ifconfig something, just plug the iPAQ on its cradle and you're set!ifconfig usb0 192.168.0.200 kind of thing automatic when you plug your iPAQ on its cradle, simply copy this script in /etc/hotplug/usb, make it executable, and plug your iPAQ. ifconfig should show, after a couple of secondes, that usb0 is now up and running with the correct IP! (you will also see something like usbnet[25097]: Running in /etc/hotplug/usb/usbnet /etc/hotplug in your /var/log/syslog or /var/log/messages too).
usbnet script that will basically do ifconfig usb0 192.168.0.200 (set up the PC USB interface IP address) for you.Now we want to have access the Internet from the iPAQ through our PC, and we do not have any spare IP address on our network.
Since we have a 2.4 (or 2.6) linux kernel on our desktop, we will be able to use netfilter (also known as iptables) (if the kernel options have been activated) to meet our needs.
modprobe ip_tables then
16:23 root@dede /etc/default# iptables -t nat -A POSTROUTING -s 192.168.0.202 -j MASQUERADE
16:32 root@dede /etc/default# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 192.168.0.202 anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
echo 1 > /proc/sys/net/ipv4/ip_forward/etc/network/interfaces below the definition of an interface like lo or eth0 if it's always up:
up iptables -t nat -F && iptables -t nat -A POSTROUTING -s 192.168.0.202 -j MASQUERADE && echo 1 > /proc/sys/net/ipv4/ip_forward
You won't be able to sync anything before you install and configure opie-security (it's included in the Opie 1 images).
You'll have to choose the IP address of the desktop network interface which points to the iPAQ, so it will be one of the IP addresses authorized by opie-security Sync configuration page:
Finally, you may try either MultiSync: a versatile synchronization tool for multiple platforms: Zaurus, iPAQ, Evolution, IrMC, Opie, Windows CE, etc. (link to how-to) or, if you are using the KDE desktop environment KitchenSync: a synchronizing tool between Opie and KDE (link to how-to).
ifconfig usb0 192.168.0.200 only if you did not apply this automatic USB network configuration by hotplug - if you did, usb0 will be automatically set up!.
192.168.0.200 and 192.168.0.202 quite often, it's much easier to give them aliases through your desktop /etc/hosts file. You can do that typing, as root (using pc for the PC USB interface and ip for the iPAQ address): echo "192.168.0.202 ip" >> /etc/hosts && echo "192.168.0.200 pc" >> /etc/hosts. Then you can replace any command like ping 192.168.0.202 (to ping your iPAQ) by ping ip.ssh will complain that the iPAQ public key has changed, unless you remove its fingerprint from your ~/.ssh/known_hosts with cat ~/.ssh/known_hosts |sed '/^192.168.0.202/d' > ~/.ssh/tmp && mv -f ~/.ssh/tmp ~/.ssh/known_hosts (or cat ~/.ssh/known_hosts |sed '/^ip/d' > ~/.ssh/tmp && mv -f ~/.ssh/tmp ~/.ssh/known_hosts if you followed my advice on aliasing the iPAQ IP address to ip).scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf/etc/init.d/opie stop for example. Now we can take all the steps to get an up-to-date operating system...ipkgipkg update && ipkg upgrade for example), at least on StrongARM-based iPAQs (digits starting with 31, 36, 37 or 38, e.g. 3870) and/or with only some images from Familiar install page. We will explain here how to upgrade it to the latest version from Familiar unstable feed. Although the logs below have been recorded during the upgrade of a 3870 iPAQ to ipkg version 0.99.117, versions 120 to 130 have since been tested successfully.ipkg, version 0.99.105, might work on your iPAQ. For example, I have not had problems with my 3970, and someone reported me her ipkg worked on her 5550 // update (May 07): even a 3870 iPAQ with a recent familiar-bootstrap image won't SIGSEGV when running ipkg update or upgrade, or installing ipkg 0.99.121 from the feeds - so YMMV //. But since the 0.99.105 ipkg version is not verbose by default (it won't tell you what it does), and you might still encounter bugs, you may have reasons to upgrade anyway. In that case, you can apply the following instructions.ping www.google.com,mv /etc/ipkg/base.conf /root/ && echo "src base http://familiar.handhelds.org/feeds/unstable" > /etc/ipkg/base.conf,ipkg update (no output is normal here),ipkg install ipkg (or ipkg -V 3 install ipkg if you really want a lot of output) and check if the output looks like this:
~ # ipkg install ipkg /etc/ipkg/familiar-ipaqsa.conf:arch all 1 /etc/ipkg/familiar-ipaqsa.conf:arch any 1 /etc/ipkg/familiar-ipaqsa.conf:arch noarch 1 /etc/ipkg/familiar-ipaqsa.conf:arch arm 10 /etc/ipkg/familiar-ipaqsa.conf:arch armv4l 20 /etc/ipkg/familiar-ipaqsa.conf:arch ipaqsa 30 update-alternatives: Linking //usr/bin/ipkg to /usr/bin/ipkg-cl SIGSEGV
SIGSEGV error code after Linking //usr/bin/ipkg to /usr/bin/ipkg-cl, your ipkg might already be upgraded! You can test that running ipkg status ipkg && ipkg status libipkg. If you see two paragraphs (one for ipkg and one for libipkg, both having a Version: 0.99.X line with X > 120, and each of them having a line like Status: install user installed or Status: install ok installed, it means you are done, and you can jump to the end of this section, where you set your Familiar feed address back to the stable one again.SIGSEGV error code (which means ipkg produced a very abnormal segmentation fault), or if you don't pass the requirements of the previous paragraph, follow on to have a completely fixed ipkg.../usr/bin/ipkg points, as it should, to /usr/bin/ipkg-cl, typing: ln -sf /usr/bin/ipkg-cl /usr/bin/ipkg./usr/bin/ipkg version:
~ # ipkg -v ipkg version 0.99.117but the installation above is not finished, so the packages database does not know ipkg is installed, plus
libipkg has not been upgraded and should be,ipkg install ipkg again, and here is the beginning of the output (I cut some uninteresting file lists creating reports):Upgrading ipkg on root from 0.99.105 to 0.99.117...
Downloading http://familiar.handhelds.org/feeds/unstable/ipkg_0.99.117_arm.ipk
Installing libipkg (0.99.117) to root...
Downloading http://familiar.handhelds.org/feeds/unstable/libipkg_0.99.117_arm.ipk
Package libipkg wants to install file /usr/lib/libipkg.so.0
But that file is already provided by package libipkg
Package libipkg wants to install file /usr/lib/libipkg.so.0.0.0
But that file is already provided by package libipkg
Package libipkg wants to install file /usr/lib/libipkg.so
But that file is already provided by package libipkg
pkg_write_changed_filelists: saving changed filelists
creating apmd.list file
creating /usr/lib/ipkg/info/apmd.list file for pkg apmd
creating dhcpcd.list file
creating /usr/lib/ipkg/info/dhcpcd.list file for pkg dhcpcd
[...]
creating /usr/lib/ipkg/info/zlib1g.list file for pkg zlib1glibipkg nor ipkg have been installed or upgraded, because of some files libipkg has to replace (you can see their version number is still ...105 and not ...117 with ipkg status). We now have to force libipkg install with the command: ipkg -force-overwrite install libipkg.ipkg install ipkg, here is the output:Upgrading ipkg on root from 0.99.105 to 0.99.117...
Downloading http://familiar.handhelds.org/feeds/unstable/ipkg_0.99.117_arm.ipk
Installing libipkg (0.99.117) to root...
Downloading http://familiar.handhelds.org/feeds/unstable/libipkg_0.99.117_arm.ipk
creating libipkg.list file
creating /usr/lib/ipkg/info/libipkg.list file for pkg libipkg
creating ipkg.list file
creating /usr/lib/ipkg/info/ipkg.list file for pkg ipkg
/etc/ipkg/familiar-ipaqsa.conf:arch all 1
/etc/ipkg/familiar-ipaqsa.conf:arch any 1
/etc/ipkg/familiar-ipaqsa.conf:arch noarch 1
/etc/ipkg/familiar-ipaqsa.conf:arch arm 10
/etc/ipkg/familiar-ipaqsa.conf:arch armv4l 20
/etc/ipkg/familiar-ipaqsa.conf:arch ipaqsa 30
update-alternatives: Linking //usr/bin/ipkg to /usr/bin/ipkg-cl
pkg_write_changed_filelists: saving changed filelists
creating ipkg.list file
creating /usr/lib/ipkg/info/ipkg.list file for pkg ipkg
creating libipkg.list file
creating /usr/lib/ipkg/info/libipkg.list file for pkg libipkg~ # ipkg status ipkg && ipkg status libipkg Package: ipkg Version: 0.99.117 Depends: libc6, libipkg Status: install user installed Section: base Architecture: arm maintainer: Jamey Hicks <jamey%40handhelds.org> Size: 16550 Filename: ipkg_0.99.117_arm.ipk Source: http://www.handhelds.org/packages/ipkg/ipkg-0.99.117.tar.gz Description: lightweight package management system ipkg is the Itsy Package Management System, for handling Package: libipkg Version: 0.99.117 Depends: libc6, libc6, wget, sed, fileutils Status: install ok installed Section: base Architecture: arm maintainer: Jamey Hicks <jamey%40handhelds.org> Size: 54834 Filename: libipkg_0.99.117_arm.ipk Source: http://www.handhelds.org/packages/ipkg/ipkg-0.99.117.tar.gz Description: lightweight package management system ipkg is the Itsy Package Management System, for handling
mv /root/base.conf /etc/ipkg/,~ # ipkg update && ipkg upgrade
Downloading http://opie.handhelds.org/feed/ipaq/5thtoe/Packages
Updated list of available packages in /usr/lib/ipkg/lists/5thtoe
Downloading http://familiar.handhelds.org/releases/v0.7.2/base/armv4l/Packages
Updated list of available packages in /usr/lib/ipkg/lists/base
Downloading http://opie.handhelds.org/feed/ipaq/1.0.2/Packages
Updated list of available packages in /usr/lib/ipkg/lists/opie
Upgrading libqte2 on root from 1:2.3.7-5 to 1:2.3.7-5.1...
Downloading http://opie.handhelds.org/feed/ipaq/1.0.2/libqte2_2.3.7-5.1_arm.ipk
creating libqte2.list file
creating /usr/lib/ipkg/info/libqte2.list file for pkg libqte2
pkg_write_changed_filelists: saving changed filelists
creating libqte2.list file
creating /usr/lib/ipkg/info/libqte2.list file for pkg libqte2Fewww, now we can see we have a clean, updated install :)ipkg is upgraded...ipkg update && ipkg upgrade if you have not followed the ipkg upgrade instructions above (but then your package manager might still be broken ;-)echo "src opie-testing http://opie.handhelds.org/feed/testing/familiar/gcc2" >> /etc/ipkg/opie.conf && echo "src opie-unstable http://opie.handhelds.org/feed/unstable/familiar/gcc2" >> /etc/ipkg/opie.conf && echo "src fifthtoe http://opie.handhelds.org/feed/5thtoe" >> /etc/ipkg/opie.conf or putting the following lines in /etc/ipkg/opie.conf on your PDA with any text editor, which will give the same result:
src opie-testing http://opie.handhelds.org/feed/testing/familiar/gcc2 src opie-unstable http://opie.handhelds.org/feed/unstable/familiar/gcc2 src fifthtoe http://opie.handhelds.org/feed/5thtoe
ipkg update for these new feeds to be taken into account.task-opie-minimal meta-package) and some basic Opie applications with something like: ipkg install timezones task-opie-minimal opie-console libopiesecurity2 opie-security opie-multiauth-pinplugin opie-multiauth-bluepingplugin opie-style-flat opie-deco-flat opie-keyboard opie-multikey opie-keyboard opie-clock opie-clockapplet opie-light-and-poweripkg install vim less scap opie-screenshotapplet konqueror libpng3. Note: libpng3 is in fact a missing dependency of the konqueror package aka Konqueror Embedded. Here is a Familiar-based handhelds packages search engine, and here is a presentation of several Opie applications if you want to go further.sshd one, but you might prefer the latter; for example it implements public key authentication (though latest Dropbear versions should do that too). You can replace dropbear (and scp, which is contained in sshd) by sshd with the command: ipkg remove dropbear && ipkg remove libcrypto && ipkg remove task-bootstrap && ipkg remove scp && ipkg install sshd, then reboot (through Opie menus or typing reboot) to allow dropbear to close for a last time and sshd to start after the reboot.sshd, type ssh-keygen -t rsa -b 768 -f /etc/ssh/ssh_host_rsa_key -N '' or if you are still using Dropbear as your SSH server, dropbearkey -t rsa -f /etc/dropbear_rsa_host_key -s 768 .sshd (it won't work with dropbear but I'm not sure why), export your SSH public key on the iPAQ with: ssh-copy-id -i pathToYourId.Pub 192.168.0.202 (considering you have generated, with ssh-keygen for example, a key pair on your desktop). Then operations such as ssh root@192.168.0.202 or scp localfile root@192.168.0.202:/pathWhereToPutTheFile won't need you to type the root password (rootme by default) anymore (more details about public key SSH authentication here).ipkg install fbvncserver!fbvncserver package, here is its home page, available through Sourceforge./etc/tssim_cal.conf, used by the remote control interface.3100 to 5500).routing.reg, containing:
REGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] "IPEnableRouter"=dword:00000001
/etc/network/interface),