developer | c98fa8f | 2022-02-09 16:27:33 +0800 | [diff] [blame] | 1 | --- 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 |
| 14 | @@ -0,0 +1,41 @@ |
| 15 | +/* 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 | + |
| 33 | +static uint boot_image_slot; |
| 34 | +module_param(boot_image_slot, uint, 0444); |
| 35 | + |
| 36 | +static uint upgrade_image_slot; |
| 37 | +module_param(upgrade_image_slot, uint, 0444); |
| 38 | + |
| 39 | +static char rootfs_data_part[BOOT_PARAM_STR_MAX_LEN]; |
| 40 | +module_param_string(rootfs_data_part, rootfs_data_part, BOOT_PARAM_STR_MAX_LEN, 0644); |
| 41 | + |
| 42 | +static char boot_kernel_part[BOOT_PARAM_STR_MAX_LEN]; |
| 43 | +module_param_string(boot_kernel_part, boot_kernel_part, BOOT_PARAM_STR_MAX_LEN, 0444); |
| 44 | + |
| 45 | +static char boot_rootfs_part[BOOT_PARAM_STR_MAX_LEN]; |
| 46 | +module_param_string(boot_rootfs_part, boot_rootfs_part, BOOT_PARAM_STR_MAX_LEN, 0444); |
| 47 | + |
| 48 | +static char upgrade_kernel_part[BOOT_PARAM_STR_MAX_LEN]; |
| 49 | +module_param_string(upgrade_kernel_part, upgrade_kernel_part, BOOT_PARAM_STR_MAX_LEN, 0444); |
| 50 | + |
| 51 | +static char upgrade_rootfs_part[BOOT_PARAM_STR_MAX_LEN]; |
| 52 | +module_param_string(upgrade_rootfs_part, upgrade_rootfs_part, BOOT_PARAM_STR_MAX_LEN, 0444); |
| 53 | + |
| 54 | +static char env_part[BOOT_PARAM_STR_MAX_LEN]; |
| 55 | +module_param_string(env_part, env_part, BOOT_PARAM_STR_MAX_LEN, 0444); |