Skip to content

Instantly share code, notes, and snippets.

View vasi's full-sized avatar

Dave Vasilevsky vasi

  • Montreal
View GitHub Profile

Cross-compiling for ArchPower

Here's how I setup reasonably fast builds for ArchPower 32-bit. There are many ways to do this, but this is what worked for me, and it made my builds much faster than native.

Warning: Cross-compiling could give you different results from compiling on a real POWER/PowerPC box! Usually it's fine, but be cautious about distributing the resulting binaries.

We'll use icecream to coordinate cross-compilation.

Build a toolchain targeting ArchPower

@vasi
vasi / test_segv.c
Last active October 26, 2025 06:04
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sched.h>
void print_maps(void *addr) {
char cmd[256];
snprintf(cmd, sizeof(cmd), "grep %lx /proc/%d/maps",
@vasi
vasi / ofchooser.cfg
Last active September 19, 2025 09:21
ofchooser.cfg
9 "Internal Mac OS 9" hd:9,\\:tbxi
# External OS 9 needs full path
f "FW Mac OS 9" /pci@f4000000/firewire@e/@1d20399007241/@4008/@0:10,\\:tbxi
x "Mac OS X" fwd:25,\\:tbxi
y Yellowdog fwd:12,yaboot
d "Debian sid" fwd:18,grub
a ArchPower fwd:20,grub
l Lubuntu fwd:22,yaboot
u "Front USB port" usb0/disk:2,\\:tbxi
o "Open Firmware" OF
@vasi
vasi / php-pear-1.10.13-4.azl3.src.rpm.log
Last active September 11, 2025 13:50
php-pear-1.10.13-4.azl3.src.rpm.log
time="2025-09-11T13:22:30Z" level=info msg="* Creating a ccache manager instance *"
time="2025-09-11T13:22:30Z" level=info msg=" ccache root folder : ()"
time="2025-09-11T13:22:30Z" level=info msg=" ccache remote configuration: ()"
time="2025-09-11T13:22:30Z" level=warning msg="Failed to initialize the ccache manager:\nCCache root directory cannot be empty."
time="2025-09-11T13:22:30Z" level=debug msg="Using (/usr/bin/pigz) to extract tar"
time="2025-09-11T13:22:30Z" level=info msg="Building (php-pear-1.10.13-4.azl3.src.rpm)."
time="2025-09-11T13:22:30Z" level=debug msg="Executing: [tar -I /usr/bin/pigz -xf /root/azurelinux/build/worker/worker_chroot.tar.gz -C /root/azurelinux/build/worker/chroot/php-pear-1.10.13-4.azl3]"
@vasi
vasi / ccache-stats.txt
Last active September 9, 2025 10:23
Azure Linux ccache
Cacheable calls: 2607 / 2622 (99.43%)
Hits: 2396 / 2607 (91.91%)
Direct: 2393 / 2396 (99.87%)
Preprocessed: 3 / 2396 ( 0.13%)
Misses: 211 / 2607 ( 8.09%)
Uncacheable calls: 15 / 2622 ( 0.57%)
Local storage:
Cache size (GiB): 5.0 / 5.0 (99.88%)
Cleanups: 20
Hits: 2396 / 2607 (91.91%)
@vasi
vasi / coredns-1.11.4-7.azl3.src.rpm.log
Created September 6, 2025 18:29
AzureLinux coredns build failure
time="2025-09-05T21:05:38Z" level=info msg="* Creating a ccache manager instance *"
time="2025-09-05T21:05:38Z" level=info msg=" ccache root folder : (/root/azurelinux/ccache)"
time="2025-09-05T21:05:38Z" level=info msg=" ccache remote configuration: (/root/azurelinux/toolkit/resources/manifests/package/ccache-configuration.json)"
time="2025-09-05T21:05:38Z" level=info msg=" loading ccache configuration file: /root/azurelinux/toolkit/resources/manifests/package/ccache-configuration.json"
time="2025-09-05T21:05:38Z" level=info msg=" Type : azure-blob-storage"
time="2025-09-05T21:05:38Z" level=info msg=" TenantId : "
time="2025-09-05T21:05:38Z" level=info msg=" UserName : "
time="2025-09-05T21:05:38Z" level=info msg=" StorageAccount : marinerccache"
time="2025-09-05T21:05:38Z" level=info msg=" ContainerName : 30-stable"
time="2025-09-05T21:05:38Z" level=info msg=" Tagsfolder : tags"
@vasi
vasi / mkofboot.sh
Last active August 29, 2025 19:20
mkofboot.sh
#!/bin/bash
output=${1-ofboot}
count=0
entries=()
addentry() {
count=$((count + 1))
entries+=("$@")
#include <sys/mman.h>
#include <fcntl.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
// Run: sudo ./test /sys/bus/pci/devices/*:00:10.0/resource2
char *file = argv[1];
fprintf(stderr, "file = %s\n", file);
int fd = open(file, O_RDWR | O_CLOEXEC);
fprintf(stderr, "fd = %d\n", fd);
SUBSYSTEM!="pci", GOTO="gdm_pci_device_end"
ACTION!="bind", ACTION!="add", GOTO="gdm_pci_device_end"
# cirrus
ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
# virtio
ATTR{vendor}=="0x1af4", ATTR{device}=="0x1050", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
# qxl
ATTR{vendor}=="0x1b36", ATTR{device}=="0x0100", RUN+="/usr/bin/touch /run/udev/gdm-machine-has-virtual-gpu", ENV{GDM_MACHINE_HAS_VIRTUAL_GPU}="1", GOTO="gdm_pci_device_end"
# vga
@vasi
vasi / .bashrc
Created March 13, 2025 05:27
uBlue bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"