Changeset 374


Ignore:
Timestamp:
Mar 16, 2007 2:50:37 AM (6 years ago)
Author:
jrollins
Message:

debif: a couple of tweaks to clean up output.
modified serial-terminal console to not fail on discovering serial-terminal
already in inittab.
tweaked man page.

Location:
trunk/debirf/fs/usr
Files:
5 edited

Legend:

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

    r373 r374  
    3939usage() { 
    4040cat <<EOF 
    41 Usage: $CMD kernel-image 
     41Usage: $CMD kernel-image.deb 
    4242 
    43 Creat a debirf initramfs. 
     43Create a debirf initramfs. 
    4444 
    4545Default config file: /etc/debirf/debirf.conf 
     
    6767## their first argument. 
    6868  
    69 ### stupid simple method 
     69# stupid simple method 
    7070create_initrd_stupid_simple() { 
    7171    #ln sbin/init to /init 
     
    7373     
    7474    # create root image 
    75     debirf_msg "creating debirf initrd..." 
     75    msg "creating debirf initrd..." 
    7676    ( cd "$DEBIRF_ROOT" && find * | cpio -H newc --create  | gzip ) > "$1" 
    7777} 
    7878 
    79 ### tweak initrd method: untested, probably doesn't work right yet.  soon! 
     79# tweak initrd method: untested, probably doesn't work right yet.  soon! 
    8080create_initrd_tweak_initrd() { 
    8181    cat "$DEBIRF_ROOT"/scripts/debirf <<EOF 
     
    9696EOF 
    9797    # create root image 
    98     debirf_msg "creating debirf initrd..." 
     98    msg "creating debirf initrd..." 
    9999    cp initrd.img* "$1" 
    100100    (cd "$DEBIRF_ROOT" && find * | cpio -H newc --create  | gzip ) >> "$1" 
     
    107107 
    108108# check specified kernel package exists, and determine kernel name 
    109 DEBIRF_KERNEL_PACKAGE="$1" 
     109export DEBIRF_KERNEL_PACKAGE="$1" 
    110110if [ ! -f "$DEBIRF_KERNEL_PACKAGE" ] ; then 
    111111    echo "Specified kernel package $DEBIRF_KERNEL_PACKAGE not found." 
     
    116116 
    117117# check for common functions 
    118 [ -f "$DEBIRF_COMMON" ] || debirf_fail "debirf function file $DEBIRF_COMMON not found." 
     118[ -f "$DEBIRF_COMMON" ] || failure "debirf function file $DEBIRF_COMMON not found." 
    119119source "$DEBIRF_COMMON" 
    120120 
     
    123123    read -p "Plugin directory $DEBIRF_PLUGINS not found.  Continue? [y|N]: " -n 1 OK ; [ -z $OK ] || echo 
    124124    if [ "${OK/y/Y}" != 'Y' ] ; then 
    125         debirf_fail "aborting." 
     125        failure "aborting." 
    126126    fi 
    127127fi 
     
    131131    read -p "Directory $DEBIRF_ROOT already exists.  write over? [y|N]: " -n 1 OK ; [ -z $OK ] || echo 
    132132    if [ "${OK/y/Y}" = 'Y' ] ; then 
    133         debirf_msg "installing new root..." 
     133        msg "installing new root..." 
    134134        create_debootstrap 
    135135    fi 
    136136else 
    137     debirf_msg "installing root..." 
     137    msg "installing root..." 
    138138    create_debootstrap 
    139139fi 
     
    149149 
    150150# install plugins 
    151 debirf_msg "installing plugins..." 
     151msg "installing plugins..." 
    152152run_plugins 
    153153 
     
    169169# final output 
    170170DEBIRF_KERNEL="vmlinu"*"$KERNAVAIL" 
    171 debirf_msg "debirf initrd created." 
     171msg "debirf initrd created." 
    172172if [ "$DEBIRF_INITRD/$DEBIRF_KERNEL" ] ; then 
    173     debirf_msg "kernel: $DEBIRF_PATH/"$DEBIRF_KERNEL 
     173    msg "kernel: $DEBIRF_PATH/"$DEBIRF_KERNEL 
    174174fi 
    175 debirf_msg "initrd: $DEBIRF_PATH/$DEBIRF_INITRD" 
     175msg "initrd: $DEBIRF_PATH/$DEBIRF_INITRD" 
  • trunk/debirf/fs/usr/share/debirf/common

    r372 r374  
    66 
    77# output debirf message to stdout 
    8 debirf_msg() { 
    9     echo " debirf: $@" 
     8msg() { 
     9    echo "debirf: $@" 
    1010} 
    11 export -f debirf_msg 
     11export -f msg 
    1212 
    1313# cause debirf to exit immediately with message and exit code 
    1414# failure message <exit-code> 
    15 debirf_fail() { 
     15failure() { 
    1616    echo "$1" >&2 
    1717    exit ${2:-'1'} 
    1818} 
    19 export -f debirf_fail 
     19export -f failure 
    2020 
    2121# output info to the debirf.info file on the initramfs 
  • trunk/debirf/fs/usr/share/debirf/plugins/install-kernel

    r370 r374  
    3333 
    3434##### install kernel 
    35 msg "installing kernel..." 
    3635install_kernel "$DEBIRF_KERNEL_PACKAGE" 
  • trunk/debirf/fs/usr/share/debirf/plugins/serial-terminal

    r370 r374  
    88if grep "$TTY" "$INITTAB" | grep -q -v "^[:space:]*#" ; then 
    99    echo "inittab already has terminal on $TTY." 
    10     exit 1 
    11 fi 
    12  
    13 cat >> "$DEBIRF_ROOT"/etc/inittab <<EOF 
     10else 
     11    cat >> "$DEBIRF_ROOT"/etc/inittab <<EOF 
    1412# debirf: added serial console output: 
    1513T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 
    1614EOF 
     15fi 
  • trunk/debirf/fs/usr/share/man/man8/make-debirf.8

    r370 r374  
    5252). 
    5353.TP 
    54 .B debirf_msg <message> 
     54.B msg <message> 
    5555Output a message to standard out during the build process. 
    5656.TP 
    57 .B debirf_failure <message> <exit-code> 
     57.B failure <message> <exit-code> 
    5858Cause make-debirf script to fail with <exit-code>, and <message> to stderr. 
    5959.RE 
Note: See TracChangeset for help on using the changeset viewer.