标签:command lin cpi define ini param save module smt
1 // 从cmdline 提取 rootfsname= 的值到 val_buf 2 char val_buf[64]; 3 #define ROOTFS_CMDLINE "rootfsname=" 4 5 static void __init gluebi_read_cmdline (void) 6 { 7 rootfsmtd_ptr = strstr(saved_command_line, ROOTFS_CMDLINE); 8 if (rootfsmtd_ptr) { 9 sscanf(rootfsmtd_ptr, ROOTFS_CMDLINE"%s", val_buf); 10 printk("Gluebi: Found kernel commandline option ‘rootfsname=%s‘\n", val_buf); 11 } 12 }
1 // drivers/acpi/sysfs.c 2 static int param_get_trace_state(char *buffer, struct kernel_param *kp) 3 { 4 if (!acpi_gbl_trace_method_name) 5 return sprintf(buffer, "disable"); 6 else { 7 if (acpi_gbl_trace_flags & 1) 8 return sprintf(buffer, "1"); 9 else 10 return sprintf(buffer, "enable"); 11 } 12 return 0; 13 } 14 // 设置 从cmdline 分析到 trace_state 参数 调用param_set_trace_state, 将值传给 buffer 15 module_param_call(trace_state, param_set_trace_state, NULL, NULL, 0);
标签:command lin cpi define ini param save module smt
原文地址:https://www.cnblogs.com/listenerln/p/10292165.html