container hack for build: unshare + chroot. unshare guarantees unmounts, given a ephemeral file system namespace :-)
#!/bin/sh
set -eu
rootfs_dir=$1
adm_user=$2
if [ "$#" -eq 3 ]; then
proxy_address=""
cmdline=$3
else
proxy_address=$3
cmdline=$4
fi
sudo unshare --mount --pid --fork sh -c "
mount --bind /sys '$rootfs_dir/sys'
mount --bind /dev '$rootfs_dir/dev'
mount -t proc proc '$rootfs_dir/proc'
mount -t devpts devpts '$rootfs_dir/dev/pts'
chroot '$rootfs_dir' su - '$adm_user' -c 'export PUAVO_CACHE_PROXY=\"$proxy_address\"; $cmdline'
"
@anneroth Danke
30 tips zu mach dich digital unabhängig von @kuketzblog
Link https://www.kuketz-blog.de/unplugtrump-mach-dich-digital-unabhaengig-von-trump-und-big-tech/
BREAKING: The C++ committee imposes tariffs on non-US locales.
Quite cool, I have to say. fwupdmgr managed to update my HP USB-C Dock G5.
fun Linux fact: because MAP_SHARED|MAP_ANONYMOUS is actually a file-backed mapping under the hood, unmapping part of such a mapping does not discard the data stored in that part:
$ cat mremap.c
#define _GNU_SOURCE
#include <err.h>
#include <stdio.h>
#include <sys/mman.h>
int main(void) {
char *p = mmap(NULL, 0x2000, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
if (p == MAP_FAILED) err(1, "mmap");
p[0x1000] = 'X';
if (munmap(p+0x1000, 0x1000)) err(1, "munmap");
// that 'X' we just wrote... is it gone?
// nope, let's bring it back!
p = mremap(p, 0x1000, 0x2000, MREMAP_MAYMOVE);
if (p == MAP_FAILED) err(1, "mremap");
printf("p[0x1000]='%c'\n", p[0x1000]);
}
$ gcc -o mremap mremap.c
$ ./mremap
p[0x1000]='X'
$