Skip to contentSkip to conversation

make building working zaurus images easier

RFC Koen Kooi 4 participants 13 messages Jul 26, 2007 – Jul 27, 2007

lore
Share & tools
lore

Koen Kooi

author
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Building a working zaurus image is tedious since you have *manually* rename a bunch of files before the on-board flashing software will accept it.

I therefore want to propose 2 small scripts that can be run as EXTRA_IMAGECMD to make life a lot easier for both developers and users:

[beware of line wrapping]

For c7x0:

#!/bin/sh
cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*jffs2 | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/initrd.bin
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
tar cjf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

For Spitz:

#!/bin/sh
cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*gz | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/hdimage1.tgz
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
cp gnu-tar ${IMAGE_NAME}-installkit/
tar cjf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

These are just proof of concept scripts, but would something like this be acceptable to the zaurus maintainers in OE? Having something like this would make live for distro people a lot easier and should confuse OE newbies a bit less.

I have added something similar for bootldr based ipaqs in OE that writes out a reflash.ctl automagically, which has been a great success.

Comments/improvements/flames?

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqIoiMkyGM64RGpERApzOAJ9LGbvsDEOdsILrWbausHIFB8gCxACeIrR+ 53PH8E27hgzdmkaYtC4EciE=
=6q4E
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 3 lines · Koen Kooi

Building a working zaurus image is tedious since you have *manually* rename a bunch of files before the on-board flashing software will accept it.

+2 from me

Quoted 6 lines

I therefore want to propose 2 small scripts that can be run as EXTRA_IMAGECMD to make life a lot easier for both developers and users:

[beware of line wrapping]

For c7x0:

For c7x0/poodle/tosa you mean ;)

For collie:

cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin
cp ls ${IMAGE_NAME}.rootfs*jffs2 | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/initrd.bin tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/ rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

Also we should use gzip compression for installkit tarballs as this will allow users to unpack them on devices (gzip is in busybox).

Signature · 6 lines
JID: hrw-jabber.org
OpenEmbedded developer/consultant

 BSD is what you get when a bunch of Unix hackers sit down to try to port
 a Unix system to the PC. Linux is what you get when a bunch of PC hackers
 sit down and try to write a Unix system for the PC.
author
#2 lore raw
In reply to Koen Kooi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Marcin

Also we should use gzip compression for installkit tarballs as this will allow users to unpack them on devices (gzip is in busybox).

Koen Kooi schreef:

Quoted 4 lines

I therefore want to propose 3 small scripts that can be run as EXTRA_IMAGECMD to make life a lot easier for both developers and users:

[beware of line wrapping]

For collie:

cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*jffs2 | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/initrd.bin
tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

For c7x0/poodle/tosa

#!/bin/sh > cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*jffs2 | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/initrd.bin
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.gz
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

For Spitz:

#!/bin/sh
cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*gz | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/hdimage1.tgz
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
cp gnu-tar ${IMAGE_NAME}-installkit/
tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.gz
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

Quoted 1 line

Comments/improvements/flames?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqI+NMkyGM64RGpERAh4MAJ0Zj+gfEm3ijOcrHDmGWIqxsG2LdACcDAcD tuSqvMZvV73LpNIqhUhbjDo=
=2GJC
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 14 lines · Koen Kooi

For Spitz:

#!/bin/sh
cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*gz | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/hdimage1.tgz
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
cp gnu-tar ${IMAGE_NAME}-installkit/
tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.gz
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

Quoted 1 line

Comments/improvements/flames?

Why not just write one decent script instead of 3+ forks?

if [ "${MACHINE}" = "spitz" ]; then

    cp gnu-tar ${IMAGE_NAME}-installkit/

fi

etc.

This is probably suitable material for a do_deploy image.bbclass task. The guts of the task can live in the machine specific files (such as the zaurus common file) as a function added into the task by some new variable. Does that seem reasonable?

Richard

author
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Purdie schreef:

Quoted 14 lines · Koen Kooi
Quoted 13 lines

For Spitz:

#!/bin/sh
cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*gz | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/hdimage1.tgz
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
cp gnu-tar ${IMAGE_NAME}-installkit/
tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.gz
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

Quoted 7 lines
Quoted 1 line
Quoted 1 line

Comments/improvements/flames?

Why not just write one decent script instead of 3+ forks?

if [ "${MACHINE}" = "spitz" ]; then

    cp gnu-tar ${IMAGE_NAME}-installkit/

fi

I was thinking of that just now :)

Quoted 6 lines

etc.

This is probably suitable material for a do_deploy image.bbclass task. The guts of the task can live in the machine specific files (such as the zaurus common file) as a function added into the task by some new variable. Does that seem reasonable?

Very reasonable! Would this also be the time to discuss a kernel deploy task?

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqJdJMkyGM64RGpERAgEOAKCWaIaePMGH4QVbjnDGy8s45Xdh0wCffQ3T s3yx50FzrnKb/r98XL+JfiA=
=nZsH
-----END PGP SIGNATURE-----

#5 lore raw
In reply to Koen Kooi

I have never looked into all this machinery, but since we have, e.g.
x11-image-spitz.tar.gz and zImage-spitz.bin symlinks, I'd guess that we can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Love,
H

Quoted 69 lines · Koen Kooi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Building a working zaurus image is tedious since you have *manually* rename a bunch of files before the on-board flashing software will accept it.

I therefore want to propose 2 small scripts that can be run as EXTRA_IMAGECMD to make life a lot easier for both developers and users:

[beware of line wrapping]

For c7x0:

#!/bin/sh
cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*jffs2 | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/initrd.bin
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
tar cjf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

For Spitz:

#!/bin/sh
cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/
cp ls zImage-2* | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/zImage.bin cp ls ${IMAGE_NAME}.rootfs*gz | sort -b | uniq |tail -n1 ${IMAGE_NAME}-installkit/hdimage1.tgz
cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh
cp gnu-tar ${IMAGE_NAME}-installkit/
tar cjf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tar.bz2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/

These are just proof of concept scripts, but would something like this be acceptable to the zaurus maintainers in OE? Having something like this would make live for distro people a lot easier and should confuse OE newbies a bit less.

I have added something similar for bootldr based ipaqs in OE that writes out a reflash.ctl automagically, which has been a great success.

Comments/improvements/flames?

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqIoiMkyGM64RGpERApzOAJ9LGbvsDEOdsILrWbausHIFB8gCxACeIrR+ 53PH8E27hgzdmkaYtC4EciE=
=6q4E
-----END PGP SIGNATURE-----

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#6 lore raw
Quoted 4 lines · Michael Krelin

I have never looked into all this machinery, but since we have, e.g. x11-image-spitz.tar.gz and zImage-spitz.bin symlinks, I'd guess that we can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Correct.

Cheers,

Richard

author
#7 lore raw
In reply to Michael Krelin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Krelin schreef:

Quoted 4 lines

I have never looked into all this machinery, but since we have, e.g. x11-image-spitz.tar.gz and zImage-spitz.bin symlinks, I'd guess that we can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Won't tar package up the symlinks instead of the real files in that case?

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqNuBMkyGM64RGpERAkr2AJ9BlpLlCmwxdakPwW7TxRFkwFAHVwCeNtcm Y7tBsLqo045ka9lG64Z+FNo=
=8+tA
-----END PGP SIGNATURE-----

#8 lore raw
Quoted 8 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Krelin schreef:

Quoted 2 lines

I have never looked into all this machinery, but since we have, e.g.
x11-image-spitz.tar.gz and zImage-spitz.bin symlinks, I'd guess that we can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Won't tar package up the symlinks instead of the real files in that case?

tar -h won't, but what I meant is (a) we do have information necessary to find out the actual filename and (b) if the information is outdated we have symlinks to access the proper image and torture it whichever way we want.

Love,
H

Quoted 16 lines

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqNuBMkyGM64RGpERAkr2AJ9BlpLlCmwxdakPwW7TxRFkwFAHVwCeNtcm Y7tBsLqo045ka9lG64Z+FNo=
=8+tA
-----END PGP SIGNATURE-----

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#9 lore raw
In reply to Koen Kooi
Quoted 10 lines · Koen Kooi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Krelin schreef:

Quoted 4 lines

I have never looked into all this machinery, but since we have, e.g. x11-image-spitz.tar.gz and zImage-spitz.bin symlinks, I'd guess that we can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Won't tar package up the symlinks instead of the real files in that case?

Yes, but we can use readlink to work out the real file...

Cheers,

Richard

author
#10 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Purdie schreef:

Quoted 7 lines · Koen Kooi
Quoted 6 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Krelin schreef:

Quoted 2 lines

I have never looked into all this machinery, but since we have, e.g. x11-image-spitz.tar.gz

IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" :)

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

and zImage-spitz.bin symlinks, I'd guess that we
can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Won't tar package up the symlinks instead of the real files in that case?

Yes, but we can use readlink to work out the real file...

How about this:

cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/

# Get the latest kernel using the zImage-<machine>.bin symlink cp readlink zImage-${MACHINE}.bin ${IMAGE_NAME}-installkit/zImage.bin

if [ "${MACHINE}" = "spitz" ]; then

    cp gnu-tar ${IMAGE_NAME}-installkit/
    cp ${IMAGE_NAME}.rootfs.tar.gz ${IMAGE_NAME}-installkit/hdimage1.tgz
else
    cp ${IMAGE_NAME}.rootfs.jffs2 ${IMAGE_NAME}-installkit/initrd.bin

fi

# All zaurus machines except collie need updater.sh if [ "${MACHINE}" != "collie" ]; then

    cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh

fi

tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tgz {IMAGE_NAME}-installkit/ rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqawcMkyGM64RGpERAvEQAKC3czWwnPBjw6gvh06AcVj3aoU7pQCgvJpc hhLFEF/cZBgUB9TGMZMPkFk=
=/QP0
-----END PGP SIGNATURE-----

#11 lore raw
Quoted 10 lines
Quoted 3 lines
Quoted 3 lines

Michael Krelin schreef:

Quoted 2 lines

I have never looked into all this machinery, but since we have, e.g. x11-image-spitz.tar.gz

IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" :)

Quoted 3 lines
Quoted 2 lines
Quoted 1 line

and zImage-spitz.bin symlinks, I'd guess that we can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Won't tar package up the symlinks instead of the real files in that case?

Yes, but we can use readlink to work out the real file...

Quoted 7 lines

How about this:

cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/

# Get the latest kernel using the zImage-<machine>.bin symlink cp readlink zImage-${MACHINE}.bin ${IMAGE_NAME}-installkit/zImage.bin

hmm.. isn't that equivalent to

cp zImage-${MACHINE}.bin ${IMAGE_NAME}-installkit/zImage.bin

? cp surely will dereference symlink unless asked not to.

Love,
H

Quoted 27 lines

if [ "${MACHINE}" = "spitz" ]; then

    cp gnu-tar ${IMAGE_NAME}-installkit/
    cp ${IMAGE_NAME}.rootfs.tar.gz ${IMAGE_NAME}-installkit/hdimage1.tgz
else
    cp ${IMAGE_NAME}.rootfs.jffs2 ${IMAGE_NAME}-installkit/initrd.bin

fi

# All zaurus machines except collie need updater.sh if [ "${MACHINE}" != "collie" ]; then

    cp updater.sh.${MACHINE} ${IMAGE_NAME}-installkit/updater.sh

fi

tar czf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit.tgz {IMAGE_NAME}-installkit/ rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-installkit/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqawcMkyGM64RGpERAvEQAKC3czWwnPBjw6gvh06AcVj3aoU7pQCgvJpc hhLFEF/cZBgUB9TGMZMPkFk=
=/QP0
-----END PGP SIGNATURE-----

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

author
#12 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Krelin schreef:

Quoted 15 lines
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines

Michael Krelin schreef:

Quoted 2 lines

I have never looked into all this machinery, but since we have, e.g. x11-image-spitz.tar.gz

IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" :)

Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

and zImage-spitz.bin symlinks, I'd guess that we
can do without these somewhat ugly when unnecessary ls|sort|uniq|tail things, can't we?

Won't tar package up the symlinks instead of the real files in that case?

Yes, but we can use readlink to work out the real file...

How about this:

cd ${DEPLOY_DIR_IMAGE}
mkdir ${IMAGE_NAME}-installkit/

Quoted 8 lines
Quoted 2 lines

# Get the latest kernel using the zImage-<machine>.bin symlink cp readlink zImage-${MACHINE}.bin ${IMAGE_NAME}-installkit/zImage.bin

hmm.. isn't that equivalent to

cp zImage-${MACHINE}.bin ${IMAGE_NAME}-installkit/zImage.bin

? cp surely will dereference symlink unless asked not to.

Good point. The script is now at http://bugs.openembedded.org/show_bug.cgi?id=2690 for review and improvements.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGqcC9MkyGM64RGpERAgdoAJ9ZX9oVInVtBvldsTOCacfeHBZbfwCgsWqM 2l4C+orHeT5qlfLSmGClq9M=
=XTtS
-----END PGP SIGNATURE-----