-
Notifications
You must be signed in to change notification settings - Fork 139
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
ssh: use correct ld-linux for chroot on arm64 #2181
Conversation
@mcbridematt Thanks for the pull request and providing the context of our prior discussion on your Rockstor fork for AArch64 work. Much appreciated, and I'm super eager to have full AArch64 support. The future improvement idea you put forward in the main intro text was also proposed by @FroggyFlox who made the most recent changes to this area of the code, in part, in the following pr: "Update libraries needed for Rsync over SFTP" #2167
But for now I think what we have works and we do have bigger fish to fry. But as for your pull request code changes themselves, continuing our keeping it simple (at least for now) idea of hard-wiring and simply substituting the appropriate lib where appropriate according to the architecture awareness provided by
looks to be good. It is also in-keeping with our prior use of this same library in our rpm file name lookup in: "[openSUSE] replace legacy yum with dnf-yum. Fixes #2092" #2097 However there I used:
With the expectation that the result would yield "aarch64". Where as in this pull request you have used:
I don't have any real AArch64 machines on which to test this, but from: https://docs.python.org/2/library/platform.html We have:
So it may be that in your setup these are the same, but my reading was that we needed the platform.machine() ideally as we are after the basic type rather than the specific CPU name. Also, before we merge, can you indicate if this works for your? As per more recent changes the rsync capability will actually be disabled by default however: "Configure SFTP server at buildtime and update customization settings. Fixes #2168" #2173 As per the prior changes upon which this pr builds, in the linked pull requests, the resulting code was tested on the intended target distros / platforms. But since we have some python 2 technical debt a Tumbleweed build/test is now rather challenging, and I believe you also have some limitations within the AArch64 platform for your particular hardware of interest so it would at least be good to see some report of this having at least worked for you on say your current Leap 15.1 builds and ideally Leap 15.2 RC. If nothing else we can then confidentially report that this fixes the issue it pertains to on the tested distros. So if in the future we have reports on one of the other distros it should help to narrow down what may have happened. On the issue note. As per our docs: http://rockstor.com/docs/contribute_section.html in the This is not being pedantic and I'm happy to create this if need be but we use the associated issue links in our display within the Rockstor Web-UI which reads the rpm changelog and parses it thus: And as such it also serves to surface to our users proper attribution and if you could create the issue then we have the appropriate link. But I'm happy to create this if need be. So in short if you could:
Thanks again for taking the time to present this pull request and apologies for so many words. Chuffed to have our first AArch64 specialist contribution. Very welcome. |
cffd42b
to
4e02da4
Compare
Good point about the platform.machine() and platform.processor() - I've updated the pull to use .machine() It turns out they are only equivalent on openSuSE due to openSuSE stuffing the uname string with extra info, here it is on Debian:
On openSuSE:
Presumably the extra 'aarch64 aarch64' is there to fix apps which look for the processor model - for various reasons Linux doesn't explicitly identify CPU core or processor models on arm64 but one can decode it from the implementor/implementation IDs in cpuinfo. Re the two pull requests: I'll spin up a clean instance and check what happens. |
@mcbridematt Thanks for the confirmation of function. From our other communications I'll note there that this looks to be known working on Leap 15.1 AArch64. And thanks for double checking that platform library result and making the change. Interesting and good to know. I'll merge this soon ready for our next rpm release and will update the pull request accordingly. Thanks again for submitting this. Much appreciated and sorry to have to ask for the issue etc. But I think we are all set now. I've just got a few odds and ends to see to and should then be able to do another merge and final testing session before the next rpm release and git tag. |
@StephenBrown2 Nice find. I'd completely missed that. @mcbridematt If you do fancy running this file through black, which should sort all formatting issues auto-style then that would be great. Or just commit @StephenBrown2 suggestion for now. But don't make any more functional changes if you do push any more to this branch as I'm currently working towards the next release which this pr is part of. No worries otherwise as we can always follow up with another pr to fix formatting issue, or tend to them the next time the file receives attention of course. Black formatting checkerWe need to setup a GitHub action really and inform folks of our more recent black policy, so a doc pr I'm thinking in the developers section. I'm afraid I just haven't gotten around to such things. Or even know how currently on the GitHub actions bit. If anyone wants to point me in the right direction re a 'black' pass/fail or change-suggester GitHub task on all .py files or the like four our pull requests that would be great as then folks will get immediate feedback and will likely then be more inclined to tend to such things immediately via further fixing commits, or applying suggested changes or the like. Sorry to have let the side done on this black notice/GitHub-task folks, busy times. |
4e02da4
to
43a65e7
Compare
@mcbridematt That's great. Thanks for applying @StephenBrown2 suggestion. I'll get to final testing on this now. |
The ld-linux filename is architecture dependent so we need to use the correct one for the system.
43a65e7
to
99144d5
Compare
I'll go one better - took me a couple of minutes to get black up and running. I authored the original patch in vi on my test instance so the formatting got mixed up. I'm surprised Python didn't complain as other editors (e.g Atom) more clearly show a difference. |
@mcbridematt Thanks for the black formatting. Much better, and much appreciated. Hopefully we can get that added to the developer docs soon. Python can deal with both but we have had an instances of a dead code line and for a while had lots of mixed tab and spaces (still do in non python files). And given indentation is functionally critical in Python we have moved to black to 'make it so'. Plus it does a byte code pre/post comparison to ensure it makes no functional changes which is nice. Thanks for going the little extra on this one. We are black formatting all python files that are changed in pull requests as we go. But on larger prs it can be very difficult to review them with potentially massive formatting changes included so we are trying to keep the black formatting to it's own commit in that case. Getting there. It would be nice if GitHub highlighted tabs vs spaces actually. |
I have now repeated the sftp test as per:
where sft-test was the user setup to own the sftp-test exported share. And further to this the resulting exported share and it's contents were displayed as expected:
Where "testfile" was the result of:
Noting test procedure here to avoid a long tail of having to dig through prior pull request to know how we tested this capability prior to merging. |
@mcbridematt Thanks again for this. I eventually got around to doing a functional confirmation prior to merging and this, unsurprisingly, is exactly as presented. @StephenBrown2 Thanks for having our back on the tab / spaces thing and contributing to this pull request by way of a review. @mcbridematt I have edited your original post to add the following line: Merging ready for the next testing release. |
The ld-linux filename is architecture dependent so we need to use
the correct one for the system.
Fixes #2183
One possible improvement could be to find the dependencies for sftp-server,rsync and bash at runtime by invoking ldd on each binary, the ldd results combined match up with the hardcoded list: