installer: remove other O.S. partiton selection, rely on grub-install + os-prober for automatic configuration

This commit is contained in:
Silvan Calarco 2013-06-12 00:21:01 +02:00
parent cdbd56e126
commit 86284136d4
2 changed files with 52 additions and 186 deletions

View File

@ -2774,6 +2774,30 @@ done
<pixmap>image7</pixmap>
</property>
</widget>
<widget class="Label">
<property name="name">
<cstring>Label21_2_2</cstring>
</property>
<property name="geometry">
<rect>
<x>70</x>
<y>10</y>
<width>500</width>
<height>30</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Configure the boot manager</string>
</property>
<property name="alignment">
<set>AlignCenter</set>
</property>
</widget>
<widget class="ButtonGroup">
<property name="name">
<cstring>BootloaderBox</cstring>
@ -2797,6 +2821,30 @@ done
<property name="title">
<string>Bootloader configuration</string>
</property>
<widget class="Label">
<property name="name">
<cstring>Label29_2</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>531</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<italic>1</italic>
</font>
</property>
<property name="text">
<string>Please select where you want to install the boot manager.</string>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>Layout5_2</cstring>
@ -2804,7 +2852,7 @@ done
<property name="geometry">
<rect>
<x>10</x>
<y>320</y>
<y>60</y>
<width>530</width>
<height>26</height>
</rect>
@ -2876,86 +2924,6 @@ done
</widget>
</hbox>
</widget>
<widget class="ListBox">
<property name="name">
<cstring>chainloadbox</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>540</width>
<height>170</height>
</rect>
</property>
<property name="selectionMode">
<enum>Multi</enum>
</property>
</widget>
<widget class="Label">
<property name="name">
<cstring>Label3_2_2_2</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>290</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Please select the boot menu options:</string>
</property>
</widget>
<widget class="Label">
<property name="name">
<cstring>Label29_2</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>280</y>
<width>531</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<italic>1</italic>
</font>
</property>
<property name="text">
<string>Please select where you want to install the boot manager.</string>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
<widget class="Label">
<property name="name">
<cstring>Label28</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>540</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<italic>1</italic>
</font>
</property>
<property name="text">
<string>Below is a list of other operating systems found on this computer, you may configure them to appear as a choice when the computer starts.</string>
</property>
<property name="alignment">
<set>WordBreak|AlignTop</set>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>setBootableCheckbox</cstring>
@ -2966,7 +2934,7 @@ done
<property name="geometry">
<rect>
<x>520</x>
<y>70</y>
<y>10</y>
<width>32</width>
<height>32</height>
</rect>
@ -2992,102 +2960,6 @@ fi
</property>
</widget>
</widget>
<widget class="Label">
<property name="name">
<cstring>Label21_2_2</cstring>
</property>
<property name="geometry">
<rect>
<x>70</x>
<y>10</y>
<width>500</width>
<height>30</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Configure the boot manager</string>
</property>
<property name="alignment">
<set>AlignCenter</set>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>scanbootloader</cstring>
</property>
<property name="geometry">
<rect>
<x>550</x>
<y>10</y>
<width>32</width>
<height>32</height>
</rect>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@BackBox.setChecked(true)
@NextBox.setChecked(true)
@chainloadbox.clear
@setBootableCheckbox.execute()
@execBegin
function get_udisks_key() {
LANG=C udisks --show-info $1 | grep " $2:" | head -n1 | sed "s|[[:space:]]*$2:[[:space:]]*\(.*\)|\1|"
}
conffile=~/.installer.conf
[ -e $conffile ] &amp;&amp; mv ${conffile} ${conffile}~
installdevice=@String.section(@devicesbox.item(@devicesbox.currentItem)," ",0)
devices=`udisks --enumerate-device-files | grep -v /dev/disk | sort -n -r`
partlabel=
for device in $devices; do
[ "${device:5:5}" = "$installdevice" ] &amp;&amp; continue
native_path=`get_udisks_key $device native-path`
[ -e $native_path/partition ] || continue
is_system_internal=`get_udisks_key $device "system internal"`
volsize=`get_udisks_key $device size`
volsize=`expr $volsize / 1024 / 1024`
volname=`get_udisks_key $device label`
[ "$volname" ] || volname="unnamed"
parttype=`get_udisks_key $device usage`
[ "$parttype" ] || parttype="unknown"
partscheme=`get_udisks_key $device scheme`
[ "$partscheme" ] || partscheme="unknown"
fstype=`get_udisks_key $device type`
[ "$fstype" ] || fstype="unformatted"
add_info=""
[ "$is_system_internal" = "1" ] || {
add_info=",removable"
[ @removablebox.checked == 1 ] || continue
}
if [ "$partscheme" == "mbr" -o "$partscheme" == "embr" ]; then
partlabel="$partlabel&lt;br&gt;${device:5:5} $fstype $volname $volsize MB"
case "$fstype" in
swap|iso9660|unformatted) ;;
ext2|ext3|ext4|reiserfs|reiser4) ;;
*) dcop @dcopid KommanderIf "addListItem(QString,QString,int)" chainloadbox "${device:5:5} ($fstype,$volname,$volsize MB${add_info})" 0
dcop @dcopid KommanderIf "setSelection" chainloadbox "${device:5:5} ($fstype,$volname,$volsize MB${add_info})"
;;
esac
elif [ "$partscheme" == "gpt" -o "$partscheme" == "unknown" -a $volsize -gt 0 ]; then
case "$fstype" in
swap|iso9660|unformatted) ;;
ext2|ext3|ext4|reiserfs|reiser4) ;;
*) dcop @dcopid KommanderIf "addListItem(QString,QString,int)" chainloadbox "${device:5:5} ($fstype,$volname,$volsize MB${add_info})" 0
dcop @dcopid KommanderIf "setSelection" chainloadbox "${device:5:5} ($fstype,$volname,$volsize MB${add_info})"
;;
esac
fi
done
@execEnd</string>
</stringlist>
</property>
</widget>
</widget>
<widget class="QWidget">
<property name="name">
@ -3653,12 +3525,6 @@ fi
<receiver>setLangLabel</receiver>
<slot>execute()</slot>
</connection>
<connection>
<sender>bootableBox</sender>
<signal>widgetOpened()</signal>
<receiver>scanbootloader</receiver>
<slot>execute()</slot>
</connection>
<connection>
<sender>NextBox</sender>
<signal>widgetOpened()</signal>

View File

@ -461,14 +461,14 @@ if [ "$INSTALL_BOOTLOADER_DEVICE" ]; then
if [ "$INSTALL_BOOTLOADER_DEVICE_INTERNAL" != "1" ]; then
echo $"Installing grub bootloader on removable device $INSTALL_BOOTLOADER_DEVICE"
echo "(hd0) $INSTALL_BOOTLOADER_DEVICE" > $MOUNTPOINT/boot/grub/device.map
grub-install $INSTALL_BOOTLOADER_DEVICE --root-directory=$MOUNTPOINT --no-floppy --force
grub-install $INSTALL_BOOTLOADER_DEVICE --root-directory=$MOUNTPOINT --target=i386-pc --recheck --no-floppy --force
else
echo $"Installing grub bootloader on $INSTALL_BOOTLOADER_DEVICE"
> $MOUNTPOINT/boot/grub/device.map
for i in `seq 1 ${#DEV_NAME_ORIG[*]}`; do
echo "(${GRUB_NAME_DEST[i-1]}) ${DEV_NAME_ORIG[i-1]}" >> $MOUNTPOINT/boot/grub/device.map
done
grub-install $INSTALL_BOOTLOADER_DEVICE --root-directory=$MOUNTPOINT --no-floppy --force
grub-install $INSTALL_BOOTLOADER_DEVICE --root-directory=$MOUNTPOINT --target=i386-pc --recheck --no-floppy --force
fi
# DEV_NAME_ORIG=(${DEV_NAME_ORIG[*]} $GRUB_DEV)