#!/bin/bash # Copyright (C) Martin Schlemmer # Copyright (C) 2006 Sam Ravnborg # # Released under the terms of the GNU GPL # # Generate a cpio packed initramfs. It uses gen_init_cpio to generate # the cpio archive, and gzip to pack it. # The script may also be used to generate the inputfile used for gen_init_cpio # This script assumes that gen_init_cpio is located in usr/ directory # error out on errors set -e usage() { cat << EOF Usage: $0 [-o ] [-u ] [-g ] {-d | } ... -o Create gzipped initramfs file named using gen_init_cpio and gzip -u User ID to map to user ID 0 (root). is only meaningful if is a directory. -g Group ID to map to group ID 0 (root). is only meaningful if is a directory. File list or directory for cpio archive. If is a .cpio file it will be used as direct input to initramfs. -d Output the default cpio list. All options except -o and -l may be repeated and are interpreted sequentially and immediately. -u and -g states are preserved across options so an explicit "-u 0 -g 0" is required to reset the root/group mapping. EOF }