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

Fix 32/64 bit architecture detection #1481

Merged
merged 9 commits into from
Aug 25, 2022

Conversation

DesktopECHO
Copy link
Contributor

To determine if the Debian edition hosting NextCloud is 32 or 64 bit, NCP uses uname -m. This is mostly fine until you have (for example) a kernel reporting aarch64 that is running Debian armhf in a container, whereupon the wheels fall off and scripts break.

As opposed to asking the Kernel, it's more reliable to ask the distro if NextCloud is 32 (armv7l, armv8l) or 64 (aarch64) bit to account for all possible hardware setups.

Copy link
Collaborator

@victor-rays victor-rays left a comment

Choose a reason for hiding this comment

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

It looks good 🙂
I have noticed this issue myself when building and experimenting with the docker images, I wrote some suggestions for changes to implent making the if-statements work and also add in the previous check as well just in case, please look it over 🙏

@DesktopECHO
Copy link
Contributor Author

Appreciate the guidance, all the best!
D.

@DesktopECHO DesktopECHO reopened this Aug 15, 2022
@theCalcaholic
Copy link
Collaborator

Thanks @DesktopECHO for creating the PR and @ZendaiOwl for reviewing it. I still need to think about the implications of checking with both methods - I'm not 100% sure if that's really what we want yet.

I'll have a more thorough look at it until tomorrow

@theCalcaholic
Copy link
Collaborator

@DesktopECHO can you please change the target branch for the PR to devel?

@DesktopECHO DesktopECHO changed the base branch from master to devel August 15, 2022 13:44
@victor-rays
Copy link
Collaborator

victor-rays commented Aug 15, 2022

Thanks @DesktopECHO for creating the PR and @ZendaiOwl for reviewing it. I still need to think about the implications of checking with both methods - I'm not 100% sure if that's really what we want yet.

I'll have a more thorough look at it until tomorrow

You're welcome 🙏
I think you're right and we should only use "$(dpkg --print-architecture)" rather than both of them, I thought of keeping it in there as a just in case, you can have a look tomorrow :)

Copy link
Collaborator

@theCalcaholic theCalcaholic left a comment

Choose a reason for hiding this comment

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

As discussed, I think it is better to only use one way to determine the architecture. I've added corresponding suggestions. :)

@delete-merged-branch delete-merged-branch bot deleted the branch nextcloud:devel August 18, 2022 08:20
@delete-merged-branch delete-merged-branch bot deleted the branch nextcloud:devel August 18, 2022 08:28
@theCalcaholic theCalcaholic reopened this Aug 18, 2022
@theCalcaholic theCalcaholic reopened this Aug 18, 2022
@theCalcaholic
Copy link
Collaborator

(just reopening to retrigger the pipelines, which I fixed in the meantime :P)

@theCalcaholic
Copy link
Collaborator

theCalcaholic commented Aug 21, 2022

@DesktopECHO Could you do a rebase on devel, please?

You can do so with the following commands:

git clone https://github.com/DesktopECHO/nextcloudpi.git && cd nextcloudpi # Only if you didn't check out the repo already
git remote add upstream https://github.com/nextcloud/nextcloudpi.git
git fetch upstream
git checkout arm32or64
git rebase upstream/devel
git push -f origin arm32or64

@theCalcaholic
Copy link
Collaborator

After the rebase, I will do some tests and then we should be able to merge this :)

DesktopECHO and others added 9 commits August 23, 2022 00:57
Learning as I go, thank you for breaking it down :)

Co-authored-by: Victor-ray <[email protected]>
Nice..  way more sensible

Co-authored-by: Victor-ray <[email protected]>
Co-authored-by: Victor-ray <[email protected]>
Co-authored-by: Victor-ray <[email protected]>
Co-authored-by: Tobias Knöppler <[email protected]>
Co-authored-by: Tobias Knöppler <[email protected]>
Co-authored-by: Tobias Knöppler <[email protected]>
Co-authored-by: Tobias Knöppler <[email protected]>
@DesktopECHO
Copy link
Contributor Author

Sorry for the delay, hope this did the trick:

zero@WinKDE:~/nextcloudpi$ git checkout arm32or64
Previous HEAD position was b88ce44 nc-datadir.sh: Add success message
Switched to branch 'arm32or64'
Your branch is up to date with 'origin/arm32or64'.
zero@WinKDE:~/nextcloudpi$ git rebase upstream/devel
First, rewinding head to replay your work on top of it...
Applying: Initial Fixes
Applying: Update bin/ncp-update-nc
Applying: Update bin/ncp/CONFIG/nc-init.sh
Applying: Update etc/library.sh
Applying: Update updates/1.43.0.sh
Applying: Update etc/library.sh
Applying: Update updates/1.43.0.sh
Applying: Update bin/ncp-update-nc
Applying: Update bin/ncp/CONFIG/nc-init.sh
zero@WinKDE:~/nextcloudpi$ git push -f origin arm32or64
Enumerating objects: 57, done.
Counting objects: 100% (57/57), done.
Delta compression using up to 36 threads
Compressing objects: 100% (43/43), done.
Writing objects: 100% (47/47), 4.16 KiB | 1.39 MiB/s, done.
Total 47 (delta 41), reused 4 (delta 4)
remote: Resolving deltas: 100% (41/41), completed with 10 local objects.
To https://github.com/DesktopECHO/nextcloudpi.git
 + e92a22b...965ffda arm32or64 -> arm32or64 (forced update)

@theCalcaholic
Copy link
Collaborator

Seems to work well. Thank you! :)

@theCalcaholic theCalcaholic merged commit c41d38a into nextcloud:devel Aug 25, 2022
This was referenced Aug 25, 2022
@theCalcaholic theCalcaholic mentioned this pull request Aug 26, 2022
theCalcaholic added a commit that referenced this pull request Aug 26, 2022
Include #1537 and #1481
@DesktopECHO DesktopECHO deleted the arm32or64 branch October 29, 2022 15:31
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