I'm trying to build /usr/ports/sysutils/e2fsprogs/ on FreeBSD. For that I'm following below steps:

  1. cd $port go to port directory: /user/ports /sysutils/e2fsprogs
  2. run 'make extract' --> will download source code
  3. cp 'file' directory to file.bckp
  4. move xyz.c xyz.c.orig
  5. do required change in xyz.c
  6. run 'make makepatch' --> will save patch in file directory
  7. run'make clean patch' --> pull fresh code and apply patch
  8. run 'make build' ---> build

When I do that I'm getting below error:

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

'make clean patch' stops at 'File to patch'.Ideally it should pick patches from files directory. But that is not happening.

If I supply patch file created by 'make patch' even then build fails. Any Idea What I'm doing wrong?

Patch creation:

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 # 

content of patch.

--- 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);
        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));
  • 1
    I suspect that you are not telling us about an important step in this description. Are you applying the patch on the same machine in the same tree as you made the patch? What version of e2fsprogs did you make the patch against? – JdeBP Sep 8 '17 at 5:02
  • 1
    If you are making makepatch, you shouldn't call diff manually. Why do you do that? – arrowd Sep 8 '17 at 6:20
  • Try making your changes to the source code as the last step before make build. – Kusalananda Sep 8 '17 at 7:59
  • 1
    @JdeBP : No aim not doing anything extra. Following exact same steps in same order. I tried on two version e2fsprogs-1.43.4 and e2fsprogs-1.42.10. – Satpal Parmar Sep 8 '17 at 9:14
  • arrowd: Diff is diff of file I modified. Just to share the change the I made. Not running any diff. It content of file created by make patch – Satpal Parmar Sep 8 '17 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.