bootrecover: fix mbr detection code; run bootrecover.kmdr as user, run bootrecover.sh with sudo

This commit is contained in:
Silvan Calarco 2011-11-02 11:49:36 +01:00
parent 5b77ac7846
commit 9046a2e3f4
2 changed files with 9 additions and 11 deletions

View File

@ -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

View File

@ -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