From 9046a2e3f4fb60f43a984c6b98008e830d9fca20 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 2 Nov 2011 11:49:36 +0100 Subject: [PATCH] bootrecover: fix mbr detection code; run bootrecover.kmdr as user, run bootrecover.sh with sudo --- bootrecover/bootrecover.kmdr | 15 ++++++++------- bootrecover/openmamba-bootrecover.desktop | 5 +---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/bootrecover/bootrecover.kmdr b/bootrecover/bootrecover.kmdr index 40d8b82..e83f7bf 100755 --- a/bootrecover/bootrecover.kmdr +++ b/bootrecover/bootrecover.kmdr @@ -648,7 +648,7 @@ function get_udisks_key() { } @if (@devicesbox.currentItem >= 0) currdev=@String.section(@devicesbox.item(@devicesbox.currentItem)," ",0) - @showdevice.setText(@String.section(@devicesbox.item(@devicesbox.currentItem)," ",0)) + @showdevice.setText(@devicesbox.item(@devicesbox.currentItem)) @dcop(@dcopid, KommanderIf, enableWidget(QString,bool), next, true) @BackBox.setChecked(true) @@ -660,11 +660,12 @@ function get_udisks_key() { dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "$currdev (@i18n("System partition"))" 0 for device in $devices; do - native_path=`get_udisks_key $d native-path` - [ ! -e $native_path/partition ] || continue - is_system_internal=`get_udisks_key $d "system internal"` - partscheme=`get_udisks_key $d scheme` - if [ "$is_system_internal" == "1" -o @removablebox.checked == 1 ]; then if [ "$partscheme" == "mbr" ]; then + native_path=`get_udisks_key $device native-path` + [ -e $native_path/partition ] && continue + is_system_internal=`get_udisks_key $device "system internal"` + partscheme=`get_udisks_key $device scheme` + if [ "$is_system_internal" == "1" -o "@removablebox.checked" == "1" ]; then + [ "$partscheme" == "mbr" ] && \ dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "${device:5:5} (master boot record)" 0 fi done @@ -1114,7 +1115,7 @@ _EOF @if (@confirmBox.checked); then @dcop(@dcopid, KommanderIf, setEnabled(QString,bool), back, false) - @exec("/usr/share/openmamba/bootrecover/bootrecover.sh -y @dcopid &> ~/.bootrecover.log") + @exec("sudo /usr/share/openmamba/bootrecover/bootrecover.sh -y @dcopid &> ~/.bootrecover.log") @execBegin dcop @dcopid KommanderIf setText installlog "`cat ~/.bootrecover.log`" @execEnd diff --git a/bootrecover/openmamba-bootrecover.desktop b/bootrecover/openmamba-bootrecover.desktop index 3840ba0..0ab8656 100644 --- a/bootrecover/openmamba-bootrecover.desktop +++ b/bootrecover/openmamba-bootrecover.desktop @@ -4,11 +4,8 @@ Name[it]=Boot Recover di openmamba GenericName=openmamba boot loader recovery GenericName[it]=Ripristino del boot loader di openmamba Comment=openmamba installer -Exec=kdesudo kmdr-executor /usr/share/openmamba/bootrecover/bootrecover.kmdr +Exec=kmdr-executor /usr/share/openmamba/bootrecover/bootrecover.kmdr Icon=bootrecover Terminal=0 Type=Application Categories=X-openmamba -X-KDE-RootOnly=true -X-KDE-SubstituteUID=true -X-KDE-Username=root