forked from Ancient-Project/android_kernel_xiaomi_violet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdsp-hook.patch
More file actions
119 lines (114 loc) · 3.46 KB
/
dsp-hook.patch
File metadata and controls
119 lines (114 loc) · 3.46 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff --git a/arch/arm64/boot/dts/xiaomi/violet/violet-sm6150.dtsi b/arch/arm64/boot/dts/xiaomi/violet/violet-sm6150.dtsi
index ec52a385d9e9..21aec506d284 100644
--- a/arch/arm64/boot/dts/xiaomi/violet/violet-sm6150.dtsi
+++ b/arch/arm64/boot/dts/xiaomi/violet/violet-sm6150.dtsi
@@ -22,12 +22,13 @@
&firmware {
android {
+ boot_devices = "soc/7c4000.sdhci";
vbmeta {
parts = "vbmeta,boot,recovery,system,vendor,dtbo";
};
fstab {
vendor {
- fsmgr_flags = "wait,avb";
+ status = "disabled";
};
};
};
diff --git a/arch/arm64/configs/vendor/violet-perf_defconfig b/arch/arm64/configs/vendor/violet-perf_defconfig
index 5cfedd616d2d..dae46d4e451f 100644
--- a/arch/arm64/configs/vendor/violet-perf_defconfig
+++ b/arch/arm64/configs/vendor/violet-perf_defconfig
@@ -177,6 +177,7 @@ CONFIG_DEFAULT_USE_ENERGY_AWARE=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_INITRAMFS_FORCE is not set
+CONFIG_INITRAMFS_IGNORE_SKIP_FLAG=y
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
diff --git a/fs/proc/cmdline.c b/fs/proc/cmdline.c
index 403cbb12a6e9..4a24f4975793 100644
--- a/fs/proc/cmdline.c
+++ b/fs/proc/cmdline.c
@@ -3,10 +3,37 @@
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
+#ifdef CONFIG_INITRAMFS_IGNORE_SKIP_FLAG
+#include <asm/setup.h>
+#endif
+
+#ifdef CONFIG_INITRAMFS_IGNORE_SKIP_FLAG
+#define INITRAMFS_STR_FIND "skip_initramf"
+#define INITRAMFS_STR_REPLACE "want_initramf"
+#define INITRAMFS_STR_LEN (sizeof(INITRAMFS_STR_FIND) - 1)
+
+static char proc_command_line[COMMAND_LINE_SIZE];
+
+static void proc_command_line_init(void) {
+ char *offset_addr;
+
+ strcpy(proc_command_line, saved_command_line);
+
+ offset_addr = strstr(proc_command_line, INITRAMFS_STR_FIND);
+ if (!offset_addr)
+ return;
+
+ memcpy(offset_addr, INITRAMFS_STR_REPLACE, INITRAMFS_STR_LEN);
+}
+#endif
static int cmdline_proc_show(struct seq_file *m, void *v)
{
+#ifdef CONFIG_INITRAMFS_IGNORE_SKIP_FLAG
+ seq_printf(m, "%s\n", proc_command_line);
+#else
seq_printf(m, "%s\n", saved_command_line);
+#endif
return 0;
}
@@ -24,6 +51,10 @@ static const struct file_operations cmdline_proc_fops = {
static int __init proc_cmdline_init(void)
{
+#ifdef CONFIG_INITRAMFS_IGNORE_SKIP_FLAG
+ proc_command_line_init();
+#endif
+
proc_create("cmdline", 0, NULL, &cmdline_proc_fops);
return 0;
}
diff --git a/init/initramfs.c b/init/initramfs.c
index 5ea7f1b5ec44..c239ddc9f16a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -614,7 +614,7 @@ static int __init skip_initramfs_param(char *str)
{
if (*str)
return 0;
- do_skip_initramfs = 1;
+ do_skip_initramfs = !IS_ENABLED(CONFIG_INITRAMFS_IGNORE_SKIP_FLAG);
return 1;
}
__setup("skip_initramfs", skip_initramfs_param);
diff --git a/usr/Kconfig b/usr/Kconfig
index 8b4826de1189..de9d04f2c0be 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -32,6 +32,17 @@ config INITRAMFS_FORCE
and is useful if you cannot or don't want to change the image
your bootloader passes to the kernel.
+config INITRAMFS_IGNORE_SKIP_FLAG
+ bool "Force initramfs even when skip_initramfs is set"
+ default n
+ help
+ Ignore skip_initramfs cmdline flag.
+
+ This should only be used if you have no control over cmdline
+ passed by your bootloader yet you can't use CMDLINE_FORCE.
+
+ If unsure say N.
+
config INITRAMFS_ROOT_UID
int "User ID to map to 0 (user root)"
depends on INITRAMFS_SOURCE!=""