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

restartcheck: add NILRT ARM kernel version detection #47610

Conversation

Projects
None yet
4 participants
@10ne1
Copy link
Contributor

commented May 11, 2018

What does this PR do?

Adds the capability to detect ARM kernel versions to restartcheck on NI Linux RT platforms.

Tests written?

No

Commits signed with GPG?

No

@cachedout

This comment has been minimized.

Copy link
Collaborator

commented May 11, 2018

@jirikotlin is this something you could help us review?

@10ne1 10ne1 force-pushed the 10ne1:dev/aratiu/nilrt-restartcheck-arm-kernel-version branch from 07f186e to 830f9b7 May 23, 2018

@rallytime

This comment has been minimized.

Copy link
Contributor

commented May 31, 2018

@isbm You came up on GitHub's reviewers suggestions list, so I've requested a review from you here. Would you mind taking a look?

@rallytime rallytime requested a review from isbm May 31, 2018

re_result = re.search(kvregex, kernel_strings)
return None if re_result is None else re_result.group(0)

if _is_older_nilrt():

This comment has been minimized.

Copy link
@isbm

isbm Jun 2, 2018

Contributor

Oh, very nice! if distribution_i_use_at_my_office(): anyone? 😉

@10ne1 since seems NILRT does not have a proper versioning, then can we come up with something generic instead, like property checker etc, which will do decision based on that (say, "foo is installed", "bar is located there" etc) instead of hardcoding "older version" or "even_older_version" right into the code?

This comment has been minimized.

Copy link
@10ne1

10ne1 Jun 3, 2018

Author Contributor

I think I can modify the distro rootfs without breaking backwards compatibility such that the lsb_release DISTRIB_ID field reflects the difference between these older/newer versions and that would automatically get picked up by the existing lsb_distrib_id grain, so then we'd just have to test for grains[lsb_distrib_id] == 'nilrt'.

Are you ok with this approach?

This comment has been minimized.

Copy link
@10ne1

10ne1 Jun 4, 2018

Author Contributor

@isbm A collegue of mine posted a PR implementing my suggestion, if that gets merged we can test the lsb grain in this one #47951

@isbm

This comment has been minimized.

Copy link
Contributor

commented Jun 2, 2018

@rallytime seems your bot works very well! Last time I was reviewing this indeed. You should also probably take to the account number of comments posted by a reviewer... 😆

kver = None

def _get_kver_from_bin(kbin):
'''Get kernel version from a binary image or None if detection fails'''

This comment has been minimized.

Copy link
@rallytime

rallytime Jun 4, 2018

Contributor

Can you split this doc string into 3 lines instead of 1?

This comment has been minimized.

Copy link
@10ne1

10ne1 Jun 8, 2018

Author Contributor

@rallytime Yes, done.

@10ne1 10ne1 force-pushed the 10ne1:dev/aratiu/nilrt-restartcheck-arm-kernel-version branch from 830f9b7 to b944c86 Jun 8, 2018

@10ne1

This comment has been minimized.

Copy link
Contributor Author

commented Jun 8, 2018

@isbm @rallytime I've rebased on top of the develop branch and removed _is_older_nilrt in favor of the lsb_distrib_id grain which recently got fixed by #47951

@10ne1 10ne1 force-pushed the 10ne1:dev/aratiu/nilrt-restartcheck-arm-kernel-version branch from b944c86 to 4eafcf6 Jun 8, 2018

@10ne1 10ne1 force-pushed the 10ne1:dev/aratiu/nilrt-restartcheck-arm-kernel-version branch 2 times, most recently from 8d0dbb1 to 9e9b4e4 Jul 5, 2018

restartcheck: add NILRT ARM kernel version detection
Detecting the NXG ARM kernel version is easy because the kernel is
installed the same way as on x64, only uncompressed (uImage).

For older ARM NILRT however on-disk kernel version detection is harder
because the kernel is compressed and stored inside an u-boot "itb"
image alongside it's device tree, ramdisk and a bootscript, so we need
to extract it and decompress.

Make the distinction between older vs newer NILRT useing the new
lsb_distrib_id grain which recently got repurposed in NILRT.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
@10ne1

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2018

Kind reminder. Ping?

@isbm

isbm approved these changes Jul 10, 2018

Copy link
Contributor

left a comment

@10ne1 oh, sorry! Thanks for the reminder, it was really needed. Yeah, looks better. I still don't like that you need to re-check the path to the image and in my personal opinion I would move it away to a separate function, like _get_kernel_path. If you would be kind to do that, go ahead.

Otherwise you can leave it as is for now.

@rallytime rallytime merged commit a33e449 into saltstack:develop Jul 16, 2018

11 of 17 checks passed

jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #11427 — ABORTED
Details
codeclimate 2 issues to fix
Details
default Build finished.
Details
jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #6457 — FAILURE
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has failed
Details
jenkins/pr/py2-centos-7 running py2-centos-7...
Details
WIP ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #26673 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #18702 — SUCCESS
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #24385 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #23339 — SUCCESS
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #20510 — SUCCESS
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details

@10ne1 10ne1 deleted the 10ne1:dev/aratiu/nilrt-restartcheck-arm-kernel-version branch Jul 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.