blob: 6a6c8a6f8d15c828f622ecbe10aa3e0b7e12a0cd [file] [log] [blame]
developerc98fa8f2022-02-09 16:27:33 +08001--- a/kernel/Makefile
2+++ b/kernel/Makefile
3@@ -12,6 +12,8 @@ obj-y = fork.o exec_domain.o panic.o
4 notifier.o ksysfs.o cred.o reboot.o \
5 async.o range.o smpboot.o ucount.o
6
7+obj-y += boot_param.o
8+
9 obj-$(CONFIG_MODULES) += kmod.o
10 obj-$(CONFIG_MULTIUSER) += groups.o
11
12--- a/kernel/boot_param.c
13+++ b/kernel/boot_param.c
developer7c45bb92022-06-13 17:42:40 +080014@@ -0,0 +1,44 @@
developerc98fa8f2022-02-09 16:27:33 +080015+/* SPDX-License-Identifier: BSD-3-Clause */
16+/*
17+* Copyright (C) 2022 MediaTek Inc. All rights reserved.
18+ *
19+ * Author: Weijie Gao <weijie.gao@mediatek.com>
20+ */
21+
22+#include <linux/kernel.h>
23+#include <linux/moduleparam.h>
24+
25+#define BOOT_PARAM_STR_MAX_LEN 256
26+
27+static bool dual_boot;
28+module_param(dual_boot, bool, 0444);
29+
30+static bool no_split_rootfs_data;
31+module_param(no_split_rootfs_data, bool, 0444);
32+
developer7c45bb92022-06-13 17:42:40 +080033+static bool reserve_rootfs_data;
34+module_param(reserve_rootfs_data, bool, 0444);
35+
developerc98fa8f2022-02-09 16:27:33 +080036+static uint boot_image_slot;
37+module_param(boot_image_slot, uint, 0444);
38+
39+static uint upgrade_image_slot;
40+module_param(upgrade_image_slot, uint, 0444);
41+
42+static char rootfs_data_part[BOOT_PARAM_STR_MAX_LEN];
43+module_param_string(rootfs_data_part, rootfs_data_part, BOOT_PARAM_STR_MAX_LEN, 0644);
44+
45+static char boot_kernel_part[BOOT_PARAM_STR_MAX_LEN];
46+module_param_string(boot_kernel_part, boot_kernel_part, BOOT_PARAM_STR_MAX_LEN, 0444);
47+
48+static char boot_rootfs_part[BOOT_PARAM_STR_MAX_LEN];
49+module_param_string(boot_rootfs_part, boot_rootfs_part, BOOT_PARAM_STR_MAX_LEN, 0444);
50+
51+static char upgrade_kernel_part[BOOT_PARAM_STR_MAX_LEN];
52+module_param_string(upgrade_kernel_part, upgrade_kernel_part, BOOT_PARAM_STR_MAX_LEN, 0444);
53+
54+static char upgrade_rootfs_part[BOOT_PARAM_STR_MAX_LEN];
55+module_param_string(upgrade_rootfs_part, upgrade_rootfs_part, BOOT_PARAM_STR_MAX_LEN, 0444);
56+
57+static char env_part[BOOT_PARAM_STR_MAX_LEN];
58+module_param_string(env_part, env_part, BOOT_PARAM_STR_MAX_LEN, 0444);