Optware

From MobileRead
Jump to: navigation, search

Instructions for getting OptWare to work on the Kindle

Contents

[edit] Overview

OptWare is better known as part of NSLU2-Linux - it's a very simple and very lightweight package manager designed to be integrated on top of embedded linuxes. Basically it's perfect for the Kindle although the repository is rather dated...still great for installing nano, wakelan, bitchx, and other fun toys to use from KiTerm.

[edit] Requirements

  • Jailbreak
  • Terminal Access (Either via usbnetwork, kiterm or similar)
  • Note: /mnt/us is inaccessible from the Kindle's shell when USB drive mode is active.

Note: This has been tested only on Kindle 3 / Keyboard and Kindle touch

Original thread

[edit] Steps

1. Create a blank file on the user directory on the Kindle (Caution! dd can be dangerous, always double check!):

The below will create a blank 250MB file in the user (USB Drive Mode) directory.

 dd if=/dev/zero of=/mnt/us/optware.ext3 bs=1M count=250

2. Create a proper ext3 filesystem within the file.

 mkfs.ext3 /mnt/us/optware.ext3

3. Make directory on Kindle and mount the image file to it.

 mntroot rw
 mkdir /mnt/optware/
 mntroot ro
 mount -o loop,noatime -t ext3 /mnt/us/optware.ext3 /mnt/optware

4. Prepare directories and symbolic links

 mkdir -p /mnt/optware/opt
 cd /mnt/optware/opt
 mkdir -p bin sbin etc info man share tmp lib
 cd /opt
 mntroot rw
 ln -s /mnt/optware/opt/bin .
 ln -s /mnt/optware/opt/sbin .
 ln -s /mnt/optware/opt/etc .
 ln -s /mnt/optware/opt/info .
 ln -s /mnt/optware/opt/man .
 ln -s /mnt/optware/opt/share .
 ln -s /mnt/optware/opt/tmp .
 ln -s /mnt/optware/opt/lib .
 mntroot ro
 

5. Retreive ipkg and extract it

 cd /opt/etc
 feed=http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
 wget $feed/ipkg-opt_0.99.163-10_arm.ipk
 tar -xOvzf ipkg-opt_0.99.163-10_arm.ipk ./data.tar.gz | tar -C / -xzvf -
 mkdir -p /opt/etc/ipkg
 echo "src cross $feed" > /opt/etc/ipkg/feeds.conf

6. Change the "dest root /" line to "dest root /mnt/optware" in /opt/etc/ipkg.conf using a text editor such as vi.

7. Fix for wget: unrecognized option `--passive-ftp' error

Check the forum post with the attached file and instructions.

Use the following command to copy it over once the drive is unmounted.

 cp /mnt/us/libipkg.so.0.0.0 /opt/lib

8. Usage (with nano as example)

 export PATH=$PATH:/mnt/optware/opt/bin
 ipkg -t /opt/tmp update
 ipkg -t /opt/tmp install nano

[edit] ADDITIONAL TWEAKS

THE BELOW SHOULD NOT BE ATTEMPTED UNLESS YOU ARE PROFICIENT WITH LINUX, BRICKING IS LIKELY OTHERWISE

To be able to run ipkg and any downloaded packages without needing to put in the full path on subsequent reboots, do the following

 mntroot rw
 vi /etc/profile
 Add
   :/opt/bin
 to
   export PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin

Save and quit out of vi then remount filesystem as read-only

 mntroot ro

To automount the image file on subsequent reboots, add the following line to the fstab

 /mnt/us/optware.ext3 /mnt/optware ext3 rw,exec,loop,noatime,nodiratime,noauto 0 0

Create the file /etc/upstart/optmount.conf with the following contents:

 # /mnt/us/optware.ext3 is the optware filesystem image
   
 start on mounted_userstore
 stop on stopping filesystems
 export LANG LC_ALL
 
 pre-start script
 mount /mnt/optware
 end script
  
 post-stop script
 umount /mnt/optware
 end script
Personal tools
Namespaces

Variants
Actions
Navigation
MobileRead Networks
Toolbox