Skip to content

IBM/ibmichroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

IBM i Chroot (version 2)

Chroot (Change Root) is a PASE command used to change the relative root of a IBM i shell job.

The purpose of this project is to automate and simplifiy chroot environment creation.

To learn more about chroots in PASE view these resources

Install

This project is available via RPM

yum install ibmichroot

For more information about yum read the docs

Usage

Before running chroot_setup ensure you have proper permissions first!

  • Minimum of *IOSYSCFG to create device nodes

  • *ALLOBJ needed to run yum.

Usage: chroot_setup [OPTIONS] CHROOT DIRECTORY [CHROOT TYPE]

[Options] - optional additonal arguments listed below

-v: More verbose output.
-y: Auto respond yes to the prompts.
-g: Dynamic global variables.  
-i: yum install into chroot.
CHROOT DIRECTORY - is the Directory where the chroot will be created.

This parameter is required and chroot directory path must begin with /QOpenSys/
[CHROOT TYPE] - is specified by the .lst config files located within /chroot
within this project.

This parameter is optional, when undefined a chroot with minimal with includes
will be created.

Full file names are not required when specifying the [CHROOT TYPE]

- chroot_minimal.lst OR minimal will work

Example

Creating a minimal chroot:

chroot_setup /QOpenSys/root_path

Config files

The .lst files that start with chroot... are meant for creating chroot environments based on specific needs.

For example, you can create a bare minimum chroot environment with chroot_minimal.lst.

Or you could add multiple *.lst files together to create an environment with many features.

Visit config to see an exhaustive list of chroot_xxxx.lst files.

Install Software into Chroot

After Creating a chroot with minimal and includes configuration you can useyum to install into your chroot.

It's recommended to install bash within your chroot as well. You can do so with:

yum --installroot=/QOpenSys/root_path install bash

Packages such as Node.js can be installed by invoking:

yum --installroot=/QOpenSys/root_path install nodejs8

As a convinence you can use -i option:

chroot_setup -i bash /QOpenSys/root_path

Note

If you plan to access DB2 from python, node.js, etc from within the chroot

iconv conversion tables provided from nls.lst is required.

chroot_setup /QOpenSys/root_path nls

Remove Chroot

Remove a chroot just like you would remove any other directory by running:

rm -r path_to_chroot

🚨 WARNING: Ensure the path to the chroot is correct before running rm. 🚨

Advanced

You can pass in any named variable to chroot_setup.sh so you can have replacement values in xxxxx.lst files.

For example:

In your custom .lst file you could have this:

:system
CHGAUT OBJ('mydir') USER(myuser) DTAAUT(*RWX) OBJAUT(*ALL) SUBTREE(*ALL)
chroot_setup -g myuser=AARON -g mydir=/QOpenSys/root_path /QOpenSys/root_path /path/to/yourCustom.lst

Any instance of myuser would be interpreted as AARON when the script is run. Same for mydir and /QOpenSys/root_path.

Chroot Manager

TODO: Document chroot_mgr.py

Resources

About

A set of scripts to facilitate the use of chroot-based containers for IBM i

Resources

License

Stars

Watchers

Forks

Packages

No packages published