From 25707e3a832e9265d8b9f3b36098c03c2282afd2 Mon Sep 17 00:00:00 2001 From: Paige Thompson Date: Wed, 8 Nov 2023 06:01:59 -0800 Subject: [PATCH] just need to update teh readme now --- .github/workflows/build.yml | 10 ++++++---- Dockerfile | 4 +++- camera.conf.example | 1 + fstab | 3 ++- logrotate.conf | 6 ++++++ packages.txt | 3 +++ startup.txt | 1 + 7 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 logrotate.conf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c638607..2c3d719 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: - name: Install tools run: sudo apt update ; sudo apt -y install python-is-python3 python3-pip exfatprogs parted exfat-fuse binfmt-support qemu-user-static - name: Create installer.bin - run: truncate -s 16384M installer.bin + run: truncate -s 8192M installer.bin - name: Create loopback device run: sudo mknod -m 0660 /dev/loop254 b 7 254 - name: Mount installer.bin as loopback device @@ -29,9 +29,9 @@ jobs: - name: Create BOOT partition run: sudo parted /dev/loop254 mkpart primary fat32 1 256 - name: Create SYSTEM partition - run: sudo parted /dev/loop254 mkpart primary ext2 256 4096 + run: sudo parted /dev/loop254 mkpart primary ext2 256 3128 - name: Create HOME partition - run: sudo parted /dev/loop254 mkpart primary fat32 4096 16384 + run: sudo parted /dev/loop254 mkpart primary fat32 3128 8192 - name: Label BOOT run: sudo parted /dev/loop254 name 1 BOOT - name: Label SYSTEM @@ -65,11 +65,13 @@ jobs: - name: Docker export run: cd /mnt ; sudo docker export rpi-image | sudo tar --exclude=etc/machine-id --exclude=etc/ssh/*_key* --exclude=etc/ssh/moduli -xf - - name: Home directories - run: sudo mkdir /mnt/home/pi/ssh /mnt/home/pi/motion_cam /mnt/home/pi/motion_logs /mnt/home/pi/motion_video /mnt/home/pi/motion_cameras + run: sudo mkdir /mnt/home/pi/ssh mnt/home/pi/system_logs /mnt/home/pi/motion_cam /mnt/home/pi/motion_logs /mnt/home/pi/motion_video /mnt/home/pi/motion_cameras - name: authorized_keys empty file run: sudo touch /mnt/home/pi/ssh/authorized_keys - name: Create empty machine-id run: sudo touch /mnt/etc/machine-id + - name: Motion camera example configuration file + run: sudo cp camera.conf.example mnt/home/pi - name: Copy hosts file run: sudo cp hosts /mnt/etc - name: Copy hostname file diff --git a/Dockerfile b/Dockerfile index 2f64f06..41573c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,8 @@ RUN cat /tmp/startup.txt | xargs -i systemctl enable {} RUN systemctl enable regenerate_ssh_host_keys +ADD logrotate.conf /etc/logrotate.d/logrotate.conf + ADD sshd_config /etc/ssh/sshd_config.d/sshd_config ADD sudoers /etc/sudoers.d @@ -48,7 +50,7 @@ ADD 10-eth.network /etc/systemd/network ADD 10-usb.network /etc/systemd/network -ADD 10-eth.network /etc/systemd/network +ADD 10-enx.network /etc/systemd/network RUN mkdir /home/pi diff --git a/camera.conf.example b/camera.conf.example index f571676..ed4575a 100644 --- a/camera.conf.example +++ b/camera.conf.example @@ -1,3 +1,4 @@ +# Rename to camera.conf and add this to the motion_cameras directory to enable the camera video_device /dev/video0 camera_name CAMERA01 camera_id 101 diff --git a/fstab b/fstab index ac131e3..c17fb4a 100644 --- a/fstab +++ b/fstab @@ -1,3 +1,4 @@ -/dev/mmcblk0p1 /boot/ vfat defaults,noauto 0 0 +/dev/mmcblk0p1 /boot/ vfat defaults 0 0 /dev/mmcblk0p2 / ext4 defaults 0 0 /dev/mmcblk0p3 /home/pi exfat defaults,nofail,uid=4000,gid=5000,dmask=007,fmask=117 0 0 +tmpfs /tmp tmpfs nosuid,nodev,noatime 0 0 \ No newline at end of file diff --git a/logrotate.conf b/logrotate.conf new file mode 100644 index 0000000..0f490c2 --- /dev/null +++ b/logrotate.conf @@ -0,0 +1,6 @@ +/var/log/* { + olddir /home/pi/system_logs + rotate 14 + daily + compress +} \ No newline at end of file diff --git a/packages.txt b/packages.txt index 68b39ac..d5804c2 100644 --- a/packages.txt +++ b/packages.txt @@ -41,3 +41,6 @@ libc6:armel zsh iproute2 less +parted +cron +logrotate diff --git a/startup.txt b/startup.txt index e1f6885..ab002d1 100644 --- a/startup.txt +++ b/startup.txt @@ -2,3 +2,4 @@ ssh motion systemd-networkd systemd-resolved +cron