fix: better cmdline/config txt setup/restore

This commit is contained in:
2026-10-27 23:25:14 +01:00
parent 055d2c5f12
commit b16ad95d97
3 changed files with 48 additions and 27 deletions
+44 -27
View File
@@ -12,22 +12,6 @@ LDLIBS ?= -lm -lGL -lglfw -lasound
# FILES
test:
echo $(PROJECT_DIR)
# forge-steel/src/main.c:
# $(MAKE) -s submodule-init
#
# forge-steel/hashmap.c/hashmap.c:
# $(MAKE) -s submodule-init
#
# forge-steel/log.c/src/log.c:
# $(MAKE) -s submodule-init
#
# forge-steel/include/linmath.h:
# $(MAKE) -s submodule-init
# $(BUILD_DIR)/$(TARGET): forge-steel/src/main.c forge-steel/hashmap.c/hashmap.c forge-steel/log.c/src/log.c forge-steel/include/linmath.h
$(BUILD_DIR)/$(TARGET): forge-steel/src/main.c forge-steel/hashmap.c/hashmap.c forge-steel/log.c/src/log.c forge-steel/include/linmath.h
mkdir -p $(BUILD_DIR)
$(CC) $(SOURCES) $(CFLAGS) $(LDLIBS) -o $(BUILD_DIR)/$(TARGET)
@@ -47,14 +31,6 @@ apt-install:
setup-weston:
ln -fs $(PROJECT_DIR)/system/weston.ini $(HOME)/.config/weston.ini
.PHONY: setup-rasp-config
setup-rasp-config:
sudo $(PROJECT_DIR)/line_in_file.sh "include custom.txt" "/boot/firmware/config.txt"
sudo $(PROJECT_DIR)/append_to_file.sh " vc4.tv_norm=PAL" "/boot/firmware/cmdline.txt" "vc4.tv_norm="
sudo $(PROJECT_DIR)/append_to_file.sh " video=Composite-1:720x576ie,tv_mode=PAL" "/boot/firmware/cmdline.txt" "video="
sudo $(PROJECT_DIR)/append_to_file.sh " quiet loglevel=0 consoleblank=1" "/boot/firmware/cmdline.txt" "quiet"
sudo cp -f $(PROJECT_DIR)/system/config.ini /boot/firmware/custom.txt
.PHONY: remove-motd
remove-motd:
sudo rm -rf /etc/motd
@@ -76,7 +52,7 @@ setup-bashrc:
$(PROJECT_DIR)/line_in_file.sh "make -C $(PROJECT_DIR) --no-print-directory start-weston" "$(HOME)/.bashrc"
.PHONY: install
install: remove-passwd apt-install setup-weston setup-rasp-config setup-services setup-bashrc remove-motd
install: remove-passwd apt-install setup-weston remove-motd disable-cloud-init setup-services setup-bashrc
.PHONY: clean
clean:
@@ -98,9 +74,50 @@ start-weston:
@echo "on" | sudo tee /sys/class/drm/card1-Composite-1/status || true
@/usr/bin/weston --shell=kiosk-shell.so --xwayland --log=$(PROJECT_DIR)/weston.log -- kitty --hold make --no-print-directory -C $(PROJECT_DIR) run
.PHONY: host-install
host-install:
.PHONY: start
start: start-bg start-fg
# HOST ONLY
.PHONY: host-submodule-update
host-submodule-update:
git submodule update --init --recursive
.PHONY: host-chmod-opt
host-chmod-opt:
sudo chmod a+rwx /run/media/$(shell whoami)/rootfs/opt/
.PHONY: host-rsync
host-rsync: host-chmod-opt
rsync -a $(PWD) /run/media/$(shell whoami)/rootfs/opt/
.PHONY: host-setup-custom
host-setup-custom:
cp $(PROJECT_DIR)/system/config.ini /run/media/$(shell whoami)/bootfs/custom.txt
.PHONY: host-reset-config
host-reset-config:
sed -i '/include custom.txt/d' /run/media/$(shell whoami)/bootfs/config.txt
.PHONY: host-setup-config
host-setup-config: host-setup-custom host-reset-config
echo "include custom.txt" >> /run/media/$(shell whoami)/bootfs/config.txt
.PHONY: host-reset-cmdline
host-reset-cmdline:
sed -i '2,$$d' /run/media/$(shell whoami)/bootfs/cmdline.txt
.PHONY: host-setup-cmdline
host-setup-cmdline: host-reset-cmdline
cat $(PROJECT_DIR)/system/cmdline.txt >> /run/media/$(shell whoami)/bootfs/cmdline.txt
.PHONY: host-unmount
host-unmount:
sudo umount -R /run/media/$(shell whoami)/rootfs
sudo umount -R /run/media/$(shell whoami)/bootfs
.PHONY: host-install
host-install: host-submodule-update host-rsync host-setup-config host-setup-cmdline host-unmount
.PHONY: host-install-reset
host-install-reset: host-submodule-update host-rsync host-reset-config host-reset-cmdline host-unmount
+1
View File
@@ -0,0 +1 @@
vc4.tv_norm=PAL video=Composite-1:720x576ie,tv_mode=PAL quiet loglevel=0 consoleblank=1
+3
View File
@@ -19,3 +19,6 @@ gpu_mem=64
enable_tvout=1
sdtv_mode=2
sdtv_aspect=1
# --- I2C ---
dtparam=i2c_arm=on