Skip to content

Commit

Permalink
grub diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeslattery committed Feb 17, 2020
1 parent 381808e commit 872e2b0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
14 changes: 10 additions & 4 deletions files/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ insmod part_gpt
insmod ntfs

menuentry "Tunic Automatic Linux Installer" {
echo "ISO: ${iso_path}"
search --set=root --file $iso_path
search --set=root --no-floppy --file $iso_path
loopback loop ($root)$iso_path

ls
ls ($root)
echo "ISO: ${root} ${iso_path}"

echo 'Loading Linux kernel...'
linux (loop)/casper/vmlinuz file=/isodevice${tunic_dir}/preseed.cfg automatic-ubiquity boot=casper iso-scan/filename=${iso_path} nomodeset toram noprompt --

Expand All @@ -32,10 +35,13 @@ menuentry "Tunic Automatic Linux Installer" {
}

menuentry "Try out Linux without install" {
echo "ISO: ${iso_path}"
search --set=root --file $iso_path
search --set=root --no-floppy --file $iso_path
loopback loop ($root)$iso_path

ls
ls ($root)
echo "ISO: ${root} ${iso_path}"

echo 'Loading Linux kernel...'
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${iso_path} nomodeset toram noprompt --
echo 'Loading ramdisk...'
Expand Down
27 changes: 26 additions & 1 deletion tunic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function downloadIso() {
if ( -not (Test-Path "$iso_path") ) {
$ciso = "Z:\Downloads\$iso_file"
if ( Test-Path "$ciso" ) {
echo 'Cached.'
copy "$ciso" "$iso_path"
} else {
try {
Expand Down Expand Up @@ -1154,6 +1155,26 @@ function hideConsole() {
[Console.Window]::ShowWindow($consoleWin, 6)
}

function uninstall() {
if( !([Security.Principal.WindowsPrincipal] `
[Security.Principal.WindowsIdentity]::GetCurrent() `
).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) ) {
echo 'Must be an Administrator'
exit 1
}
if( test-path("${global:tunic_dir}\bcd.id") ) {
$osloader = (get-content "${global:tunic_dir}\bcd.id")
bcdedit /delete "$osloader" /cleanup /f
}
$efi = "S:"
if ( -not (Test-Path "$efi") ) {
mountvol $efi /s
}
rm "${efi}\boot" -recurse -force
mountvol "$efi" /d
rm "${global:tunic_dir}" -recurse -force
}

# Installs full disk install.
# Mainly for testing purposes.
# User will have 'tunic' password.
Expand All @@ -1163,8 +1184,9 @@ function fullDisk() {
$global:data.password = 'tunic'
# copied from distros.ps1
$url = 'http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso'
$url = 'http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-xfce-64bit.iso'
$url = 'http://releases.ubuntu.com/19.10/ubuntu-19.10-desktop-amd64.iso'
$url = 'http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-xfce-64bit.iso'
$url = 'http://mirrors.gigenet.com/linuxmint/iso/stable/19.3/linuxmint-19.3-cinnamon-64bit.iso'
$global:data.iso_url = $url

if( $global:data.installType -eq $DUALBOOT ) {
Expand Down Expand Up @@ -1218,6 +1240,9 @@ switch($op) {
$global:form = (gui)
[void]$form.showDialog()
}
{$_ -eq "uninstall" } {
uninstall
}
default {
$global:form = (gui)
[void]$form.showDialog()
Expand Down

0 comments on commit 872e2b0

Please sign in to comment.