diff --git a/README.md b/README.md index f0d4df7..aa780e1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ MultiCD ======== -Official site: http://multicd.us -Updates are posted at http://blog.multicd.us and http://twitter.com/multicd +Official site: [https://www.lakora.us/multicd/](https://www.lakora.us/multicd/) + +Updates are posted at http://twitter.com/multicd diff --git a/downloader.sh b/downloader.sh new file mode 100644 index 0000000..60ca889 --- /dev/null +++ b/downloader.sh @@ -0,0 +1,287 @@ +#!/bin/bash +getISO() { + #echo $1 #Distro name + #echo $2 #Choice Label + #echo $3 #File + #echo $4 #URL + clear + echo "Downloading $2..." + if ! wget -t 1 -O "${3}" "${4}";then + echo "Error: could not download $4. Please update the URL in downloader.sh." + ### Left in the loop to main menu commented incase one wants to just loop back on error. + exit 1 + #downloadisos + fi + + case $1 in + "Ubuntu") select_ubuntu $1 "$2" ;; + *) downloadisos ;; + esac +} +failed() { + error="No $1 entries yet."; +} +cancelled() { + cancel="Selection from $1 cancelled."; +} +### Important: +### This is the blank entry template for distros +### we support but don't have or can't provide links for. +# select_distronamehere() { +# failed "$1" +# return=$error +# downloadisos "$return" +# } +select_debian() { + failed "$1" + cancelled "$1" + return=$error + exit=$cancel + downloadisos "$return" +} +select_fedora() { + failed "$1" + cancelled "$1" + return=$error + exit=$cancel + downloadisos "$return" +} +select_ubuntu() { + failed "$1" + cancelled "$1" + return=$error + exit=$cancel + + HEIGHT=50 + WIDTH=70 + TITLE="ISO Selections" + MENU="Choose an ISO: " + if [ ! "$2" = "" ];then + MENU="Last Downloaded ISO: $2" + fi + + ISOS=('12.04.5 Alternate 32bit' \ + '12.04.5 Alternate 64bit' \ + '12.04.5 Desktop 32bit' \ + '12.04.5 Desktop 64bit' \ + '12.04.5 Server 32bit' \ + '12.04.5 Server 64bit' \ + '14.04.5 Desktop 32bit' \ + '14.04.5 Desktop 64bit' \ + '14.04.5 Server 32bit' \ + '14.04.5 Server 64bit' \ + '16.04.2 Desktop 32bit' \ + '16.04.2 Desktop 64bit' \ + '16.04.2 Server 32bit' \ + '16.04.2 Server 64bit' \ + '16.10 Desktop 32bit' \ + '16.10 Desktop 64bit' \ + '16.10 Server 32bit' \ + '16.10 Server 64bit' \ + '17.04 Desktop 32bit' \ + '17.04 Desktop 64bit' \ + '17.04 Server 32bit' \ + '17.04 Server 64bit' + ); + + COUNT=1 + OPTIONS=() + for i in "${ISOS[@]}"; do + OPTIONS+=($COUNT "$i") + COUNT=$[COUNT+1] + done + OPTIONS+=($COUNT "Distro Menu") + COUNT=$[COUNT+1] + OPTIONS+=($COUNT "Exit") + CHOICE_HEIGHT=$[COUNT+3] + + CHOICE=$(dialog \ + --no-lines \ + --title "$TITLE" \ + --menu "$MENU" \ + $HEIGHT $WIDTH $CHOICE_HEIGHT \ + "${OPTIONS[@]}" \ + 2>&1 >/dev/tty + ) + + if [[ $CHOICE = $[COUNT-1] ]];then + downloadisos "Returned from $1" + fi + if [[ $CHOICE = $COUNT ]];then + echo "Leaving Distro Downloader from $1 menu." + exit 1 + fi + + COMMON="http://releases.ubuntu.com/" + FILE="" + URL="" + + case $CHOICE in + 1) + FILE="ubuntu-12.04.5-alternate-i386.iso" + URL="${COMMON}12.04/${FILE}" + ;; + 2) + FILE="ubuntu-12.04.5-alternate-amd64.iso" + URL="${COMMON}12.04/${FILE}" + ;; + 3) + FILE="ubuntu-12.04.5-desktop-i386.iso" + URL="${COMMON}12.04/${FILE}" + ;; + 4) + FILE="ubuntu-12.04.5-desktop-amd64.iso" + URL="${COMMON}12.04/${FILE}" + ;; + 5) + FILE="ubuntu-12.04.5-server-i386.iso" + URL="${COMMON}12.04/${FILE}" + ;; + 6) + FILE="ubuntu-12.04.5-server-amd64.iso" + URL="${COMMON}12.04/${FILE}" + ;; + + 7) + FILE="ubuntu-14.04.5-desktop-i386.iso" + URL="${COMMON}14.04/${FILE}" + ;; + 8) + FILE="ubuntu-14.04.5-desktop-amd64.iso" + URL="${COMMON}14.04/${FILE}" + ;; + 9) + FILE="ubuntu-14.04.5-server-i386.iso" + URL="${COMMON}14.04/${FILE}" + ;; + 10) + FILE="ubuntu-14.04.5-server-amd64.iso" + URL="${COMMON}14.04/${FILE}" + ;; + + 11) + FILE="ubuntu-16.04.2-desktop-i386.iso" + URL="${COMMON}16.04/${FILE}" + ;; + 12) + FILE="ubuntu-16.04.2-desktop-amd64.iso" + URL="${COMMON}16.04/${FILE}" + ;; + 13) + FILE="ubuntu-16.04.2-server-i386.iso" + URL="${COMMON}16.04/${FILE}" + ;; + 14) + FILE="ubuntu-16.04.2-server-amd64.iso" + URL="${COMMON}16.04/${FILE}" + ;; + + 15) + FILE="ubuntu-16.10-desktop-i386.iso" + URL="${COMMON}16.10/${FILE}" + ;; + 16) + FILE="ubuntu-16.10-desktop-amd64.iso" + URL="${COMMON}16.10/${FILE}" + ;; + 17) + FILE="ubuntu-16.10-server-i386.iso" + URL="${COMMON}16.10/${FILE}" + ;; + 18) + FILE="ubuntu-16.10-server-amd64.iso" + URL="${COMMON}16.10/${FILE}" + ;; + + 19) + FILE="ubuntu-17.04-desktop-i386.iso" + URL="${COMMON}17.04/${FILE}" + ;; + 20) + FILE="ubuntu-17.04-desktop-amd64.iso" + URL="${COMMON}17.04/${FILE}" + ;; + 21) + FILE="ubuntu-17.04-server-i386.iso" + URL="${COMMON}17.04/${FILE}" + ;; + 22) + FILE="ubuntu-17.04-server-amd64.iso" + URL="${COMMON}17.04/${FILE}" + ;; + esac + + if [[ -z $CHOICE ]];then + downloadisos "$exit" + else + GETNAME=$CHOICE-1 + getISO $1 "${ISOS[$GETNAME]}" "$FILE" "$URL" + fi + + ### If menu fails, drop to main menu. + downloadisos "$return" +} +distrochoice() { + ### return is the default for any entry not populated with a function. + ### Please use similar templates to existing. + ### (select_ then distro name only in lower case.) + ### Then add Just the name in downloadisos() in the DISTROS array. + ### Keep the array name a singular word for simplicity. + ### Can split revisions out further down. + + return="No $1 entries yet or invalid selection." + case $1 in + "Debian") select_debian $1 ;; + "Fedora") select_fedora $1 ;; + "Ubuntu") select_ubuntu $1 ;; + esac + downloadisos "$return" +} +### Main function. Entry point for this file. +downloadisos() { + if ! which dialog &> /dev/null;then + echo "You must install dialog to use the interactive options." + exit 1 + fi + + HEIGHT=50 + WIDTH=70 + TITLE="Distro Selections" + MENU="Choose a Distro: "$1 + + ### Add distro name here. Singular word for simplicity. + DISTROS=('Debian' 'Fedora' 'Ubuntu'); + + COUNT=0 + OPTIONS=() + for i in "${DISTROS[@]}"; do + OPTIONS+=($COUNT "$i") + COUNT=$[COUNT+1] + done + OPTIONS+=($COUNT "Exit") + CHOICE_HEIGHT=$[COUNT+3] + + CHOICE=$(dialog \ + --no-lines \ + --title "$TITLE" \ + --menu "$MENU" \ + $HEIGHT $WIDTH $CHOICE_HEIGHT \ + "${OPTIONS[@]}" \ + 2>&1 >/dev/tty + ) + + if [[ $CHOICE = $COUNT ]];then + echo "Leaving Distro Downloader from main menu." + exit 1 + fi + + if [[ -z $CHOICE ]];then + echo "Cancelled Distro Downloader from main menu." + exit 1 + else + distrochoice ${DISTROS[$CHOICE]} + fi + + ## Clean exit on menu fail. + exit 1 +} diff --git a/multicd.sh b/multicd.sh index 9718acf..fe2a024 100755 --- a/multicd.sh +++ b/multicd.sh @@ -8,10 +8,11 @@ trap exit ERR export MCDDIR=$(cd "$(dirname "$0")" && pwd) PATH=$PATH:$MCDDIR:$MCDDIR/plugins . functions.sh +. downloader.sh -MCDVERSION="20170609" -#multicd.sh June 9, 2017 -#Copyright (c) 2017 Isaac Schemm +MCDVERSION="20221119" +#multicd.sh November 19, 2022 +#Copyright (c) 2022 Isaac Schemm # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -101,6 +102,10 @@ if [ "$1" = "give-error" ];then exit 1 fi +if [ "$1" = "download" ];then + downloadisos +fi + #if getopt -T > /dev/null;then # echo "You have a non-GNU getopt. Don't use an output path with spaces in it." ARGS=$(getopt cdmviVo:tw $*) @@ -108,7 +113,7 @@ fi # ARGS=$(getopt cdmviVo:tw "$@") #fi export MD5=false -export MEMTEST=true +export MEMTEST=false export VERBOSE=true export INTERACTIVE=false export DEBUG=false @@ -121,7 +126,6 @@ for i do -c) shift;export MD5=true;; -d) shift;export DEBUG=true;; -i) shift;export INTERACTIVE=true;; - -m) shift;export MEMTEST=false;; -o) shift;export OUTPUT="$1";shift;; -t) shift;export TESTISO=true;; -v) shift;export VERBOSE=true;; @@ -136,6 +140,10 @@ if echo "${OUTPUT}" | grep -q "/";then echo "The -o option must be either a filename without an extension (.iso will be appended) or an absolute path." exit 1 fi + if ! (echo "${OUTPUT}" | tail -c 4 | grep -q iso);then + echo "The -o option does not accept paths with spaces. If an absolute path is used, the .iso extension is required." + exit 1 + fi OUTPUTPATH="${OUTPUT}" else # Filename @@ -218,9 +226,6 @@ done if [ -f grub.exe ];then echo "GRUB4DOS" fi -if $MEMTEST;then - echo "Memtest86+" -fi if [ $EXTRACTOR == file-roller ];then FRVER=$(file-roller --version 2>/dev/null|awk '{print $2}'|head -c 3) @@ -440,34 +445,9 @@ cp /tmp/syslinux-*/bios/com32/elflink/ldlinux/ldlinux.c32 "${WORK}"/boot/isolinu cp /tmp/syslinux-*/bios/com32/chain/chain.c32 "${WORK}"/boot/isolinux/ cp /tmp/syslinux-*/bios/com32/libutil/libutil.c32 "${WORK}"/boot/isolinux/ cp /tmp/syslinux-*/bios/com32/lib/libcom32.c32 "${WORK}"/boot/isolinux/ -cp /tmp/syslinux-*/bios/utils/isohybrid "${TAGS}"/isohybrid chmod -R +w "$WORK/boot/isolinux" -chmod +x "${TAGS}"/isohybrid rm -r /tmp/syslinux-*/ -if $MEMTEST;then - if [ -f memtest ] && [ -f memtestver ] && [ "$(cat memtestver)" = "v4.20" ];then - rm memtest - rm memtestver - fi - if [ -f memtest ] && [ -f memtestver ] && [ "$(wc -c memtest)" != "0" ];then - cp memtest "${WORK}"/boot/memtest - else - echo "Downloading memtest86+ 5.01 from memtest.org..." - if $VERBOSE;then - wget -O- http://www.memtest.org/download/5.01/memtest86+-5.01.bin.gz|gzip -cd>memtest - else - wget -qO- http://www.memtest.org/download/5.01/memtest86+-5.01.bin.gz|gzip -cd>memtest - fi - if [ -f memtest ] && [ "$(wc -c memtest)" != "0 memtest" ];then - cp memtest "${WORK}"/boot/memtest - echo 'v5.01' > memtestver - else - echo "Download of memtest failed." - fi - fi -fi - echo "Writing isolinux.cfg..." ##BEGIN ISOLINUX MENU CODE## @@ -567,14 +547,6 @@ com32 menu.c32 append games.cfg">>"${WORK}"/boot/isolinux/isolinux.cfg fi #END GAMES ENTRY# - -#BEGIN MEMTEST ENTRY# -if [ -f "${WORK}"/boot/memtest ];then -echo "label memtest -menu label ^Memtest86+ $(cat memtestver) -kernel /boot/memtest">>"${WORK}"/boot/isolinux/isolinux.cfg -fi -#END MEMTEST ENTRY# ##END ISOLINUX MENU CODE## if [ $GAMES = 1 ];then @@ -685,27 +657,12 @@ $GENERATOR -o "${OUTPUTPATH}" \ -V "$CDLABEL" "${WORK}"/ rm -rf "${WORK}"/ -# try to find a working version of isohybrid -ISOHYBRID="${TAGS}/isohybrid" -{ - trap '' ERR - "${TAGS}"/isohybrid &> /dev/null - if [ $? = 127 ];then - echo "Could not run downloaded isohybrid (it's probably 32-bit) - looking for installed version..." - rm "$TAGS"/isohybrid - ihpath="$(which isohybrid)" - if [ -z "$ihpath" ];then - echo "WARNING: isohybrid not found." - echo "Install isohybrid (syslinux) to use your multicd on a USB drive" - else - ln -s $ihpath "$TAGS"/isohybrid - fi - fi -} -if [ -f "${TAGS}/isohybrid" ];then +if [ -n "$(which isohybrid)" ];then echo "Running isohybrid..." - "${TAGS}/isohybrid" ""${OUTPUT}"" 2> /dev/null || echo "isohybrid gave an error status of $?. The ISO might not work on a flash drive." - rm "${TAGS}"/isohybrid + isohybrid "${OUTPUTPATH}" 2> /dev/null || echo "isohybrid gave an error status of $?. The ISO might not work on a flash drive." +else + echo "WARNING: isohybrid not found." + echo "Install isohybrid (from the syslinux-utils package) to use your multicd on a USB drive" fi if [ $(whoami) == "root" ];then diff --git a/plugins/arch.sh b/plugins/arch.sh index 53f1b9a..b0820fe 100755 --- a/plugins/arch.sh +++ b/plugins/arch.sh @@ -38,6 +38,7 @@ elif [ $1 = copy ];then echo "Copying Arch Linux..." mcdmount arch mcdcp -r -T "${MNT}"/arch/arch "${WORK}"/arch + mcdcp -r "${MNT}"/arch/syslinux "${WORK}"/arch/boot/ umcdmount arch fi elif [ $1 = writecfg ];then diff --git a/plugins/bodhi.sh b/plugins/bodhi.sh new file mode 100755 index 0000000..c60ebc8 --- /dev/null +++ b/plugins/bodhi.sh @@ -0,0 +1,8 @@ +#!/bin/sh +#Bodhi Linux plugin for multicd.sh +#https://www.bodhilinux.com/ +#version 20191102 +if [ $1 = links ];then + echo "bodhi-*-32.iso bodhilinux.casper.iso Bodhi_Linux_(*)" + echo "bodhi-*-64.iso bodhilinux.casper.iso Bodhi_Linux_(*)" +fi diff --git a/plugins/caine.sh b/plugins/caine.sh index 4bf5f92..b9ea929 100755 --- a/plugins/caine.sh +++ b/plugins/caine.sh @@ -2,8 +2,8 @@ set -e . "${MCDDIR}"/functions.sh #Caine plugin for multicd.sh -#version 6.9 -#Copyright (c) 2011 Isaac Schemm +#version 20190527 +#Copyright (c) 2019 Isaac Schemm # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -22,37 +22,28 @@ set -e #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN #THE SOFTWARE. -if [ $1 = scan ];then - if [ -f caine.iso ];then - echo "Caine" - fi +if [ $1 = links ];then + echo "caine*.iso caine.casper.iso Caine_*" +elif [ $1 = scan ];then + true elif [ $1 = copy ];then - if [ -f caine.iso ];then - echo "Copying Caine..." - mcdmount caine - cp -r "${MNT}"/caine/casper "${WORK}"/boot/caine #Live system - cp "${MNT}"/caine/README.diskdefines "${WORK}"/ + if [ -f caine.casper.iso ];then + echo "Copying Caine (extra files/folders)..." + mcdmount caine.casper mkdir "${WORK}"/CaineFiles - for item in AutoPlay autorun.exe autorun.inf comdlg32.ocx files license.txt page5 preseed Programs RegOcx4Vista.bat rw_common tabctl32.ocx vbrun60.exe WinTaylor.exe; do - [[ -a "${MNT}"/caine/$item ]] && cp -r "${MNT}"/caine/$item "${WORK}"/CaineFiles - done - umcdmount caine + ls "${MNT}"/caine.casper | while read i;do + if [ "$i" = "casper" ];then + true + else + mcdcp -r "${MNT}/caine.casper/${i}" "${WORK}"/CaineFiles + fi + done + umcdmount caine.casper fi elif [ $1 = writecfg ];then - if [ -f "${TAGS}"/lang ];then - LANGCODE=$(cat "${TAGS}"/lang) - else - LANGCODE=en - fi - if [ -f caine.iso ];then - echo "label caine2 (Computer Aided Investigative Environment) - kernel /boot/caine/vmlinuz - initrd /boot/caine/initrd.gz - append live-media-path=/boot/caine ignore_uuid noprompt persistent BOOT_IMAGE=/casper/vmlinuz file=/cdrom/CaineFiles/custom.seed boot=casper -- debian-installer/language=$LANGCODE console-setup/layoutcode=$LANGCODE - " >> "${WORK}"/boot/isolinux/isolinux.cfg - fi + true else - echo "Usage: $0 {scan|copy|writecfg}" + echo "Usage: $0 {links|scan|copy|writecfg}" echo "Use only from within multicd.sh or a compatible script!" echo "Don't use this plugin script on its own!" fi diff --git a/plugins/casper.sh b/plugins/casper.sh old mode 100644 new mode 100755 index 588e32d..942c657 --- a/plugins/casper.sh +++ b/plugins/casper.sh @@ -2,8 +2,8 @@ set -e . "${MCDDIR}"/functions.sh #Casper plugin for multicd.sh -#version 20121113 -#Copyright (c) 2012 Isaac Schemm +#version 20221119 +#Copyright (c) 2022 Isaac Schemm # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -84,8 +84,10 @@ elif [ $1 = copy ];then UBUCFG=text.cfg elif [ -f "${MNT}"/$BASENAME/isolinux/txt.cfg ];then UBUCFG=txt.cfg + elif [ -f "${MNT}"/$BASENAME/isolinux/menuentries.cfg ];then + UBUCFG=menuentries.cfg #e.g. Zorin else - UBUCFG=isolinux.cfg #For custom-made live CDs like Weaknet and Zorin + UBUCFG=isolinux.cfg fi cp "${MNT}"/$BASENAME/isolinux/splash.* \ "${MNT}"/$BASENAME/isolinux/bg_redo.png \ diff --git a/plugins/clonezilla.sh b/plugins/clonezilla.sh index 932009c..e4e3213 100755 --- a/plugins/clonezilla.sh +++ b/plugins/clonezilla.sh @@ -52,9 +52,10 @@ elif [ $1 = copy ];then echo "Copying Clonezilla ($i)..." BASENAME=$(echo $i|sed -e 's/\.iso//g') mcdmount $BASENAME - cp "${MNT}"/$BASENAME/*linux/ocswp.png "${WORK}"/boot/isolinux/ocswp.png #Boot menu logo + cp "${MNT}"/$BASENAME/*linux/ocswp.png "${WORK}"/boot/isolinux/ocswp.png || true #Boot menu logo cp -r "${MNT}"/$BASENAME/live "${WORK}"/boot/$BASENAME #Another Debian Live-based ISO - cp "${MNT}"/$BASENAME/C* "${WORK}"/boot/$BASENAME #PDV Clonezilla-Live-Version and COPYING files + cp "${MNT}"/$BASENAME/Clonezilla-Live-Version "${WORK}"/boot/$BASENAME #PDV Clonezilla-Live-Version file + cp "${MNT}"/$BASENAME/GPL "${WORK}"/boot/$BASENAME #PDV GPL file cp "${MNT}"/$BASENAME/*linux/isolinux.cfg "${WORK}"/boot/isolinux/cz-$BASENAME.cfg #PDV umcdmount $BASENAME fi @@ -68,15 +69,12 @@ elif [ $1 = writecfg ];then sed -i -e 's/\/live\//\/boot\/'$BASENAME'\//g' "${WORK}"/boot/isolinux/cz-$BASENAME.cfg #Change directory to /boot/clonezilla sed -i -e 's/append initrd=/append live-media-path=\/boot\/'$BASENAME' initrd=/g' "${WORK}"/boot/isolinux/cz-$BASENAME.cfg #Tell the kernel we moved it if [ -f "${TAGS}"/country ]; then #PDV - if [ $(cat "${TAGS}"/country) = "be" ];then - sed -i -e 's/ocs_live_keymap=""/ocs_live_keymap="\/usr\/share\/keymaps\/i386\/azerty\/be2-latin1.kmap.gz"/' "${WORK}"/boot/isolinux/cz-$BASENAME.cfg #set keymap - fi + sed -i -e 's/keyboard-layouts=/keyboard-layouts="'$(cat "${TAGS}"/country)'"/' "${WORK}"/boot/isolinux/cz-$BASENAME.cfg #set keymap fi if [ -f "${TAGS}"/lang-full ]; then #PDV - sed -i -e 's/ocs_lang=""/ocs_lang="'$(cat "${TAGS}"/lang-full)'.UTF-8"/' "${WORK}"/boot/isolinux/cz-$BASENAME.cfg #menu language + sed -i -e 's/locales=/locales="'$(cat "${TAGS}"/lang-full)'.UTF-8"/' "${WORK}"/boot/isolinux/cz-$BASENAME.cfg #menu language fi ls "${WORK}"/boot/isolinux/cz-$BASENAME.cfg - ##sed -i -e 's/[[:blank:]]ip=frommedia[[:blank:]]/ /' "${WORK}"/boot/isolinux/clonezil$BASENAME.cfg #PDV get ip via dhcp if $MEMTEST; then #PDV remove memtest if already in main menu sed -i -e '/MENU BEGIN Memtest/,/MENU END/ s/MENU END//' -e '/MENU BEGIN Memtest/,/ENDTEXT/d' -e '/./,/^$/!d' "${WORK}"/boot/isolinux/cz-$BASENAME.cfg rm "${WORK}"/boot/$BASENAME/memtest diff --git a/plugins/debian-live.sh b/plugins/debian-live.sh index 9dc0b52..94c012a 100755 --- a/plugins/debian-live.sh +++ b/plugins/debian-live.sh @@ -2,8 +2,8 @@ set -e . "${MCDDIR}"/functions.sh #Debian Live plugin for multicd.sh -#version 20140410 -#Copyright (c) 2014 Isaac Schemm +#version 20180130 +#Copyright (c) 2018 Isaac Schemm # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -72,6 +72,7 @@ elif [ $1 = copy ];then mcdmount $BASENAME cp "${MNT}"/$BASENAME/isolinux/live.cfg "${WORK}"/boot/isolinux/$BASENAME.cfg || cp "${MNT}"/$BASENAME/boot/live.cfg "${WORK}"/boot/isolinux/$BASENAME.cfg || + cp "${MNT}"/$BASENAME/isolinux/menu.cfg "${WORK}"/boot/isolinux/$BASENAME.cfg || cp "${MNT}"/$BASENAME/isolinux/isolinux.cfg "${WORK}"/boot/isolinux/$BASENAME.cfg sed -i -e 's/default vesamenu.c32/default menu.c32/g' "${WORK}"/boot/isolinux/$BASENAME.cfg LIVEFOLDER=$BASENAME @@ -87,7 +88,7 @@ elif [ $1 = copy ];then fi fi mkdir "${WORK}"/$LIVEFOLDER - mcdcp -rv "${MNT}"/$BASENAME/live/* "${WORK}"/$LIVEFOLDER + mcdcp -r "${MNT}"/$BASENAME/live/* "${WORK}"/$LIVEFOLDER umcdmount $BASENAME done if [ -f "${WORK}"/live/memtest ];then diff --git a/plugins/debian-mini.sh b/plugins/debian-mini.sh index 8d10d29..9dd3bce 100755 --- a/plugins/debian-mini.sh +++ b/plugins/debian-mini.sh @@ -38,7 +38,7 @@ elif [ $1 = copy ];then elif [ $1 = writecfg ];then if [ -f debian-mini.iso ];then DEBNAME="Debian GNU/Linux mini netinst (i386)" -echo "menu begin -->^DEBNAME +echo "menu begin -->^$DEBNAME label ^Install Debian kernel /boot/debian/linux diff --git a/plugins/debian-mini64.sh b/plugins/debian-mini64.sh index 0cc18eb..23280e6 100755 --- a/plugins/debian-mini64.sh +++ b/plugins/debian-mini64.sh @@ -30,9 +30,9 @@ elif [ $1 = copy ];then if [ -f debian-mini64.iso ];then echo "Copying Debian netboot installer (amd64)..." mcdmount debian-mini64 - mkdir "${WORK}"/boot/debian - cp "${MNT}"/debian-mini64/linux "${WORK}"/boot/debian/linux - cp "${MNT}"/debian-mini64/initrd.gz "${WORK}"/boot/debian/initrd.gz + mkdir -p "${WORK}"/boot/debian64 + cp "${MNT}"/debian-mini64/linux "${WORK}"/boot/debian64/linux + cp "${MNT}"/debian-mini64/initrd.gz "${WORK}"/boot/debian64/initrd.gz umcdmount debian-mini64 fi elif [ $1 = writecfg ];then @@ -41,11 +41,11 @@ DEBNAME="Debian GNU/Linux mini netinst (amd64)" echo "menu begin -->^$DEBNAME label ^Install Debian - kernel /boot/debian/linux - append vga=normal initrd=/boot/debian/initrd.gz -- quiet + kernel /boot/debian64/linux + append vga=normal initrd=/boot/debian64/initrd.gz -- quiet label ^Install Debian - expert mode - kernel /boot/debian/linux - append priority=low vga=normal initrd=/boot/debian/initrd.gz -- + kernel /boot/debian64/linux + append priority=low vga=normal initrd=/boot/debian64/initrd.gz -- menu end" >> "${WORK}"/boot/isolinux/isolinux.cfg fi diff --git a/plugins/krd.sh b/plugins/krd.sh new file mode 100755 index 0000000..d6f5877 --- /dev/null +++ b/plugins/krd.sh @@ -0,0 +1,98 @@ +#!/bin/sh +set -e +. "${MCDDIR}"/functions.sh +#Kapersky Rescue Disk 18 plugin for multicd.sh +#version 20180621 +#Copyright (c) 2018 Isaac Schemm +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. +if [ $1 = scan ];then + if [ -f krd.iso ];then + echo "Kapersky Rescue Disk" + fi +elif [ $1 = copy ];then + if [ -f krd.iso ];then + echo "Copying Kapersky Rescue Disk..." + mcdmount krd + mkdir "${WORK}"/boot/krd + # Kernel, initrd + mcdcp "${MNT}"/krd/boot/grub/k-x86 "${WORK}"/boot/krd + mcdcp "${MNT}"/krd/boot/grub/k-x86_64 "${WORK}"/boot/krd + mcdcp "${MNT}"/krd/boot/grub/initrd.xz "${WORK}"/boot/krd + # Filesystem + mcdcp -r "${MNT}"/krd/data "${WORK}" + umcdmount krd + fi +elif [ $1 = writecfg ];then + if [ -f krd.iso ];then + if [ -f "${TAGS}"/lang ];then + LANGCODE=$(cat "${TAGS}"/lang) + else + LANGCODE=en + fi + echo "menu begin --> ^Kapersky Rescue Disk + + label kav64 + menu label (x86_64) Kaspersky Rescue Disk. Graphic mode + kernel /boot/krd/k-x86_64 + initrd /boot/krd/initrd.xz + append net.ifnames=0 lang=$LANGCODE dostartx + + label kav64nomodeset + menu label (x86_64) Kaspersky Rescue Disk. Limited graphic mode + kernel /boot/krd/k-x86_64 + initrd /boot/krd/initrd.xz + append net.ifnames=0 nomodeset lang=$LANGCODE dostartx + + label kav64hardwareinfo + menu label (x86_64) Hardware Info + kernel /boot/krd/k-x86_64 + initrd /boot/krd/initrd.xz + append net.ifnames=0 lang=$LANGCODE docache loadsrm=000-core.srm,003-kl.srm nox hwinfo docheck + + label kav32 + menu label (x86) Kaspersky Rescue Disk. Graphic mode + kernel /boot/krd/k-x86 + initrd /boot/krd/initrd.xz + append net.ifnames=0 lang=$LANGCODE dostartx + + label kav32nomodeset + menu label (x86) Kaspersky Rescue Disk. Limited graphic mode + kernel /boot/krd/k-x86 + initrd /boot/krd/initrd.xz + append net.ifnames=0 nomodeset lang=$LANGCODE dostartx + + label kav32hardwareinfo + menu label (x86) Hardware Info + kernel /boot/krd/k-x86 + initrd /boot/krd/initrd.xz + append net.ifnames=0 lang=$LANGCODE docache loadsrm=000-core.srm,003-kl.srm nox hwinfo docheck + + label back + menu label ^Back to main menu + com32 menu.c32 + append isolinux.cfg + + menu end" >> "${WORK}"/boot/isolinux/isolinux.cfg + fi +else + echo "Usage: $0 {links|scan|copy|writecfg}" + echo "Use only from within multicd.sh or a compatible script!" + echo "Don't use this plugin script on its own!" +fi diff --git a/plugins/parrot.sh b/plugins/parrot.sh new file mode 100755 index 0000000..02ea659 --- /dev/null +++ b/plugins/parrot.sh @@ -0,0 +1,7 @@ +#!/bin/sh +#Parrot OS plugin for multicd.sh +#https://parrotlinux.org/ +#version 20191102 +if [ $1 = links ];then + echo "Parrot-*_x64.iso parrot.debian.iso Parrot_(*)" +fi diff --git a/plugins/puppy.sh b/plugins/puppy.sh index 1450ece..86c81e7 100755 --- a/plugins/puppy.sh +++ b/plugins/puppy.sh @@ -36,6 +36,7 @@ if [ $1 = links ];then echo "racy-*.iso racy.puppy.iso none" echo "slacko-*.iso slacko.puppy.iso Slacko_*" echo "tahr-*.iso tahr.puppy.iso Tahrpup_*" + echo "fossa-*.iso fossa.puppy.iso Fossapup_*" elif [ $1 = scan ];then if $(puppyExists);then for i in *.puppy.iso;do echo "Puppy Linux" diff --git a/plugins/reactos.sh b/plugins/reactos.sh new file mode 100755 index 0000000..55d4a8d --- /dev/null +++ b/plugins/reactos.sh @@ -0,0 +1,51 @@ +#!/bin/sh +set -e +. "${MCDDIR}"/functions.sh +#ReactOS plugin for multicd.sh +#version 20190608 +#Copyright (c) 2019 Isaac Schemm +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. +if [ $1 = links ];then + echo "ReactOS-*.iso reactos.iso ReactOS" +elif [ $1 = scan ];then + if [ -f reactos.iso ];then + echo "ReactOS" + fi +elif [ $1 = copy ];then + if [ -f reactos.iso ];then + echo "Copying ReactOS..." + mcdmount reactos + mcdcp -r -n "${MNT}"/reactos/loader "${WORK}"/ + if [ -d "${MNT}"/reactos/Profiles ];then + mcdcp -r -n "${MNT}"/reactos/Profiles "${WORK}"/ + fi + mcdcp -r -n "${MNT}"/reactos/reactos "${WORK}"/ + cp -n "${MNT}"/reactos/freeldr.ini "${WORK}"/ + umcdmount reactos + fi +elif [ $1 = writecfg ];then + if [ -f reactos.iso ];then + echo "label reactos + menu label ^ReactOS $(getVersion reactos) + kernel /loader/isoboot.bin" >> "${WORK}"/boot/isolinux/isolinux.cfg + fi +else + echo "Usage: $0 {links|scan|copy|writecfg}" +fi diff --git a/plugins/sysresccd.sh b/plugins/sysresccd.sh new file mode 100755 index 0000000..daebc1c --- /dev/null +++ b/plugins/sysresccd.sh @@ -0,0 +1,53 @@ +#!/bin/sh +set -e +. "${MCDDIR}"/functions.sh +#SystemRescueCd plugin for multicd.sh +#version 20190303 +#Copyright (c) 2010-2019 Isaac Schemm and Pascal De Vuyst +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. +if [ $1 = links ];then + echo "systemrescuecd-6*.iso sysresccd.iso none" +elif [ $1 = scan ];then + if [ -f sysresccd.iso ];then + echo "SystemRescueCd" + fi +elif [ $1 = copy ];then + if [ -f sysresccd.iso ];then + echo "Copying SystemRescueCd..." + mcdmount sysresccd + mkdir "${WORK}"/sysresccd + mcdcp -r "${MNT}"/sysresccd/sysresccd/* "${WORK}"/sysresccd + for i in "${WORK}"/sysresccd/boot/syslinux/*.cfg;do + sed -i -e "s/archisolabel=/archisolabel=$CDLABEL originalwas=/g" "$i" + done + umcdmount sysresccd + fi +elif [ $1 = writecfg ];then +if [ -f sysresccd.iso ];then +echo "label sysresccd +menu label --> ^SystemRescueCd +config /sysresccd/boot/syslinux/sysresccd.cfg /sysresccd +" >> "${WORK}"/boot/isolinux/isolinux.cfg +fi +else + echo "Usage: $0 {links|scan|copy|writecfg}" + echo "Use only from within multicd.sh or a compatible script!" + echo "Don't use this plugin script on its own!" +fi diff --git a/plugins/trk.sh b/plugins/trk.sh index 46ea3cd..7aa87c3 100755 --- a/plugins/trk.sh +++ b/plugins/trk.sh @@ -2,8 +2,9 @@ set -e . "${MCDDIR}"/functions.sh #Trinity Rescue Kit plugin for multicd.sh -#version 20150622 -#Copyright (c) 2015 Isaac Schemm +#version 20190810 +#edited to fit newer version of trk +#Copyright (c) 2015-2019 Isaac Schemm et al # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -22,6 +23,7 @@ set -e #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN #THE SOFTWARE. + if [ $1 = links ];then echo "trinity-rescue-kit.*.iso trk.iso none" elif [ $1 = scan ];then @@ -33,11 +35,22 @@ elif [ $1 = copy ];then echo "Copying Trinity Rescue Kit..." mcdmount trk cp -r "${MNT}"/trk/trk3 "${WORK}"/ #TRK files - mkdir "${WORK}"/boot/trinity - cp "${MNT}"/trk/syslinux.cfg "${WORK}"/boot/isolinux/trk.menu - cp "${MNT}"/trk/kernel.trk "${WORK}"/boot/trinity/kernel.trk - cp "${MNT}"/trk/initrd.trk "${WORK}"/boot/trinity/initrd.trk - cp "${MNT}"/trk/bootlogo.jpg "${WORK}"/boot/isolinux/trklogo.jpg #Boot logo + if [ ! -f "${MNT}"/trk/disableautorun.exe ];then + echo New Build Detected + mkdir "${WORK}"/boot/trinity + cp "${MNT}"/trk/isolinux/syslinux.cfg "${WORK}"/boot/isolinux/trk.menu + cp "${MNT}"/trk/isolinux/kernel.trk "${WORK}"/boot/trinity/kernel.trk + cp "${MNT}"/trk/isolinux/initrd.trk "${WORK}"/boot/trinity/initrd.trk + cp "${MNT}"/trk/isolinux/bootlogo.jpg "${WORK}"/boot/isolinux/trklogo.jpg #Boot logo + else + echo Old Build Detected + mkdir "${WORK}"/boot/trinity + cp "${MNT}"/trk/syslinux.cfg "${WORK}"/boot/isolinux/trk.menu + cp "${MNT}"/trk/kernel.trk "${WORK}"/boot/trinity/kernel.trk + cp "${MNT}"/trk/initrd.trk "${WORK}"/boot/trinity/initrd.trk + cp "${MNT}"/trk/bootlogo.jpg "${WORK}"/boot/isolinux/trklogo.jpg #Boot logo + fi + umcdmount trk fi elif [ $1 = writecfg ];then diff --git a/plugins/ubuntu-alternate.sh b/plugins/ubuntu-alternate.sh index d4e1636..588b774 100755 --- a/plugins/ubuntu-alternate.sh +++ b/plugins/ubuntu-alternate.sh @@ -1,9 +1,9 @@ #!/bin/sh set -e . "${MCDDIR}"/functions.sh -#Ubuntu alternate install CD plugin for multicd.sh -#version 20121113 -#Copyright (c) 2012 Isaac Schemm +#Ubuntu alternate/server install CD plugin for multicd.sh +#version 20181227 +#Copyright (c) 2012-2018 Isaac Schemm # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -41,13 +41,22 @@ elif [ $1 = scan ];then elif [ $1 = copy ];then if [ -f ubuntu-alternate.iso ];then if [ -d "${WORK}"/pool ];then - echo "NOT copying Ubuntu alternate installer - some sort of Ubuntu/Debian installer is already present." - touch "${TAGS}"/ubuntu-not-copied + echo "Not copying Ubuntu alternate/server installer - some sort of Ubuntu/Debian installer is already present." + exit 1 else echo "Copying Ubuntu alternate installer..." mcdmount ubuntu-alternate - cp "${MNT}"/ubuntu-alternate/cdromupgrade "${WORK}" 2>&1 || true #Not essential + cp "${MNT}"/ubuntu-alternate/cdromupgrade "${WORK}" 2>/dev/null || true #Not essential cp -r "${MNT}"/ubuntu-alternate/.disk "${WORK}" + echo "Ubuntu (MultiCD)" > "${WORK}"/.disk/info + if [ -d "${MNT}"/ubuntu-alternate/casper ];then + if [ -d "${WORK}"/casper ];then + echo "There is a conflict on the live CD. The Ubuntu alternate/server installer needs to use /casper folder, but it already exists." + exit 1 + fi + mkdir "${WORK}"/casper + cp -r "${MNT}"/ubuntu-alternate/casper/* "${WORK}"/casper + fi cp -r "${MNT}"/ubuntu-alternate/dists "${WORK}" cp -r "${MNT}"/ubuntu-alternate/doc "${WORK}" || true cp -r "${MNT}"/ubuntu-alternate/install "${WORK}" @@ -58,11 +67,12 @@ elif [ $1 = copy ];then if [ ! -e "${MNT}"/ubuntu-alternate/ubuntu ];then ln -s . "${MNT}"/ubuntu-alternate/ubuntu fi + cp "${MNT}"/ubuntu-alternate/isolinux/txt.cfg "${WORK}"/boot/isolinux/ubuntu-alternate.cfg umcdmount ubuntu-alternate fi fi elif [ $1 = writecfg ];then -if [ -f ubuntu-alternate.iso ] && [ ! -f "${TAGS}"/ubuntu-not-copied ];then +if [ -f ubuntu-alternate.iso ];then cd "$WORK" PRESEED=$(echo preseed/*ubuntu*|awk '{print $1}') cd - @@ -71,23 +81,9 @@ if [ -f "${WORK}"/README.diskdefines ];then else CDNAME="Ubuntu alternate installer" fi -echo "menu begin --> ^$CDNAME - -label install - menu label ^Install Ubuntu - kernel /install/vmlinuz - append file=/cdrom/$PRESEED vga=788 initrd=/install/initrd.gz quiet -- - -label expert - menu label ^Expert install - kernel /install/vmlinuz - append file=/cdrom/$PRESEED priority=low vga=788 initrd=/install/initrd.gz -- -label rescue - menu label ^Rescue a broken system - kernel /install/vmlinuz - append rescue/enable=true vga=788 initrd=/install/initrd.gz -- - -menu end" >> "${WORK}"/boot/isolinux/isolinux.cfg +echo "menu begin --> ^$CDNAME" >> "${WORK}"/boot/isolinux/isolinux.cfg +cat "${WORK}"/boot/isolinux/ubuntu-alternate.cfg | sed -e 's/^default .*//g' >> "${WORK}"/boot/isolinux/isolinux.cfg +echo "menu end" >> "${WORK}"/boot/isolinux/isolinux.cfg fi else echo "Usage: $0 {links|scan|copy|writecfg}" diff --git a/plugins/ubuntu.sh b/plugins/ubuntu.sh index 7b164f3..a2d370c 100755 --- a/plugins/ubuntu.sh +++ b/plugins/ubuntu.sh @@ -2,8 +2,8 @@ set -e . "${MCDDIR}"/functions.sh #Ubuntu plugin for multicd.sh -#version 20121113 -#Copyright (c) 2012 Isaac Schemm +#version 20181226 +#Copyright (c) 2012-2018 Isaac Schemm et al # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -54,16 +54,56 @@ getUbuntuName () { #END FUNCTIONS# if [ $1 = links ];then - echo "ubuntu-*-desktop-i386.iso i386.ubuntu.iso Ubuntu_(32-bit)_*" - echo "ubuntu-*-desktop-amd64.iso amd64.ubuntu.iso Ubuntu_(64-bit)_*" - echo "kubuntu-*-desktop-i386.iso i386.k.ubuntu.iso Kubuntu_(32-bit)_*" - echo "kubuntu-*-desktop-amd64.iso amd64.k.ubuntu.iso Kubuntu_(64-bit)_*" - echo "xubuntu-*-desktop-i386.iso i386.x.ubuntu.iso Xubuntu_(32-bit)_*" - echo "xubuntu-*-desktop-amd64.iso amd64.x.ubuntu.iso Xubuntu_(64-bit)_*" - echo "edubuntu-*-dvd-i386.iso i386.x.ubuntu.iso Edubuntu_(32-bit)_*" - echo "edubuntu-*-dvd-amd64.iso amd64.x.ubuntu.iso Edubuntu_(64-bit)_*" - echo "lubuntu-*-desktop-i386.iso i386.l.ubuntu.iso Lubuntu_(32-bit)_*" - echo "lubuntu-*-desktop-amd64.iso amd64.l.ubuntu.iso Lubuntu_(64-bit)_*" + for i in *ubuntu*.iso; do + if [ "$i" = '*ubuntu*.iso' ];then + continue + fi + # stheno - This processes the iso name into usable chunks for other purposes. + # This is key in the start for allowing multiple Ubuntu desktop flavors. + BASENAME=$(echo $i|sed -e 's/\.iso//g') + TYPETEMP1=`echo $BASENAME | sed 's/ubuntu.*//g'` + TYPETEMP2=`echo $BASENAME | sed 's/.*ubuntu-//g' | sed 's/[0-9].*//g' | sed 's/\-//g'` + VERSIONPRE=`echo $BASENAME | sed 's/.*ubuntu-[^0-9]*//g'` + VERSIONPOST=`echo $VERSIONPRE | sed 's/-.*//g'` + ARCHPRE=`echo $BASENAME | sed "s/.*ubuntu-[^0-9]*"${VERSIONPOST}"-//g"` + ARCHPOST=`echo $ARCHPRE | sed 's/.*-//g'` + PLATPRE=`echo $BASENAME | sed "s/.*ubuntu-[^0-9]*"${VERSIONPOST}"-//g"` + PLATPOST=`echo $PLATPRE | sed "s/-$ARCHPOST*//g"` + if [ "${TYPETEMP1}" ];then + TYPE="${TYPETEMP1}." + TYPELABEL=$(echo $TYPETEMP1 | sed 's/./\U&/')ubuntu + elif [ "${TYPETEMP2}" ];then + TYPE="${TYPETEMP2}." + TYPELABEL="Ubuntu-$(echo $TYPETEMP2 | sed 's/\-//g')" + TYPETEMP2="-${TYPETEMP2}" + else + TYPE="" + TYPELABEL="Ubuntu" + fi + if [ "${ARCHPOST}" = "i386" ];then + ARCHLABEL="(32-bit)" + elif [ "${ARCHPOST}" = "amd64" ];then + ARCHLABEL="(64-bit)" + else + ARCHLABEL="" + fi + # stheno - writes temp file to parse new menu title. + case "$BASENAME" in + *desktop*) + if [ ! "${PLATPOST}" = "server" ];then + echo "${TYPELABEL}_${VERSIONPOST}_${PLATPOST}_${ARCHLABEL}" > "${VERSIONPOST}.${ARCHPOST}.${PLATPOST}.${TYPE}ubuntu.title" + # stheno - This covers ALL links available on discovered files. + # No need to write entries that do not exist and be bound to only them. + # This facilitates multiple iso files of similar flavor but different versions or arch. + echo "${TYPETEMP1}ubuntu${TYPETEMP2}-${VERSIONPOST}-${PLATPOST}-${ARCHPOST}.iso ${VERSIONPOST}.${ARCHPOST}.${PLATPOST}.${TYPE}ubuntu.iso ${TYPELABEL}_${VERSIONPOST}_${PLATPOST}_${ARCHLABEL}" + fi + ;; + + *server*) + ;; + esac + done + elif [ $1 = scan ];then if $(ubuntuExists);then for i in *.ubuntu.iso; do @@ -77,68 +117,86 @@ elif [ $1 = copy ];then echo "Copying $(getUbuntuName)..." BASENAME=$(echo $i|sed -e 's/\.iso//g') if [ ! -z "$BASENAME" ] && [ -f $BASENAME.iso ];then - mcdmount $BASENAME - mkdir -p "${WORK}"/boot/$BASENAME - if [ -d "${MNT}"/$BASENAME/casper ];then - mcdcp -R "${MNT}"/$BASENAME/casper/* "${WORK}"/boot/$BASENAME/ #Live system - #elif [ -d "${MNT}/$BASENAME/live" ];then - # mcdcp -R "${MNT}"/$BASENAME/live/* "${WORK}"/boot/$BASENAME/ #Debian live (for Linux Mint Debian) - else - echo "Could not find a \"casper\" folder in "${MNT}"/$BASENAME." - return 1 - fi - if [ -d "${MNT}"/$BASENAME/preseed ];then - cp -R "${MNT}"/$BASENAME/preseed "${WORK}"/boot/$BASENAME - fi - # Fix the isolinux.cfg - if [ -f "${MNT}"/$BASENAME/isolinux/text.cfg ];then - UBUCFG=text.cfg - elif [ -f "${MNT}"/$BASENAME/isolinux/txt.cfg ];then - UBUCFG=txt.cfg - else - UBUCFG=isolinux.cfg #For custom-made live CDs like Weaknet and Zorin - fi - cp "${MNT}"/$BASENAME/isolinux/splash.* \ - "${MNT}"/$BASENAME/isolinux/bg_redo.png \ - "${WORK}"/boot/$BASENAME/ 2> /dev/null || true #Splash screen - only if the filename is splash.something or bg_redo.png - cp "${MNT}"/$BASENAME/isolinux/$UBUCFG "${WORK}"/boot/$BASENAME/$BASENAME.cfg - echo "label back - menu label Back to main menu - com32 menu.c32 - append /boot/isolinux/isolinux.cfg - " >> "${WORK}"/boot/$BASENAME/$BASENAME.cfg - cp "${WORK}"/boot/$BASENAME/$BASENAME.cfg a.cfg - sed -i "s@menu background @menu background /boot/$BASENAME/@g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #If it uses a splash screen, update the .cfg to show the new location - sed -i "s@MENU BACKGROUND @MENU BACKGROUND /boot/$BASENAME/@g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #uppercase - sed -i "s@default live@default menu.c32@g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Show menu instead of boot: prompt - sed -i "s@file=/cdrom/preseed/@file=/cdrom/boot/$BASENAME/preseed/@g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Preseed folder moved - not sure if ubiquity uses this - - #Remove reference to previous live media path - sed -i "s^live-media-path=[^ ]*^^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg + # stheno - Look for what types of Ubuntu installer iso we have. + # Then build accordingly, final stage in allowing multiple flavors. + case "$BASENAME" in + *desktop*) + mcdmount $BASENAME + mkdir -p "${WORK}"/boot/$BASENAME + if [ -d "${MNT}"/$BASENAME/casper ];then + mcdcp -R "${MNT}"/$BASENAME/casper/* "${WORK}"/boot/$BASENAME/ #Live system + #elif [ -d "${MNT}/$BASENAME/live" ];then + # mcdcp -R "${MNT}"/$BASENAME/live/* "${WORK}"/boot/$BASENAME/ #Debian live (for Linux Mint Debian) + else + echo "Could not find a \"casper\" folder in "${MNT}"/$BASENAME." + return 1 + fi + if [ -d "${MNT}"/$BASENAME/preseed ];then + cp -R "${MNT}"/$BASENAME/preseed "${WORK}"/boot/$BASENAME + fi + # Fix the isolinux.cfg + if [ -f "${MNT}"/$BASENAME/isolinux/text.cfg ];then + UBUCFG=text.cfg + elif [ -f "${MNT}"/$BASENAME/isolinux/txt.cfg ];then + UBUCFG=txt.cfg + else + UBUCFG=isolinux.cfg #For custom-made live CDs like Weaknet and Zorin + fi + cp "${MNT}"/$BASENAME/isolinux/splash.* \ + "${MNT}"/$BASENAME/isolinux/bg_redo.png \ + "${WORK}"/boot/$BASENAME/ 2> /dev/null || true #Splash screen - only if the filename is splash.something or bg_redo.png + cp "${MNT}"/$BASENAME/isolinux/$UBUCFG "${WORK}"/boot/$BASENAME/$BASENAME.cfg + + MENUTITLETEMP=`cat $BASENAME.title` + MENUTITLE=$(echo "$MENUTITLETEMP" | sed 's/_/ /g') + + CFGFILE=`cat "${WORK}""/boot/$BASENAME/$BASENAME".cfg` - sed -i "s^initrd=/casper/^live-media-path=/boot/$BASENAME ignore_uuid initrd=/boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Initrd moved, ignore_uuid added - sed -i "s^kernel /casper/^kernel /boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Kernel moved - sed -i "s^KERNEL /casper/^KERNEL /boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #For uppercase KERNEL + EDITS=$(echo "$CFGFILE" | \ + sed '/default live/a menu title '"$MENUTITLE" | \ + sed 's/default live/default menu.c32/g' | \ + sed 's/\/casper\//\/boot\/'"$BASENAME"'\//g' | \ + sed 's/\/cdrom\//\/boot\/'"$BASENAME"'\//g' | \ + sed 's/casper initrd/casper live-media-path=\/boot\/'"$BASENAME"' ignore_uuid initrd/g' | \ + sed 's/ubiquity initrd/ubiquity live-media-path=\/boot\/'"$BASENAME"' ignore_uuid initrd/g' | \ + sed 's/check initrd/check live-media-path=\/boot\/'"$BASENAME"' ignore_uuid initrd/g' | \ + sed 's/\/install\//\/boot\/'"$BASENAME"'\//g' | \ + sed '$ a label back' | \ + sed '$ a menu label Back to main menu' | \ + sed '$ a com32 menu.c32' | \ + sed 's/menu title/ menu title/g' | \ + sed 's/menu label/ menu label/g' | \ + sed 's/kernel / kernel /g' | \ + sed 's/KERNEL / KERNEL /g' | \ + sed 's/localboot/ localboot/g' | \ + sed 's/append / append /g' | \ + sed '$ a append /boot/isolinux/isolinux.cfg' | \ + sed 's/append \/boot/ append \/boot/g' | \ + sed 's/menu label Back/ menu label Back/g' | \ + sed 's/com32 menu.c32/ com32 menu.c32/g' + ) + echo "$EDITS" > "${WORK}"/boot/$BASENAME/$BASENAME.cfg - #Equivalents for Mint Debian - #sed -i "s^initrd=/live/^live-media-path=/boot/$BASENAME ignore_uuid initrd=/boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg - #sed -i "s^kernel /live/^kernel /boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg - #sed -i "s^KERNEL /live/^KERNEL /boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg + if [ -f "${TAGS}"/lang ];then + echo added lang + sed -i "s^initrd=/boot/$BASENAME/^debian-installer/language=$(cat "${TAGS}"/lang) initrd=/boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Add language codes to cmdline + fi + if [ -f "${TAGS}"/country ];then + echo added country + sed -i "s^initrd=/boot/$BASENAME/^console-setup/layoutcode?=$(cat "${TAGS}"/country) initrd=/boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Add language codes to cmdline + fi + + umcdmount $BASENAME + ;; - if [ -f "${TAGS}"/lang ];then - echo added lang - sed -i "s^initrd=/boot/$BASENAME/^debian-installer/language=$(cat "${TAGS}"/lang) initrd=/boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Add language codes to cmdline - fi - if [ -f "${TAGS}"/country ];then - echo added country - sed -i "s^initrd=/boot/$BASENAME/^console-setup/layoutcode?=$(cat "${TAGS}"/country) initrd=/boot/$BASENAME/^g" "${WORK}"/boot/$BASENAME/$BASENAME.cfg #Add language codes to cmdline - fi - cp "${WORK}"/boot/$BASENAME/$BASENAME.cfg b.cfg - umcdmount $BASENAME + *server*) + ;; + esac else echo "$0: \"$BASENAME\" is empty or not an ISO" exit 1 fi + rm $BASENAME.title done fi elif [ $1 = writecfg ];then diff --git a/plugins/win7.sh b/plugins/win7.sh new file mode 100755 index 0000000..8a50887 --- /dev/null +++ b/plugins/win7.sh @@ -0,0 +1,67 @@ +#!/bin/sh +set -e +. "${MCDDIR}"/functions.sh +#Windows 7 Disc plugin for multicd.sh +#version 20170620 +#Copyright for this script (c) 2011-2017 Isaac Schemm et al +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. +if [ $1 = links ];then + echo "HBCD_PE_*.iso win7.iso Hiren's_BootCD_PE" +elif [ $1 = scan ];then + if [ -f win7.iso ];then + echo "Windows 7+" + touch "${TAGS}/win7.needsname" + fi +elif [ $1 = copy ];then + if [ -f win7.iso ];then + echo "Copying Windows 7+..." + mcdmount win7 + if [ -d "${MNT}"/win7/HBCD_PE.ini ];then + cp "${MNT}"/win7/HBCD_PE.ini "${WORK}"/ + cp "${MNT}"/win7/Version.txt "${WORK}"/hirens.txt || true + fi + cp -r "${MNT}"/win7/[Bb]oot/* "${WORK}"/boot/ + cp -r "${MNT}"/win7/sources "${WORK}"/ + cp "${MNT}"/win7/bootmgr "${WORK}"/ + umcdmount win7 + fi +elif [ $1 = writecfg ];then +if [ -f win7.iso ];then + DISPLAYNAME="$(cat "${TAGS}"/win7.name)" + if [ -z "$DISPLAYNAME" ];then + DISPLAYNAME="Windows 7+" + if which isoinfo &> /dev/null;then + if isoinfo -d -i win7.iso;then + DISPLAYNAME="Windows 7+ (64-bit)" + else + DISPLAYNAME="Windows 7+ (32-bit)" + fi + fi + fi + echo "label win7 + menu label $DISPLAYNAME + kernel chain.c32 + append boot ntldr=/bootmgr">>"${WORK}"/boot/isolinux/isolinux.cfg +fi +else + echo "Usage: $0 {scan|copy|writecfg}" + echo "Use only from within multicd.sh or a compatible script!" + echo "Don't use this plugin script on its own!" +fi diff --git a/plugins/zorin.sh b/plugins/zorin.sh index 93e0d2d..f5d502a 100755 --- a/plugins/zorin.sh +++ b/plugins/zorin.sh @@ -2,7 +2,8 @@ set -e . "${MCDDIR}"/functions.sh #Zorin OS plugin for multicd.sh -#version 20161022 +#version 20221119 if [ $1 = links ];then echo "zorin-os-*.iso zorin.casper.iso Zorin_OS" + echo "Zorin-OS-*.iso zorin.casper.iso Zorin_OS" fi