SF.net SVN: morphix: [2320] trunk/morph-scripts
[email protected] Wed, 21 Jun 2006 14:19:18 -0700
| Newsgroups | gmane.linux.morphix.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2320
Author: bmsleight
Date: 2006-06-21 14:19:11 -0700 (Wed, 21 Jun 2006)
ViewCVS: http://svn.sourceforge.net/morphix/?rev=2320&view=rev
Log Message:
-----------
Fixing morphix-rebrand bugs
Modified Paths:
--------------
trunk/morph-scripts/debian/changelog
trunk/morph-scripts/debian/morphix-rebrand.1
trunk/morph-scripts/morphix-rebrand.sh
Modified: trunk/morph-scripts/debian/changelog
===================================================================
--- trunk/morph-scripts/debian/changelog 2006-06-20 22:53:57 UTC (rev 2319)
+++ trunk/morph-scripts/debian/changelog 2006-06-21 21:19:11 UTC (rev 2320)
@@ -1,3 +1,9 @@
+morph-scripts (0.2-24) unstable; urgency=low
+
+ * fixing morphix-rebrand bugs
+
+ -- bmsleight <[email protected]> Wed, 21 Jun 2006 22:00:00 +0100
+
morph-scripts (0.2-23) unstable; urgency=low
* adding morphix-rebrand
Modified: trunk/morph-scripts/debian/morphix-rebrand.1
===================================================================
--- trunk/morph-scripts/debian/morphix-rebrand.1 2006-06-20 22:53:57 UTC (rev 2319)
+++ trunk/morph-scripts/debian/morphix-rebrand.1 2006-06-21 21:19:11 UTC (rev 2320)
@@ -28,7 +28,7 @@
.SH "DESCRIPTION"
-This script Re\-brands a Morphix CD image using the graphic Rebrand\&.png taking Rebrand as the new title\&.
+This script Re\-brands a Morphix CD image using the graphic file\&. Any Graphic file will do\&. Rebrand\&.png, Rebrand\&.jpg or Rebrand\&.gif The name of the graphics file is importnat as the script takes Rebrand as the new title for the LiveCd\&. Need to have be able to run the mount command, i\&.e\&. must be root"
.SH "EXAMPLES"
Modified: trunk/morph-scripts/morphix-rebrand.sh
===================================================================
--- trunk/morph-scripts/morphix-rebrand.sh 2006-06-20 22:53:57 UTC (rev 2319)
+++ trunk/morph-scripts/morphix-rebrand.sh 2006-06-21 21:19:11 UTC (rev 2320)
@@ -20,10 +20,27 @@
mkdir -p $TMP_DIR
mkdir -p $NEW_IMAGE_DIR
mkdir -p $OLD_IMAGE_DIR
- TITLE=$(basename $GRAPHIC .png)
- echo "Title $TITLE"
+ TMP=$(basename "${GRAPHIC}")
+ TITLE=${TMP%.*}
+ TITLE=$(echo "$TITLE" | tr -cd '[:alnum:]')
+ echo "New title: $TITLE"
}
+full_path ()
+{
+BASENAME=$(basename "${1}")
+DIRNAME=$(cd $(dirname "${1}") && pwd)
+FULL_PATH="${DIRNAME}/${BASENAME}"
+}
+
+am_i_root_exit_if_not ()
+{
+if [ `id -u` -ne 0 ]; then
+ echo "Need to have be able to run the mount command, i.e. must be root"
+ exit
+fi
+}
+
mount_and_copy ()
{
echo "Mount old image and copying files for new Image"
@@ -94,6 +111,8 @@
convert -background none -fill white -gravity North -pointsize 24 -size 148x183 caption:"Welcome to $TITLE LiveCD" $TMP_DIR/title.png
convert -page 640x503+172+34 $TMP_DIR/grubmenu.png -page 640x503+6+34 $TMP_DIR/resize.png -page 640x503+12+166 $TMP_DIR/title.png -page 640x503+6+160 $TMP_DIR/background_br.png -page 640x503+0,0 $TMP_DIR/background_tr.png -background none -compose DstOver -flatten $TMP_DIR/grub.pcx
convert $TMP_DIR/grub.pcx -resize 640x503! -colors 14 -depth 8 $TMP_DIR/gfxboot-grub-0.1/background.pcx
+sed "s/$OLD_TITLE/$TITLE/g" $TMP_DIR/gfxboot-grub-0.1/help-boot.en.html >$TMP_FILE
+mv $TMP_FILE $TMP_DIR/gfxboot-grub-0.1/help-boot.en.html
cd $TMP_DIR/gfxboot-grub-0.1/ && make >/dev/null 2>%1
cp $TMP_DIR/gfxboot-grub-0.1/boot/message $NEW_IMAGE_DIR/boot/grub
}
@@ -116,10 +135,10 @@
convert $GRAPHIC -quality 75 -resize 1024x768 -size 1024x768 xc:white +swap -gravity center -composite $TMP_DIR/silent-1024x768.jpg
convert $TMP_DIR/silent-1024x768.jpg -modulate 5,10,10 $TMP_DIR/bootsplash-1024x768.jpg
cp $TMP_DIR/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent-1024x768.jpg
-cp $TMP_DIR/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent2-1024x768.jpg
-cp $TMP_DIR/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent3-1024x768.jpg
-cp $TMP_DIR/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent4-1024x768.jpg
-cp $TMP_DIR/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent5-1024x768.jpg
+ln -sf /bootsplash/images/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent2-1024x768.jpg
+ln -sf /bootsplash/images/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent3-1024x768.jpg
+ln -sf /bootsplash/images/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent4-1024x768.jpg
+ln -sf /bootsplash/images/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent5-1024x768.jpg
cp $TMP_DIR/bootsplash-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/bootsplash-1024x768.jpg
sync
umount $TMP_DIR/miniroot
@@ -135,7 +154,8 @@
cleanup_and_make_iso ()
{
-make-iso $NEW_IMAGE_DIR $ENDISO $TITLE
+LABEL=$(echo "$TITLE" | cut -c1-32)
+make-iso $NEW_IMAGE_DIR $ENDISO $LABEL
rm $TMP_DIR -R 2>/dev/null
rm $TMP_FILE 2>/dev/null
}
@@ -144,19 +164,24 @@
#Main loop
#Confirm parameters
-STARTISO=$1
-ENDISO=$2
-GRAPHIC=$3
-if [ -z "$STARTISO" -a -z "$ENDISO" -a -z "$GRAPHIC" ]; then
+if [ -z "$1" -a -z "$2" -a -z "$3" ]; then
echo "Usage: $0 old.iso new.iso Rebrand.png"
echo
- echo " This script Re-brands a Morphix CD image using the graphic Rebrand.png"
- echo " taking Rebrand as the new title."
+ echo " This script Re-brands a Morphix CD image using the graphic file "
+ echo " Any Graphic file will do. Rebrand.png, Rebrand.jpg or Rebrand.gif"
+ echo " The name of the graphics file is important as the script takes Rebrand as the new title for the LiveCd."
echo " Need to have be able to run the mount command, i.e. must be root"
exit
fi
+full_path $1
+STARTISO=$FULL_PATH
+full_path $2
+ENDISO=$FULL_PATH
+full_path $3
+GRAPHIC=$FULL_PATH
+am_i_root_exit_if_not
get_global_variables
mount_and_copy
grub_title_boot_options
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642