Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
TeamWin
android_bootable_recovery
Repository navigation
Code
Issues
305
(305)
Pull requests
6
(6)
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
android-12.1
Breadcrumbs
android_bootable_recovery
/
kernel_module_loader.hpp
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
38 lines (32 loc) · 1.43 KB
android-12.1
Breadcrumbs
android_bootable_recovery
/
kernel_module_loader.hpp
Copy path
Top
File metadata and controls
Code
Blame
38 lines (32 loc) · 1.43 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _KERNELMODULELOADER_HPP
#define _KERNELMODULELOADER_HPP
#include <dirent.h>
#include <string>
#include <vector>
#include <android-base/file.h>
#include <android-base/strings.h>
#include <modprobe/modprobe.h>
#include <sys/mount.h>
#include <sys/utsname.h>
#include "twcommon.h"
#include "twrp-functions.hpp"
#define VENDOR_MODULE_DIR "/vendor/lib/modules" // Base path for vendor kernel modules to check by TWRP
#define VENDOR_BOOT_MODULE_DIR "/lib/modules" // vendor_boot ramdisk GKI modules to check by TWRP
#define VENDOR_DLKM_MODULE_DIR "/vendor_dlkm/lib/modules" // vendor_dlkm placed modules to check by TWRP
typedef enum {
RECOVERY_FASTBOOT_MODE = 0,
RECOVERY_IN_BOOT_MODE,
FASTBOOTD_MODE
} BOOT_MODE;
class KernelModuleLoader
{
public:
static bool Load_Vendor_Modules(); // Load specific maintainer defined kernel modules in TWRP
private:
static int Try_And_Load_Modules(std::string module_dir, bool vendor_is_mounted); // Use libmodprobe to attempt loading kernel modules
static bool Write_Module_List(std::string module_dir); // Write list of modules to load from TW_LOAD_VENDOR_MODULES
static bool Copy_Modules_To_Tmpfs(std::string module_dir); // Copy modules to ramdisk for loading
static std::vector<string> Skip_Loaded_Kernel_Modules(); // return list of loaded kernel modules already done by init
static BOOT_MODE Get_Boot_Mode(); // For getting the current boot mode
};
#endif // _KERNELMODULELOADER_HPP
You can’t perform that action at this time.