bootrecover: fix mbr detection code; run bootrecover.kmdr as user, run bootrecover.sh with sudo
This commit is contained in:
parent
5b77ac7846
commit
9046a2e3f4
@ -648,7 +648,7 @@ function get_udisks_key() {
|
|||||||
}
|
}
|
||||||
@if (@devicesbox.currentItem >= 0)
|
@if (@devicesbox.currentItem >= 0)
|
||||||
currdev=@String.section(@devicesbox.item(@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)
|
@dcop(@dcopid, KommanderIf, enableWidget(QString,bool), next, true)
|
||||||
@BackBox.setChecked(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
|
dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "$currdev (@i18n("System partition"))" 0
|
||||||
|
|
||||||
for device in $devices; do
|
for device in $devices; do
|
||||||
native_path=`get_udisks_key $d native-path`
|
native_path=`get_udisks_key $device native-path`
|
||||||
[ ! -e $native_path/partition ] || continue
|
[ -e $native_path/partition ] && continue
|
||||||
is_system_internal=`get_udisks_key $d "system internal"`
|
is_system_internal=`get_udisks_key $device "system internal"`
|
||||||
partscheme=`get_udisks_key $d scheme`
|
partscheme=`get_udisks_key $device scheme`
|
||||||
if [ "$is_system_internal" == "1" -o @removablebox.checked == 1 ]; then if [ "$partscheme" == "mbr" ]; then
|
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
|
dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "${device:5:5} (master boot record)" 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -1114,7 +1115,7 @@ _EOF
|
|||||||
|
|
||||||
@if (@confirmBox.checked); then
|
@if (@confirmBox.checked); then
|
||||||
@dcop(@dcopid, KommanderIf, setEnabled(QString,bool), back, false)
|
@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
|
@execBegin
|
||||||
dcop @dcopid KommanderIf setText installlog "`cat ~/.bootrecover.log`"
|
dcop @dcopid KommanderIf setText installlog "`cat ~/.bootrecover.log`"
|
||||||
@execEnd
|
@execEnd
|
||||||
|
@ -4,11 +4,8 @@ Name[it]=Boot Recover di openmamba
|
|||||||
GenericName=openmamba boot loader recovery
|
GenericName=openmamba boot loader recovery
|
||||||
GenericName[it]=Ripristino del boot loader di openmamba
|
GenericName[it]=Ripristino del boot loader di openmamba
|
||||||
Comment=openmamba installer
|
Comment=openmamba installer
|
||||||
Exec=kdesudo kmdr-executor /usr/share/openmamba/bootrecover/bootrecover.kmdr
|
Exec=kmdr-executor /usr/share/openmamba/bootrecover/bootrecover.kmdr
|
||||||
Icon=bootrecover
|
Icon=bootrecover
|
||||||
Terminal=0
|
Terminal=0
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=X-openmamba
|
Categories=X-openmamba
|
||||||
X-KDE-RootOnly=true
|
|
||||||
X-KDE-SubstituteUID=true
|
|
||||||
X-KDE-Username=root
|
|
||||||
|
Loading…
Reference in New Issue
Block a user