Skip to content

Instantly share code, notes, and snippets.

@ma34s
Created January 28, 2013 14:05
Show Gist options
  • Save ma34s/4655749 to your computer and use it in GitHub Desktop.
Save ma34s/4655749 to your computer and use it in GitHub Desktop.
/proc/cmdlineを再設定するバイナリのコード
/*---------------------------------------------------------------------------**
ma34s. All rights reserved.
**---------------------------------------------------------------------------**
$HeadURL: $
$LastChangedDate:: #$
$LastChangedRevision: $
$LastChangedBy: $
**------------------------------------------------------------------------*//**
@file
@author ma34s
@date 2013/01/28 start
*//*-------------------------------------------------------------------------*/
/*=============================================================================
Include
==============================================================================*/
#include <stdio.h>
#include <stdlib.h>
/*=============================================================================
Macro
==============================================================================*/
#define UI_PARAMETER_FILE "/data/kbc/cmdline"
/*=============================================================================
Typedef
==============================================================================*/
/*=============================================================================
Prototype
==============================================================================*/
/*=============================================================================
Variable
==============================================================================*/
/*===========================================================================**
Functiuon
**============================================================================*/
int main(int argc,char argv[])
{
static char cmd[1024];
// printf("setcmdline\n");
FILE* f = fopen(UI_PARAMETER_FILE, "rt");
if (f == NULL) {
return;
}
fclose(f);
sprintf(cmd,"cat %s > /proc/cmdline",USR_CMDLINE);
// printf("cmd::%s\n",cmd);
system(cmd);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment