Compare commits

...

10 commits

Author SHA1 Message Date
timoxa0 0499c3f0ef Update kernel to commit 2b004e6b55f8 2024-08-11 16:19:49 +05:00
timoxa0 b96306ca8f Change mode to 644 2024-08-11 16:18:04 +05:00
timoxa0 51df6cbce6 Add path 2024-08-11 16:06:26 +05:00
timoxa0 6d2aa96f44 Add zram mount 2024-08-11 16:06:18 +05:00
timoxa0 3a32b3adb6 Add 00_image_builder 2024-08-11 16:05:58 +05:00
timoxa0 57f6c1027c Add zram rule 2024-08-11 16:05:43 +05:00
timoxa0 056ac9efe9 Implement comression script 2024-08-11 16:01:48 +05:00
timoxa0 2bc641aa22 Add CTRL+C handler 2024-08-11 16:01:21 +05:00
timoxa0 563466c887 Refactor cleanup.sh 2024-08-11 16:00:00 +05:00
timoxa0 f9a39959cb Enable zram 2024-08-11 15:59:41 +05:00
18 changed files with 75 additions and 14 deletions

View file

@ -87,6 +87,9 @@ gen_fstab "$rootdir"
log "Adding %wheel to sudoers"
cp ./drop/00_image_builder "$rootdir/etc/sudoers.d/00_image_builder"
# Enable zram
log "Enabling zram"
cp ./drop/99-zram.rules "$rootdir/etc/udev/rules.d/99-zram.rules"
# +++ Rotate gdm
log "Configuring gdm and gnome"

View file

@ -67,6 +67,10 @@ chroot "$rootdir" systemctl enable qrtr-ns pd-mapper tqftpserv rmtfs
gen_fstab "$rootdir"
# Enable zram
log "Enabling zram"
cp ./drop/99-zram.rules "$rootdir/etc/udev/rules.d/99-zram.rules"
# +++ Rotate gdm
log "Configuring gdm and gnome"
mkdir -p "$rootdir/etc/skel/.config"

View file

@ -8,16 +8,19 @@ fi
source common.sh
# Begin script
# shellcheck disable=SC2162
if find ./tmp/ -mindepth 1 -maxdepth 1 | read; then
for d in ./tmp/*/; do
log "Unmounting $d"
detach_chroot "$d"
umount "$d/boot/simpleinit" 2> /dev/null
umount "$d/boot/efi" 2> /dev/null
umount ./tmp/tmp.* 2> /dev/null
rm -d "$d"
done
else
find ./tmp/ -mindepth 1 -maxdepth 1 | read || {
log_err "Nothing to clean"
fi
exit 1
}
for d in ./tmp/*/; do
log "Unmounting $d"
detach_chroot "$d"
umount "$d/boot/simpleinit" 2> /dev/null
umount "$d/boot/efi" 2> /dev/null
umount ./tmp/tmp.* 2> /dev/null
rm -d "$d"
done

View file

@ -5,10 +5,19 @@ SIMPLEINIT_CMDLINE="root=PARTLABEL=linux loglevel=3 fbcon=rotate:1"
function log() {
printf "\e[1m\e[92m==>\e[0m \e[1m%s\e[0m\n" "$*"
}
function log_err() {
printf "\e[1m\e[31m==>\e[0m \e[1m%s\e[0m\n" "$*"
}
function sigterm_handler() {
printf "\e[1m\e[31m>\e[0m \e[1m%s\e[0m\n" "Shutdown signal received."
exit 1
}
trap 'trap " " SIGINT SIGTERM SIGHUP; kill 0; wait; sigterm_handler' SIGINT SIGTERM SIGHUP
function create_image() {
name="$(realpath "./raw/${1}.img")"
if [ -z "$2" ]; then

33
compress.sh Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
source common.sh
# Ensure that lon-tool installed
which lon-tool > /dev/null 2>&1 || {
log_err "lon-tool not found"
exit 1
}
# shellcheck disable=SC2162
find ./raw/ -mindepth 1 -maxdepth 1 | read || {
log_err "Nothing to compress"
exit 1
}
# Settings
DATE=$(date +"%d-%m-%y")
# Begin script
log "Start compressing images"
log "Current date: ${DATE}"
for image in raw/*; do
full_image_path=$(realpath "$image")
image_name=$(basename "$full_image_path")
lni_name="${image_name/.img/""}"
full_lni_path=$(realpath "./out/${image_name/.img/".lni"}")
log "Compressing $lni_name"
lon-tool image create -n "$lni_name" -v "$DATE" "$full_image_path" "$full_lni_path"
done
log "Stop compressing images"

2
drop/00_image_builder Normal file
View file

@ -0,0 +1,2 @@
# /etc/sudoers.d/00_image_builder
%wheel ALL=(ALL:ALL) ALL

2
drop/99-zram.rules Normal file
View file

@ -0,0 +1,2 @@
# /etc/udev/rules.d/99-zram.rules
ACTION=="add", KERNEL=="zram0", ATTR{comp_algorithm}="zstd", ATTR{disksize}="4G", RUN="/usr/bin/mkswap -U clear /dev/%k", TAG+="systemd"

View file

@ -1,3 +1,7 @@
PARTLABEL=linux / ext4 errors=remount-ro,x-systemd.growfs 0 1
PARTLABEL=esp /boot/efi/ vfat umask=0022 0 1
PARTLABEL=logfs /boot/simpleinit/ vfat umask=0022 0 1
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
PARTLABEL=linux / ext4 errors=remount-ro,x-systemd.growfs 0 1
PARTLABEL=esp /boot/efi/ vfat defaults,umask=0022 0 1
PARTLABEL=logfs /boot/simpleinit/ vfat defaults,umask=0022 0 1
/dev/zram0 none swap defaults,pri=100,nofail 0 0

View file

@ -1,2 +1,3 @@
#!/bin/bash
# /opt/nabu/postinstall
tar -xf /opt/nabu/efi.tar -C / || true

0
packages/linux-nabu-firmware-1.0.0-1-aarch64.deb Executable file → Normal file
View file

View file

0
packages/linux-nabu-firmware-1.0.0-1.aarch64.rpm Executable file → Normal file
View file

0
packages/qcom-services-1.0.0-1-aarch64.deb Executable file → Normal file
View file

0
packages/qcom-services-1.0.0-1-aarch64.pkg.tar.zst Executable file → Normal file
View file

0
packages/qcom-services-1.0.0-1.aarch64.rpm Executable file → Normal file
View file