SF.net SVN: morphix: [2428] trunk/morph-scripts/morphix-rebrand.sh
[email protected] Thu, 05 Oct 2006 14:38:27 -0700
| Newsgroups | gmane.linux.morphix.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2428
http://svn.sourceforge.net/morphix/?rev=2428&view=rev
Author: bmsleight
Date: 2006-10-05 14:38:21 -0700 (Thu, 05 Oct 2006)
Log Message:
-----------
Extra options for morphix-rebrand. (Guess who found getopts?) To Do: testing, man page then packaging
Modified Paths:
--------------
trunk/morph-scripts/morphix-rebrand.sh
Modified: trunk/morph-scripts/morphix-rebrand.sh
===================================================================
--- trunk/morph-scripts/morphix-rebrand.sh 2006-10-05 20:23:18 UTC (rev 2427)
+++ trunk/morph-scripts/morphix-rebrand.sh 2006-10-05 21:38:21 UTC (rev 2428)
@@ -20,9 +20,14 @@
mkdir -p $TMP_DIR
mkdir -p $NEW_IMAGE_DIR
mkdir -p $OLD_IMAGE_DIR
- TMP=$(basename "${GRAPHIC}")
- TITLE=${TMP%.*}
- TITLE=$(echo "$TITLE" | tr -cd '[:alnum:]')
+ #Get Titles, graphicfilenames etc.
+ if [ "$MASTER_TITLE" = "" ]; then
+ TMP=$(basename "${GRAPHIC}")
+ TITLE=${TMP%.*}
+ TITLE=$(echo "$TITLE" | tr -cd '[:alnum:]')
+else
+ TITLE=$MASTER_TITLE
+ fi
TITLE_LC=$(echo "$TITLE" | tr A-Z a-z)
TITLE_UC=$(echo "$TITLE" | tr a-z A-Z)
echo "New title: $TITLE $TITLE_LC $TITLE_UC"
@@ -33,8 +38,27 @@
echo " This is a special reserved name. Please use another title. "
exit
fi
-
-
+ if [ "$BACK_GRAPHIC" = "" ]; then
+ BACK_GRAPHIC=$GRAPHIC
+ else
+ full_path $BACK_GRAPHIC
+ BACK_GRAPHIC=$FULL_PATH
+ fi
+ if [ "$GRUB_TITLE" = "" ]; then
+ GRUB_TITLE=$TITLE
+ fi
+ if [ "$HOST_NAME" = "" ]; then
+ HOST_NAME=$TITLE
+ fi
+ if [ "$USER_NAME" = "" ]; then
+ USER_NAME=$TITLE_LC
+ fi
+ if [ "$WALLPAPER" = "" ]; then
+ WALLPAPER=$GRAPHIC
+ else
+ full_path $WALLPAPER
+ WALLPAPER=$FULL_PATH
+ fi
}
full_path ()
@@ -70,7 +94,7 @@
echo
for TMP_GRUB_FILE in $NEW_IMAGE_DIR/boot/grub/*.lst
do
- sed "/title/s/$OLD_TITLE/$TITLE/g" $TMP_GRUB_FILE > $TMP_FILE
+ sed "/title/s/$OLD_TITLE/$GRUB_TITLE/g" $TMP_GRUB_FILE > $TMP_FILE
mv $TMP_FILE $TMP_GRUB_FILE
done
#Remove BOOT_IMAGE
@@ -100,7 +124,7 @@
#Add BOOT_IMAGE username and hostname
for TMP_GRUB_FILE in $NEW_IMAGE_DIR/boot/grub/*.lst
do
- sed "/kernel/s/$/ BOOT_IMAGE=$TITLE hostname=$TITLE username=$TITLE_LC /" $TMP_GRUB_FILE > $TMP_FILE
+ sed "/kernel/s/$/ BOOT_IMAGE=$TITLE hostname=$HOST_NAME username=$USER_NAME /" $TMP_GRUB_FILE > $TMP_FILE
mv $TMP_FILE $TMP_GRUB_FILE
done
}
@@ -123,7 +147,7 @@
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
+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
}
@@ -144,7 +168,7 @@
#mv $TMP_FILE $TMP_DIR/lxrc/linuxrc
chmod a+x $TMP_DIR/lxrc/linuxrc
ln -s /${OLD_TITLE}CD $TMP_DIR/lxrc/${TITLE}CD
-convert $GRAPHIC -quality 75 -resize 1024x768 -size 1024x768 xc:white +swap -gravity center -composite $TMP_DIR/silent-1024x768.jpg
+convert $BACK_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
ln -sf /bootsplash/images/silent-1024x768.jpg $TMP_DIR/lxrc/bootsplash/images/silent2-1024x768.jpg
@@ -161,7 +185,7 @@
xbackground ()
{
mkdir -p $NEW_IMAGE_DIR/copy/morphix/
-convert $GRAPHIC -resize 1024x768 -size 1024x768 xc:white +swap -gravity center -composite $NEW_IMAGE_DIR/copy/morphix/background.png
+convert $WALLPAPER -resize 1024x768 -size 1024x768 xc:white +swap -gravity center -composite $NEW_IMAGE_DIR/copy/morphix/background.png
}
cleanup_and_make_iso ()
@@ -174,15 +198,41 @@
#Main loop
+# * Grub Titles
+# * Grub Background
+# * Username, Hostname
+# * Boot-up message
+# * Boot-up background
+# * Window Manager Wallpaper
+
+while getopts T:b:g:h:u:w: opt
+do
+ case "$opt" in
+ T) MASTER_TITLE="$OPTARG";;
+ b) BACK_GRAPHIC="$OPTARG";;
+ g) GRUB_TITLE="$OPTARG";;
+ h) HOST_NAME="$OPTARG";;
+ u) USER_NAME="$OPTARG";;
+ w) WALLPAPER="$OPTARG";;
+
+ \?) # unknown flag
+ echo >&2 \
+ "usage: $0 [-T Master_Title] [-b background_graphic] [-g title_grub_menu] [-h hostname] [-u username] [-w x_wallpaper_graphic] old.iso new.iso Rebrand.png "
+ exit 1;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
#Confirm parameters
if [ -z "$1" -a -z "$2" -a -z "$3" ]; then
- echo "Usage: $0 old.iso new.iso Rebrand.png"
+ echo "usage: $0 [-T Master_Title] [-b background_graphic] [-g title_grub_menu] [-h hostname] [-u username] [-w x_wallpaper_graphic] old.iso new.iso Rebrand.png "
echo
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 " The name should not contain non-alpha-numeric characters"
+ echo " To override the default name obtain from the graphics file use the option items such as -T ReBrand"
+ echo " The names should not contain non-alpha-numeric characters"
echo " Need to have be able to run the mount command, i.e. must be root"
exit
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV