Skip to content

Commit

Permalink
Merge pull request #69 from NeroReflex/bugfixes
Browse files Browse the repository at this point in the history
Bug fixes and verious improments
  • Loading branch information
NeroReflex authored Aug 21, 2024
2 parents 4bdd761 + d06e62c commit 90bd045
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 466 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
run: |
cd test
./run.sh
- name: Test Tracker file permissions
run: |
docker run --name test_tracker -u root --rm --entrypoint=/workdir/test/test-permissions.sh -v $(pwd):/workdir -v /dev:/dev --privileged archlinux:latest
- name: Test Deployment creation & installation
run: |
docker run --name test_deploy -u root --rm --entrypoint=/workdir/test/test-deploy.sh -v $(pwd):/workdir -v /dev:/dev --privileged archlinux:latest
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ ifeq ($(PREFIX),)
PREFIX := /
endif

VERSION := $(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
ifeq ($(VERSION),)
VERSION := $(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
endif

.PHONY: install

Expand All @@ -17,8 +19,6 @@ install:
install -m 755 "__frzr-unlock" "${PREFIX}/usr/bin"
install -m 755 "frzr-bootloader" "${PREFIX}/usr/bin"
install -m 755 "__frzr-bootloader" "${PREFIX}/usr/bin"
install -m 755 "frzr-kernel" "${PREFIX}/usr/bin"
install -m 755 "__frzr-kernel" "${PREFIX}/usr/bin"
install -m 755 "frzr-version" "${PREFIX}/usr/bin"
install -m 755 "__frzr-version" "${PREFIX}/usr/bin"
install -m 755 "frzr-bootstrap" "${PREFIX}/usr/bin"
Expand Down
25 changes: 21 additions & 4 deletions __frzr
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,28 @@ EOF
trap frzr_status SIGINT SIGTERM ERR

write_tracker_file() {
local running_user=$(whoami)
local grps=$(groups)

if [ ! -d "${TRACKER_FILE_DIR}" ]; then
if echo "$grps" | grep -Fq "frzr"; then
sg frzr -c "mkdir $TRACKER_FILE_DIR"
else
mkdir "${TRACKER_FILE_DIR}"
chmod g+w "${TRACKER_FILE_DIR}"
chown :frzr "${TRACKER_FILE_DIR}"
fi
fi

if [ ! -f "${TRACKER_FILE_PATH}" ]; then
touch "${TRACKER_FILE_PATH}"
chown $UID:379 "${TRACKER_FILE_PATH}"
chmod g+w "${TRACKER_FILE_PATH}"
if echo "$grps" | grep -Fq "frzr"; then
rm -f "${TRACKER_FILE_PATH}"
sg frzr -c "touch ${TRACKER_FILE_PATH}"
else
sudo rm -rf "${TRACKER_FILE_PATH}"
sudo touch "${TRACKER_FILE_PATH}"
sudo chown :frzr "${TRACKER_FILE_PATH}"
sudo chmod g+w "${TRACKER_FILE_PATH}"
fi
fi

frzr_status > "${TRACKER_FILE_PATH}"
Expand Down
6 changes: 5 additions & 1 deletion __frzr-envars
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ if [ -z "$EFI_MOUNT_PATH" ]; then
EFI_MOUNT_PATH="${MOUNT_PATH}/efi" # EFI mount path
fi

if [ -z "$SHOW_UI" ]; then
SHOW_UI="0"
fi

if [ -z "$FRZR_INSTALLER" ]; then
FRZR_INSTALLER="0"
fi
Expand All @@ -47,7 +51,7 @@ ACTUAL_CHECKSUM="" # Actual checksum of the file downloaded
STATE=""

# Tracker file directory
TRACKER_FILE_DIR="/tmp"
TRACKER_FILE_DIR="/tmp/frzr"
TRACKER_FILE_PATH="${TRACKER_FILE_DIR}/frzr.tracker"

# Signals
Expand Down
Loading

0 comments on commit 90bd045

Please sign in to comment.