Commit 2548a757 authored by Mike Hibler's avatar Mike Hibler
Browse files

Use sudo when trying to run sgdisk.

Otherwise it will fail and we will think we don't have a GPT when we
really do. Some unnamed 56-year-old screwed that up!
parent 7c39b26e
...@@ -191,7 +191,7 @@ if ($^O eq 'linux') { ...@@ -191,7 +191,7 @@ if ($^O eq 'linux') {
# #
my $isgpt = 0; my $isgpt = 0;
if ($^O eq 'linux' && -x "/sbin/sgdisk" && if ($^O eq 'linux' && -x "/sbin/sgdisk" &&
!system("/sbin/sgdisk $device >/dev/null 2>&1")) { !system("$sudo /sbin/sgdisk $device >/dev/null 2>&1")) {
if ($slicenum == 0) { if ($slicenum == 0) {
print STDERR print STDERR
"Cannot take whole disk image of GPT disk\n"; "Cannot take whole disk image of GPT disk\n";
......
...@@ -579,7 +579,7 @@ sub process_image($) ...@@ -579,7 +579,7 @@ sub process_image($)
# #
my $isgpt = 0; my $isgpt = 0;
if ($^O eq 'linux' && -x "/sbin/sgdisk" && if ($^O eq 'linux' && -x "/sbin/sgdisk" &&
!mysystem("/sbin/sgdisk ".$iinfo{$iid}{'disk'}." >/dev/null 2>&1")) { !mysystem("$sudo /sbin/sgdisk ".$iinfo{$iid}{'disk'}." >/dev/null 2>&1")) {
if ($iinfo{$iid}{'part'} == 0) { if ($iinfo{$iid}{'part'} == 0) {
print STDERR print STDERR
"Cannot take whole disk image of GPT disk\n"; "Cannot take whole disk image of GPT disk\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment