Changeset 1186


Ignore:
Timestamp:
Dec 20, 2008, 3:27:48 PM (9 years ago)
Author:
jrollins
Message:

debirf: apply some nice patches from Gary Kramlich to allow for
specifying the arch (with DEBIRF_ARCH), and cleanly determining the
initramfs name in makeiso.

Location:
trunk/debirf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/debirf/debian/changelog

    r1184 r1186  
     1debirf (0.22-1~pre) UNRELEASED; urgency=low
     2
     3  * add DEBIRF_ARCH variable to allow for specifying different
     4    architecture than default (thanks to Gary Kramlich for patch).
     5  * fix initramfs determination in makeiso (thanks again Gary Kramlich).
     6
     7 -- Jameson Graef Rollins <jrollins@finestructure.net>  Sat, 20 Dec 2008 15:21:34 -0500
     8
    19debirf (0.21-1) unstable; urgency=low
    210
  • trunk/debirf/man/man1/debirf.1

    r1183 r1186  
    133133where to build the debirf (default: ./)
    134134.TP
     135.B DEBIRF_ARCH
     136architecture to build (default is the architecture of the build
     137machine)
     138.TP
    135139.B DEBIRF_SUITE
    136140suite to build from (default "hardy" on Ubuntu, "lenny" otherwise)
  • trunk/debirf/src/debirf

    r1182 r1186  
    8989    if [ "$DEBIRF_KEYRING" ] ; then
    9090        OPTS="--keyring='$DEBIRF_KEYRING' $OPTS"
     91    fi
     92
     93    if [ "$DEBIRF_ARCH" ] ; then
     94        OPTS="--arch='$DEBIRF_ARCH' $OPTS"
    9195    fi
    9296
     
    520524    [ -d "$DEBIRF_PROFILE" ] || failure "'$DEBIRF_PROFILE' does not seem to be a directory"
    521525
    522     # determine iso name
    523     local KERNEL_VERS=$(ls -1 "${DEBIRF_ROOT}/lib/modules" | head -n1)
    524     local ISO="${DEBIRF_LABEL}_${DEBIRF_SUITE}_${KERNEL_VERS}.iso"
    525 
    526     msg "creating debirf iso..."
    527 
     526    # find kernel
    528527    local KERNEL=${KERNEL:-$(cd "${DEBIRF_BUILDD}" && ls -1 vmlinu*)}
    529     local INITRAMFS=${INITRAMFS:-$(cd "${DEBIRF_BUILDD}" && ls -1 debirf-*.cgz)}
    530 
     528    case $(echo "$KERNEL" | wc -l) in
     529        0)
     530            failure "Failed to find a kernel.  Maybe you need to run 'debirf make $DEBIRF_PROFILE' first?"
     531            ;;
     532        1)
     533            true
     534            ;;
     535        *)
     536            failure "Multiple kernels found.  Please clear out all but the desired kernel."
     537            ;;
     538    esac
     539
     540    # find initramfs
     541    local INITRAMFS=${INITRAMFS:-$(cd "${DEBIRF_BUILDD}" && ls -1 "${DEBIRF_LABEL}"_*.cgz)}
     542    case $(echo "$INITRAMFS" | wc -l) in
     543        0)
     544            failure "Failed to find a single initramfs.  Maybe you need to run 'debirf make $DEBIRF_PROFILE' first?"
     545            ;;
     546        1)
     547            true
     548            ;;
     549        *)
     550            failure "Multiple initramfs found.  Please clear out all but the desired initramfs."
     551            ;;
     552    esac
     553
     554    # find GRUB
    531555    # FIXME: it would be best to pull the name of the architecture
    532556    # exactly instead of using shell globbing to guess at it:
    533557    local GRUB_ELTORITO=${GRUB_ELTORITO:-$(echo "/usr/lib/grub/"*"-pc/stage2_eltorito")}
    534 
    535     case $(echo "$KERNEL" | wc -l) in
    536         0)
    537             failure "Failed to find a kernel.  Maybe you need to run 'debirf make $DEBIRF_PROFILE' first?"
    538             ;;
    539         1)
    540             true
    541             ;;
    542         *)
    543             failure "Multiple kernels found.  Please clear out all but the desired kernel."
    544             ;;
    545     esac
    546     case $(echo "$INITRAMFS" | wc -l) in
    547         0)
    548             failure "Failed to find a single initramfs.  Maybe you need to run 'debirf make $DEBIRF_PROFILE' first?"
    549             ;;
    550         1)
    551             true
    552             ;;
    553         *)
    554             failure "Multiple initramfs found.  Please clear out all but the desired initramfs."
    555             ;;
    556     esac
    557     [ -r "$GRUB_ELTORITO" ] || failure "Failed to find a grub El Torito stage2 loader at '$GRUB_ELTORITO'.  Try specifying it explicitly with the GRUB_ELTORITO environment variable"
    558 
    559     # get rid of the "iso" directory if it exists.
     558    [ -r "$GRUB_ELTORITO" ] || \
     559        failure "Failed to find a grub El Torito stage2 loader at '$GRUB_ELTORITO'.  Try specifying it explicitly with the GRUB_ELTORITO environment variable"
     560
     561    msg "creating debirf iso..."
     562
     563    # determine the iso name from the initramfs
     564    local ISO=$(basename "$INITRAMFS" .cgz).iso
     565
     566    # create clean iso directory
    560567    local ISODIR="${DEBIRF_BUILDD}/iso"
    561568    rm -rf "$ISODIR"
Note: See TracChangeset for help on using the changeset viewer.