Changeset 343


Ignore:
Timestamp:
Mar 14, 2007 12:39:34 PM (6 years ago)
Author:
jrollins
Message:

debirf: made some changes in how variables are passed and how the config
directory works. the default variables are not stored in the make-debirf script
itself. i also made the script fail if a kernel image is not specified on the
command line. added usage.

Location:
trunk/debirf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/debirf/etc/debirf/debirf.conf

    r328 r343  
    33 
    44# label for debirf system (for hostname and initrd) 
    5 DEBIRF_LABEL=${DEBIRF_LABEL:-debirf} 
     5#DEBIRF_LABEL="debirf 
    66 
    77# where to build the debirf 
    8 DEBIRF_PATH=${DEBIRF_PATH:-"/var/lib/debirf"} 
     8#DEBIRF_PATH="/var/lib/debirf" 
    99 
    1010# the debirf root, used by plugins 
    11 DEBIRF_ROOT=${DEBIRF_ROOT:-"$DEBIRF_PATH/root"} 
     11#DEBIRF_ROOT="$DEBIRF_PATH/root" 
    1212 
    1313# the plugins directory 
    14 DEBIRF_PLUGINS=${DEBIRF_PLUGINS:-"/usr/share/debirf/plugins"} 
     14#DEBIRF_PLUGINS="/usr/share/debirf/plugins" 
    1515 
    1616# debirf boot method 
    17 DEBIRF_METHOD=${DEBIRF_METHOD:-stupid_simple} 
     17#DEBIRF_METHOD="stupid_simple" 
    1818 
    1919# Debian mirror 
    20 # DEBIRF_MIRROR="http://ftp.debian.org/debian" 
    21 DEBIRF_MIRROR=${DEBIRF_MIRROR:-"http://mirrors.kernel.org/debian"} 
     20#DEBIRF_MIRROR="http://mirrors.kernel.org/debian" 
    2221 
    2322# what distribution should debirf be built from? 
    24 DEBIRF_DISTRO=${DEBIRF_DISTRO:-etch} 
     23#DEBIRF_DISTRO="etch" 
  • trunk/debirf/usr/sbin/make-debirf

    r328 r343  
    33# DEBIRF creation script.  You must pass a kernel .deb as the first argument. 
    44 
     5############################################################### 
     6### VARIABLES 
     7 
    58CMD=$(basename $0) 
    6 CMD_PATH=$(dirname $0) 
    79 
    810DEBIRF_CONF=${DEBIRF_CONF:-"/etc/debirf/debirf.conf"} 
     11[ -f "$DEBIRF_CONF" ] && source "$DEBIRF_CONF" 
     12 
     13### defaults 
     14# debirf label 
     15DEBIRF_LABEL=${DEBIRF_LABEL:-"debirf"} 
     16# where to build the debirf 
     17DEBIRF_PATH=${DEBIRF_PATH:-"/var/lib/debirf"} 
     18# the debirf root, used by plugins 
     19DEBIRF_ROOT=${DEBIRF_ROOT:-"$DEBIRF_PATH/root"} 
     20# the plugins directory 
     21DEBIRF_PLUGINS=${DEBIRF_PLUGINS:-"/usr/share/debirf/plugins"} 
     22# debirf boot method 
     23DEBIRF_METHOD=${DEBIRF_METHOD:-"stupid_simple"} 
     24# Debian mirror 
     25DEBIRF_MIRROR=${DEBIRF_MIRROR:-"http://mirrors.kernel.org/debian"} 
     26# what distribution should debirf be built from? 
     27DEBIRF_DISTRO=${DEBIRF_DISTRO:-"etch"} 
    928 
    1029# set locale default 
     
    1635### FUNCTIONS 
    1736 
    18 failure(){ 
     37usage() { 
     38cat <<EOF 
     39Usage: $CMD kernel-image 
     40 
     41Creat a debirf initramfs. 
     42 
     43Default config file: /etc/debirf/debirf.conf 
     44All config variables are bash shell variables. 
     45Specify alternate config file with "DEBIRF_CONF=". 
     46EOF 
     47} 
     48 
     49failure() { 
    1950    echo "$1" >&2 
    2051    exit ${2:-'1'} 
     
    110141### MAIN 
    111142 
    112 # some checks 
    113 [ -f "$DEBIRF_CONF" ] || failure "$DEBIRF_CONF config file not found." 
    114 source "$DEBIRF_CONF" 
    115  
    116143# check specified kernel package exists, and determine kernel name 
    117 if [ "$1" ]; then 
    118     DEBIRF_KERNEL_PACKAGE="$1" 
    119     [ -f "$DEBIRF_KERNEL_PACKAGE" ] || failure "Specified kernel package $DEBIRF_KERNEL_PACKAGE not found." 
     144DEBIRF_KERNEL_PACKAGE="$1" 
     145if [ ! -f "$DEBIRF_KERNEL_PACKAGE" ] ; then 
     146    echo "Specified kernel package $DEBIRF_KERNEL_PACKAGE not found." 
     147    echo 
     148    usage 
     149    exit 1 
    120150fi 
    121151 
     
    174204 
    175205# final output 
    176 KERNEL="$DEBIRF_PATH/vmlinu"* 
     206KERNEL="$DEBIRF_PATH/vmlinu"*"$KERNAVAIL" 
    177207if [ "$KERNEL" ] ; then 
    178208    msg "kernel: $KERNEL" 
Note: See TracChangeset for help on using the changeset viewer.