如何修改和构建 Freebsd 端口 (e2fsprogs)

如何修改和构建 Freebsd 端口 (e2fsprogs)

我正在尝试在 FreeBSD 上构建 /usr/ports/sysutils/e2fsprogs/ 。为此,我遵循以下步骤:

  1. cd $port 转到端口目录:/user/ports /sysutils/e2fsprogs
  2. 运行 'make extract' --> 将下载源代码
  3. cp 'file' 目录到 file.bckp
  4. 移动 xyz.c xyz.c.orig
  5. 在 xyz.c 中进行必要的更改
  6. 运行 'make makepatch' --> 将补丁保存在文件目录中
  7. 运行'make clean patch' --> 提取新代码并应用补丁
  8. 运行“make build”--->构建

当我这样做时,我收到以下错误:

root@pod1229-client98:/usr/ports/sysutils/e2fsprogs # make clean patch DISABLE_VULNERABILITIES=yes
===>  Cleaning for e2fsprogs-1.42.10
===>  License GPLv2 accepted by the user
===>  Found saved configuration for e2fsprogs-1.42.10
===>   e2fsprogs-1.42.10 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by e2fsprogs-1.42.10 for building
===>  Extracting for e2fsprogs-1.42.10
=> SHA256 Checksum OK for e2fsprogs-1.42.10.tar.xz.
===>  Patching for e2fsprogs-1.42.10
===>  Applying FreeBSD patches for e2fsprogs-1.42.10

 File to patch: /data/usr/ports/sysutils/e2fsprogs/files/patch-misc__mke2fs.c
    No such line 551 in input file, ignoring
    1 out of 1 hunks failed--saving rejects to /data/usr/ports/sysutils/e2fsprogs/files/patch-misc__mke2fs.c.rej
    => Patch patch-misc__mke2fs.c failed to apply cleanly.
    => Patch(es) patch-350897 patch-e2fsck__unix.c patch-lib__ext2fs__ext2_fs.h patch-lib__ext2fs__tdb.c patch-lib__ext2fs__tst_bitops.c patch-lib__uuid__gen_uuid.c patch-misc__Makefile.in applied cleanly.
    *** Error code 1
    Stop.

“make clean patch”在“要修补的文件”处停止。理想情况下,它应该从文件目录中选择补丁。但这并没有发生。

如果我提供由“make patch”创建的补丁文件,即使构建失败。知道我做错了什么吗?

补丁创建:

root@pod1229-client98:/usr/ports/sysutils/e2fsprogs # make makepatch
/usr/bin/diff -ud misc/mke2fs.c.orig misc/mke2fs.c > /data/usr/ports/sysutils/e2fsprogs/files/patch-misc__mke2fs.c
root@pod1229-client98:/usr/ports/sysutils/e2fsprogs # 

补丁内容。

--- misc/mke2fs.c.orig  2017-09-07 17:08:40 UTC
+++ misc/mke2fs.c
@@ -552,7 +552,7 @@
        io_channel_set_blksize(fs->io, fs->blocksize);
        free(buf);
        if (retval)
-               fprintf(stderr, _("Warning: could not erase sector %d: %s\n"),
+               fprintf(stderr, _("Warning: satpal could not erase sector %d: %s\n"),
                        sect, error_message(retval));
 }

相关内容