Compare commits

...

9 Commits

4 changed files with 213 additions and 373 deletions

View File

@ -1,3 +1,3 @@
VERSION=2.5.4
VERSION=2.5.6

View File

@ -2106,57 +2106,6 @@ dcop @dcopid KommanderIf setText installhint "$insthint"
</hbox>
</widget>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>setlabel</cstring>
</property>
<property name="geometry">
<rect>
<x>540</x>
<y>40</y>
<width>32</width>
<height>32</height>
</rect>
</property>
<property name="populationText">
<string></string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@execBegin
function get_udisks_key() {
LANG=C udisks --show-info $1 | grep " $2:" | head -n1 | sed "s|[[:space:]]*$2:[[:space:]]*\(.*\)|\1|"
}
@if (@devicesbox.currentItem &gt;= 0)
currdev=@String.section(@devicesbox.item(@devicesbox.currentItem)," ",0)
@showdevice.setText(@devicesbox.item(@devicesbox.currentItem))
@dcop(@dcopid, KommanderIf, enableWidget(QString,bool), next, true)
@BackBox.setChecked(true)
#
# set MBR combo box
#
dcop @dcopid KommanderIf "clear(QString)" mbrbox
devices=`udisks --enumerate-device-files | grep -v /dev/disk`
dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "$currdev (@i18n("System partition"))" 0
for device in $devices; do
native_path=`get_udisks_key $device native-path`
[ -e $native_path/partition ] &amp;&amp; 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" ] &amp;&amp; \
dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "${device:5:5} (master boot record)" 0
fi
done
dcop @dcopid KommanderIf "setCurrentItem(int)" 0
@endif
@execEnd
@setBootableCheckbox.execute()</string>
</stringlist>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>scanDevices</cstring>
@ -2243,6 +2192,66 @@ done
</stringlist>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>setlabel</cstring>
</property>
<property name="geometry">
<rect>
<x>540</x>
<y>40</y>
<width>32</width>
<height>32</height>
</rect>
</property>
<property name="populationText">
<string></string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@execBegin
function get_udisks_key() {
LANG=C udisks --show-info $1 | grep " $2:" | head -n1 | sed "s|[[:space:]]*$2:[[:space:]]*\(.*\)|\1|"
}
function get_udisks_key_last() {
LANG=C udisks --show-info $1 | grep " $2:" | tail -n1 | sed "s|[[:space:]]*$2:[[:space:]]*\(.*\)|\1|"
}
@if (@devicesbox.currentItem &gt;= 0)
currdev=@String.section(@devicesbox.item(@devicesbox.currentItem)," ",0)
@showdevice.setText(@devicesbox.item(@devicesbox.currentItem))
@dcop(@dcopid, KommanderIf, enableWidget(QString,bool), next, true)
@BackBox.setChecked(true)
#
# set MBR combo box
#
dcop @dcopid KommanderIf "clear(QString)" mbrbox
devices=`udisks --enumerate-device-files | grep -v /dev/disk`
dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "$currdev (@i18n("System partition"))" 0
for device in $devices; do
native_path=`get_udisks_key $device native-path`
if [ -e $native_path/partition ]; then
partition_label=`get_udisks_key_last $device label`
if [ "${partition_label:0:3}" = "EFI" ]; then
dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "${device:5:5} (@i18n("EFI system partition"))" 0
fi
else
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" ] &amp;&amp; \
dcop @dcopid KommanderIf "addListItem(QString,QString,int)" mbrbox "${device:5:5} (master boot record)" 0
fi
fi
done
dcop @dcopid KommanderIf "setCurrentItem(int)" 0
@endif
@execEnd
@setBootableCheckbox.execute()</string>
</stringlist>
</property>
</widget>
</widget>
<widget class="QWidget">
<property name="name">
@ -2644,45 +2653,6 @@ done
<set>AlignCenter</set>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>setlabel_2</cstring>
</property>
<property name="geometry">
<rect>
<x>550</x>
<y>50</y>
<width>32</width>
<height>32</height>
</rect>
</property>
<property name="populationText">
<string></string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@execBegin
@format_home_box.setEnabled(false)
@if (@devicesbox_2.currentItem &gt;= 0)
currdev=@String.section(@devicesbox_2.item(@devicesbox_2.currentItem)," ",0)
if [ "$currdev" != "none" -a "$currdev" != "nessuna" ]; then
dcop @dcopid KommanderIf "setText(QString,QString)" showdevice_2 "@devicesbox_2.item(@devicesbox_2.currentItem)"
dcop @dcopid KommanderIf "setEnabled(QString,bool)" format_home_box true
dcop @dcopid KommanderIf "setEnabled(QString,bool)" formathome_group @format_home_box.checked()
else
dcop @dcopid KommanderIf "setText(QString,QString)" showdevice_2 ""
dcop @dcopid KommanderIf "setEnabled(QString,bool)" format_home_box false
dcop @dcopid KommanderIf "setEnabled(QString,bool)" formathome_group false
fi
@dcop(@dcopid, KommanderIf, enableWidget(QString,bool), next, true)
@BackBox.setChecked(true)
dcop @dcopid KommanderIf "setCurrentItem(int)" 0
@endif
@execEnd
@setBootableCheckbox.execute()</string>
</stringlist>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>scanDevices_2</cstring>
@ -2750,6 +2720,45 @@ done
</stringlist>
</property>
</widget>
<widget class="ScriptObject">
<property name="name">
<cstring>setlabel_2</cstring>
</property>
<property name="geometry">
<rect>
<x>550</x>
<y>50</y>
<width>32</width>
<height>32</height>
</rect>
</property>
<property name="populationText">
<string></string>
</property>
<property name="associations" stdset="0">
<stringlist>
<string>@execBegin
@format_home_box.setEnabled(false)
@if (@devicesbox_2.currentItem &gt;= 0)
currdev=@String.section(@devicesbox_2.item(@devicesbox_2.currentItem)," ",0)
if [ "$currdev" != "none" -a "$currdev" != "nessuna" ]; then
dcop @dcopid KommanderIf "setText(QString,QString)" showdevice_2 "@devicesbox_2.item(@devicesbox_2.currentItem)"
dcop @dcopid KommanderIf "setEnabled(QString,bool)" format_home_box true
dcop @dcopid KommanderIf "setEnabled(QString,bool)" formathome_group @format_home_box.checked()
else
dcop @dcopid KommanderIf "setText(QString,QString)" showdevice_2 ""
dcop @dcopid KommanderIf "setEnabled(QString,bool)" format_home_box false
dcop @dcopid KommanderIf "setEnabled(QString,bool)" formathome_group false
fi
@dcop(@dcopid, KommanderIf, enableWidget(QString,bool), next, true)
@BackBox.setChecked(true)
dcop @dcopid KommanderIf "setCurrentItem(int)" 0
@endif
@execEnd
@setBootableCheckbox.execute()</string>
</stringlist>
</property>
</widget>
</widget>
<widget class="QWidget">
<property name="name">
@ -2774,6 +2783,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 +2830,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 +2861,7 @@ done
<property name="geometry">
<rect>
<x>10</x>
<y>320</y>
<y>60</y>
<width>530</width>
<height>26</height>
</rect>
@ -2876,86 +2933,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 +2943,7 @@ done
<property name="geometry">
<rect>
<x>520</x>
<y>70</y>
<y>10</y>
<width>32</width>
<height>32</height>
</rect>
@ -2974,9 +2951,10 @@ done
<property name="associations" stdset="0">
<stringlist>
<string>@execBegin
mbrstring=@String.section(@mbrbox.item(@mbrbox.currentItem)," ",1)
mbrdevice=@String.section(@mbrbox.item(@mbrbox.currentItem)," ",0)
mbrpart=${mbrdevice:3:2}
if [ "$mbrpart" ]; then
if [ "$mbrpart" -a "${mbrstring/EFI}" = "${mbrstring}" ]; then
if [ $mbrpart -le 4 ]; then
dcop @dcopid KommanderIf setEnabled bootableBox true
else
@ -2992,102 +2970,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">
@ -3320,22 +3202,20 @@ _EOF
@dcop(@dcopid, KommanderIf, enableWidget(QString,bool), back,false)
installdevice=@String.section(@devicesbox.item(@devicesbox.currentItem)," ",0)
mbrdevice=@String.section(@mbrbox.item(@mbrbox.currentItem)," ",0)
mbrstring="@mbrbox.item(@mbrbox.currentItem)"
if [ "${mbrstring/EFI}" != "${mbrstring}" ]; then
efidevice=/dev/@String.section(@mbrbox.item(@mbrbox.currentItem)," ",0)
else
mbrdevice=/dev/@String.section(@mbrbox.item(@mbrbox.currentItem)," ",0)
fi
installhomedevice=@String.section(@devicesbox_2.item(@devicesbox_2.currentItem)," ",0)
[ "$installhomedevice" = "none" ] &amp;&amp; installhomedevice=
IFS=$'\n'
CHAINLOAD_SELECTED=(`dcop @dcopid KommanderIf selection chainloadbox`)
for i in ${CHAINLOAD_SELECTED[*]}; do
chainloaddevices="/dev/${i:0:4} $chainloaddevices"
done
IFS=$' \t\n'
cat &gt;&gt;$conffile &lt;&lt; _EOF
INSTALL_DEVICE='/dev/$installdevice'
INSTALL_DRIVER='@driverlabel.text'
INSTALL_BOOTLOADER_DEVICE='/dev/$mbrdevice'
INSTALL_BOOTLOADER_DEVICE='$mbrdevice'
INSTALL_BOOTLOADER_DEVICE_EFI='$efidevice'
INSTALL_BOOTLOADER_DEVICE_SETBOOTABLE=@bootableBox.checked
INSTALL_BOOTLOADER_CHAINLOAD=($chainloaddevices)
INSTALL_FSTYPE='@fstypebox.item(@fstypebox.currentItem)'
@ -3653,12 +3533,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

@ -1,5 +1,5 @@
# openmamba installation script
# Copyright (c) 2007-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2007-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
# For the devfs2gdev() function:
# Copyright (c) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
@ -364,7 +364,7 @@ chmod 0750 $MOUNTPOINT/root
UDEV_ROOT=$MOUNTPOINT/dev /lib/udev/devices/MAKEDEV
dcop_write $"Binding system dirs to new mountpoint..." 73
echo $"Binding /dev, /proc and /sys to new mountpoint"
echo $"Binding /dev, /proc, /run and /sys to new mountpoint"
mount -o bind /dev $MOUNTPOINT/dev || {
echo $"Error: could not bind /dev to new mountpoint; aborting." >&2
abort
@ -373,6 +373,10 @@ mount -o bind /proc $MOUNTPOINT/proc || {
echo $"Error: could not bind /proc to new mountpoint; aborting." >&2
abort
}
mount -o bind /run $MOUNTPOINT/run || {
echo $"Error: could not bind /run to new mountpoint; aborting." >&2
abort
}
mount -o bind /sys $MOUNTPOINT/sys || {
echo $"Error: could not bind /sys to new mountpoint; aborting." >&2
abort
@ -430,16 +434,7 @@ chroot $MOUNTPOINT \
}
# --fstab=/etc/fstab ||
if [ "$INSTALL_BOOTLOADER_DEVICE" ]; then
dcop_write $"Installing bootloader on $INSTALL_BOOTLOADER_DEVICE..." 85
INSTALL_BOOTLOADER_DEVICE_BYID=$INSTALL_BOOTLOADER_DEVICE
for f in `ls /dev/disk/by-id/*`; do
if [ "$INSTALL_BOOTLOADER_DEVICE" = "`readlink -f $f`" ]; then
INSTALL_BOOTLOADER_DEVICE_BYID=$f
break
fi
done
if [ "$INSTALL_BOOTLOADER_DEVICE" -o "$INSTALL_BOOTLOADER_DEVICE_EFI" ]; then
CMDLINE=`cat /proc/cmdline`
echo $"Current kernel command line is '$CMDLINE'"
NOMODESET_ADD=`echo $CMDLINE | grep "nomodeset" | sed "s|.*\(nomodeset\).*|\1|"`
@ -450,40 +445,35 @@ if [ "$INSTALL_BOOTLOADER_DEVICE" ]; then
if [ "$GRUB_CMDLINE_ADD" ]; then
sed -i "s|GRUB_CMDLINE_LINUX=\"\(.*\)\"|GRUB_CMDLINE_LINUX=\"\1 $GRUB_CMDLINE_ADD\"|" $MOUNTPOINT/etc/default/grub
fi
fi
if [ "$INSTALL_BOOTLOADER_DEVICE" ]; then
#
# MBR/BOOT SECTOR
#
dcop_write $"Installing bootloader on $INSTALL_BOOTLOADER_DEVICE..." 85
INSTALL_BOOTLOADER_DEVICE_BYID=$INSTALL_BOOTLOADER_DEVICE
for f in `ls /dev/disk/by-id/*`; do
if [ "$INSTALL_BOOTLOADER_DEVICE" = "`readlink -f $f`" ]; then
INSTALL_BOOTLOADER_DEVICE_BYID=$f
break
fi
done
echo "GRUB_INSTALL_DEVICE=$INSTALL_BOOTLOADER_DEVICE_BYID" >> $MOUNTPOINT/etc/sysconfig/grub
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)
# DEV_NAME_DEST=(${DEV_NAME_DEST[*]} $NEW_GRUB_DEV)
# # create a couple of conversion vectors to convert/dev/sd* devices names
# # into how they will appear on the installed system
# unset CURR_DRIVER LOAD_DRIVER_LIST
# CURR_SD_LETTER=0
# while read line; do
# GRUB_DEV=`echo ${line/*[[:space:]]/}`
# if [ "${GRUB_DEV:0:7}" = "/dev/sd" ]; then
# NEW_GRUB_DEV=/dev/sd${LETTERS[CURR_SD_LETTER]}
# let CURR_SD_LETTER+=1
# else
# NEW_GRUB_DEV=$GRUB_DEV
# fi
# DEV_NAME_ORIG=(${DEV_NAME_ORIG[*]} $GRUB_DEV)
# DEV_NAME_DEST=(${DEV_NAME_DEST[*]} $NEW_GRUB_DEV)
# done < /boot/grub/device.map
if [ "${INSTALL_BOOTLOADER_DEVICE:8:2}" = "" ]; then
# MBR install: set /boot partition as bootable as required by grub2
# CHECK: this does not work when install device is an extended partition, but in this case
@ -499,63 +489,38 @@ if [ "$INSTALL_BOOTLOADER_DEVICE" ]; then
echo $"Warning: there was an error setting bootloader partition as bootable." >&2
fi
[ "$INSTALL_BOOTLOADER_CHAINLOAD" ] && {
# configure boot chainloader for e.g. windows
GRUB_OTHER_TITLES=()
GRUB_OTHER_DEVICES=()
for i in ${INSTALL_BOOTLOADER_CHAINLOAD[*]}; do
# FIXME: missing conversion from device to grub (hdx,y) form
unset ID_FS_UUID ID_FS_TYPE ID_FS_LABEL
eval `blkid $i -o udev`
if [ "$ID_FS_UUID" ]; then
if [ "$ID_FS_TYPE" = "ntfs" ]; then
[ "$ID_FS_LABEL" ] &&
ID_FS_LABEL="Windows ($ID_FS_LABEL)" || ID_FS_LABEL="Windows"
elif [ "${ID_FS_TYPE:0:3}" = "fat" ]; then
[ "$ID_FS_LABEL" ] &&
ID_FS_LABEL="Win/DOS ($ID_FS_LABEL)" || ID_FS_LABEL="Windows/DOS"
else
[ "$ID_FS_LABEL" ] &&
ID_FS_LABEL="Other OS ($ID_FS_LABEL)" || ID_FS_LABEL="Other OS"
fi
[ "$ID_FS_LABEL" ] || ID_FS_LABEL="Unknown"
GRUB_OTHER_DEVICES=(${GRUB_OTHER_DEVICES[*]} /dev/disk/by-uuid/$ID_FS_UUID)
GRUB_OTHER_TITLES=(${GRUB_OTHER_TITLES[*]} "\"$ID_FS_LABEL\"")
else
GRUB_OTHER_DEV=$i
for o in `seq 1 ${#DEV_NAME_ORIG[*]}`; do
[ "${DEV_NAME_ORIG[o-1]}" = "${i:5:3}" ] && {
GRUB_OTHER_DEV=${DEV_NAME_DEST[o-1]}${i:8:2}
break
}
done
# echo $"Renaming device "${DEV_NAME_ORIG[o-1]}$" to "${DEV_NAME_DEST[o-1]}
# sed -i "s|/dev/${DEV_NAME_ORIG[o-1]:5:3}|/dev/${DEV_NAME_DEST[o-1]:5:3}|" \
# $MOUNTPOINT/boot/grub/devices.map \
# $MOUNTPOINT/etc/sysconfig/grub
# CURR_ROOT_LETTER=0
# sed -i "s|root=/dev/${INSTALL_DEVICE:5:5}|root=/dev/${DEV_NAME_DEST[o-1]:5:3}|" \
# $MOUNTPOINT/boot/grub/grub.cfg
# done
GRUB_OTHER_DEVICES=(${GRUB_OTHER_DEVICES[*]} $GRUB_OTHER_DEV)
GRUB_OTHER_TITLES=(${GRUB_OTHER_TITLES[*]} "\"Windows on $GRUB_OTHER_DEV\"")
fi
done
cat >> $MOUNTPOINT/etc/sysconfig/grub << _EOF
GRUB_OTHER_DEVICES=(${GRUB_OTHER_DEVICES[*]})
GRUB_OTHER_TITLES=(${GRUB_OTHER_TITLES[*]})
_EOF
}
elif [ "$INSTALL_BOOTLOADER_DEVICE_EFI" ]; then
#
# EFI
#
dcop_write $"Installing bootloader on ""$INSTALL_BOOTLOADER_DEVICE_EFI (EFI)..." 85
INSTALL_BOOTLOADER_DEVICE_EFI_BYID=$INSTALL_BOOTLOADER_DEVICE_EFI
for f in `ls /dev/disk/by-id/*`; do
if [ "$INSTALL_BOOTLOADER_DEVICE_EFI" = "`readlink -f $f`" ]; then
INSTALL_BOOTLOADER_DEVICE_EFI_BYID=$f
break
fi
done
echo "GRUB_INSTALL_DEVICE_EFI=$INSTALL_BOOTLOADER_DEVICE_EFI_BYID" >> $MOUNTPOINT/etc/sysconfig/grub
echo $"Installing grub bootloader on ""$INSTALL_BOOTLOADER_DEVICE_EFI (EFI)"
[ -e $MOUNTPOINT/boot/efi ] || mkdir -p $MOUNTPOINT/boot/efi
mount $INSTALL_BOOTLOADER_DEVICE_EFI $MOUNTPOINT/boot/efi
grub-install --root-directory=$MOUNTPOINT --efi-directory=$MOUNTPOINT/boot/efi --target=x86_64-efi \
--bootloader-id="openmamba Boot Manager" --recheck --no-floppy
umount $MOUNTPOINT/boot/efi
fi
if [ "$INSTALL_BOOTLOADER_DEVICE" -o "$INSTALL_BOOTLOADER_DEVICE_EFI" ]; then
# mount all disks and dbus for Grub other linuxes detection to work (30_other_linux)
mount -o bind /mnt $MOUNTPOINT/mnt
mount -o bind /var/run/dbus $MOUNTPOINT/var/run/dbus
for d in /mnt/*; do
[ -d $d ] && mount -o bind,ro $d ${MOUNTPOINT}${d}
[ -d $d -a "$d" != "${MOUNTPOINT}" ] && mount -o bind $d ${MOUNTPOINT}${d}
done
chroot $MOUNTPOINT grub-mkconfig -o /boot/grub/grub.cfg
chroot $MOUNTPOINT update-grub
for d in /mnt/*; do
[ -d $d ] && umount ${MOUNTPOINT}${d}
[ -d $d -a "$d" != "${MOUNTPOINT}" ] && umount ${MOUNTPOINT}${d}
done
umount $MOUNTPOINT/var/run/dbus
umount $MOUNTPOINT/mnt
@ -637,7 +602,7 @@ rpm -r $MOUNTPOINT -e livecd-tools
[ "$INSTALL_STABLE_UPDATES" = "1" ] && rpm -r $MOUNTPOINT -e openmamba-devel 2>/dev/null
# remove ssh live medium keys
rm -f $MOUNTPOINT/etc/ssh_host_*.key $MOUNTPOINT/etc/ssh_host_*.key.pub
rm -f $MOUNTPOINT/etc/ssh/ssh_host*_key $MOUNTPOINT/etc/ssh/ssh_host*_key.pub
sed -i /eject_cd.sh/d $MOUNTPOINT/etc/rc0.d/K99halt
sed -i /eject_cd.sh/d $MOUNTPOINT/etc/rc6.d/K99reboot
@ -659,6 +624,7 @@ rm -f $MOUNTPOINT/root/.DCOPserver* $MOUNTPOINT/root/.ICEauthority
umount $MOUNTPOINT/dev
umount $MOUNTPOINT/proc
umount $MOUNTPOINT/run
umount $MOUNTPOINT/sys
[ "$INSTALL_HOME_DEVICE" ] && umount $MOUNTPOINT/home

View File

@ -1,11 +1,11 @@
#! /bin/sh
#
# eject_cd.sh - QiLinux eject CD script (called by install1.sh)
# eject_cd.sh - openmamba livecd eject CD and halt/reboot script
#
# Copyright (c) 2003-2004 by Silvan Calarco <silvan.calarco@qilinux.it>
# Copyright (c) 2003-2013 by Silvan Calarco <silvan.calarco@qilinux.it>
# Copyright (c) 2003-2004 by Davide Madrisan <davide.madrisan@qilinux.it>
# FIXME: support SCSI cdroms
CDROMDEV=`cat /etc/mtab | sed -n '/ \/cdrom /{h;s/ .*//p}'`
# eject live CDROM
cdrecord -eject dev=ATAPI:$CDROMDEV 1>/dev/null 2>/dev/null
eject -m $CDROMDEV