Linux: Debian: Minimal ARM filesystem

From Wiki

Jump to: navigation, search

Contents

Overview

Debian Linux for ARM processors provides thousands of software packages. CompuLab provides minimal Debian filesystem that can be used as a basis for custom filesystem creation. The minimal filesystem packages include archive of basic Debian system created with debootsrap.

Suites

The basic Debian system is available for the following Debian suites:

Custom filesystem development

The basic Debian system allows development of custom filesystem images either on-target in NFS-rooted environment or on-host using QEMU ARM emulation.

NFS-rooted environment

  • Extract the basic Debian filesystem to a directory on the host workstation and export that directory through NFS:
mkdir -p /path/to/armel/debian/sid
cd /path/to/armel/debian/sid
sudo tar xjvf /path/to/sid-minimal-armel.tar.bz2
sudo sh -c 'echo "/path/to/armel/debian/sid 192.168.0.0/24(rw,no_root_squash,sync)" >> /etc/exports'
sudo exportfs -a
  • Ensure that kernel command line contains parameters required to boot the target system with root on NFS, for example
setenv bootargs "root=/dev/nfs nfsroot=<hostip>:/path/to/armel/debian/sid ip=dhcp console=ttyS2,38400"
  • Boot the target.
  • Login as root, password 111111
  • Use apt-get package handling utility to install required packages

QEMU environment

mkdir -p /path/to/armel/debian/sid
cd /path/to/armel/debian/sid
sudo tar xjvf /path/to/sid-minimal-armel.tar.bz2
  • Copy static QEMU into the basic Debian system:
cp /path/to/static/qemu-arm* /path/to/armel/debian/sid/usr/local/bin
  • Enter the ARM Debian environment:
 sudo chroot /path/to/armel/debian/sid /bin/sh
  • Use apt-get package handling utility to install required packages

Deployment

Reducing target filesystem size

Image:admolition_warning.png The following commands must be executed on target or in chroot'ed environment. Execution of the below commands on the host system may severely damage it!
  • Remove packages that were automatically installed to satisfy dependencies for some package and that are no more needed
apt-get --purge autoremove
  • Remove packages that are not needed on the target system, for example:
apt-get purge man
  • Clean local repository of retrieved package files
apt-get clean
  • If the target is not intended to run package management tools remove Debian package databases:
find  /var/lib/dpkg/ /var/lib/apt -type f -exec rm {} \;
  • Remove unneeded data in /usr/share, for instance
rm -fr /usr/share/doc/ /usr/share/info/

Creating NAND flash image

After the filesystem modifications are complete follow the Creating NAND flash images guide to create an image ready for deployment onto the system NAND flash.

See also

Personal tools