Android kernel version name

I have successfully created Gingerbread 2.3.4 for beagleboard xM rev C. Now I want to check the Linux kernel version name inside the script that runs after init.rc. In linux, we can find the same thing using the uname -r command. But it is not found in the Android kernel. can someone help me with some sample script to do the same.

+6
source share
6 answers

There is a version file in the / proc directory. Try cat /proc/version in the shell and it should display information about your kernel.

+5
source

If your phone is rooted and BusyBox is installed, then uname -r should work.

enter image description here

+2
source

You can get the kernel version using

 adb shell cat /proc/version 

or with

 System.getProperty("os.version"); 
+1
source

It worked for me

 public static String getKernelVersion() { try { Process p = Runtime.getRuntime().exec("uname -a"); InputStream is = null; if (p.waitFor() == 0) { is = p.getInputStream(); } else { is = p.getErrorStream(); } BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line = br.readLine(); Log.i("Kernel Version", line); br.close(); return line; } catch (Exception ex) { return "ERROR: " + ex.getMessage(); } } 
0
source
Command

'uname -r' should also work

-1
source

Source: https://habr.com/ru/post/906198/


All Articles