This commit is contained in:
victor 2025-09-27 00:34:18 +02:00
parent 4df22a038f
commit 6daf9c499f
505 changed files with 110256 additions and 68 deletions

View File

@ -1,32 +1,37 @@
CC = clang
SRC_DIR := src SRC_DIR := src
SRC := $(SRC_DIR)/main.c SRC := $(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)
TOOLCHAIN_DIR := $(HOME)/.local/toolchains TOOLCHAIN_DIR := $(HOME)/.local/toolchains
TOOLCHAIN := $(TOOLCHAIN_DIR)/aarch64-linux-musl-cross TOOLCHAIN := $(TOOLCHAIN_DIR)/aarch64-linux-musl-cross
TOOLCHAIN_BIN := $(TOOLCHAIN)/bin TOOLCHAIN_BIN := $(TOOLCHAIN)/bin
MUSL_LD := $(TOOLCHAIN_BIN)/aarch64-linux-musl-ld MUSL_LD := $(TOOLCHAIN_BIN)/aarch64-linux-musl-ld
CC := $(TOOLCHAIN_BIN)/aarch64-linux-musl-gcc
CFLAGS := -Wall -Wextra -Werror --target=aarch64-linux-musl \ LIBGPIOD_INCLUDE := $(TOOLCHAIN)/include
--sysroot=$(TOOLCHAIN) \ LIBGPIOD := $(TOOLCHAIN)/lib/libgpiod.a
--ld-path=$(MUSL_LD)
CFLAGS := -Wall -Wextra -Werror -I$(LIBGPIOD_INCLUDE)
DOCKER_CMD := /bin/sh #-c 'hello "host.docker.internal" "8000"' DOCKER_CMD := /bin/sh #-c 'hello "host.docker.internal" "8000"'
MINIROOTFS := $(ASSETS)/minirootfs.tar.gz MINIROOTFS := $(ASSETS)/minirootfs.tar.gz
LINKER_FLAGS := -L$(TOOLCHAIN)/lib -lgpiod
ALPINE := alpine ALPINE := alpine
ALPINE_KERNEL := alpine/boot/vmlinuz-rpi ALPINE_KERNEL := alpine/boot/vmlinuz-rpi
ALPINE_INITFRAM_FS := alpine/boot/initramfs-rpi ALPINE_INITFRAM_FS := alpine/boot/initramfs-rpi
@ -44,8 +49,7 @@ SSH_AUTH_KEYS := $(ALPINE)/authorized_keys
all: $(TARGET) all: $(TARGET)
$(TARGET): $(TOOLCHAIN) $(SRC) $(BUILD_DIR) $(LIB) $(TARGET): $(SRC) $(BUILD_DIR) $(LIB) $(LIBGPIOD)
echo $(HOME)
$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LIB) $(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LIB)
get: $(ASSETS) $(ALPINE_TAR) $(ALPINE_HEADLESS) get: $(ASSETS) $(ALPINE_TAR) $(ALPINE_HEADLESS)
@ -53,17 +57,9 @@ get: $(ASSETS) $(ALPINE_TAR) $(ALPINE_HEADLESS)
tar xvf $(ALPINE_TAR) -C $(ALPINE) tar xvf $(ALPINE_TAR) -C $(ALPINE)
cp $(ALPINE_HEADLESS) $(ALPINE) cp $(ALPINE_HEADLESS) $(ALPINE)
qemu: $(ALPINE_CUSTOM_IMG) img sync: $(TARGET)
$(QEMU_VM) -machine raspi3ap -cpu cortex-a53 -smp 4 -m 512M \ rsync -avz root@pi:/media/mmcblk0p1/ ./image
-drive format=raw,file=$(ALPINE_CUSTOM_IMG) \ rsync -avz ./build/* root@pi:/root/build/
-nographic
#$(QEMU_VM) -M virt -cpu cortex-a72 -smp 2 -m 1G \
# -kernel $(ALPINE_KERNEL) \
# -initrd $(ALPINE_INITFRAM_FS) \
# -append "console=ttyAMA0 root=/dev/vda rw" \
# -drive format=raw,file=fat:rw:$(ALPINE)/ \
# -nographic \
# -virtfs local,path=$(BUILD_DIR),mount_tag=$(BUILD_DIR),security_model=none
img: get $(ALPINE) $(BUILD_DIR) img: get $(ALPINE) $(BUILD_DIR)
$(QEMU_IMG) create -f raw $(ALPINE_CUSTOM_IMG) 512M $(QEMU_IMG) create -f raw $(ALPINE_CUSTOM_IMG) 512M
@ -79,6 +75,19 @@ bootable: $(ALPINE) $(WPA_CONFIG) get
$(ALPINE_HEADLESS): $(ALPINE_HEADLESS):
wget https://github.com/macmpi/alpine-linux-headless-bootstrap/raw/98728731299f262eab270941c522138d6c5cea73/headless.apkovl.tar.gz -O $(ALPINE_HEADLESS) wget https://github.com/macmpi/alpine-linux-headless-bootstrap/raw/98728731299f262eab270941c522138d6c5cea73/headless.apkovl.tar.gz -O $(ALPINE_HEADLESS)
$(LIBGPIOD):
git clone https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git && \
cd libgpiod && \
./autogen.sh && \
./configure --host=aarch64-linux-musl \
--prefix=/home/victor/.local/toolchains/aarch64-linux-musl-cross \
--enable-tools=no \
--enable-bindings-cxx=no && \
make && make install && \
cd .. && \
rm -rf libgpiod
$(TOOLCHAIN): | $(TOOLCHAIN_DIR) $(TOOLCHAIN): | $(TOOLCHAIN_DIR)
wget https://musl.cc/aarch64-linux-musl-cross.tgz wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar xvf aarch64-linux-musl-cross.tgz -C $(TOOLCHAIN_DIR) tar xvf aarch64-linux-musl-cross.tgz -C $(TOOLCHAIN_DIR)

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