developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 1 | From 32fdf519125a828c6fbbbc8dfdfda22791e710e6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Sam Shih <sam.shih@mediatek.com> |
| 3 | Date: Fri, 2 Jun 2023 13:06:24 +0800 |
| 4 | Subject: [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 | |
| 12 | diff --git a/kernel/Makefile b/kernel/Makefile |
| 13 | index d038b0de8..be219c6ca 100644 |
developer | c98fa8f | 2022-02-09 16:27:33 +0800 | [diff] [blame] | 14 | --- a/kernel/Makefile |
| 15 | +++ b/kernel/Makefile |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 16 | @@ -12,6 +12,8 @@ obj-y = fork.o exec_domain.o panic.o \ |
developer | c98fa8f | 2022-02-09 16:27:33 +0800 | [diff] [blame] | 17 | 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 | |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 25 | diff --git a/kernel/boot_param.c b/kernel/boot_param.c |
| 26 | new file mode 100644 |
| 27 | index 000000000..3dfe828bc |
| 28 | --- /dev/null |
developer | c98fa8f | 2022-02-09 16:27:33 +0800 | [diff] [blame] | 29 | +++ b/kernel/boot_param.c |
developer | 7c45bb9 | 2022-06-13 17:42:40 +0800 | [diff] [blame] | 30 | @@ -0,0 +1,44 @@ |
developer | c98fa8f | 2022-02-09 16:27:33 +0800 | [diff] [blame] | 31 | +/* 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 | + |
developer | 7c45bb9 | 2022-06-13 17:42:40 +0800 | [diff] [blame] | 49 | +static bool reserve_rootfs_data; |
| 50 | +module_param(reserve_rootfs_data, bool, 0444); |
| 51 | + |
developer | c98fa8f | 2022-02-09 16:27:33 +0800 | [diff] [blame] | 52 | +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); |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 75 | -- |
| 76 | 2.34.1 |
| 77 | |