Skip to content

Commit

Permalink
sysutils/busybox: fix reboot/halt/poweroff commands
Browse files Browse the repository at this point in the history
  • Loading branch information
samm-git committed Jul 16, 2023
1 parent 5560f5f commit fc96e77
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions sysutils/busybox/Makefile
@@ -1,5 +1,6 @@
PORTNAME= busybox
PORTVERSION= 1.36.1
PORTREVISION= 1
CATEGORIES= sysutils misc shells
MASTER_SITES= https://busybox.net/downloads/

Expand Down
15 changes: 15 additions & 0 deletions sysutils/busybox/files/patch-init_halt.c
@@ -0,0 +1,15 @@
--- init/halt.c.orig 2021-01-01 10:52:27 UTC
+++ init/halt.c
@@ -169,8 +169,11 @@ int halt_main(int argc UNUSED_PARAM, char **argv)
RB_POWER_OFF,
RB_AUTOBOOT
};
+#if defined(__FreeBSD__)
+ static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGINT };
+#else
static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM };
-
+#endif
int delay = 0;
int which, flags, rc;

12 changes: 12 additions & 0 deletions sysutils/busybox/files/patch-init_reboot.h
@@ -0,0 +1,12 @@
--- init/reboot.h.orig 2023-07-16 21:31:29 UTC
+++ init/reboot.h
@@ -12,6 +12,9 @@
# define RB_DISABLE_CAD 0
# define RB_POWER_OFF 0x4321fedc
# define RB_AUTOBOOT 0x01234567
+# elif defined(__FreeBSD__)
+# define RB_HALT_SYSTEM RB_HALT
+# define RB_POWER_OFF RB_POWEROFF
# elif defined(RB_HALT)
# define RB_HALT_SYSTEM RB_HALT
# endif

0 comments on commit fc96e77

Please sign in to comment.