Search
SailfishOS Open Build Service
>
Projects
>
nemo
:
testing:hw
:
x86:x86-common
>
installer-shell
> fix-bootloader-probe-for-extlinux.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File fix-bootloader-probe-for-extlinux.patch of Package installer-shell
diff --git a/installer-shell b/installer-shell index 0acb98b..ffc61f7 100755 --- a/installer-shell +++ b/installer-shell @@ -262,33 +262,29 @@ check_partition () { fi } -# Probe other bootloaders -# $1 is the menu file +# Probe other bootloaders, extlinux only, it skipes / partition, so it's maybe failed. +# A effective os probe method has implemented, will be in the next release bootloader_probe () { local TMP_MNT=/tmp/bootloader_probe_mnt [ -d $TMP_MNT ] || mkdir $TMP_MNT - for tmp_part in $(fdisk -l /dev/$DEV 2>/dev/null |grep "^/dev/" |grep -v "Extended" |grep -v "swap" |awk '{print $1}'); + for tmp_part in $(fdisk -l /dev/$DEV 2>/dev/null |grep "^/dev/" |grep "^/dev/.*Linux$" |awk '{print $1}'); do if [ $tmp_part = "$BOOTDEV" -o $tmp_part = "$ROOTDEV" ]; then continue fi - mount_check "mount $tmp_part $TMP_MNT" + dbglg_exec "mount $tmp_part $TMP_MNT" + [ $? -ne 0 ] && continue #FIXME: grub, lilo - if [ -f $TMP_MNT/extlinux/extlinux.conf -o $TMP_MNT/boot/extlinux/extlinux.conf -o -f $TMP_MNT/bootmgr ]; then - tmp_nr=$(echo $tmp_part |grep -o "[1-9]\|[1-9][0-9]") - echo -e "label ${tmp_part#/dev/*}" >> $1 - if [ -f $TMP_MNT/bootmgr ]; then - echo -e "\tmenu label Windows($tmp_part)" >> $1 - else - echo -e "\tmenu label Linux($tmp_part)" >> $1 - fi - echo -e "\tkernel chain.c32" >> $1 - echo -e "\tappend boot $tmp_nr" >> $1 - unset tmp_nr + if [ -f $TMP_MNT/extlinux/extlinux.conf -o -f $TMP_MNT/boot/extlinux/extlinux.conf ]; then + cat >> $1 <<EOF +label extlinux ($tmp_part) + label extlinux ($tmp_part) + kernel chain.c32 + append boot $(echo $tmp_part |grep -o "[1-9]\|[1-9][0-9]") +EOF fi - persistent_umount "$tmp_part" + persistent_umount $tmp_part done - unset tmp_part dbglg_exec "rm -rf $TMP_MNT" }