It is currently Sat Oct 25, 2014 2:49 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Unbundling Parted Magic
PostPosted: Sat Aug 21, 2010 10:41 am 
Offline

Joined: Thu Dec 21, 2006 4:28 pm
Posts: 85
This is a script to unbundle Parted Magic from UBCD. You are then free to add an updated Parted Magic as you see fit or add UBCD to your own boot disks. This is a bash script so you can even use Parted Magic (running from RAM of course) to remove itself :D.

ubcd-unbundle-pmagic.sh:
Code:
#!/bin/sh

help() {
  echo "
  This script unbundles Parted Magic from The Ultimate Boot CD.
 
  Usage: $(basename "$0") [path-to-extracted-UBCD-iso]
  "
}

unbundle() {
# syslinux
sed -i -e '/pmagic[[:digit:]].hlp/s|^F|#F|g' -e '/MENU LABEL Parted Magic/aMENU HIDE' \
  ./ubcd/menus/{iso,sys}linux/main.cfg

sed -i -e '/MENU LABEL partimage/aMENU HIDE' \
  ./ubcd/menus/syslinux/hdd/cloning.cfg
 
sed -i -e '/MENU LABEL GParted/aMENU HIDE' \
  ./ubcd/menus/syslinux/hdd/partmgmt.cfg
 
sed -i -e '/MENU LABEL PhotoRec/aMENU HIDE' -e '/MENU LABEL TestDisk/aMENU HIDE' \
  ./ubcd/menus/syslinux/hdd/recovery.cfg

# grub4dos
sed -i -e '/title Parted Magic/,/configfile/s|^|#|g' \
  ./ubcd/menus/grub4dos/main.lst

sed -i -e '/title partimage/,/configfile/s|^|#|g' \
  ./ubcd/menus/grub4dos/hdd/cloning.lst

sed -i -e '/title GParted/,/configfile/s|^|#|g' \
  ./ubcd/menus/grub4dos/hdd/partmgmt.lst

sed -i -e '/title PhotoRec/,/configfile/s|^|#|g' -e '/title TestDisk/,/configfile/s|^|#|g' \
  ./ubcd/menus/grub4dos/hdd/recovery.lst

# cleanup
rm ./ubcd/menus/syslinux/pmagic*.hlp
rm -rf ./pmagic
rm ./ubcd/tools/{linux,win32}/antivirus/{clamav,fprot}.*
}

ubcddir="$1"

if [ -z "$1" ]; then
  help
  exit
elif [ -f "$ubcddir/ubcd/ubcd.ico" ]; then
  cd -- "$ubcddir"
else
  echo "$(basename "$0"): \`$ubcddir' directory does not contain UBCD files"
  exit 1
fi

unbundle

if [ "$?" != "0" ]; then
  echo "$(basename "$0"): An error occurred, please try again"
  exit 1
else
  echo "$(basename "$0"): All processes completed successfully"
  exit
fi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group