Skip to content

Commit

Permalink
sysutils/toybox: Update to 0.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarlsen authored and nunotexbsd committed Aug 15, 2022
1 parent 5362a55 commit 1418764
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 119 deletions.
5 changes: 2 additions & 3 deletions sysutils/toybox/Makefile
@@ -1,5 +1,5 @@
PORTNAME= toybox
PORTVERSION= 0.8.6
PORTVERSION= 0.8.8
CATEGORIES= sysutils
MASTER_SITES= http://landley.net/toybox/downloads/

Expand Down Expand Up @@ -30,7 +30,7 @@ BIN_LINKS= [ cat chgrp chmod chown cksum cpio crc32 date dos2unix echo \
mknod mktemp mountpoint nice pidof printenv pwd rm rmdir sed \
sleep sync touch true uname unix2dos usleep vmstat
SBIN_LINKS= killall5 lsmod mkswap modinfo sysctl
USRBIN_LINKS= acpi ascii base64 basename bunzip2 bzcat cal catv chrt chvt \
USRBIN_LINKS= acpi ascii base64 basename bunzip2 bzcat cal chrt chvt \
clear cmp comm count cut dirname du expand factor fallocate \
file find flock fmt groups head hexedit iconv id killall link \
logger logname lspci lsusb makedevs mkfifo mkpasswd nl nohup \
Expand All @@ -40,7 +40,6 @@ USRBIN_LINKS= acpi ascii base64 basename bunzip2 bzcat cal catv chrt chvt \
uuidgen w watch wc which who whoami xargs xxd yes
USRSBIN_LINKS= chroot


post-patch:
${REINPLACE_CMD} -e 's|<sys/inotify.h>|"${LOCALBASE}/include/sys/inotify.h"|' \
${WRKSRC}/lib/portability.c
Expand Down
6 changes: 3 additions & 3 deletions sysutils/toybox/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1643028839
SHA256 (toybox-0.8.6.tar.gz) = 4298c90a2b238348e4fdc9f89eb4988356c80da3f0cf78c279d2e82b9119034b
SIZE (toybox-0.8.6.tar.gz) = 3458765
TIMESTAMP = 1660384956
SHA256 (toybox-0.8.8.tar.gz) = dafd41978d40f02a61cf1be99a2b4a25812bbfb9c3157e679ee7611202d6ac58
SIZE (toybox-0.8.8.tar.gz) = 3492750
70 changes: 3 additions & 67 deletions sysutils/toybox/files/patch-lib_portability.c
@@ -1,53 +1,6 @@
--- lib/portability.c.orig 2021-12-02 04:45:52 UTC
--- lib/portability.c.orig 2022-08-13 14:55:14 UTC
+++ lib/portability.c
@@ -6,6 +6,10 @@

#include "toys.h"

+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#endif
+
// We can't fork() on nommu systems, and vfork() requires an exec() or exit()
// before resuming the parent (because they share a heap until then). And no,
// we can't implement our own clone() call that does the equivalent of fork()
@@ -332,7 +336,7 @@ ssize_t xattr_fset(int fd, const char* name,
return fsetxattr(fd, name, value, size, 0, flags);
}

-#elif !defined(__OpenBSD__)
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)

ssize_t xattr_get(const char *path, const char *name, void *value, size_t size)
{
@@ -537,6 +541,8 @@ int dev_minor(int dev)
return dev&0xffffff;
#elif defined(__OpenBSD__)
return minor(dev);
+#elif defined(__FreeBSD__)
+ return minor(dev);
#else
#error
#endif
@@ -550,6 +556,8 @@ int dev_major(int dev)
return (dev>>24)&0xff;
#elif defined(__OpenBSD__)
return major(dev);
+#elif defined(__FreeBSD__)
+ return major(dev);
#else
#error
#endif
@@ -563,6 +571,8 @@ int dev_makedev(int major, int minor)
return (minor&0xffffff)|((major&0xff)<<24);
#elif defined(__OpenBSD__)
return makedev(major, minor);
+#elif defined(__FreeBSD__)
+ return makedev(major, minor);
#else
#error
#endif
@@ -623,6 +633,17 @@ int get_block_device_size(int fd, unsigned long long*
@@ -625,6 +625,17 @@ int get_block_device_size(int fd, unsigned long long*
*size = lab.d_secsize * lab.d_nsectors;
return status;
}
Expand All @@ -64,21 +17,4 @@
+}
#endif

// TODO copy_file_range
@@ -690,7 +711,7 @@ int timer_create_wrap(clockid_t c, struct sigevent *se
};
int timer;

- if (syscall(SYS_timer_create, c, &kk, &timer)<0) return -1;
+ if (syscall(SYS_ktimer_create, c, &kk, &timer)<0) return -1;
*t = (timer_t)(long)timer;

return 0;
@@ -699,6 +720,6 @@ int timer_create_wrap(clockid_t c, struct sigevent *se
int timer_settime_wrap(timer_t t, int flags, struct itimerspec *val,
struct itimerspec *old)
{
- return syscall(SYS_timer_settime, t, flags, val, old);
+ return syscall(SYS_ktimer_settime, t, flags, val, old);
}
#endif
// Return bytes copied from in to out. If bytes <0 copy all of in to out.
20 changes: 0 additions & 20 deletions sysutils/toybox/files/patch-lib_portability.h

This file was deleted.

25 changes: 0 additions & 25 deletions sysutils/toybox/files/patch-toys_other_chvt.c

This file was deleted.

48 changes: 48 additions & 0 deletions sysutils/toybox/files/patch-toys_other_openvt.c
@@ -0,0 +1,48 @@
--- toys/other/openvt.c.orig 2022-08-12 07:58:03 UTC
+++ toys/other/openvt.c
@@ -44,8 +44,8 @@ config DEALLOCVT

#define FOR_openvt
#include "toys.h"
-#include <linux/vt.h>
-#include <linux/kd.h>
+#include <sys/consio.h>
+#include <sys/kbio.h>

GLOBALS(
long c;
@@ -72,12 +72,17 @@ static int activate(int fd, int cc)

void openvt_main(void)
{
+ struct vt_stat {
+ unsigned short v_active;
+ unsigned short v_signal;
+ unsigned short v_state;
+ };
struct vt_stat vstate;
int fd, cc = (int)TT.c;
pid_t pid;

// find current console
- if (-1 == (ioctl(fd = open_console(), VT_GETSTATE, &vstate)) ||
+ if (-1 == (ioctl(fd = open_console(), VT_GETACTIVE, &vstate)) ||
(!cc && 0>=(cc = xioctl(fd, VT_OPENQRY, &fd))))
perror_exit("can't find open VT");

@@ -95,7 +100,7 @@ void openvt_main(void)
while (-1 == waitpid(pid, NULL, 0) && errno == EINTR) errno = 0;
if (FLAG(s)) {
activate(fd, vstate.v_active);
- dprintf(2, "%d\n", ioctl(fd, VT_DISALLOCATE, cc));
+ dprintf(2, "%d\n", ioctl(fd, VT_ACTIVATE, cc));
}
}
}
@@ -111,5 +116,5 @@ void deallocvt_main(void)
int fd = open_console(), vt_num = 0; // 0 = all

if (*toys.optargs) vt_num = atolx_range(*toys.optargs, 1, 63);
- if (-1 == ioctl(fd, VT_DISALLOCATE, vt_num)) perror_exit("%d", vt_num);
+ if (-1 == ioctl(fd, VT_ACTIVATE, vt_num)) perror_exit("%d", vt_num);
}
1 change: 0 additions & 1 deletion sysutils/toybox/pkg-plist
Expand Up @@ -51,7 +51,6 @@ toybox/usr/bin/basename
toybox/usr/bin/bunzip2
toybox/usr/bin/bzcat
toybox/usr/bin/cal
toybox/usr/bin/catv
toybox/usr/bin/chrt
toybox/usr/bin/chvt
toybox/usr/bin/clear
Expand Down

0 comments on commit 1418764

Please sign in to comment.