Bug 187910 - sysutils/syslinux: failed to create ldlinux.c32
Summary: sysutils/syslinux: failed to create ldlinux.c32
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-24 22:20 UTC by Uffe Jakobsen
Modified: 2014-10-13 10:25 UTC (History)
1 user (show)

See Also:


Attachments
syslinux.patch (1015 bytes, patch)
2014-09-29 03:40 UTC, Uffe Jakobsen
no flags Details | Diff
syslinux.patch (1017 bytes, patch)
2014-09-29 03:46 UTC, Uffe Jakobsen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Uffe Jakobsen 2014-03-24 22:20:00 UTC
Executing the following against a msdosfs slice (/dev/ada0s1) fails

# syslinux -i -f   /dev/ada0s1
syslinux: failed to create ldlinux.c32

Is seems impossible to perform syslinux installs with the current release of the syslinux port 6.02 - it used work the last time I needed it - at syslinux 6.0 or 6.01
Comment 1 Kurt Jaeger freebsd_committer freebsd_triage 2014-05-23 20:53:57 UTC
State Changed
From-To: open->feedback

Tested on 10.0p3-amd64, reproduced the problem
Comment 2 John Marino freebsd_committer freebsd_triage 2014-07-26 14:41:58 UTC
This port has no maintainer, so I guess somebody needs to come up with a patch.
Comment 3 Uffe Jakobsen 2014-09-29 03:40:16 UTC
Created attachment 147790 [details]
syslinux.patch
Comment 4 Uffe Jakobsen 2014-09-29 03:41:10 UTC
The attached patch solved the problem reported here
Comment 5 Uffe Jakobsen 2014-09-29 03:46:37 UTC
Created attachment 147791 [details]
syslinux.patch
Comment 6 Uffe Jakobsen 2014-09-29 03:47:09 UTC
Previous patch did not apply clean - fixed
Comment 7 Uffe Jakobsen 2014-10-05 15:33:25 UTC
Would someone be so kind to take a look at this patch - I believe that this case is in "patch ready state"

Executive summary: previous maintainer did an error in the ports adaption patches - effectively creating the problem that I reported - this is now fixed with the current change.

I'm stepping up to maintain this port - if that can speed things up :-)
Comment 8 John Marino freebsd_committer freebsd_triage 2014-10-05 16:25:18 UTC
Testing linux patches is not easy for me, but it's a minimal patch and uffe has some credibility.

He's requested maintainership, so in addition to applying the patch, the MAINTAINER needs to be updated and from what I can tell, the PORTREVISION needs to be bumped in addition to the patch.

Moving to the patch-ready pool for a more thorough review...
Comment 9 Uffe Jakobsen 2014-10-09 02:42:32 UTC
How to test:

Despite the name of this port (syslinux) - no linux is actually required in order to test this patch.

Background:
syslinux is a boot menu (manager) ala grub - just without the ugly syntax
On DOS partitions it installs a stage1 boot loader file "ldlinux.sys" into the filesystem root - it is hooked into the PBR (partition boot record).
A stage2 (com32) boot loader called "ldlinux.c32" is also installed into the filesystem root - this installation (of ldlinux.c32) fails with the current port.
The attached patch fixes that issue.


Here is a quick "before-and-after-patch" test-case:

Make sure that you have the mtools (emulators/mtools) package installed.
All you need is a FreeBSD root access, an usb-stick or similar media that can be manipulated for test purposes - in other words no
valuable data should be on that media.

The rest of this text assumes that device /dev/da0 and slice-partition /dev/da0s1 identifies the USB device that testing is to be carried out on.

1) Create a MBR-style partition table on the usb stick (da0) - use your favourite partitioning tool - fdisk, gpart etc
2) Create a MSDOS partition (slice) on the usb stick (da0) - use your favourite partitioning tool - fdisk, gpart etc
3) Create a MSDOS filesystem on the newly created partition (da0s1) - command: newfs_msdos /dev/da0s1
4) Display newly created (empty) MSDOS filesystem - run: # mdir -a -i /dev/da0s1

5) before applying my patch to syslinux - running the following command:

# syslinux -i -f /dev/da0s1

Results in error message:
syslinux: failed to create ldlinux.c32

6) run:
# mdir -a -i /dev/da0s1
shows that only ldlinux.sys is copied to root of the MSDOS filesystem - ldlinux.c32 is not seen

7) after applying my patch to syslinux - running the following command:

# syslinux -i -f /dev/da0s1

Completes without error

8) rerun:

# mdir -a -i /dev/da0s1

should show that now both ldlinux.sys and ldlinux.c32 is copied to root of MSDOS filesystem.

9) Done.
Comment 10 Kurt Jaeger freebsd_committer freebsd_triage 2014-10-10 18:22:22 UTC
There is a newer version of syslinux (6.03) around. Would you provide a patch that also does the 6.02 -> 6.03 ? I'd test it and commit it ?

And thanks for the wonderful explaination!
Comment 11 Uffe Jakobsen 2014-10-13 09:57:41 UTC
Hello,

Yes I'll be happy to provide an update to syslinux 6.03.

But with my current workload at $work - I may need some weeks for proper testing etc.

With that in mind I wonder if we could put this patch "into production" until then ?
Comment 12 commit-hook freebsd_committer freebsd_triage 2014-10-13 10:23:00 UTC
A commit references this bug:

Author: pi
Date: Mon Oct 13 10:22:19 UTC 2014
New revision: 370762
URL: https://svnweb.freebsd.org/changeset/ports/370762

Log:
  sysutils/syslinux: fix bug, give maintainer to submitter

  PR:		187910
  Submitted by:	uffe@uffe.org

Changes:
  head/sysutils/syslinux/Makefile
  head/sysutils/syslinux/files/patch-libinstaller-syslinux.h
Comment 13 Kurt Jaeger freebsd_committer freebsd_triage 2014-10-13 10:25:07 UTC
Committed to syslinux in version 6.02, thanks!