Advanced Programming on the 3290

This is a work in progress and currently just some notes.  So far, this is just some ideas; they aren't tested yet.  USE AT YOUR OWN RISK.

Customizing the File System

If you want to add your own features to the file system, you have to start by making that part of the file system writable and those changes persistent.

  • You can change the root file system to be mounted read/write.
    • This requires connecting the serial cable (add REF to serial cable instructions) and modifying the boot parameters.  Add 'rw' to the definition of bootargs in the boot command definition.
    • This doesn't solve the problem of persistence.
  • You can add an init script that copies the root FS contents of the directory you want to modify to /cf_card and then mount that directory over the root FS one.
    • If you do this automatically in the script, you need to detect if the directory already exists in /cf_card and not overwrite it.
    • Alternatively, copy the root FS content over once, by hand, and then just mount the result in the init script.
    • If the root FS changes, you'll need to integrate your changes with any updates that come in the new root FS.

Here's an example.  Suppose you want to keep passwd and shadow files customized for your deployment.  These live in /etc.  So the steps would be:

  • Bring up the system and log into the shell
  • Decide where you want your changes to live.  I suggest a new directory, /cf_card/overlay
  • mkdir -p /cf_card/overlay
  • cp -a /etc /cf_card/overlay
  • Create or modify the script /cf_card/local/indigo-preinit.sh (this is in $client_root.  This gets executed on boot up early in the initialization process.
    • Add the line: "mount /cf_card/overlay/etc /etc"
    • On boot, this should mount the CF card version of etc over /etc.  You can then make changes in /etc (which you couldn't before if the file system was mounted read-only) and those change will be preserved across reboots.