mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Add FreeDOS support (#374)
* Add support for FreeDOS 1.2 to quickget * Add support for freedos guests to quickemu * Add support for FreeDOS 1.3 to quickget * Force qemu to keep booting from cd after formatting disk * Adjust VM settings * Refactor FreeDOS to use create_vm * Add FreeDOS to README * Add unzip to README as a dependency
This commit is contained in:
		
							parent
							
								
									38b086244d
								
							
						
					
					
						commit
						ebc83ebacf
					
				
					 3 changed files with 55 additions and 4 deletions
				
			
		|  | @ -86,6 +86,7 @@ Requirements | |||
| -   [xdg-user-dirs](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/) | ||||
| -   [xrandr](https://gitlab.freedesktop.org/xorg/app/xrandr) | ||||
| -   [zsync](http://zsync.moria.org.uk/) | ||||
| -   [unzip](http://www.info-zip.org/UnZip.html) | ||||
| 
 | ||||
| Usage | ||||
| ===== | ||||
|  | @ -215,10 +216,11 @@ Other Operating Systems | |||
| -   `cachyos` (CachyOS) | ||||
| -   `debian` (Debian) | ||||
| -   `devuan` (Devuan) | ||||
|     `dragonflybsd` (DragonFlyBSD) | ||||
| -    `dragonflybsd` (DragonFlyBSD) | ||||
| -   `elementary` (elementary OS) | ||||
| -   `fedora` (Fedora) | ||||
| -   `freebsd` (FreeBSD) | ||||
| -    `freedos` (FreeDOS) | ||||
| -   `garuda` (Garuda Linux) | ||||
| -   `gentoo` (Gentoo) | ||||
| -   `ghostbsd` (GhostBSD) | ||||
|  |  | |||
							
								
								
									
										10
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -463,7 +463,7 @@ function vm_boot() { | |||
| 
 | ||||
|   # Make any OS specific adjustments | ||||
|   case ${guest_os} in | ||||
|     *bsd|haiku|linux) | ||||
|     *bsd|haiku|freedos|linux) | ||||
|       CPU="-cpu host,kvm=on" | ||||
|       if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then | ||||
|         CPU="${CPU},topoext" | ||||
|  | @ -471,7 +471,7 @@ function vm_boot() { | |||
| 
 | ||||
|       if [ "${guest_os}" == "freebsd" ] || [ "${guest_os}" == "ghostbsd" ]; then | ||||
|         MOUSE="usb-mouse" | ||||
|       elif [ "${guest_os}" == "haiku" ]; then | ||||
|       elif [ "${guest_os}" == "haiku" ] || [ "${guest_os}" == "freedos" ]; then | ||||
|         MACHINE_TYPE="pc" | ||||
|         NET_DEVICE="rtl8139" | ||||
|       fi | ||||
|  | @ -933,7 +933,11 @@ function vm_boot() { | |||
|     args+=(-drive media=cdrom,index=1,file="${fixed_iso}") | ||||
|   fi | ||||
| 
 | ||||
|   if [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then | ||||
|   if [ -n "{iso}" ] && [ "${guest_os}" == "freedos" ]; then | ||||
|     # FreeDOS reboots after partitioning the disk, and QEMU tries to boot from disk after first restart | ||||
|     # This flag sets the boot order to cdrom,disk. It will persist until powering down the VM | ||||
|     args+=(-boot order=dc) | ||||
|   elif [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then | ||||
|     # Since there is bug (probably) in KolibriOS: cdrom indexes 0 or 1 make system show an extra unexisting iso, so we use index=2 | ||||
|     # shellcheck disable=SC2054 | ||||
|     args+=(-drive media=cdrom,index=2,file="${iso}") | ||||
|  |  | |||
							
								
								
									
										45
									
								
								quickget
									
										
									
									
									
								
							
							
						
						
									
										45
									
								
								quickget
									
										
									
									
									
								
							|  | @ -39,6 +39,7 @@ function pretty_name() { | |||
|     dragonflybsd)       PRETTY_NAME="DragonFlyBSD";; | ||||
|     elementary)         PRETTY_NAME="elementary OS";; | ||||
|     freebsd)            PRETTY_NAME="FreeBSD";; | ||||
|     freedos)            PRETTY_NAME="FreeDOS";; | ||||
|     garuda)             PRETTY_NAME="Garuda Linux";; | ||||
|     ghostbsd)           PRETTY_NAME="GhostBSD";; | ||||
|     kdeneon)            PRETTY_NAME="KDE Neon";; | ||||
|  | @ -166,6 +167,7 @@ function os_support() { | |||
|     elementary \ | ||||
|     fedora \ | ||||
|     freebsd \ | ||||
|     freedos \ | ||||
|     garuda \ | ||||
|     gentoo \ | ||||
|     ghostbsd \ | ||||
|  | @ -283,6 +285,11 @@ function editions_freebsd(){ | |||
|     echo disc1 dvd1 | ||||
| } | ||||
| 
 | ||||
| function releases_freedos() { | ||||
|     echo 1.2 \ | ||||
|          1.3 | ||||
| } | ||||
| 
 | ||||
| function releases_garuda() { | ||||
|     echo 220131 | ||||
| } | ||||
|  | @ -657,6 +664,9 @@ function make_vm_config() { | |||
|         haiku) | ||||
|             GUEST="haiku" | ||||
|             IMAGE_TYPE="iso";; | ||||
|         freedos) | ||||
|             GUEST="freedos" | ||||
|             IMAGE_TYPE="iso";; | ||||
|         kolibrios) | ||||
|             GUEST="kolibrios" | ||||
|             IMAGE_TYPE="iso";; | ||||
|  | @ -698,6 +708,11 @@ EOF | |||
|         case ${OS} in | ||||
|           alma|oraclelinux|rockylinux) echo "disk_size=\"32G\"" >> "${CONF_FILE}";; | ||||
|           dragonflybsd|haiku|openbsd|netbsd|slackware|tails) echo "boot=\"legacy\"" >> "${CONF_FILE}";; | ||||
|           freedos) | ||||
|             echo "boot=\"legacy\"" >> "${CONF_FILE}" | ||||
|             echo "disk_size=\"4G\"" >> "${CONF_FILE}" | ||||
|             echo "ram=\"256M\"" >> "${CONF_FILE}" | ||||
|             ;; | ||||
|           kolibrios) | ||||
|             echo "boot=\"legacy\"" >> "${CONF_FILE}" | ||||
|             echo "disk_size=\"2G\"" >> "${CONF_FILE}" | ||||
|  | @ -875,6 +890,28 @@ function get_freebsd() { | |||
|     echo "${URL}/${ISO} ${HASH}" | ||||
| } | ||||
| 
 | ||||
| function get_freedos() { | ||||
|     local HASH="" | ||||
|     local ISO="" | ||||
|     local URL="" | ||||
| 
 | ||||
|     URL="http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/${RELEASE}/official" | ||||
| 
 | ||||
|     case $RELEASE in | ||||
|         1.2) | ||||
|           ISO="FD12CD.iso" | ||||
|           HASH=$(wget -q -O- "${URL}/FD12.sha" | grep "${ISO}" | cut -d' ' -f1) | ||||
|           ;; | ||||
|         1.3) | ||||
|           ISO="FD13-LiveCD.zip" | ||||
|           HASH=$(wget -q -O- "${URL}/verify.txt" | grep -A 8 "sha256sum" | \ | ||||
|             grep "${ISO}" | cut -d' ' -f1) | ||||
|           ;; | ||||
|     esac | ||||
| 
 | ||||
|     echo "${URL}/${ISO} ${HASH}" | ||||
| } | ||||
| 
 | ||||
| function get_garuda() { | ||||
|     local EDITION="${1:-}" | ||||
|     local HASH="" | ||||
|  | @ -1657,13 +1694,21 @@ create_vm() { | |||
|     local URL="${URL_HASH[0]}" | ||||
|     local HASH="${URL_HASH[1]}" | ||||
|     local ISO="${URL##*/}" | ||||
| 
 | ||||
|     #echo "${URL}" | ||||
|     #echo "${ISO}" | ||||
|     #echo "${HASH}" | ||||
|     web_get "${URL}" "${VM_PATH}" | ||||
| 
 | ||||
|     if [ -n "${HASH}" ]; then | ||||
|       check_hash "${ISO}" "${HASH}" | ||||
|     fi | ||||
| 
 | ||||
|     if [ ${OS} == "freedos" ] && [[ $ISO =~ ".zip" ]]; then | ||||
|         unzip ${VM_PATH}/${ISO} -d ${VM_PATH} | ||||
|         ISO=$(ls ${VM_PATH} | grep -i '.iso') | ||||
|     fi | ||||
| 
 | ||||
|     make_vm_config "${ISO}" | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue