#!/bin/sh LOGO_SRC="diality-splash.png" LOGO_DST="logo_diality_1280_800.ppm" LOGO_LOC="/home/bruce/leahi-workspace/leahi-distro/sources/meta-leahi/recipes-kernel/linux/files/" SERVER_IP="192.168.10.161" SERVER_USR="bruce" ERR_EXP=1 ERR_SCP=2 function help() { echo "usage: This script reads the following file: png: '$LOGO_SRC' from current folder and converts it to the follwogin ppm file: ppm: '$LOGO_DST' suitable to the Linux kernel logo. After successful conversion, copies the ppm, to the Yocto build server, in the following location: svr: '$LOGO_LOC' Todo: The script also converts the png to bmp format to be used for U-Boot, but it is not yet updates the server. " } if [ "$1" = "-h" ]; then help exit 0 fi convert -compress none "$LOGO_SRC" diality-splash-raw.ppm ppmquant 224 diality-splash-raw.ppm > diality-splash-224.ppm rm diality-splash-raw.ppm pnmnoraw diality-splash-224.ppm > "$LOGO_DST" rm diality-splash-224.ppm ACT=`file "$LOGO_DST"` EXP="$LOGO_DST: Netpbm image data, size = 1280 x 800, pixmap, ASCII text" if [ "$ACT" != "$EXP" ]; then echo "ERR: The result is not expected." echo "DSC: $ACT" exit "$ERR_EXP" fi echo "The ppm file '$LOGO_DST' created" echo " starting to copy $LOGO_DST into the $SERVER_USR@$SERVER_IP:$LOGO_LOC " scp "$LOGO_DST" "$SERVER_USR"@"$SERVER_IP":"$LOGO_LOC" if [ ! "$?" ]; then echo "ERR: The logo file '$LOGO_DST' cannot be copied to the build server." echo "DSC: $SERVER_USR"@"$SERVER_IP":"$LOGO_LOC" exit "$ERR_SCP" fi echo "The logo file '$LOGO_DST' has been copied to build server." convert "$LOGO_SRC" -resize 1280x800! -depth 8 -type TrueColor BMP3:diality-splash.bmp file diality-splash.bmp exit 0