mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
- Unbreak and update to 4.03
- Fix and rename patches to match file names - Depend on perl5 only during build - Make portlint happy - Replace with sed and do it in pre-patch stage - Use DATADIR and MANPREFIX PR: ports/152300 Approved by: luigi (maintainer, private e-mail)
This commit is contained in:
parent
72fea00235
commit
c5912aade0
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=264784
17 changed files with 310 additions and 194 deletions
|
@ -7,8 +7,7 @@
|
|||
#
|
||||
|
||||
PORTNAME= syslinux
|
||||
PORTVERSION= 3.83
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 4.03
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= ${MASTER_SITE_KERNEL_ORG}
|
||||
MASTER_SITE_SUBDIR= linux/boot/syslinux
|
||||
|
@ -17,32 +16,27 @@ MAINTAINER= luigi@FreeBSD.org
|
|||
COMMENT= Syslinux for FreeBSD
|
||||
|
||||
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
|
||||
RUN_DEPENDS= mtools:${PORTSDIR}/emulators/mtools
|
||||
|
||||
IGNORE= Does not run; segfaults.
|
||||
RUN_DEPENDS= mtools:${PORTSDIR}/emulators/mtools
|
||||
|
||||
MAN1= syslinux.1
|
||||
|
||||
USE_BZIP2= yes
|
||||
USE_GMAKE= yes
|
||||
# perl is used in post-extract to convert elf names.
|
||||
USE_PERL5= yes
|
||||
USE_PERL5_BUILD= yes
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
# Following instructions at http://phaq.phunsites.net/2007/02/14/
|
||||
# compiling-pxelinux-and-memdisk-on-freebsd/
|
||||
# convert elf_i386 to elf_i386_fbsd
|
||||
post-extract:
|
||||
(cd ${WRKSRC}; \
|
||||
${FIND} . -type f -exec ${GREP} -le 'elf_i386' \{\} \; | \
|
||||
${XARGS} ${PERL} -i -p -e 's/elf_i386/elf_i386_fbsd/g;' )
|
||||
|
||||
# utility target to build pkg-plist
|
||||
_A = mbr/mbr.bin mbr/gptmbr.bin
|
||||
_A += core/pxelinux.0 core/isolinux.bin gpxe/gpxelinux.0
|
||||
_A += memdisk/memdisk
|
||||
_A += com32/menu/*.c32 com32/modules/*.c32
|
||||
_A = mbr/mbr.bin mbr/gptmbr.bin \
|
||||
core/pxelinux.0 core/isolinux.bin gpxe/gpxelinux.0 \
|
||||
memdisk/memdisk \
|
||||
com32/menu/*.c32 com32/modules/*.c32
|
||||
|
||||
# convert elf_i386 to elf_i386_fbsd
|
||||
pre-patch:
|
||||
@(cd ${WRKSRC}; \
|
||||
${FIND} . -type f -exec ${GREP} -le 'elf_i386' \{\} \; | \
|
||||
${XARGS} ${REINPLACE_CMD} -e 's/elf_i386/elf_i386_fbsd/g;' )
|
||||
|
||||
build_pkg-plist:
|
||||
@( ${ECHO} "bin/syslinux" ; \
|
||||
|
@ -51,9 +45,9 @@ build_pkg-plist:
|
|||
${ECHO} "@dirrm share/syslinux" )
|
||||
|
||||
do-install:
|
||||
${MKDIR} ${PREFIX}/share/${PORTNAME}
|
||||
( cd ${WRKSRC}; ${INSTALL_DATA} ${_A} ${PREFIX}/share/${PORTNAME} )
|
||||
${MKDIR} ${DATADIR}
|
||||
( cd ${WRKSRC}; ${INSTALL_DATA} ${_A} ${DATADIR} )
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/mtools/syslinux ${PREFIX}/bin
|
||||
${INSTALL_MAN} ${WRKSRC}/man/syslinux.1 ${PREFIX}/man/man1
|
||||
${INSTALL_MAN} ${WRKSRC}/man/syslinux.1 ${MANPREFIX}/man/man1
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
MD5 (syslinux-3.83.tar.bz2) = 069160bc3776eca71a57cabace22bb24
|
||||
SHA256 (syslinux-3.83.tar.bz2) = 9ec84d6dcc188f082a875b69796b196f98ea8c0102b55b03123616a285c2d9f9
|
||||
SIZE (syslinux-3.83.tar.bz2) = 3184349
|
||||
SHA256 (syslinux-4.03.tar.bz2) = c65567e324f9d1f7f794ae8f9578a0292bbd47d7b8d895a004d2f0152d0bda38
|
||||
SIZE (syslinux-4.03.tar.bz2) = 4381187
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
diff -ubwr ./Makefile ../../work/syslinux-3.72/Makefile
|
||||
--- ./Makefile 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../work/syslinux-3.72/Makefile 2008-11-25 11:38:14.000000000 +0100
|
||||
@@ -48,18 +48,18 @@
|
||||
# Note: libinstaller is both a BSUBDIR and an ISUBDIR. It contains
|
||||
# files that depend only on the B phase, but may have to be regenerated
|
||||
# for "make installer".
|
||||
-BSUBDIRS = codepage core memdisk modules com32 mbr memdump gpxe sample \
|
||||
+BSUBDIRS_ = codepage core memdisk modules com32 mbr memdump gpxe sample \
|
||||
libinstaller dos win32
|
||||
ITARGET =
|
||||
IOBJECTS = $(ITARGET) dos/copybs.com \
|
||||
utils/gethostip utils/isohybrid utils/mkdiskimage \
|
||||
- mtools/syslinux linux/syslinux extlinux/extlinux
|
||||
-ISUBDIRS = libinstaller mtools linux extlinux utils
|
||||
+ mtools/syslinux
|
||||
+ISUBDIRS = libinstaller mtools
|
||||
|
||||
# Things to install in /usr/bin
|
||||
INSTALL_BIN = mtools/syslinux
|
||||
# Things to install in /sbin
|
||||
-INSTALL_SBIN = extlinux/extlinux
|
||||
+INSTALL_SBIN = #extlinux/extlinux
|
||||
# Things to install in /usr/lib/syslinux
|
||||
INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 core/isolinux.bin \
|
||||
core/isolinux-debug.bin \
|
||||
diff -ubwr ./com32/libutil/md5.c ../../work/syslinux-3.72/com32/libutil/md5.c
|
||||
--- ./com32/libutil/md5.c 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../work/syslinux-3.72/com32/libutil/md5.c 2008-11-25 11:32:22.000000000 +0100
|
||||
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
-#include <endian.h>
|
||||
+#include <machine/endian.h>
|
||||
#include <md5.h>
|
||||
|
||||
static void MD5Transform(uint32_t [4], const unsigned char [64]);
|
||||
diff -ubwr ./com32/libutil/sha256crypt.c ../../work/syslinux-3.72/com32/libutil/sha256crypt.c
|
||||
--- ./com32/libutil/sha256crypt.c 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../work/syslinux-3.72/com32/libutil/sha256crypt.c 2008-11-25 11:32:22.000000000 +0100
|
||||
@@ -1,8 +1,8 @@
|
||||
/* SHA256-based Unix crypt implementation.
|
||||
Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>. */
|
||||
|
||||
-#include <alloca.h>
|
||||
-#include <endian.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <machine/endian.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
diff -ubwr ./com32/libutil/sha512crypt.c ../../work/syslinux-3.72/com32/libutil/sha512crypt.c
|
||||
--- ./com32/libutil/sha512crypt.c 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../work/syslinux-3.72/com32/libutil/sha512crypt.c 2008-11-25 11:32:22.000000000 +0100
|
||||
@@ -1,8 +1,8 @@
|
||||
/* SHA512-based Unix crypt implementation.
|
||||
Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>. */
|
||||
|
||||
-#include <alloca.h>
|
||||
-#include <endian.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <machine/endian.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
25
sysutils/syslinux/files/patch-Makefile
Normal file
25
sysutils/syslinux/files/patch-Makefile
Normal file
|
@ -0,0 +1,25 @@
|
|||
--- Makefile.orig 2010-10-20 21:25:38.000000000 +0200
|
||||
+++ Makefile 2010-11-16 14:26:43.525341037 +0100
|
||||
@@ -54,18 +54,18 @@
|
||||
# Note: libinstaller is both a BSUBDIR and an ISUBDIR. It contains
|
||||
# files that depend only on the B phase, but may have to be regenerated
|
||||
# for "make installer".
|
||||
-BSUBDIRS = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
|
||||
+BSUBDIRS_ = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
|
||||
libinstaller dos win32 win64 dosutil
|
||||
ITARGET =
|
||||
IOBJECTS = $(ITARGET) \
|
||||
utils/gethostip utils/isohybrid utils/mkdiskimage \
|
||||
- mtools/syslinux linux/syslinux extlinux/extlinux
|
||||
-ISUBDIRS = libinstaller mtools linux extlinux utils
|
||||
+ mtools/syslinux
|
||||
+ISUBDIRS = libinstaller mtools
|
||||
|
||||
# Things to install in /usr/bin
|
||||
INSTALL_BIN = mtools/syslinux
|
||||
# Things to install in /sbin
|
||||
-INSTALL_SBIN = extlinux/extlinux
|
||||
+INSTALL_SBIN = #extlinux/extlinux
|
||||
# Things to install in /usr/lib/syslinux
|
||||
INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 core/isolinux.bin \
|
||||
core/isolinux-debug.bin \
|
12
sysutils/syslinux/files/patch-com32-libutil-md5.c
Normal file
12
sysutils/syslinux/files/patch-com32-libutil-md5.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff -ubwr ./com32/libutil/md5.c ../../work/syslinux-3.72/com32/libutil/md5.c
|
||||
--- ./com32/libutil/md5.c 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../work/syslinux-3.72/com32/libutil/md5.c 2008-11-25 11:32:22.000000000 +0100
|
||||
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
-#include <endian.h>
|
||||
+#include <machine/endian.h>
|
||||
#include <md5.h>
|
||||
|
||||
static void MD5Transform(uint32_t [4], const unsigned char [64]);
|
14
sysutils/syslinux/files/patch-com32-libutil-sha256crypt.c
Normal file
14
sysutils/syslinux/files/patch-com32-libutil-sha256crypt.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff -ubwr ./com32/libutil/sha256crypt.c ../../work/syslinux-3.72/com32/libutil/sha256crypt.c
|
||||
--- ./com32/libutil/sha256crypt.c 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../work/syslinux-3.72/com32/libutil/sha256crypt.c 2008-11-25 11:32:22.000000000 +0100
|
||||
@@ -1,8 +1,8 @@
|
||||
/* SHA256-based Unix crypt implementation.
|
||||
Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>. */
|
||||
|
||||
-#include <alloca.h>
|
||||
-#include <endian.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <machine/endian.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
14
sysutils/syslinux/files/patch-com32-libutil-sha512crypt.c
Normal file
14
sysutils/syslinux/files/patch-com32-libutil-sha512crypt.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff -ubwr ./com32/libutil/sha512crypt.c ../../work/syslinux-3.72/com32/libutil/sha512crypt.c
|
||||
--- ./com32/libutil/sha512crypt.c 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../work/syslinux-3.72/com32/libutil/sha512crypt.c 2008-11-25 11:32:22.000000000 +0100
|
||||
@@ -1,8 +1,8 @@
|
||||
/* SHA512-based Unix crypt implementation.
|
||||
Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>. */
|
||||
|
||||
-#include <alloca.h>
|
||||
-#include <endian.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <machine/endian.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
|
@ -1,6 +1,5 @@
|
|||
diff -ubwr ../../work/syslinux-3.72/libinstaller/bin2c.pl ./libinstaller/bin2c.pl
|
||||
--- ../../work/syslinux-3.72/libinstaller/bin2c.pl 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ./libinstaller/bin2c.pl 2008-11-26 13:32:45.000000000 +0100
|
||||
--- libinstaller/bin2c.pl.orig 2010-10-20 21:25:38.000000000 +0200
|
||||
+++ libinstaller/bin2c.pl 2010-11-16 14:24:32.427122941 +0100
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
$pad = 1 if ($pad < 1);
|
||||
|
@ -13,7 +12,7 @@ diff -ubwr ../../work/syslinux-3.72/libinstaller/bin2c.pl ./libinstaller/bin2c.p
|
|||
@@ -74,5 +74,6 @@
|
||||
@st = stat STDIN;
|
||||
|
||||
printf "\nint %s_mtime = %d;\n", $table_name, $st[9];
|
||||
printf "\nconst int %s_mtime = %d;\n", $table_name, $st[9];
|
||||
+printf "\nunsigned char *%s = _%s;\n", $table_name, $table_name;
|
||||
|
||||
exit 0;
|
27
sysutils/syslinux/files/patch-libinstaller-syslinux.h
Normal file
27
sysutils/syslinux/files/patch-libinstaller-syslinux.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
--- libinstaller/syslinux.h.orig 2010-10-20 21:25:38.000000000 +0200
|
||||
+++ libinstaller/syslinux.h 2010-11-16 15:03:24.279408609 +0100
|
||||
@@ -18,12 +18,12 @@
|
||||
#include "setadv.h"
|
||||
|
||||
/* The standard boot sector and ldlinux image */
|
||||
-extern unsigned char syslinux_bootsect[];
|
||||
+extern unsigned char *syslinux_bootsect;
|
||||
extern const unsigned int syslinux_bootsect_len;
|
||||
extern const int syslinux_bootsect_mtime;
|
||||
|
||||
-extern unsigned char syslinux_ldlinux[];
|
||||
-extern const unsigned int syslinux_ldlinux_len;
|
||||
+extern unsigned char *syslinux_ldlinux;
|
||||
+extern unsigned int syslinux_ldlinux_len;
|
||||
extern const int syslinux_ldlinux_mtime;
|
||||
|
||||
#define boot_sector syslinux_bootsect
|
||||
@@ -31,7 +31,7 @@
|
||||
#define boot_image syslinux_ldlinux
|
||||
#define boot_image_len syslinux_ldlinux_len
|
||||
|
||||
-extern unsigned char syslinux_mbr[];
|
||||
+extern unsigned char *syslinux_mbr;
|
||||
extern const unsigned int syslinux_mbr_len;
|
||||
extern const int syslinux_mbr_mtime;
|
||||
|
64
sysutils/syslinux/files/patch-libinstaller-syslxopt.c
Normal file
64
sysutils/syslinux/files/patch-libinstaller-syslxopt.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
--- libinstaller/syslxopt.c.orig 2010-10-20 21:25:38.000000000 +0200
|
||||
+++ libinstaller/syslxopt.c 2010-11-16 15:09:16.897550744 +0100
|
||||
@@ -44,6 +44,8 @@
|
||||
.activate_partition = 0,
|
||||
.force = 0,
|
||||
.bootsecfile = NULL,
|
||||
+ .verbose = 0,
|
||||
+ .bimage = NULL,
|
||||
};
|
||||
|
||||
const struct option long_options[] = {
|
||||
@@ -57,7 +59,7 @@
|
||||
{"stupid", 0, NULL, 's'},
|
||||
{"heads", 1, NULL, 'H'},
|
||||
{"raid-mode", 0, NULL, 'r'},
|
||||
- {"version", 0, NULL, 'v'},
|
||||
+ {"version", 0, NULL, 'V'},
|
||||
{"help", 0, NULL, 'h'},
|
||||
{"once", 1, NULL, OPT_ONCE},
|
||||
{"clear-once", 0, NULL, 'O'},
|
||||
@@ -65,10 +67,12 @@
|
||||
{"menu-save", 1, NULL, 'M'},
|
||||
{"mbr", 0, NULL, 'm'}, /* DOS/Win32 only */
|
||||
{"active", 0, NULL, 'a'}, /* DOS/Win32 only */
|
||||
+ {"verbose", 0, NULL, 'v' },
|
||||
+ {"bimage", 1, NULL, 'b' },
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
-const char short_options[] = "t:fid:UuzsS:H:rvho:OM:ma";
|
||||
+const char short_options[] = "t:fid:UuzsS:H:rVho:OM:mavb:";
|
||||
|
||||
void __attribute__ ((noreturn)) usage(int rv, enum syslinux_mode mode)
|
||||
{
|
||||
@@ -109,7 +113,9 @@
|
||||
" --raid -r Fall back to the next device on boot failure\n"
|
||||
" --once=... %s Execute a command once upon boot\n"
|
||||
" --clear-once -O Clear the boot-once command\n"
|
||||
- " --reset-adv Reset auxilliary data\n",
|
||||
+ " --reset-adv Reset auxilliary data\n"
|
||||
+ " --bimage=# -b Load a custom boot image\n"
|
||||
+ " --verbose -v Increase verbosity level\n",
|
||||
mode == MODE_SYSLINUX ? " " : "-o");
|
||||
/*
|
||||
* Have to chop this roughly in half for the DOS installer due
|
||||
@@ -209,11 +215,17 @@
|
||||
case 'a':
|
||||
opt.activate_partition = 1;
|
||||
break;
|
||||
- case 'v':
|
||||
+ case 'V':
|
||||
fprintf(stderr,
|
||||
"%s " VERSION_STR " Copyright 1994-" YEAR_STR
|
||||
" H. Peter Anvin et al\n", program);
|
||||
exit(0);
|
||||
+ case 'v':
|
||||
+ opt.verbose = 1;
|
||||
+ break;
|
||||
+ case 'b':
|
||||
+ opt.bimage = optarg;
|
||||
+ break;
|
||||
default:
|
||||
fprintf(stderr, "%s: Unknown option: -%c\n", program, optopt);
|
||||
usage(EX_USAGE, mode);
|
11
sysutils/syslinux/files/patch-libinstaller-syslxopt.h
Normal file
11
sysutils/syslinux/files/patch-libinstaller-syslxopt.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- libinstaller/syslxopt.h.orig 2010-11-16 14:53:01.569209804 +0100
|
||||
+++ libinstaller/syslxopt.h 2010-11-16 14:53:08.769406093 +0100
|
||||
@@ -18,6 +18,8 @@
|
||||
int install_mbr;
|
||||
int activate_partition;
|
||||
const char *bootsecfile;
|
||||
+ int verbose;
|
||||
+ const char *bimage;
|
||||
};
|
||||
|
||||
enum long_only_opt {
|
|
@ -1,21 +0,0 @@
|
|||
--- libinstaller/syslinux.h.orig 2009-10-06 02:06:06.000000000 +0400
|
||||
+++ libinstaller/syslinux.h 2009-12-04 10:09:04.000000000 +0300
|
||||
@@ -17,15 +17,15 @@
|
||||
#include "advconst.h"
|
||||
|
||||
/* The standard boot sector and ldlinux image */
|
||||
-extern unsigned char syslinux_bootsect[];
|
||||
+extern unsigned char *syslinux_bootsect;
|
||||
extern unsigned int syslinux_bootsect_len;
|
||||
extern int syslinux_bootsect_mtime;
|
||||
|
||||
-extern unsigned char syslinux_ldlinux[];
|
||||
+extern unsigned char *syslinux_ldlinux;
|
||||
extern unsigned int syslinux_ldlinux_len;
|
||||
extern int syslinux_ldlinux_mtime;
|
||||
|
||||
-extern unsigned char syslinux_mbr[];
|
||||
+extern unsigned char *syslinux_mbr;
|
||||
extern unsigned int syslinux_mbr_len;
|
||||
extern int syslinux_mbr_mtime;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
--- man/syslinux.1 2008-09-26 01:46:02.000000000 +0200
|
||||
+++ ../../files/syslinux.1 2008-11-25 15:38:02.000000000 +0100
|
||||
@@ -9,20 +9,22 @@
|
||||
--- man/syslinux.1.orig 2010-10-20 21:25:38.000000000 +0200
|
||||
+++ man/syslinux.1 2010-11-16 14:50:50.947688888 +0100
|
||||
@@ -7,21 +7,23 @@
|
||||
.I device
|
||||
.SH DESCRIPTION
|
||||
\fBSyslinux\fP is a boot loader for the Linux operating system which
|
||||
|
@ -16,13 +16,15 @@
|
|||
+normal FAT formatted disk (or file image), and
|
||||
+execute the command:
|
||||
.IP
|
||||
.B syslinux /dev/fd0
|
||||
.B syslinux \-\-install /dev/fd0
|
||||
.PP
|
||||
-This will alter the boot sector on the disk and copy a file named
|
||||
-LDLINUX.SYS into its root directory.
|
||||
+This will copy a file named LDLINUX.SYS into the root directory of
|
||||
+the disk, install a suitable boot code in the boot sector, and patch the
|
||||
+boot sector and LDLINUX.SYS (see \fBNOTES\fP).
|
||||
-.I ldlinux.sys
|
||||
-into its root directory.
|
||||
+This will alter the boot sector on the disk, copy a file named
|
||||
+.I LDLINUX.SYS
|
||||
+into its root directory and patch the boot sector and LDLINUX.SYS
|
||||
+(see \fBNOTES\fP).
|
||||
.PP
|
||||
-On boot time, by default, the kernel will be loaded from the image named
|
||||
+On boot time, by default, the boot loader will try to load a linux
|
||||
|
@ -51,8 +53,8 @@
|
|||
+
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-s
|
||||
@@ -380,9 +397,11 @@
|
||||
\fB\-i\fP, \fB\-\-install\fP
|
||||
@@ -412,9 +429,11 @@
|
||||
.BR lilo (8),
|
||||
.BR keytab-lilo.pl (8),
|
||||
.BR fdisk (8),
|
13
sysutils/syslinux/files/patch-mtools-Makefile
Normal file
13
sysutils/syslinux/files/patch-mtools-Makefile
Normal file
|
@ -0,0 +1,13 @@
|
|||
--- mtools/Makefile.orig 2010-11-16 15:44:53.882896167 +0100
|
||||
+++ mtools/Makefile 2010-11-16 15:45:31.261185647 +0100
|
||||
@@ -1,9 +1,8 @@
|
||||
topdir = ..
|
||||
include $(topdir)/MCONFIG
|
||||
|
||||
-OPTFLAGS = -g -Os
|
||||
INCLUDES = -I. -I.. -I../libfat -I../libinstaller
|
||||
-CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
|
||||
+CFLAGS += $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(INCLUDES)
|
||||
LDFLAGS = -s
|
||||
|
||||
SRCS = syslinux.c \
|
|
@ -1,15 +1,30 @@
|
|||
--- mtools/syslinux.c.orig 2009-10-06 02:06:06.000000000 +0400
|
||||
+++ mtools/syslinux.c 2009-12-04 11:18:37.000000000 +0300
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "syslinux.h"
|
||||
#include "libfat.h"
|
||||
--- mtools/syslinux.c.orig 2010-10-20 21:25:38.000000000 +0200
|
||||
+++ mtools/syslinux.c 2010-11-16 14:59:55.668749526 +0100
|
||||
@@ -20,12 +20,12 @@
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
-#include <alloca.h>
|
||||
+//#include <alloca.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <inttypes.h>
|
||||
-#include <mntent.h>
|
||||
+//#include <mntent.h>
|
||||
#include <paths.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -42,6 +42,8 @@
|
||||
#include "setadv.h"
|
||||
#include "syslxopt.h"
|
||||
|
||||
+int verbose=0;
|
||||
+
|
||||
char *program; /* Name of program */
|
||||
char *device; /* Device to install to */
|
||||
pid_t mypid;
|
||||
@@ -123,6 +125,53 @@
|
||||
|
||||
@@ -124,6 +126,53 @@
|
||||
return xpread(pp, buf, secsize, offset);
|
||||
}
|
||||
|
||||
|
@ -37,7 +52,7 @@
|
|||
+ return 1;
|
||||
+ }
|
||||
+ if (sb.st_size < 1024 || sb.st_size > 0x8000) {
|
||||
+ fprintf(stderr, "boot image %s bad size %lld\n", name, sb.st_size);
|
||||
+ fprintf(stderr, "boot image %s bad size %lld\n", name, (long long int)sb.st_size);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ buf = calloc(1, sb.st_size);
|
||||
|
@ -62,46 +77,52 @@
|
|||
+
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
static unsigned char sectbuf[512];
|
||||
@@ -160,6 +209,10 @@
|
||||
while (*opt) {
|
||||
if (*opt == 's') {
|
||||
stupid = 1;
|
||||
+ } else if ( *opt == 'v' ) {
|
||||
+ verbose++;
|
||||
+ } else if ( *opt == 'b' && argp[1] ) {
|
||||
+ load_boot_image(*++argp);
|
||||
} else if (*opt == 'r') {
|
||||
raid_mode = 1;
|
||||
} else if (*opt == 'f') {
|
||||
@@ -220,11 +273,10 @@
|
||||
fprintf(mtc,
|
||||
/* "MTOOLS_NO_VFAT=1\n" */
|
||||
"MTOOLS_SKIP_CHECK=1\n" /* Needed for some flash memories */
|
||||
static unsigned char sectbuf[SECTOR_SIZE];
|
||||
@@ -150,9 +199,15 @@
|
||||
|
||||
parse_options(argc, argv, MODE_SYSLINUX);
|
||||
|
||||
+ if (opt.verbose)
|
||||
+ verbose = 1;
|
||||
+
|
||||
if (!opt.device)
|
||||
usage(EX_USAGE, MODE_SYSLINUX);
|
||||
|
||||
+ if (opt.bimage != NULL)
|
||||
+ load_boot_image(opt.bimage);
|
||||
+
|
||||
if (opt.sectors || opt.heads || opt.reset_adv || opt.set_once
|
||||
|| (opt.update_only > 0) || opt.menu_save) {
|
||||
fprintf(stderr,
|
||||
@@ -216,11 +271,9 @@
|
||||
/* These are needed for some flash memories */
|
||||
"MTOOLS_SKIP_CHECK=1\n"
|
||||
"MTOOLS_FAT_COMPATIBILITY=1\n"
|
||||
- "drive s:\n"
|
||||
- " file=\"/proc/%lu/fd/%d\"\n"
|
||||
+ "drive s: file=\"%s\"\n"
|
||||
" offset=%llu\n",
|
||||
(unsigned long)mypid,
|
||||
- dev_fd, (unsigned long long)filesystem_offset);
|
||||
+ device, (unsigned long long)filesystem_offset);
|
||||
fclose(mtc);
|
||||
- (unsigned long)mypid,
|
||||
- dev_fd, (unsigned long long)opt.offset);
|
||||
+ opt.device, (unsigned long long)opt.offset);
|
||||
|
||||
/*
|
||||
@@ -236,8 +288,10 @@
|
||||
}
|
||||
if (ferror(mtc) || fclose(mtc))
|
||||
die_err(mtools_conf);
|
||||
@@ -239,9 +292,11 @@
|
||||
syslinux_reset_adv(syslinux_adv);
|
||||
|
||||
/* This command may fail legitimately */
|
||||
+ if (verbose) fprintf(stderr, "doing mattrib\n");
|
||||
system("mattrib -h -r -s s:/ldlinux.sys 2>/dev/null");
|
||||
status = system("mattrib -h -r -s s:/ldlinux.sys 2>/dev/null");
|
||||
(void)status; /* Keep _FORTIFY_SOURCE happy */
|
||||
|
||||
+ if (verbose) fprintf(stderr, "doing mcopy\n");
|
||||
mtp = popen("mcopy -D o -D O -o - s:/ldlinux.sys", "w");
|
||||
if (!mtp || (fwrite(syslinux_ldlinux, 1, syslinux_ldlinux_len, mtp)
|
||||
!= syslinux_ldlinux_len) ||
|
||||
@@ -249,7 +303,9 @@
|
||||
* Now, use libfat to create a block map
|
||||
*/
|
||||
if (!mtp ||
|
||||
fwrite(syslinux_ldlinux, 1, syslinux_ldlinux_len, mtp)
|
||||
@@ -259,7 +314,9 @@
|
||||
+ SECTOR_SIZE - 1) >> SECTOR_SHIFT;
|
||||
sectors = calloc(ldlinux_sectors, sizeof *sectors);
|
||||
fs = libfat_open(libfat_xpread, dev_fd);
|
||||
+ if (verbose) fprintf(stderr, "libfat_open returns %p\n", fs);
|
||||
ldlinux_cluster = libfat_searchdir(fs, 0, "LDLINUX SYS", NULL);
|
||||
|
@ -109,11 +130,11 @@
|
|||
secp = sectors;
|
||||
nsectors = 0;
|
||||
s = libfat_clustertosector(fs, ldlinux_cluster);
|
||||
@@ -257,6 +313,7 @@
|
||||
@@ -267,6 +324,7 @@
|
||||
*secp++ = s;
|
||||
nsectors++;
|
||||
s = libfat_nextsector(fs, s);
|
||||
+ if (verbose) fprintf(stderr, "libfat_nextsector returns %d\n", s);
|
||||
+ if (verbose) fprintf(stderr, "libfat_nextsector returns %d\n", (int)s);
|
||||
}
|
||||
libfat_close(fs);
|
||||
|
|
@ -1,30 +1,38 @@
|
|||
bin/syslinux
|
||||
share/syslinux/mbr.bin
|
||||
share/syslinux/gptmbr.bin
|
||||
share/syslinux/pxelinux.0
|
||||
share/syslinux/isolinux.bin
|
||||
share/syslinux/gpxelinux.0
|
||||
share/syslinux/memdisk
|
||||
share/syslinux/menu.c32
|
||||
share/syslinux/vesamenu.c32
|
||||
share/syslinux/chain.c32
|
||||
share/syslinux/cmd.c32
|
||||
share/syslinux/config.c32
|
||||
share/syslinux/cpuidtest.c32
|
||||
share/syslinux/disk.c32
|
||||
share/syslinux/dmitest.c32
|
||||
share/syslinux/elf.c32
|
||||
share/syslinux/ethersel.c32
|
||||
share/syslinux/gpxecmd.c32
|
||||
share/syslinux/ifcpu64.c32
|
||||
share/syslinux/kbdmap.c32
|
||||
share/syslinux/linux.c32
|
||||
share/syslinux/meminfo.c32
|
||||
share/syslinux/pcitest.c32
|
||||
share/syslinux/pmload.c32
|
||||
share/syslinux/reboot.c32
|
||||
share/syslinux/sanboot.c32
|
||||
share/syslinux/sdi.c32
|
||||
share/syslinux/vesainfo.c32
|
||||
share/syslinux/vpdtest.c32
|
||||
@dirrm share/syslinux
|
||||
%%DATADIR%%/mbr.bin
|
||||
%%DATADIR%%/gptmbr.bin
|
||||
%%DATADIR%%/pxelinux.0
|
||||
%%DATADIR%%/isolinux.bin
|
||||
%%DATADIR%%/gpxelinux.0
|
||||
%%DATADIR%%/memdisk
|
||||
%%DATADIR%%/menu.c32
|
||||
%%DATADIR%%/vesamenu.c32
|
||||
%%DATADIR%%/cat.c32
|
||||
%%DATADIR%%/chain.c32
|
||||
%%DATADIR%%/cmd.c32
|
||||
%%DATADIR%%/config.c32
|
||||
%%DATADIR%%/cpuid.c32
|
||||
%%DATADIR%%/cpuidtest.c32
|
||||
%%DATADIR%%/disk.c32
|
||||
%%DATADIR%%/dmitest.c32
|
||||
%%DATADIR%%/elf.c32
|
||||
%%DATADIR%%/ethersel.c32
|
||||
%%DATADIR%%/gpxecmd.c32
|
||||
%%DATADIR%%/host.c32
|
||||
%%DATADIR%%/ifcpu.c32
|
||||
%%DATADIR%%/ifcpu64.c32
|
||||
%%DATADIR%%/ifplop.c32
|
||||
%%DATADIR%%/kbdmap.c32
|
||||
%%DATADIR%%/linux.c32
|
||||
%%DATADIR%%/ls.c32
|
||||
%%DATADIR%%/meminfo.c32
|
||||
%%DATADIR%%/pcitest.c32
|
||||
%%DATADIR%%/pmload.c32
|
||||
%%DATADIR%%/pwd.c32
|
||||
%%DATADIR%%/reboot.c32
|
||||
%%DATADIR%%/sanboot.c32
|
||||
%%DATADIR%%/sdi.c32
|
||||
%%DATADIR%%/vesainfo.c32
|
||||
%%DATADIR%%/vpdtest.c32
|
||||
%%DATADIR%%/whichsys.c32
|
||||
@dirrm %%DATADIR%%
|
||||
|
|
Loading…
Add table
Reference in a new issue