./chroot and converts it to a ISO image.First of all, create a folder as the root for the building, e.g. live-root. Then execute all commands under this folder.
The configuration files for building the target is stored in the config folder. To create this folder and populate with required config files, simply run:
lh config
The config structure created:
vps2:~/live-root# tree -p
.
|-- [drwxr-xr-x] auto
| `-- [drwxr-xr-x] functions
`-- [drwxr-xr-x] config
|-- [-rw-r--r--] binary
|-- [drwxr-xr-x] binary_debian-installer
|-- [drwxr-xr-x] binary_debian-installer-includes
|-- [drwxr-xr-x] binary_grub
|-- [drwxr-xr-x] binary_local-debs
|-- [drwxr-xr-x] binary_local-hooks
|-- [drwxr-xr-x] binary_local-includes
|-- [drwxr-xr-x] binary_local-packageslists
|-- [drwxr-xr-x] binary_local-udebs
|-- [drwxr-xr-x] binary_rootfs
|-- [drwxr-xr-x] binary_syslinux
|-- [-rw-r--r--] bootstrap
|-- [-rw-r--r--] chroot
|-- [drwxr-xr-x] chroot_apt
|-- [drwxr-xr-x] chroot_local-hooks
|-- [drwxr-xr-x] chroot_local-includes
|-- [drwxr-xr-x] chroot_local-packages
|-- [drwxr-xr-x] chroot_local-packageslists
|-- [drwxr-xr-x] chroot_local-patches
|-- [drwxr-xr-x] chroot_local-preseed
|-- [drwxr-xr-x] chroot_sources
|-- [-rw-r--r--] common
|-- [drwxr-xr-x] includes
|-- [-rw-r--r--] source
`-- [drwxr-xr-x] templates
Edit file config/bootstrap to config which mirrors to use, example:
LH_MIRROR_BOOTSTRAP="http://ftp.hk.debian.org/debian/" LH_MIRROR_CHROOT="http://ftp.hk.debian.org/debian/"
This is controlled by the LH_PACKAGES_LISTS variable in the file chroot:
LH_PACKAGES_LISTS="standard"
What the “standard” list contains is defined in /usr/share/live-helper/lists/standard.
All predefined list is in this folder.
Create .list files (example: utils.list) inside folder config/chroot_local-packageslists.
# file utils.list # install these network tools: ntop iftop iptraf
Put additional files under folder config/chroot_local-includes/.
For example, you want to add /var/www/index.html to the target, then place
it as:
config/chroot_local-includes/var/www/index.html
You can place scripts/programs in config/chroot_local-hooks/.
For example, place a script here to remove some unwanted package, generate keys, do some special task…etc
This stage uses the config file bootstrap.
Run bootstrap stage:
lh bootstrap
After that, a root filesystem is created in chroot.