Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to freeze and unfreeze board firmware #25

Merged
merged 7 commits into from
Aug 2, 2024
Merged

Function to freeze and unfreeze board firmware #25

merged 7 commits into from
Aug 2, 2024

Conversation

igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Dec 9, 2023

This function is an example (its just copy / paste from old and does not function due to missing helper functions) what we need to implement as common functions:

  • whenever we are executing apt function, we need to check if apt is not working in the back
  • we need to have all board / armbian related variables like ${BOARD} ${BRANCH} ...

Here I had in mind that menu would once says "Freeze" and second time "Unfreeze". We can solve this in several ways ... also we should condition this entry even file is there.

@igorpecovnik
Copy link
Member Author

#12

@schwar3kat
Copy link
Collaborator

schwar3kat commented Dec 11, 2023

Here I had in mind that menu would once says "Freeze" and second time "Unfreeze". We can solve this in several ways ... also we should condition this entry even file is there.

Yes... this is exactly the type of thing that a menu initialization function in the script could achieve. The menu could say freeze if it's not frozen (freezed) and could say unfreeze if it is frozen (freezed). The menu item visibility could also depend on the resources (files and etc) being available.

I'm not sure if my suggestions are viable or the best way to do it, but let's see if @Tearran can come up with a way to make this happen.

#26

@Tearran Tearran added the WIP label Jan 4, 2024
@Tearran
Copy link
Member

Tearran commented Jan 5, 2024

There is no traditional definition for "freeze" in this context.

Previous assumption was to explore read-only root filesystem system and read-write root filesystem.

Current assumption Hold/Unhold, u-boot and kernel updates
Apt seems to be part of all builds, Uusing apt terms "hold" "unhold".

{
    source /etc/armbian-release
    packages=("linux-image-current-$LINUXFAMILY" "linux-u-boot-$BOARD-$BRANCH" "u-boot-tools")

    for pkg in "${packages[@]}"; do
        if apt-mark showhold | grep -q "^$pkg$"; then
            sudo apt-mark unhold "$pkg"
            echo "Unheld $pkg"
        else
            sudo apt-mark hold "$pkg"
            echo "Held $pkg"
        fi
    done
}

TODO trigger event communication layer. Failed but informative attempts have been made to get the relative information and provide doc generation of said variables last attempt was armbian/build#5894

Closed previous PR. Levering for for other reasons become a distraction. Abended idea of exposing any helpful information

Exploring /share/armbian-config/configng.config key=pair for system state runtime checks.

ku_freeze=$(apt-mark showhold)

[[ -z $ku_freeze ]] && #TODO change a Variable that can be read at runtime and change by group function
#TODO determine if the build first run can be leveraged to provide a default system state configuration file. 

The group function be responsible for changes system setting and to set the current state a file was intended. The config read this file and produce a json for other purposes, primarily the gui and tui.

@Tearran Tearran self-requested a review May 23, 2024 15:58
@Tearran Tearran self-assigned this Aug 2, 2024
@Tearran Tearran marked this pull request as ready for review August 2, 2024 20:09
Copy link
Member

@Tearran Tearran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general concept applied

@Tearran Tearran merged commit d957dbe into main Aug 2, 2024
1 check passed
@Tearran Tearran deleted the freeze branch August 2, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants