busybox patches for FreeBSD

Denys Vlasenko vda.linux at googlemail.com
Sun Jul 5 01:37:21 UTC 2009


On Friday 26 June 2009 14:17, Luigi Rizzo wrote:
> Hi,
> I am maintaining the busybox port on FreeBSD, and there are
> several patches that I have to apply from time to time to
> let the code build (attached is the current version for 1.13.4).
> Some of them are also required when building openwrt on FreeBSD,
> because parts of the code are built to run on the host.
> 
> It would be great if you could push at least some of them
> upstream to the main distribution -- I think they apply to
> most of the *BSD and derived systems around, including __APPLE__
> (in fact i do see you have some conditional code for __APPLE__
> that may apply to FreeBSD as well).
> 
> The patch i am attaching is targeted to the FreeBSD port --  if you
> are interested i can try to clean it up a bit so that it has the
> right #ifdefs to avoid interference when building on linux

Yes, I wouldn't send patches which contain gems like this:

+#if !defined __FreeBSD__
+#endif


I applied some parts of the patch, the rest is in attached z.patch.


--- ./libbb/lineedit.c  2008-11-29 07:48:56.000000000 +0100
+++ ../../work.patched/busybox-1.13.4/libbb/lineedit.c  2009-06-25 23:05:54.000000000 +0200
@@ -78,6 +78,7 @@
 #if ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR
 static const char null_str[] ALIGN1 = "";
 #endif
+typedef void (*sighandler_t)(int signum);

 /* We try to minimize both static and stack usage. */
 struct lineedit_statics {

Instead of this, perhaps remove the single occurence
of sighandler_t in that file.


--- ./libbb/login.c     2008-11-09 18:28:09.000000000 +0100
+++ ../../work.patched/busybox-1.13.4/libbb/login.c     2009-06-25 23:05:54.000000000 +0200
@@ -62,10 +62,12 @@
                        case 'm':
                                outbuf = uts.machine;
                                break;
+#if 0
                        case 'D':
                        case 'o':
                                outbuf = uts.domainname;
                                break;
+#endif

Yeah right, now *Linux* users will come complaining... not acceptable.
Make it so that both camps are satisfied. (Many such places)


--- ./libbb/makedev.c   2008-11-09 18:28:09.000000000 +0100
+++ ../../work.patched/busybox-1.13.4/libbb/makedev.c   2009-06-25 23:05:54.000000000 +0200
@@ -5,7 +5,7 @@
  *
  * Licensed under GPL version 2, see file LICENSE in this tarball for details.
  */
-
+#if !defined __FreeBSD__
 /* We do not include libbb.h - #define makedev() is there! */
 #include "platform.h"
 #include <features.h>
@@ -22,3 +22,4 @@
        return makedev(major, minor);
 }
 #endif
+#endif /* !__FreeBSD__ */

Maybe it's needed, but it's not obvious. Can you add a comment why
do you exclude this code on FreeBSD?


If you will be sending further patches, please diff them
against current git.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: z.diff
Type: text/x-diff
Size: 8786 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090705/887746c8/attachment.bin>


More information about the busybox mailing list