lkml.org 
[lkml]   [2002]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectIncremental Patch Building Script
    Hi,

    I have written a script to build incremental patches, as found on
    bzimage.org previously. I have written this so that other people will find
    it easier to roll their own incremental patches to use.

    Comments/Suggestions on improvement welcome

    Please CC me, as I am not subscribed to the list.

    Thanks.

    --
    Robin Hugh Johnson
    E-Mail : robbat2@orbis-terrarum.net
    Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
    ICQ# : 30269588 or 41961639
    #!/bin/bash
    #
    # Incremental Kernel Patch Builder
    # Robin Johnson
    # robbat2@orbis-terrarum.net
    #
    # Build an incremental diff between two kernel patches
    # run as "./interpatch 2.4.13 ac7 ac8" to build patch-2.4.13-ac7-ac8.bz2
    # this would require the follow files in the current directory:
    # linux-2.4.13.tar.bz2
    # patch-2.4.13-ac7.bz2
    # patch-2.4.13-ac8.bz2
    #
    # REQUIRES tmpfs and lots of RAM for speed reasons
    #
    #

    TAR_CMD="tar x"
    COMPRESS_CMD="bzip2 -9c"
    UNCOMPRESS_CMD="bzip2 -dc"
    PATCH_CMD="patch -s -p1"
    DIFF_CMD="diff -HurdN" #the Hurd kernel ?
    MOUNTCMD="mount -t tmpfs /dev/ram8"
    MOUNTOPT=" -o size=512M"

    # -----------------------------------------
    # NO USER CONFIGURATION BEYOND THIS!
    # -----------------------------------------

    KERNELVERSION=$1
    PATCHLEVEL1=$2
    PATCHLEVEL2=$3

    SRC="linux-${KERNELVERSION}.tar.bz2"
    OLDVERSION="${KERNELVERSION}-${PATCHLEVEL1}"
    NEWVERSION="${KERNELVERSION}-${PATCHLEVEL2}"
    OLDDIR="linux-${OLDVERSION}"
    NEWDIR="linux-${NEWVERSION}"
    PATCH1="patch-${OLDVERSION}.bz2"
    PATCH2="patch-${NEWVERSION}.bz2"
    TARGET="patch-${KERNELVERSION}-${PATCHLEVEL1}-${PATCHLEVEL2}"

    SRCDIR=`pwd`
    TMPDIR=`mktemp -q -d kernpatch.XXXXXX`


    echo "Setting up space..."
    ${MOUNTCMD} ${TMPDIR} ${MOUNTOPT}

    cd ${TMPDIR}

    echo "Extracting..."
    ${UNCOMPRESS_CMD} ${SRCDIR}/${SRC} | ${TAR_CMD}

    echo "Copying..."
    mv linux $OLDDIR
    cp -r $OLDDIR $NEWDIR

    echo "Patching #1..."
    ${UNCOMPRESS_CMD} ${SRCDIR}/${PATCH1} | ${PATCH_CMD} -d $OLDDIR
    echo "Patching #2..."
    ${UNCOMPRESS_CMD} ${SRCDIR}/${PATCH2} | ${PATCH_CMD} -d $NEWDIR
    echo "Building diff..."
    ${DIFF_CMD} $OLDDIR $NEWDIR > ${TARGET}

    echo "Compressing diff..."
    ${COMPRESS_CMD} ${TARGET} > ${SRCDIR}/${TARGET}.bz2

    cd ${SRCDIR}

    echo "Cleaning up..."
    rm -rf ${TMPDIR}/*
    umount ${TMPDIR}
    rm -rf ${TMPDIR}

    \
     
     \ /
      Last update: 2005-03-22 13:25    [W:0.052 / U:1.880 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site