[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2017-09-12 Thread Anatol Pomozov
Date: Tuesday, September 12, 2017 @ 16:49:56
  Author: anatolik
Revision: 305369

FS#55250 match number only at the end of partition name

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Modified: syslinux-install_update
===
--- syslinux-install_update 2017-09-12 10:20:55 UTC (rev 305368)
+++ syslinux-install_update 2017-09-12 16:49:56 UTC (rev 305369)
@@ -59,8 +59,9 @@
 fi
 
 case "$part" in
+# catch cases like mmcblk0p1 and loop0p3
 *[[:digit:]]p[[:digit:]]*)
-local disk="${part%%p[[:digit:]]*}" # get everything before p1
+local disk="${part%p[[:digit:]]}" # get everything before p1
 ;;
 *)
 local disk="${part%%[[:digit:]]*}"


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2017-09-11 Thread Anatol Pomozov
Date: Monday, September 11, 2017 @ 23:49:07
  Author: anatolik
Revision: 305365

Fix formatting

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Modified: syslinux-install_update
===
--- syslinux-install_update 2017-09-11 21:03:32 UTC (rev 305364)
+++ syslinux-install_update 2017-09-11 23:49:07 UTC (rev 305365)
@@ -207,7 +207,7 @@
 if [[ $bootfs = ext4 && -n "$(tune2fs -l $bootpart | grep 64bit)" ]]; then
 echo "64 bit option on EXT filesystem is not supported by Syslinux, 
see http://www.syslinux.org/wiki/index.php?title=Filesystem#ext";;
 exit 1
-fi
+fi
 }
 
 # We store the partition table type either gpt or mbr in var ptb


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2017-09-09 Thread Anatol Pomozov
Date: Saturday, September 9, 2017 @ 20:22:35
  Author: anatolik
Revision: 305194

FS#55250 change partnumber pattern to [[:digit:]]* to match loop0p0 case

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Modified: syslinux-install_update
===
--- syslinux-install_update 2017-09-09 20:00:06 UTC (rev 305193)
+++ syslinux-install_update 2017-09-09 20:22:35 UTC (rev 305194)
@@ -60,7 +60,7 @@
 
 case "$part" in
 *[[:digit:]]p[[:digit:]]*)
-local disk="${part%%p$partnum}" # get everything before p1
+local disk="${part%%p[[:digit:]]*}" # get everything before p1
 ;;
 *)
 local disk="${part%%[[:digit:]]*}"


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2017-04-22 Thread Anatol Pomozov
Date: Saturday, April 22, 2017 @ 16:47:00
  Author: anatolik
Revision: 293941

FS#53436 check if ext4 formatted with 64bit option. If yes bail out as syslinux 
does not support this feature.

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |5 +
 1 file changed, 5 insertions(+)

Modified: syslinux-install_update
===
--- syslinux-install_update 2017-04-22 16:45:09 UTC (rev 293940)
+++ syslinux-install_update 2017-04-22 16:47:00 UTC (rev 293941)
@@ -203,6 +203,11 @@
 echo "Could not find filesystem on / (root) or /boot."
 exit 1
 fi
+
+if [[ $bootfs = ext4 && -n "$(tune2fs -l $bootpart | grep 64bit)" ]]; then
+echo "64 bit option on EXT filesystem is not supported by Syslinux, 
see http://www.syslinux.org/wiki/index.php?title=Filesystem#ext";;
+exit 1
+fi
 }
 
 # We store the partition table type either gpt or mbr in var ptb


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2017-02-12 Thread Anatol Pomozov
Date: Monday, February 13, 2017 @ 02:48:08
  Author: anatolik
Revision: 288769

Make error message cleaner for non-partitioned disks

syslinux requires partition table is we want to install MBR or active bit.
Make the error message cleaner.

Inspired by https://bbs.archlinux.org/viewtopic.php?id=223038

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Modified: syslinux-install_update
===
--- syslinux-install_update 2017-02-12 21:34:51 UTC (rev 288768)
+++ syslinux-install_update 2017-02-13 02:48:08 UTC (rev 288769)
@@ -233,7 +233,7 @@
 # If any bootdev is a block device without partitions bail
 # we want to set the boot flag on partitioned disk
 for dev in "${!bootdevs[@]}"; do
-dev_is_part $dev || { echo "$dev - is a block device. Aborting 
set_active!"; return 1; }
+dev_is_part $dev || { echo "$dev does not contain partition table. 
Aborting set_active!"; return 1; }
 done
 
 # Clear BIOS Bootable Legacy Attribute for GPT drives
@@ -281,7 +281,7 @@
 # If any bootdev is a block device without partitions bail
 # we want to install the mbr to a partitioned disk
 for dev in "${!bootdevs[@]}"; do
-dev_is_part "$dev" || { echo "$dev - is a block device. Aborting MBR 
install"; return 1; }
+dev_is_part "$dev" || { echo "$dev does not contain partition table. 
Aborting MBR install."; return 1; }
 done
 
 for part in "${!bootdevs[@]}"; do


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2016-12-19 Thread Anatol Pomozov
Date: Monday, December 19, 2016 @ 18:13:10
  Author: anatolik
Revision: 284323

FS#52155: add xfs support to the syslinux update script

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Modified: syslinux-install_update
===
--- syslinux-install_update 2016-12-19 16:47:24 UTC (rev 284322)
+++ syslinux-install_update 2016-12-19 18:13:10 UTC (rev 284323)
@@ -173,7 +173,7 @@
 exit 1
 fi
 
-syslinux_fs=(ext2 ext3 ext4 btrfs vfat)
+syslinux_fs=(ext2 ext3 ext4 btrfs vfat xfs)
 
 # Use DATA from findmnt see rc.sysint for more info
 if [[ -f /proc/self/mountinfo ]]; then


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2015-10-31 Thread Anatol Pomozov
Date: Saturday, October 31, 2015 @ 22:44:52
  Author: anatolik
Revision: 249894

FS#46242 Fix typos in the messages

Author:  Christoph Gysin

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Modified: syslinux-install_update
===
--- syslinux-install_update 2015-10-31 16:25:54 UTC (rev 249893)
+++ syslinux-install_update 2015-10-31 21:44:52 UTC (rev 249894)
@@ -54,7 +54,7 @@
 get_disk() {
 local part=$1
 if [[ ! -b "${part}" ]]; then
-echo >&2 "error: '$part' is not a valid block partition!"
+echo >&2 "error: '$part' is not a valid block device!"
 exit 1
 fi
 
@@ -67,7 +67,7 @@
 ;;
 esac
 if [[ ! -b "${disk}" ]]; then
-echo >&2 "error: '$diskj' is not a valid block device!"
+echo >&2 "error: '$disk' is not a valid block device!"
 exit 1
 fi
 echo $disk


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2015-10-30 Thread Anatol Pomozov
Date: Saturday, October 31, 2015 @ 06:29:26
  Author: anatolik
Revision: 249885

FS#46242 Handle installation to partitions with names like /dev/mmcblk0p1

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |   46 +++---
 1 file changed, 27 insertions(+), 19 deletions(-)

Modified: syslinux-install_update
===
--- syslinux-install_update 2015-10-30 21:49:02 UTC (rev 249884)
+++ syslinux-install_update 2015-10-31 05:29:26 UTC (rev 249885)
@@ -51,6 +51,28 @@
 return 1
 }
 
+get_disk() {
+local part=$1
+if [[ ! -b "${part}" ]]; then
+echo >&2 "error: '$part' is not a valid block partition!"
+exit 1
+fi
+
+case "$part" in
+*[[:digit:]]p[[:digit:]]*)
+local disk="${part%%p$partnum}" # get everything before p1
+;;
+*)
+local disk="${part%%[[:digit:]]*}"
+;;
+esac
+if [[ ! -b "${disk}" ]]; then
+echo >&2 "error: '$diskj' is not a valid block device!"
+exit 1
+fi
+echo $disk
+}
+
 # return true when blockdevice is an md raid, otherwise return a unset value
 # get all devices that are part of raid device $1
 device_is_raid() {
@@ -194,12 +216,12 @@
 slaves=$(mdraid_all_slaves "$bootpart")
 
 for slave in ${slaves[@]}; do
-local disk="${slave%%[[:digit:]]*}"
+local disk=$(get_disk "$slave")
 device_is_gpt "$disk" && local ptb="GPT" || local ptb="MBR"
 bootdevs[$slave]="$ptb"
 done
 else
-local disk="${bootpart%%[[:digit:]]*}"
+local disk=$(get_disk "$bootpart")
 device_is_gpt "$disk" && local ptb="GPT" || local ptb="MBR"
 bootdevs[$bootpart]="$ptb"
 fi
@@ -220,7 +242,7 @@
 for dev in "${!bootdevs[@]}"; do
 local ptb="${bootdevs[$dev]}"
 if [[ "$ptb" = GPT ]]; then
-local disk="${dev%%[[:digit:]]*}" #ex: /dev/sda
+local disk=$(get_disk "$dev")
 clear_gpt_attr2 "$disk"
 fi
 done
@@ -229,14 +251,7 @@
 for part in "${!bootdevs[@]}"; do
 local ptb="${bootdevs[$part]}"
 local partnum="${part##*[[:alpha:]]}"
-case "$part" in
-*[[:digit:]]p[[:digit:]]*)
-local disk="${part%%p$partnum}" # get everything before p1
-;;
-*)
-local disk="${part%%[[:digit:]]*}"
-;;
-esac
+local disk=$(get_disk "$part")
 
 if [[ "$ptb" = MBR ]]; then
 if sfdisk "$disk" --activate "$partnum" &>/dev/null; then
@@ -271,14 +286,7 @@
 
 for part in "${!bootdevs[@]}"; do
 local partnum="${part##*[[:alpha:]]}"
-case "$part" in
-*[[:digit:]]p[[:digit:]]*)
-local disk="${part%%p$partnum}" # get everything before p1
-;;
-*)
-local disk="${part%%[[:digit:]]*}"
-;;
-esac
+local disk=$(get_disk "$part")
 local ptb="${bootdevs[$part]}"
 
 # We want to install to the root of the block device


[arch-commits] Commit in syslinux/trunk (syslinux-install_update)

2014-12-27 Thread Anatol Pomozov
Date: Saturday, December 27, 2014 @ 15:08:17
  Author: anatolik
Revision: 228088

gptfdisk is not installed by default, this causes cryptic syslinux installation 
errors that confuses many users. Make the error message more obvious.

Modified:
  syslinux/trunk/syslinux-install_update

-+
 syslinux-install_update |5 +
 1 file changed, 5 insertions(+)

Modified: syslinux-install_update
===
--- syslinux-install_update 2014-12-27 13:00:28 UTC (rev 228087)
+++ syslinux-install_update 2014-12-27 14:08:17 UTC (rev 228088)
@@ -246,6 +246,11 @@
 exit 3
 fi
 elif [[ "$ptb" = GPT ]]; then
+if [[ ! -e /usr/bin/sgdisk ]]; then
+echo "FAILED to set attribute Legacy BIOS Bootable. sgdisk is 
not found - please install 'gptfdisk' package."
+exit 3
+fi
+
 if sgdisk "$disk" --attributes="$partnum":set:2 &>/dev/null; then
 echo "Attribute Legacy Bios Bootable Set - $part"
 else