[Sugar-devel] XO-system 1a builds

James Cameron quozl at laptop.org
Mon Oct 28 05:12:47 EDT 2013


On Mon, Oct 28, 2013 at 09:01:02PM +1300, Tom Parker wrote:
> On 28/10/13 12:50, Walter Bender wrote:
> >I'll look around in OZ
> 
> I'm mostly interested in the changelog -- I have a copy of the .zd
> file and fs.zip so don't spend time looking for those.
> 
> If the changelog isn't available, is there a way to unpack a .zd
> file and then compare it with the .lzma file from a subsequent
> build? It appears to be in zhashfs format but this doesn't seem to
> have many tools?

zdextract in the bios-crypto package will unpack it, giving you a disk
image, which you can then loopback mount as a filesystem and compare
with another filesystem.

http://wiki.laptop.org/go/User:Quozl/Remastering is an example use of
zdextract for adding files to a build without having to re-run the
builder.  hasn't been tested since 2012, but it should help you
understand zdextract.

which changelog are you after?  there isn't one in the release file
set.  for example;

http://download.laptop.org/xo-4/os/official/latest/

you can build packages.txt from a filesystem using "rpm -qa | sort",
and activities.txt can also be built; there's code in olpc-os-builder
to do these things, see modules/base/postimage.50.core.sh.  (i used to
maintain tools to do this in a separate tree, but they were merged
with olpc-os-builder in 2010-01).

http://dev.laptop.org/git/projects/olpc-os-builder/tree/modules/base/postimage.50.core.sh

> I guess the obvious thing to do is to flash an XO and then tar up
> the result for comparison on another computer. Is that likely to
> work?

perhaps.  but zdextract is easier.

the /versions tree becomes interesting.  and the kernel version in the
modules path too.  before comparing, normalise the tree.  the attached
script is truly ancient, not peer reviewed, dating back to 2010, but
it has some ideas for automated comparison that you might find useful.

but modules/base/postimage.50.core.sh is probably simpler to use; it
was peer reviewed.

-- 
James Cameron
http://quozl.linux.org.au/
-------------- next part --------------
#!/bin/bash
set -e

ORIGIN_DEFAULT=/var/www/build/10.2.0
ORIGIN_DEFAULT=/var/www/build/10.1.2/xo-1.5

A=$1
shift

B=$1
shift

ORIGIN_A=${A}
ORIGIN_B=${B}

BUILD_A=$(basename ${A})
BUILD_B=$(basename ${B})

if [ "${ORIGIN_A}" = "${BUILD_A}" ]; then
    ORIGIN_A=${ORIGIN_DEFAULT}
else
    ORIGIN_A=$(dirname ${ORIGIN_A})
fi

if [ "${ORIGIN_B}" = "${BUILD_B}" ]; then
    ORIGIN_B=${ORIGIN_DEFAULT}
else
    ORIGIN_B=$(dirname ${ORIGIN_B})
fi

echo ${ORIGIN_A}
echo ${BUILD_A}
echo ${ORIGIN_B}
echo ${BUILD_B}

if [ ! -d ${ORIGIN_A} ]; then
    echo 'no origin directory $ORIGIN_A found'
    exit 1
fi

if [ ! -d ${ORIGIN_B} ]; then
    echo 'no origin directory $ORIGIN_B found'
    exit 1
fi

if [ ! -d ${ORIGIN_A}/${BUILD_A} ]; then
    echo "no build directory for $BUILD_A found"
    exit 1
fi

if [ ! -d ${ORIGIN_B}/${BUILD_B} ]; then
    echo "no build directory for $BUILD_B found"
    exit 1
fi

NUMBER_A=$(echo ${BUILD_A} | sed 's/os//')
NUMBER_B=$(echo ${BUILD_B} | sed 's/os//')

function get_kernel_release {
    echo $(egrep '^kernel-firmware-' ${1}/${2}/${2}.packages.txt | sed -e 's/^kernel-firmware-//g' -e 's/.i586//g' )
}

function get_firmware_release {
    echo $(egrep '^bootfw-' ${1}/${2}/${2}.packages.txt | sed -e 's/^bootfw-//g' | cut -f1 -d'-' )
}

KERNEL_A=$(get_kernel_release ${ORIGIN_A} ${BUILD_A})
KERNEL_B=$(get_kernel_release ${ORIGIN_B} ${BUILD_B})

function generate_list_old {
    FILE=${1}/${2}/${2}.tree.tar.lzma

    if [ ! -r ${FILE} ]; then
	echo "no readable build file for ${2} found";
	exit 1
    fi

    echo 'generate list for' ${2} 'from tar.lzma'
    lzma --decompress --stdout < ${FILE} | \
        tar --list --file - | \
        sed -e "s/pristine\/${3}/pristine\/xx/g" \
            -e "s/run\/${3}/run\/xx/g" \
            -e "s%/${4}%/\${KERNEL}%g" | \
        grep -v "/var/lib/yum/yumdb" | \
        sort >> ${2}.list
}

function generate_list {
    echo > ${2}.list
    echo 'firmware' $(get_firmware_release ${1} ${2}) >> ${2}.list
    echo 'kernel' ${4} >> ${2}.list
    sed -e 's/^/activity /g' ${1}/${2}/${2}.activities.txt >> ${2}.list
    sed -e 's/^/library /g' ${1}/${2}/${2}.libraries.txt >> ${2}.list
    sed -e 's/^/package /g' ${1}/${2}/${2}.packages.txt >> ${2}.list
    FILES=${1}/${2}/${2}.files.txt.gz
    if [ ! -r ${FILES} ]; then
	generate_list_old "$1" "$2" "$3" "$4"
	return
    fi
    echo 'generate list for' ${2} 'from files.txt.gz'
    zcat ${FILES} | \
        sed -e 's%^/%./%g' \
            -e "s/pristine\/${3}/pristine\/xx/g" \
            -e "s/run\/${3}/run\/xx/g" \
            -e "s%/${4}%/\${KERNEL}%g" \
	    -e 's/^/file /g' | \
        grep -v "/var/lib/yum/yumdb" | \
        sort >> ${2}.list
    touch --reference ${1}/${2}/${2}.zd ${2}.list || touch --reference ${1}/${2}/${2}.img ${2}.list
}

generate_list ${ORIGIN_A} ${BUILD_A} ${NUMBER_A} ${KERNEL_A}
generate_list ${ORIGIN_B} ${BUILD_B} ${NUMBER_B} ${KERNEL_B}

O=${BUILD_A}-${BUILD_B}.diff
echo 'generate diff'
diff -u ${BUILD_A}.list ${BUILD_B}.list > ${O} || true
source-highlight ${O}
cp ${O}.html ~/public_html/
echo http://dev.laptop.org/~quozl/${O}.html



More information about the Sugar-devel mailing list