Compare commits

..

10 Commits

Author SHA1 Message Date
victor
49535cb998 bless 2025-09-27 03:05:05 +02:00
victor
6daf9c499f bless 2025-09-27 00:34:18 +02:00
Your Name
4df22a038f bless 2025-09-24 23:54:35 +00:00
Your Name
535365bc1a bless 2025-09-24 23:53:49 +00:00
Your Name
fd7081778b bless 2025-09-23 16:12:34 +00:00
Your Name
c6732e14e9 Bless 2025-09-23 10:15:47 +00:00
victor
7e834acae9 bless 2025-09-23 11:48:30 +02:00
Your Name
885fe574da bless 2025-09-23 06:53:20 +00:00
Your Name
99b4fe9808 bless 2025-09-23 06:41:54 +00:00
Your Name
d26952319c bless 2025-09-22 20:05:58 +00:00
515 changed files with 110466 additions and 63 deletions

108
Makefile
View File

@ -1,44 +1,111 @@
CC = clang
SRC_DIR := src SRC_DIR := src
SRC := $(SRC_DIR)/main.c SRC := $(wildcard $(SRC_DIR)/*.c)
BUILD_DIR := build BUILD_DIR := build
ASSETS := assets ASSETS := assets
TARGET := $(BUILD_DIR)/hello TARGET := $(BUILD_DIR)/hello
INCLUDE := /usr/include/
CTOOLS := $(SRC_DIR)/ctools CTOOLS := $(SRC_DIR)/ctools
LIBFT_DIR := $(CTOOLS)/libft LIBFT_DIR := $(CTOOLS)/libft
LIBFT := $(LIBFT_DIR)/lib/libft.a LIBFT := $(LIBFT_DIR)/lib/libft.a
LIB := $(LIBFT) LIB := $(LIBFT) $(LIBGPIOD)
CFLAGS := -Wall -Wextra -Werror --target=arm-linux-gnueabihf TOOLCHAIN_DIR := $(HOME)/.local/toolchains
TOOLCHAIN := $(TOOLCHAIN_DIR)/aarch64-linux-musl-cross
TOOLCHAIN_BIN := $(TOOLCHAIN)/bin
MUSL_LD := $(TOOLCHAIN_BIN)/aarch64-linux-musl-ld
CC := $(TOOLCHAIN_BIN)/aarch64-linux-musl-gcc
DOCKER_CMD := /bin/sh -c 'hello "host.docker.internal" "8000"' LIBGPIOD_INCLUDE := $(TOOLCHAIN)/include
LIBGPIOD := $(TOOLCHAIN)/lib/libgpiod.a
CFLAGS := -Wall -Wextra -Werror -I$(LIBGPIOD_INCLUDE)
DOCKER_CMD := /bin/sh #-c 'hello "host.docker.internal" "8000"'
MINIROOTFS := $(ASSETS)/minirootfs.tar.gz MINIROOTFS := $(ASSETS)/minirootfs.tar.gz
ALPINE := alpine/
LINKER_FLAGS := -L$(TOOLCHAIN)/lib -lgpiod
ALPINE := alpine
ALPINE_KERNEL := alpine/boot/vmlinuz-rpi
ALPINE_INITFRAM_FS := alpine/boot/initramfs-rpi
ALPINE_BIN := $(ALPINE)/bin ALPINE_BIN := $(ALPINE)/bin
ALPINE_TAR := $(ASSETS)/alpine-rpi-aarch64.gz
ALPINE_HEADLESS := $(ASSETS)/headless.apkovl.tar.gz
get: $(ALPINE) $(ASSETS) ALPINE_CUSTOM_IMG := $(BUILD_DIR)/alpine-custom.img
wget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/armhf/alpine-minirootfs-3.22.1-armhf.tar.gz -O $(MINIROOTFS)
tar xvf $(MINIROOTFS) -C $^
all: $(SRC) $(BUILD_DIR) $(LIB) PLATFORM := arm64
$(CC) $(CFLAGS) -o $(TARGET) -static $(SRC) $(LIB) QEMU_VM := qemu-system-aarch64
cp $(TARGET) $(ALPINE_BIN) QEMU_IMG := qemu-img
tar czf $(MINIROOTFS) -C alpine ./
docker import --platform linux/arm/v7 $(MINIROOTFS) alpine-custom:latest SSH_AUTH_KEYS := $(ALPINE)/authorized_keys
all: $(TARGET)
$(TARGET): $(SRC) $(BUILD_DIR) $(LIB) $(LIBGPIOD)
$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LIB) $(LIBGPIOD)
get: $(ASSETS) $(ALPINE_TAR) $(ALPINE_HEADLESS)
rm -rf $(ALPINE)/*
tar xvf $(ALPINE_TAR) -C $(ALPINE)
cp $(ALPINE_HEADLESS) $(ALPINE)
sync: $(TARGET)
rsync -avz root@pi:/media/mmcblk0p1/ ./image
rsync -avz ./build/* root@pi:/root/build/
img: get $(ALPINE) $(BUILD_DIR)
$(QEMU_IMG) create -f raw $(ALPINE_CUSTOM_IMG) 512M
mformat -i $(ALPINE_CUSTOM_IMG) -F ::
mcopy -i $(ALPINE_CUSTOM_IMG) -s $(ALPINE)/* ::
$(SSH_AUTH_KEYS):
cp ~/.ssh/authorized_keys $(ALPINE)
bootable: $(ALPINE) $(WPA_CONFIG) get
tar czf $(MINIROOTFS) -C $(ALPINE) ./
$(ALPINE_HEADLESS):
wget https://github.com/macmpi/alpine-linux-headless-bootstrap/raw/98728731299f262eab270941c522138d6c5cea73/headless.apkovl.tar.gz -O $(ALPINE_HEADLESS)
$(LIBGPIOD): $(TOOLCHAIN)
rm -f $(LIBGPIOD)
git clone https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git && \
cd libgpiod && \
export ac_cv_func_malloc_0_nonnull=yes && \
export ac_cv_func_realloc_0_nonnull=yes && \
./autogen.sh && \
./configure --host=aarch64-linux-musl \
--prefix=$(TOOLCHAIN) \
--enable-tools=no \
--enable-bindings-cxx=no \
--disable-shared \
--enable-static && \
make && make install && \
cd .. && \
rm -rf libgpiod
run: all $(TOOLCHAIN): | $(TOOLCHAIN_DIR)
docker run --add-host=host.docker.internal:host-gateway --platform linux/arm/v7 -it alpine-custom $(DOCKER_CMD) wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar xvf aarch64-linux-musl-cross.tgz -C $(TOOLCHAIN_DIR)
rm aarch64-linux-musl-cross.tgz
$(TOOLCHAIN_DIR):
mkdir -p $@
$(ALPINE_TAR):
wget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/aarch64/alpine-rpi-3.22.1-aarch64.tar.gz -O $(ALPINE_TAR)
$(LIB): $(LIB):
make -C $(LIBFT_DIR) make aarch64 -C $(LIBFT_DIR)
$(BUILD_DIR): $(BUILD_DIR):
mkdir -p $@ mkdir -p $@
@ -50,4 +117,7 @@ $(ASSETS):
mkdir -p $@ mkdir -p $@
clean: clean:
rm -rf $(BUILD_DIR) rm -rf $(BUILD_DIR) $(ALPINE) $(ASSETS)
make fclean -C $(LIBFT_DIR)
.PHONY: sync

0
image/apks/.boot_repository Executable file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
image/apks/aarch64/iw-6.9-r0.apk Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More