Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# encoding: UTF-8
# Usage:
# % sudo kldload linux64 linprocfs linsysfs
# % sudo kldload nullfs
# % sudo sysctl security.bsd.unprivileged_chroot=1
# % sudo sysctl vfs.usermount=1
# % ./linux-chroot /usr/bin/glxinfo
# % ./linux-chroot /usr/bin/glxgears -info | grep RENDER
% env LD_PRELOAD=libSegFault.so MESA_LOADER_DRIVER_OVERRIDE=i965 /compat/linux/bin/glxgears -info
GL_RENDERER = Mesa DRI Intel(R) Haswell Desktop
GL_VERSION = 3.0 Mesa 18.3.4
GL_VENDOR = Intel Open Source Technology Center
GL_EXTENSIONS = GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_copy_texture GL_EXT_subtexture GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D GL_IBM_rasterpos_clip GL_ARB_point_parameters GL_EXT_draw_range_elements GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_separate_specular_color GL_EXT_texture_edge_clamp GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_ARB_framebuffer_sRGB GL_ARB_multitexture GL_EXT_framebuffer_sRGB GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat GL_3DFX_texture_compression_FXT1 GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_transpose_matrix G
@shkhln
shkhln / patch-compat32-evdev.patch
Created July 3, 2020 02:52
webcamd, compat32, evdev
diff --git a/kernel/linux_file.c b/kernel/linux_file.c
index a68291a..98cef0a 100644
--- kernel/linux_file.c
+++ kernel/linux_file.c
@@ -194,7 +194,14 @@ linux_read(struct cdev_handle *handle, int fflags, char *ptr, size_t len)
linux_fix_f_flags(&handle->fixed_file, fflags);
- error = handle->fixed_file.f_op->read(&handle->fixed_file, ptr, len, &off);
+ if (fflags & CUSE_FFLAG_COMPAT32) {
lang/gcc9/work/gcc-9.3.0 % ./configure --help
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
diff --git a/linux-c7-python3-libs/Makefile b/linux-c7-python3-libs/Makefile
new file mode 100644
index 0000000..2d7c0af
--- /dev/null
+++ b/linux-c7-python3-libs/Makefile
@@ -0,0 +1,15 @@
+PORTNAME= python3-libs
+PORTVERSION= 3.6.8
+PORTREVISION= 1
+CATEGORIES= linux
#define _GNU_SOURCE
#include <dlfcn.h>
#include <fcntl.h>
#include <string.h>
#include <stdarg.h>
#include <stdint.h>
// pkg install linux-c7-devtools
// /compat/linux/bin/cc --sysroot=/compat/linux -m64 -std=c99 -Wall -ldl -fPIC -shared -o dummy-uvm.so uvm_ioctl_override.c
@shkhln
shkhln / [1] packages
Last active March 12, 2020 17:53
steam-runtime vs linux-c7 packages
% procstat -v `cat ~/.steam/steam.pid` | grep "\.so" | rev | cut -w -f 1 | rev | sort -u | grep "/compat" | xargs pkg which | rev | cut -w -f 1 | rev | sort -u
linux_base-c7-7.7.1908_1
linux-c7-atk-2.28.1
linux-c7-cairo-1.15.12_1
linux-c7-expat-2.1.0_2
linux-c7-fontconfig-2.13.0
linux-c7-freetype-2.8_1
linux-c7-fribidi-1.0.2_1
linux-c7-gdk-pixbuf2-2.36.12
linux-c7-graphite2-1.3.10
diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile
index db3c80b86a7b..a745b44255b5 100644
--- a/devel/binutils/Makefile
+++ b/devel/binutils/Makefile
@@ -15,7 +15,7 @@ LICENSE= GPLv3 LGPL3
LICENSE_COMB= multi
FLAVORS= native aarch64 aarch64_none_elf amd64 arm_gnueabi arm_none_eabi \
- avr i386 mingw32 mips mips64 powerpc powerpc64 riscv64 \
+ avr i386 mingw32 mingw_w64 mips mips64 powerpc powerpc64 riscv64 \
#define _GNU_SOURCE
#include <assert.h>
#include <dlfcn.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
// pkg install linux-c7-devtools
// /compat/linux/bin/cc --sysroot=/compat/linux -m64 -std=c99 -Wall -ldl -pthread -fPIC -shared -o fmod_workaround.so fmod_workaround.c
1566819895.883 [apulse 50037] F pa_mainloop_new (void)
1566819895.883 [apulse 50037] F pa_mainloop_get_api m=0x1d489d0
1566819895.883 [apulse 50037] F pa_context_new mainloop_api=0x1d489d0, name=FMOD Ex Enumerator
1566819895.883 [apulse 50037] F pa_proplist_new (void)
1566819895.883 [apulse 50037] F pa_context_new_with_proplist mainloop_api=0x1d489d0, name=FMOD Ex Enumerator, proplist=0x1d2c910
1566819895.883 [apulse 50037] F pa_proplist_free p=0x1d2c910
1566819895.883 [apulse 50037] P pa_context_connect c=0x1d48aa0, server=(null), flags=0, api=(nil)
1566819895.883 [apulse 50037] F pa_context_ref c=0x1d48aa0
1566819895.883 [apulse 50037] F pa_context_ref c=0x1d48aa0
1566819895.884 [apulse 50037] F pa_context_unref c=0x1d48aa0