diff --git a/files/distros.ps1 b/files/distros.ps1 index 970211d..b5b3ac8 100644 --- a/files/distros.ps1 +++ b/files/distros.ps1 @@ -1,15 +1,15 @@ @( @{ name='Linux Mint - Cinnamon - 19.3'; - url='http://mirrors.kernel.org/linuxmint/stable/19.3/linuxmint-19.3-cinnamon-64bit.iso'; + url='http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-cinnamon-64bit.iso'; }, @{ name='Linux Mint - MATE - 19.3'; - url='http://mirrors.kernel.org/linuxmint/stable/19.3/linuxmint-19.3-mata-64bit.iso'; + url='http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-mate-64bit.iso'; }, @{ name='Linux Mint - Xfce - 19.3'; - url='http://mirrors.kernel.org/linuxmint/stable/19.3/linuxmint-19.3-xfce-64bit.iso'; + url='http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-xfce-64bit.iso'; }, @{ name='Ubuntu 18.04/LTS'; diff --git a/files/preseed.cfg b/files/preseed.cfg index d4b20ba..4dbed47 100644 --- a/files/preseed.cfg +++ b/files/preseed.cfg @@ -9,6 +9,9 @@ d-i partman/early_command string \ ubiquity ubiquity/success_command string \ in-target sed 's/^\(GRUB_CMDLINE_LINUX="\).*$/\1" #tunic/' /etc/default/grub || true; +d-i preseed/late_command string \ + in-target sed 's/^\(GRUB_CMDLINE_LINUX="\).*$/\1" #tunic/' /etc/default/grub || true; + # Partition #d-i ubiquity/partman-skip-unmount boolean true diff --git a/tunic.ps1 b/tunic.ps1 index d879d5b..f423026 100644 --- a/tunic.ps1 +++ b/tunic.ps1 @@ -29,7 +29,7 @@ function initData() { mkdir "$global:tunic_dir" | out-null } - $distros = . files/distros.ps1 + $global:distros = . files/distros.ps1 $userInfo = ( Get-WMIObject Win32_UserAccount | where caption -eq (whoami) ) $global:data = @{ @@ -37,7 +37,7 @@ function initData() { fullname = $userInfo.fullName; username = $userInfo.name.toLower(); hostname = $userInfo.psComputerName; - iso_url = $distros[0].url + iso_url = $global:distros[0].url } } @@ -172,6 +172,8 @@ function downloadIso() { #TODO: save to temp and move after. #TODO: verify integrity } catch { + write-host "Error downloading $( $global:data.iso_url ) to $iso_path" + write-host $_ Remove-Item "$iso_path" Throw "Download failed" } @@ -396,7 +398,7 @@ function initFields() { $username.text = $global:data.username $hostname.text = $global:data.hostname - $distroName.items.addRange($distros % { $_.name }) + $distroName.items.addRange( ( $global:distros | % { $_.name } ) ) $distroName.selectedIndex = 0 } @@ -946,7 +948,7 @@ function gui() { } else { $global:data.installType = $CUSTOMBOOT } - $global:data.iso_url = $distros[ $distroName.selectedIndex ].url + $global:data.iso_url = $global:distros[ $distroName.selectedIndex ].url if( -not (checkFields) ) { return