blob: eadc28872bbbd731190bfbc1cec52f52b9a1ee25 [file] [log] [blame]
developer5d148cb2023-06-02 13:08:11 +08001From 32fdf519125a828c6fbbbc8dfdfda22791e710e6 Mon Sep 17 00:00:00 2001
2From: Sam Shih <sam.shih@mediatek.com>
3Date: Fri, 2 Jun 2023 13:06:24 +0800
4Subject: [PATCH] [adv-feature][999-2540-cmdline-boot-parameters.patch]
5
6---
7 kernel/Makefile | 2 ++
8 kernel/boot_param.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
9 2 files changed, 46 insertions(+)
10 create mode 100644 kernel/boot_param.c
11
12diff --git a/kernel/Makefile b/kernel/Makefile
13index d038b0de8..be219c6ca 100644
developerc98fa8f2022-02-09 16:27:33 +080014--- a/kernel/Makefile
15+++ b/kernel/Makefile
developer5d148cb2023-06-02 13:08:11 +080016@@ -12,6 +12,8 @@ obj-y = fork.o exec_domain.o panic.o \
developerc98fa8f2022-02-09 16:27:33 +080017 notifier.o ksysfs.o cred.o reboot.o \
18 async.o range.o smpboot.o ucount.o
19
20+obj-y += boot_param.o
21+
22 obj-$(CONFIG_MODULES) += kmod.o
23 obj-$(CONFIG_MULTIUSER) += groups.o
24
developer5d148cb2023-06-02 13:08:11 +080025diff --git a/kernel/boot_param.c b/kernel/boot_param.c
26new file mode 100644
27index 000000000..3dfe828bc
28--- /dev/null
developerc98fa8f2022-02-09 16:27:33 +080029+++ b/kernel/boot_param.c
developer7c45bb92022-06-13 17:42:40 +080030@@ -0,0 +1,44 @@
developerc98fa8f2022-02-09 16:27:33 +080031+/* SPDX-License-Identifier: BSD-3-Clause */
32+/*
33+* Copyright (C) 2022 MediaTek Inc. All rights reserved.
34+ *
35+ * Author: Weijie Gao <weijie.gao@mediatek.com>
36+ */
37+
38+#include <linux/kernel.h>
39+#include <linux/moduleparam.h>
40+
41+#define BOOT_PARAM_STR_MAX_LEN 256
42+
43+static bool dual_boot;
44+module_param(dual_boot, bool, 0444);
45+
46+static bool no_split_rootfs_data;
47+module_param(no_split_rootfs_data, bool, 0444);
48+
developer7c45bb92022-06-13 17:42:40 +080049+static bool reserve_rootfs_data;
50+module_param(reserve_rootfs_data, bool, 0444);
51+
developerc98fa8f2022-02-09 16:27:33 +080052+static uint boot_image_slot;
53+module_param(boot_image_slot, uint, 0444);
54+
55+static uint upgrade_image_slot;
56+module_param(upgrade_image_slot, uint, 0444);
57+
58+static char rootfs_data_part[BOOT_PARAM_STR_MAX_LEN];
59+module_param_string(rootfs_data_part, rootfs_data_part, BOOT_PARAM_STR_MAX_LEN, 0644);
60+
61+static char boot_kernel_part[BOOT_PARAM_STR_MAX_LEN];
62+module_param_string(boot_kernel_part, boot_kernel_part, BOOT_PARAM_STR_MAX_LEN, 0444);
63+
64+static char boot_rootfs_part[BOOT_PARAM_STR_MAX_LEN];
65+module_param_string(boot_rootfs_part, boot_rootfs_part, BOOT_PARAM_STR_MAX_LEN, 0444);
66+
67+static char upgrade_kernel_part[BOOT_PARAM_STR_MAX_LEN];
68+module_param_string(upgrade_kernel_part, upgrade_kernel_part, BOOT_PARAM_STR_MAX_LEN, 0444);
69+
70+static char upgrade_rootfs_part[BOOT_PARAM_STR_MAX_LEN];
71+module_param_string(upgrade_rootfs_part, upgrade_rootfs_part, BOOT_PARAM_STR_MAX_LEN, 0444);
72+
73+static char env_part[BOOT_PARAM_STR_MAX_LEN];
74+module_param_string(env_part, env_part, BOOT_PARAM_STR_MAX_LEN, 0444);
developer5d148cb2023-06-02 13:08:11 +080075--
762.34.1
77