Skip to content

Commit

Permalink
distro, grug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeslattery committed Jan 31, 2020
1 parent a76c97a commit 4632866
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions files/distros.ps1
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 3 additions & 0 deletions files/preseed.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions tunic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ 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 = @{
installType = $DUALBOOT;
fullname = $userInfo.fullName;
username = $userInfo.name.toLower();
hostname = $userInfo.psComputerName;
iso_url = $distros[0].url
iso_url = $global:distros[0].url
}
}

Expand Down Expand Up @@ -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"
}
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4632866

Please sign in to comment.