Install Packages on a USB-Stick
- make sure you have full working USB support (detailed: usb.essentials + usb.storage, short: install these packages on the device
kmod-usb-storage,block-mount,block-hotplug,kmod-fs-ext2) - prepare an USB stick by formating it with an ext2 filesystem. It must not be FAT as it is very basic and does not support symbolic links etc. - installation would fail. You won't be able to do this from the router itself because installing the filesystem tools packages takes too much space, so either:
- do it from Windows with various tools, for example: EASEUS Partition Master 9
- do it from some other Linux with:
mke2fs /dev/<usb device>
- plug this USB stick in the router and mount it:
mount -t ext2 /dev/<usb device> /mnt/usb/
Notes:<usb device> usually it'ssda1,/mnt/usb/must be first created withmkdir, or you can use /mnt directly - from now on i'll assume /mnt/usb/ was used - prepare opkg for external installs (detailed: opkg)
- edit /etc/opkg.conf and add an extra line that maps the destination "usb" to the path where you mounted the stick
dest usb /mnt/usb/
- prepare the extra paths for executables and libraries, enter
export USB=/mnt/usb export PATH=$PATH:$USB/usr/bin:$USB/usr/sbin export LD_LIBRARY_PATH=$USB/lib:$USB/usr/lib
- install whatever you want on the external storage with:
opkg install <package> -d usb
Note:so "-d usb" is the key, make sure you don't forget it otherwise packages will be installed in the router storage itself and will quickly fill it up leading to corruption!
General Notes:
- you will want to automate steps 3 and 5 somehow otherwise on the next reboot it won't work and you'll have to run them again
- for #3, see start.on.boot
- for #5 edit /etc/profile and add the variables there
- some programs need additional config files to run, you will have to create links between the root filesystem and the usb one, e.g. to successfully run Midnight Commander after installing it on a USB stick, you must run:
ln -s $USB/usr/share/terminfo/ /usb/share/ ln -s $USB/etc/mc /etc/mc
doc/recipes/install.packages.on.usb-stick.txt · Last modified: 2013/04/25 21:01 by xiloynaha
