Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
init: Export Android version from kernel command line
Browse files Browse the repository at this point in the history
This flag will be provided by our flasher to facilitate support for both
Android Pie and 10 in the same kernel.

Signed-off-by: Danny Lin <[email protected]>
Signed-off-by: Oktapra Amtono <[email protected]>
Signed-off-by: RyuujiX <[email protected]>
Signed-off-by: Kneba <[email protected]>
Signed-off-by: negrroo <[email protected]>
  • Loading branch information
kdrag0n authored and reocat committed Jan 24, 2024
1 parent 9d2db6d commit d812587
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/linux/android_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* SPDX-License-Identifier: GPL-2.0 */

unsigned int get_android_version(void);
14 changes: 14 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ static char *initcall_command_line;
static char *execute_command;
static char *ramdisk_execute_command;

static unsigned int android_version = 9;

static int __init set_android_version(char *val)
{
get_option(&val, &android_version);
return 0;
}
__setup("androidboot.version=", set_android_version);

unsigned int get_android_version(void)
{
return android_version;
}

/*
* Used to generate warnings if static_key manipulation functions are used
* before jump_label_init is called.
Expand Down

0 comments on commit d812587

Please sign in to comment.