Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Make the kernel version detection more robust #167

Open
luxas opened this issue Jul 15, 2019 · 1 comment
Open

Make the kernel version detection more robust #167

luxas opened this issue Jul 15, 2019 · 1 comment
Labels
contributor-assigned This issue has been assigned to a contributor kind/enhancement Categorizes issue or PR as related to improving an existing feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@luxas
Copy link
Contributor

luxas commented Jul 15, 2019

Hoping to be able to code this in Go, based off the C code sample in https://stackoverflow.com/questions/3180029/how-can-i-determine-the-build-version-of-linux-kernel-uimage:

#include <stdio.h>

int main(int argc, char** argv){
    if (argc > 1){
        FILE* f = fopen(argv[1], "r");
        short offset = 0;
        char str[128];
        if(f){
            fseek(f, 0x20E, SEEK_SET);
            fread(&offset, 2, 1, f);
            fseek(f, offset + 0x200, SEEK_SET);
            fread(str, 128, 1, f);
            str[127] = '\0';
            printf("%s\n", str);
            fclose(f);
            return 0;
        }else {
            return 2;
        }
    } else {
        printf("use: kver [kernel image file]\n");
        return 1;
    }
}

Unfortunately this didn't work on a 4.19 kernel for me :/
Builds upon issue #69

@luxas luxas added kind/enhancement Categorizes issue or PR as related to improving an existing feature. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Jul 15, 2019
@luxas
Copy link
Contributor Author

luxas commented Jul 16, 2019

@kim3z is working on this 😄

@luxas luxas added this to the v0.5.0 milestone Jul 16, 2019
@luxas luxas added the contributor-assigned This issue has been assigned to a contributor label Jul 16, 2019
@luxas luxas modified the milestones: v0.5.0, Next Aug 6, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
contributor-assigned This issue has been assigned to a contributor kind/enhancement Categorizes issue or PR as related to improving an existing feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

1 participant