Ignore:
Timestamp:
May 8, 2007 11:25:32 PM (6 years ago)
Author:
jrollins
Message:

debirf: a bit of cleanup of default profile setup.

added debian/dh_link file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debirf/fs/usr/sbin/make-debirf

    r475 r476  
    3939    # exclude aptitude 
    4040    mkdir -p "$DEBIRF_ROOT" 
    41     /usr/sbin/debootstrap --exclude=aptitude --include=initramfs-tools "$DEBIRF_DISTRO" "$DEBIRF_ROOT" "$DEBIRF_MIRROR" 
     41    /usr/sbin/debootstrap --exclude=aptitude "$DEBIRF_DISTRO" "$DEBIRF_ROOT" "$DEBIRF_MIRROR" 
    4242} 
    4343 
     
    121121    1) 
    122122        DEBIRF_KERNEL_PACKAGE="$1" 
     123        echo "Profile not specified.  Using default profile ('$DEBIRF_PROFILE_DEFAULT')..." 
     124        DEBIRF_PROFILE="$DEBIRF_PROFILE_DEFAULT" 
    123125        ;; 
    124126    2) 
     
    139141 
    140142# check for debirf profile 
    141 if [ -z "$DEBIRF_PROFILE" ] ; then 
    142     echo "Profile not specified." 
    143     read -p "Use default profile ('$DEBIRF_PROFILE_DEFAULT')? [Y|n]: " OK 
    144     if [ -z "$OK" -o "${OK/y/Y}" = 'Y' ] ; then 
    145         DEBIRF_PROFILE="$DEBIRF_PROFILE_DEFAULT" 
    146     fi 
    147 fi 
    148 if [ "$DEBIRF_PROFILE" ] ; then 
    149     if [ ! -d "$DEBIRF_PROFILE" ] ; then 
    150         if [ ! -d "$DEBIRF_PROFILED/$DEBIRF_PROFILE" ] ; then 
    151             failure "Profile '$DEBIRF_PROFILE' not found." 
    152         else 
    153             DEBIRF_PROFILE="$DEBIRF_PROFILED/$DEBIRF_PROFILE" 
    154         fi 
    155     fi 
    156     echo "Using profile '$DEBIRF_PROFILE'." 
    157     DEBIRF_CONF="$DEBIRF_PROFILE/debirf.conf" 
    158     DEBIRF_PLUGINS="$DEBIRF_PROFILE/plugins.d" 
    159 fi 
     143if [ ! -d "$DEBIRF_PROFILE" ] ; then 
     144    if [ ! -d "$DEBIRF_PROFILED/$DEBIRF_PROFILE" ] ; then 
     145        failure "Profile '$DEBIRF_PROFILE' not found." 
     146    else 
     147        DEBIRF_PROFILE="$DEBIRF_PROFILED/$DEBIRF_PROFILE" 
     148    fi 
     149    fi 
     150fi 
     151 
     152DEBIRF_CONF=${DEBIRF_CONF:-"$DEBIRF_PROFILE/debirf.conf"} 
     153DEBIRF_PLUGINS=${DEBIRF_PLUGINS:-"$DEBIRF_PROFILE/plugins" 
    160154 
    161155# find debirf.conf 
    162 if [ "$DEBIRF_CONF" ] ; then 
    163     if [ -f "$DEBIRF_CONF" ] ; then 
    164         source "$DEBIRF_CONF" 
    165     else 
    166         failure "Config file '$DEBIRF_CONF' not found." 
    167     fi 
    168 fi 
    169  
    170 # find plugin directory 
    171 if [ "$DEBIRF_PLUGINS" ] ; then 
    172     if [ ! -d "$DEBIRF_PLUGINS" ] ; then 
    173         failure "Plugin directory '$DEBIRF_PLUGINS' not found." 
    174     fi 
    175 else 
    176     echo "Plugin directory file not specified." 
    177     read -p "Continue without plugins? [y|N]: " OK 
    178     if [ "${OK/y/Y}" != 'Y' ] ; then 
    179         failure "aborting." 
    180     fi 
    181 fi 
    182  
    183 # echo 
    184 # for var in ${!DEBIRF_*}; do 
    185 #     export $var 
    186 # done 
    187 # env | /bin/grep "^DEBIRF_" 
    188 # exit 
    189  
     156[ -f "$DEBIRF_CONF" ] && source "$DEBIRF_CONF" 
     157 
     158# check plugins 
     159if [ ! -d foo -o $(ls foo -1 | wc -l) = 0 ] ; then 
     160    echo "Plugin directory '$DEBIRF_PLUGINS' is empty or does not exist." 
     161    read -p "Continue? [Y|n]: " OK 
     162    if [ "$OK" -a "${OK/y/Y}" != 'Y' ] ; then 
     163        failure "Aborting." 
     164    fi 
     165fi 
     166     
    190167# create debootstrap root 
    191168if [ -d "$DEBIRF_ROOT" ] ; then 
Note: See TracChangeset for help on using the changeset viewer.