Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#46242 - [syslinux] `syslinux-install_update -m` misinterprets disks with numerics in names

Attached to Project: Arch Linux
Opened by Tim Popham (popham) - Wednesday, 09 September 2015, 23:07 GMT
Last edited by Anatol Pomozov (anatolik) - Sunday, 28 February 2016, 17:14 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Anatol Pomozov (anatolik)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I'm on a Chromebook with an SSD that shows up as `/dev/mmcblk0` with partitions `/dev/mmcblk0p1`, etc. `syslinux-install_update -m` goofs the install and then reports success :(. Following the wiki's manual instructions works.

I'm using GPT, but `syslinux-install_update -m` writes `mbr.bin` to the master boot record instead of `gptmbr.bin`. It reports that everything completed successfully, but then I reboot and ...nope: "Operating system not found" or "OS not found" (I'm 90% sure that it's the former).

(When I was dropping random `echo`s in the script, I saw an `mmcblk` without the trailing `0` blow by. I figured that some pattern matching that is intended to take `sda5` to `sda` is taking `mmcblk0p1` to `mmcblk` and that the error goes unnoticed.)

Additional info:
* Build Date: 2015-03-26 16:40 UTC

Steps to reproduce:
* Basic setup of GPT partition table with a ext2, 100 MiB /dev/mmcblk0p1 and ext4, 2000000 MiB /dev/mmcblk0p2 (I'm using gdisk).
* `mount /dev/mmcblk0p2 /mnt && mkdir /mnt/boot && mount /dev/mmcblk0p1 /mnt/boot`
* `syslinux-install_update -c /mnt -i`
* Update /mnt/boot/syslinux/syslinux.cfg to reflect the root filesystem at /dev/mmcblk0p2.
* `syslinux-install_update -c /mnt -m`
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Sunday, 28 February 2016, 17:14 GMT
Reason for closing:  Fixed
Additional comments about closing:  6.04-5
Comment by Christoph Gysin (christoph.gysin) - Monday, 14 September 2015, 19:09 GMT
Could you test if attached patch fixes the problem?
Comment by Anatol Pomozov (anatolik) - Tuesday, 15 September 2015, 00:05 GMT
Thanks for the patch. A few remarks:

- there is similar "local disk="${bootpart%%[[:digit:]]*}"" code just a few lines above in the raid checking section. Do we need to fix it the same way?

- we need to have a guard that checks $disk is a valid storage device to prevent this kind of issues in the future.
Comment by Christoph Gysin (christoph.gysin) - Tuesday, 15 September 2015, 05:51 GMT
I extracted a function get_disk(). Let me know if I missed a spot.
Comment by Anatol Pomozov (anatolik) - Tuesday, 15 September 2015, 06:47 GMT
Typo - 'error: '$diskj' is not a valid block device' diskj -> disk. Otherwise patch looks fine.

I am away from my workstation and will be available to test it only in 2 weeks.
Comment by Christoph Gysin (christoph.gysin) - Tuesday, 15 September 2015, 06:56 GMT
Fixed typo.
Comment by Anatol Pomozov (anatolik) - Saturday, 31 October 2015, 05:30 GMT
Sorry for the delay. I just merged your patch with some minor modifications. Thanks for you work. Could you please pull the latest version of this script and check that everything works as expected?
Comment by Christoph Gysin (christoph.gysin) - Saturday, 31 October 2015, 19:03 GMT
There is still a "$diskj" typo in the current version.

Also, I'd change the error message back, since a partition is also a block device. There is no such thing as a "block partition".

Please see attached patch.
Comment by Anatol Pomozov (anatolik) - Saturday, 31 October 2015, 21:45 GMT
Your suggestion makes sense. Thanks. Just submitted it to svn.

Loading...