Skip to content
Narrow screen resolution Wide screen resolution Auto adjust screen size Increase font size Decrease font size Default font size

gumstix developer site

Home arrow Documentation arrow User arrow Installing packages to CF memory cards
Installing packages to CF memory cards
Print 
The procedure for installing packages to CF memory cards is very similar to that for MMC/SD/microSD

 

Installing packages to memory cards is only slightly more complex that doing normal ipkg installs.

Initial one time setup for the memory card

Note: recent builds include support for the ext2 file system. If you have an older build, or if you disabled ext2 support you can install it by typing "ipkg install task-base-gumstix-ext2"

The first step in this process is to format your memory card with the ext2 file sysytem. You can do this with the mkfs.ext2 command:

$ mkfs.ext2 /dev/hda1 
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
31360 inodes, 125040 blocks
6252 blocks (5.00%) reserved for the super user
First data block=1
16 block groups
8192 blocks per group, 8192 fragments per group
1960 inodes per group
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done                        
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Now that the card is properly formatted, we can mount it:

$ mount -a

CF memory cards are mounted at /media/cf. We can now check to verify the free space on our card:

$ df /media/cf
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hda1               121075        13    114810   0% /media/cf

That's it for the memory card setup.

Setting up an installation destination shortcut

The next step is to define a destination label for our memory card. This is also a "one time" step -- it doesn't need to be repeated for each installation. Edit /etc/ipkg.conf and add the following line to the end of the file:

dest cf /media/cf                                                             

We'll be using this destination label a bit later when we install our package.

Installing a package to the memory card

As always, we'll start this process by downloading the latest list of available packages from the repository:

$ ipkg update
Downloading http://www.gumstix.net/feeds/current/glibc/ipk/armv5te/Packages.gz
Inflating http://www.gumstix.net/feeds/current/glibc/ipk/armv5te/Packages.gz
Updated list of available packages in /var/lib/ipkg/base
Downloading http://www.gumstix.net/feeds/current/glibc/ipk/gumstix-custom-verdex/Packages.gz
Inflating http://www.gumstix.net/feeds/current/glibc/ipk/gumstix-custom-verdex/Packages.gz
Updated list of available packages in /var/lib/ipkg/gumstix-custom-verdex
Downloading http://www.gumstix.net/feeds/current/glibc/ipk/all/Packages.gz
Inflating http://www.gumstix.net/feeds/current/glibc/ipk/all/Packages.gz
Updated list of available packages in /var/lib/ipkg/no-arch

For this example let's install the perl package to our microSD card:

$ ipkg -d cf install perl
Installing perl (5.8.8-r25) to sd...
Downloading http://www.gumstix.net/feeds/current/glibc/ipk/armv5te/perl_5.8.8-r25_armv5te.ipk
Installing libperl5 (5.8.8-r25) to sd...
Downloading http://www.gumstix.net/feeds/current/glibc/ipk/armv5te/libperl5_5.8.8-r25_armv5te.ipk
Configuring libperl5
Configuring perl

This command differs from the normal ipkg install in that we have specified the destination cf via the -d option.

(You may see an error about a failure to rename status.tmp. You can safely ignore this)

We have one final step to complete our installation, linking the newly installed packages to the root file system using the ipkg-link command:

$ ipkg-link mount /media/cf
*** Command: mount
*** Command: add
*** Locating package
*** Found package on /media/cf
*** Adding libperl5
Linking /usr/lib/perl/5.8 to /media/card/usr/lib/perl/5.8
Linking /usr/lib/perl/5.8 to /media/card/usr/share/perl/5.8
*** Done.

*** Command: add
*** Locating package
*** Found package on /media/cf
*** Adding perl
*** Done.

*** Done.

Packages often force the installation of dependency packages (in this case libperl5). To keep from having to link each package individually, we used the form of the command that links all installed packages on the memory card. We could have linked the packages individually by using "ipkg-link add perl" and "ipkg-link add libperl5".

You may see a warning or two during the installation process depending upon the package you are installing. These are normally not a cause for concern.

That's all there is to it! We can give our installation a quick test by invoking perl with the --help option:

$ perl --help

Usage: perl [switches] [--] [programfile] [arguments]
  -0[octal]       specify record separator (\0, if no argument)
  -a              autosplit mode with -n or -p (splits $_ into @F)
  -C[number/list] enables the listed Unicode features
  -c              check syntax only (runs BEGIN and CHECK blocks)
  -d[:debugger]   run program under debugger
  -D[number/list] set debugging flags (argument is a bit mask or alphabets)
  -e program      one line of program (several -e's allowed, omit programfile)
  -f              don't do $sitelib/sitecustomize.pl at startup
  -F/pattern/     split() pattern for -a switch (//'s are optional)
  -i[extension]   edit <> files in place (makes backup if extension supplied)
  -Idirectory     specify @INC/#include directory (several -I's allowed)
  -l[octal]       enable line ending processing, specifies line terminator
  -[mM][-]module  execute "use/no module..." before executing program
  -n              assume "while (<>) { ... }" loop around program
  -p              assume loop like -n but print line also, like sed
  -P              run program through C preprocessor before compilation
  -s              enable rudimentary parsing for switches after programfile
  -S              look for programfile using PATH environment variable
  -t              enable tainting warnings
  -T              enable tainting checks
  -u              dump core after parsing program
  -U              allow unsafe operations
  -v              print version, subversion (includes VERY IMPORTANT perl info)
  -V[:variable]   print configuration summary (or a single Config.pm variable)
  -w              enable many useful warnings (RECOMMENDED)
  -W              enable all warnings
  -x[directory]   strip off text before #!perl line and perhaps cd to directory
  -X              disable all warnings

Uninstalling a package from your memory card

If you decide to uninstall a package, the process is quite simple. First we'll unlink the package from the root file system:

$ ipkg-link remove perl
*** Command: remove
*** Locating package
*** Found package on /media/cf
*** Removing perl
*** Done.
$ ipkg-link remove libperl5
*** Command: remove
*** Locating package
*** Found package on /media/cf
*** Removing libperl5
*** Done.

In this case we didn't use a shorcut to unlink all packages installed on the memory card since there may be some previously installed packages that we would like to keep.

The final step is to remove the packages themselves:

root@gumstix-custom-verdex:~$ ipkg remove perl libperl5
Removing package perl from cf...
Removing package libperl5 from cf...

Command summaries

For your convenience, here's a brief overview of the options for each ipkg command.

ipkg command
usage: ipkg [options...] sub-command [arguments...]
where sub-command is one of:

Package Manipulation:
        update                  Update list of available packages
        upgrade                 Upgrade all installed packages to latest version
        install            Download and install  (and dependencies)
install Install package
configure [] Configure unpacked packages
remove
ipkg-link command
ipkg-link add    packagename (links "packagename" to root filesystem)
    ipkg-link remove packagename (unlinks "packagename" from root filesystem)
    ipkg-link list   mountpoint  (lists packages on "mountpoint", e.g. '/mnt/card')
    ipkg-link mount  mountpoint  (links all packages on "mountpoint", e.g. '/mnt/card')
    bin/ipkg-link umount mountpoint  (unlinks all packages on "mountpoint", e.g. '/mnt/card')

 

Tags