Changes

From Amahi Wiki
Jump to: navigation, search
1,464 bytes removed ,  04:02, 29 March 2015
no edit summary
<b>NOTE:</b> This is specific to Fedora 19.
<u>'''INSTALL'''</u>
<pre># App specific variablesTemp download/extract filesmkdir -p files;export WASNAM='pmagic'echo Extracting files;export WALNAM='Parted Magic'unzip -q source-file -d files;export WAPATH='/var/hda/webmkdir -apps/pmagic/html'p elevated;cd elevated# App specific variables
# Constant variables--DO NOT CHANGE
export NBPATH='/var/lib/tftpboot';
export INTFC=`ifconfig | expand | cut -c1-8 | sort | uniq -u | awk -F: '{print $1;}' | grep -Fvx -e lo | grep -Fvx -e tun0`
export HDAIP=$(/sbin/ip -o -4 addr list $INTFC | awk '{print $4}' | cut -d/ -f1);
# Start of $WALNAM Installcat > html../install-$WASNAM.sh << EOF
#!/bin/bash
echo Copying files;mkdir -p $NBPATH/$WASNAMHDA_APP_NAME;# Copy $WALNAM files to Netbootcp $WAPATH../files/live/vmlinuz ../files/live/initrd.img ../files/$WASNAMlive/* filesystem.squashfs -d $NBPATH/$WASNAMHDA_APP_NAME
# Update PXE Menu
echo Backing up menu;
if [ -f $NBPATH/pxelinux.cfg/default.bu ]; then
cp $NBPATH/pxelinux.cfg/default.bu $NBPATH/pxelinux.cfg/default
fi
# Append app menu to default
echo Updating menu;
if [ -d $NBPATH/menu ]; then
cp $WAPATH../$WASNAMHDA_APP_NAME.mnu $NBPATH/menu
cat $NBPATH/menu/*.mnu >> $NBPATH/pxelinux.cfg/default
else
mkdir $NBPATH/menu
cp $WAPATH../$WASNAMHDA_APP_NAME.mnu $NBPATH/menu
cat $NBPATH/menu/*.mnu >> $NBPATH/pxelinux.cfg/default
fi
# Copy submenu (if needed) to conf
if [ -d $NBPATH/conf ]; then
cp $WAPATH../$WASNAMHDA_APP_NAME.conf $NBPATH/conf
else
mkdir $NBPATH/conf
cp $WAPATH../$WASNAMHDA_APP_NAME.conf $NBPATH/conf
fi
echo "Installation Removing source files";rm -rf ../files;echo "Install complete.";# End of $WALNAM Install
EOF
# Start of $WASNAM Uninstallcat > html../uninstall-$WASNAM.sh << EOF
#!/bin/bash
# Remove $WALNAMecho Removing files;rm -rf ../files;rm -rf $NBPATH/$WASNAMHDA_APP_NAME;rm -rf $NBPATH/conf/$WASNAMHDA_APP_NAME.conf;rm -rf $NBPATH/menu/$WASNAMHDA_APP_NAME.mnu;echo Restoring menu backup;
cp $NBPATH/pxelinux.cfg/default.bu $NBPATH/pxelinux.cfg/default;
if [ -f $NBPATH/menu/*.mnu ]; then
cat $NBPATH/menu/*.mnu >> $NBPATH/pxelinux.cfg/default
fiecho "Uninstallation Uninstall complete.";# End of $WALNAM Uninstall
EOF
# This needs to be changed to match the app. This can be a single menu or link to a sub menu
cat > html../$WASNAMHDA_APP_NAME.mnu << EOFLABEL Parted Magic$HDA_APP_NAME MENU LABEL Parted Magic$HDA_APP_NAME
kernel menu.c32
append conf/pmagic$HDA_APP_NAME.conf
EOF
# This is specific to the app and may not be needed. It generates a sub menu
cat > html../$WASNAMHDA_APP_NAME.conf << EOFMENU TITLE Parted Magic$HDA_APP_NAMELABEL Parted Magic$HDA_APP_NAME MENU LABEL Parted Magic$HDA_APP_NAME kernel pmagic$HDA_APP_NAME/bzImagevmlinuz append initrd=pmagic$HDA_APP_NAME/initramfs load_ramdiskinitrd.img boot=live union=1 prompt_ramdiskaufs noswap noprompt vga=0 rw sleep788 fetch=10 LABEL Parted Magic (FAILSAFE) MENU LABEL Parted Magic (FAILSAFE) kernel pmagictftp://$HDA_IP/bzImage append initrd=pmagic$HDA_APP_NAME/initramfs load_ramdisk=1 prompt_ramdisk=0 rw sleep=10 livemedia filesystem.squashfs live-config
EOF
cat > htmlchmod 755 ../indexinstall.html << EOF<html><head><title> </title><style type="text/css"><!--h1 {text-align:center; font-family:Arial, Helvetica, Sans-Serif; } p {text-indent:20px; }--></style></head><body bgcolor = "#ffffcc" text = "#000000"><center><img src="http://wikish .amahi.org/images/6/60/Partedmagic-logouninstall.png"></a></center><h1>Parted Magic Installed!</h1>sh; <p>The Parted Magic OS employs core programs of GParted and Parted to handle partitioning tasks with ease, while featuring other useful <a href="/programscp .html" mce_href="/programs.html" target="_blank">programs</a> (e.g. Clonezilla, Partimage, TestDisk, Truecrypt, G4L, SuperGrubDisk, ddrescue, etcinstall.sh .;sudo .) and an excellent set of <a href="/documentationinstall.html" mce_href="/documentation.html" target="_blank">documentation</a> to benefit the user. An extensive collection of file system tools are also included, as Parted Magic supports the following: ext2, ext3, ext4, fat16, fat32, hfs, hfs+, jfs, linux-swap, ntfs, reiserfs, reiser4, and xfs.</p>sh;<p><b>NOTE:</b> This application is a PXE network bootable OS which cannot be accessed via a web browsercd . Uncheck <b>List in dashboard</b> option to remove link from dashboard.</p>;</body></html>EOFrm -rf elevated;
chmod 755 html/install-$WASNAM.sh html/uninstall-$WASNAM.sh; mkdir elevated;cd elevated cp $WAPATH/install-$WASNAM.sh .;sudo ./install-$WASNAM.sh;cd ..;rm -rf elevated*.zip;</pre>
<u>'''UNINSTALL'''</u>
<pre># App specific variablesexport WASNAM='pmagic';export WAPATH='/var/hda/web-apps/pmagic/html';# Uninstall $WASNAMmkdir -p elevated;
cd elevated;
cp $WAPATH../uninstall-$WASNAM.sh .;sudo ./uninstall-$WASNAM.sh;
cd ..;
rm -rf elevated;</pre>
12,424

edits