mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Add ubuntu server (#702)
* merged 577 fixed conflicts and readme Co-authored-by: funk-on-code <funk-on-code@users.noreply.github.com> * Corrected ubuntu-server implementation naming aligned releases corrected implemented daily-live maybe some more alignement and refactoring possible --------- Co-authored-by: funk-on-code <funk-on-code@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									8ee0d3a207
								
							
						
					
					
						commit
						eb8d4ec173
					
				
					 1 changed files with 57 additions and 1 deletions
				
			
		
							
								
								
									
										58
									
								
								quickget
									
										
									
									
									
								
							
							
						
						
									
										58
									
								
								quickget
									
										
									
									
									
								
							|  | @ -72,6 +72,7 @@ function pretty_name() { | ||||||
|     ubuntucinnamon)     PRETTY_NAME="Ubuntu Cinnamon";; |     ubuntucinnamon)     PRETTY_NAME="Ubuntu Cinnamon";; | ||||||
|     ubuntukylin)        PRETTY_NAME="Ubuntu Kylin";; |     ubuntukylin)        PRETTY_NAME="Ubuntu Kylin";; | ||||||
|     ubuntu-mate)        PRETTY_NAME="Ubuntu MATE";; |     ubuntu-mate)        PRETTY_NAME="Ubuntu MATE";; | ||||||
|  |     ubuntu-server)      PRETTY_NAME="Ubuntu Server";; | ||||||
|     ubuntustudio)       PRETTY_NAME="Ubuntu Studio";; |     ubuntustudio)       PRETTY_NAME="Ubuntu Studio";; | ||||||
|     ubuntu-unity)       PRETTY_NAME="Ubuntu Unity";; |     ubuntu-unity)       PRETTY_NAME="Ubuntu Unity";; | ||||||
|     vanillaos)          PRETTY_NAME="Vanilla OS";; |     vanillaos)          PRETTY_NAME="Vanilla OS";; | ||||||
|  | @ -90,6 +91,7 @@ function validate_release() { | ||||||
| 
 | 
 | ||||||
|   DISPLAY_NAME="$(pretty_name "${OS}")" |   DISPLAY_NAME="$(pretty_name "${OS}")" | ||||||
|   case ${OS} in |   case ${OS} in | ||||||
|  |     *ubuntu-server*) RELEASE_GENERATOR="releases_ubuntu-server";; | ||||||
|     *ubuntu*) RELEASE_GENERATOR="releases_ubuntu";; |     *ubuntu*) RELEASE_GENERATOR="releases_ubuntu";; | ||||||
|     *) RELEASE_GENERATOR="${1}";; |     *) RELEASE_GENERATOR="${1}";; | ||||||
|   esac |   esac | ||||||
|  | @ -229,6 +231,7 @@ function os_support() { | ||||||
|     ubuntucinnamon \ |     ubuntucinnamon \ | ||||||
|     ubuntukylin \ |     ubuntukylin \ | ||||||
|     ubuntu-mate \ |     ubuntu-mate \ | ||||||
|  |     ubuntu-server \ | ||||||
|     ubuntustudio \ |     ubuntustudio \ | ||||||
|     ubuntu-unity \ |     ubuntu-unity \ | ||||||
|     vanillaos \ |     vanillaos \ | ||||||
|  | @ -441,6 +444,7 @@ function editions_linuxmint(){ | ||||||
| function editions_lmde(){ | function editions_lmde(){ | ||||||
|     echo cinnamon |     echo cinnamon | ||||||
| } | } | ||||||
|  | 
 | ||||||
| function releases_lmde(){ | function releases_lmde(){ | ||||||
|     echo 5 |     echo 5 | ||||||
| } | } | ||||||
|  | @ -662,6 +666,14 @@ function releases_ubuntu() { | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | function releases_ubuntu-server() { | ||||||
|  |    local LTS_SUPPORT="18.04 20.04 22.04" | ||||||
|  |    local INTERIM_SUPPORT="22.10 23.04" | ||||||
|  |     echo ${LTS_SUPPORT} \ | ||||||
|  |          ${INTERIM_SUPPORT} \ | ||||||
|  |          daily-live | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function releases_vanillaos() { | function releases_vanillaos() { | ||||||
|     echo 22.10 |     echo 22.10 | ||||||
| } | } | ||||||
|  | @ -933,6 +945,15 @@ EOF | ||||||
|            # echo "1stdrive_size=\"20G\"" >> "${CONF_FILE}" # for testing |            # echo "1stdrive_size=\"20G\"" >> "${CONF_FILE}" # for testing | ||||||
|            # echo "2nddrive_size=\"20G\"" >> "${CONF_FILE}" # again, for testing |            # echo "2nddrive_size=\"20G\"" >> "${CONF_FILE}" # again, for testing | ||||||
|             ;; |             ;; | ||||||
|  |           ubuntu-server) | ||||||
|  |             # 22.04+ fails on LVM build if disk size is < 10G | ||||||
|  |             # 22.04.1 fails on auto-install if TPM is disabled | ||||||
|  |             echo "disk_size=\"10G\"" >> "${CONF_FILE}" | ||||||
|  |             echo "ram=\"4G\"" >> "${CONF_FILE}" | ||||||
|  |             if [[ "${RELEASE}" == *"22.04"* ]]; then | ||||||
|  |             echo "tpm=\"on\"" >> "${CONF_FILE}" | ||||||
|  |             fi | ||||||
|  |             ;; | ||||||
|           vanillaos) |           vanillaos) | ||||||
|           ## Minimum 50G for abroot |           ## Minimum 50G for abroot | ||||||
|            echo "disk_size=\"64G\"" >> "${CONF_FILE}" |            echo "disk_size=\"64G\"" >> "${CONF_FILE}" | ||||||
|  | @ -1715,6 +1736,33 @@ function get_truenas-core() { | ||||||
|     echo "${URL} ${HASH}" |     echo "${URL} ${HASH}" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | function get_ubuntu-server() { | ||||||
|  | 
 | ||||||
|  |       local HASH="" | ||||||
|  |       local ISO="" | ||||||
|  |       local URL="https://releases.ubuntu.com/${RELEASE}" | ||||||
|  | 
 | ||||||
|  |       if wget -q --spider "${URL}/SHA256SUMS"; then | ||||||
|  |           ISO=$(wget -q -O- "${URL}/SHA256SUMS" | grep 'live-server' | grep amd64 | grep iso | cut -d'*' -f2) | ||||||
|  |           HASH=$(wget -q -O- "${URL}/SHA256SUMS" | grep 'live-server' | grep amd64 | grep iso |cut -d' ' -f1) | ||||||
|  |       else | ||||||
|  |           ISO=$(wget -q -O- "${URL}/MD5SUMS" | grep 'live-server' | grep amd64 | grep iso | cut -d' ' -f3) | ||||||
|  |           HASH=$(wget -q -O- "${URL}/MD5SUMS" | grep 'live-server' | grep amd64 | grep iso | cut -d' ' -f1) | ||||||
|  |       fi | ||||||
|  | 
 | ||||||
|  |       if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then | ||||||
|  |           URL="https://cdimage.ubuntu.com/${OS}/${RELEASE}/current" | ||||||
|  |           ISO=$(wget -q -O- "${URL}/SHA256SUMS" | grep 'live-server' | grep amd64 | grep iso | cut -d'*' -f2) | ||||||
|  |           HASH=$(wget -q -O- "${URL}/SHA256SUMS" | grep 'live-server' | grep amd64 | grep iso |cut -d' ' -f1) | ||||||
|  |           zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso" | ||||||
|  |           make_vm_config "${OS}-devel.iso" | ||||||
|  |       else | ||||||
|  |           web_get "${URL}/${ISO}" "${VM_PATH}" | ||||||
|  |           check_hash "${ISO}" "${HASH}" | ||||||
|  |           make_vm_config "${ISO}" | ||||||
|  |       fi | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function get_ubuntu() { | function get_ubuntu() { | ||||||
|     local ISO="" |     local ISO="" | ||||||
|     local HASH="" |     local HASH="" | ||||||
|  | @ -1750,7 +1798,6 @@ function get_ubuntu() { | ||||||
|         ISO=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | cut -d' ' -f3) |         ISO=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | cut -d' ' -f3) | ||||||
|         HASH=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | cut -d' ' -f1) |         HASH=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | cut -d' ' -f1) | ||||||
|     fi |     fi | ||||||
|     #echo "${URL}/${ISO} ${HASH}" |  | ||||||
| 
 | 
 | ||||||
|     if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then |     if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then | ||||||
|         zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso" |         zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso" | ||||||
|  | @ -2319,6 +2366,11 @@ if [ -n "${2}" ]; then | ||||||
|         # macOS doesn't use create_vm() |         # macOS doesn't use create_vm() | ||||||
|         validate_release releases_macos |         validate_release releases_macos | ||||||
|         get_macos |         get_macos | ||||||
|  |     elif [[ "${OS}" == *"ubuntu-server"* ]]; then | ||||||
|  |         # (Comes before regular Ubuntu, or the code tries to download the desktop) # | ||||||
|  |         # Ubuntu doesn't use create_vm() | ||||||
|  |         validate_release releases_ubuntu-server | ||||||
|  |         get_ubuntu-server | ||||||
|     elif [[ "${OS}" == *"ubuntu"* ]]; then |     elif [[ "${OS}" == *"ubuntu"* ]]; then | ||||||
|         # Ubuntu doesn't use create_vm() |         # Ubuntu doesn't use create_vm() | ||||||
|         validate_release releases_ubuntu |         validate_release releases_ubuntu | ||||||
|  | @ -2349,6 +2401,10 @@ if [ -n "${2}" ]; then | ||||||
| else | else | ||||||
|     echo "ERROR! You must specify a release." |     echo "ERROR! You must specify a release." | ||||||
|     case ${OS} in |     case ${OS} in | ||||||
|  |       *ubuntu-server*) | ||||||
|  |         echo -n " - Releases: " | ||||||
|  |         releases_ubuntu-server | sed -Ee 's/eol-\S+//g' # hide eol releases | ||||||
|  |         ;; | ||||||
|       *ubuntu*) |       *ubuntu*) | ||||||
|         echo -n " - Releases: " |         echo -n " - Releases: " | ||||||
|         releases_ubuntu | sed -Ee 's/eol-\S+//g' # hide eol releases |         releases_ubuntu | sed -Ee 's/eol-\S+//g' # hide eol releases | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue