Commit 8f6c8be9 authored by Mick Michalski's avatar Mick Michalski
Browse files

Added config settings to set kernel and filesystem device names

parent 96bc93f1
......@@ -9,8 +9,10 @@ extern char **environ;
int main(void) {
char *devSettings = getenv("DEVICE_SETTINGS");
char *devFs = getenv("DEVICE_FILESYSTEM");
char *devFsMain = getenv("DEVICE_FILESYSTEM_MAIN");
char *devFsAlt = getenv("DEVICE_FILESYSTEM_ALT");
char *devK = getenv("DEVICE_KERNEL");
char *devKMain = getenv("DEVICE_KERNEL_MAIN");
char *devKAlt = getenv("DEVICE_KERNEL_ALT");
......@@ -70,21 +72,21 @@ int main(void) {
}
if(buffer[3] == '1'){ /* The current filesystem */
snprintf(cmd, 127, "ln -sf %s /dev/dev-fs", devFsMain);
snprintf(cmd, 127, "ln -sf %s %s", devFsMain, devFs);
printf("Executing: %s\n", cmd);
system(cmd); /* Create a new link to alt fs partition */
} else {
snprintf(cmd, 127, "ln -sf %s /dev/dev-fs", devFsAlt);
snprintf(cmd, 127, "ln -sf %s %s", devFsAlt, devFs);
printf("Executing: %s\n", cmd);
system(cmd); /* Create a new link to main fs partition */
}
if(buffer[2] == '1'){ /* The current kernel */
snprintf(cmd, 127, "ln -sf %s /dev/dev-k", devKMain);
snprintf(cmd, 127, "ln -sf %s %s", devKMain, devK);
printf("Executing: %s\n", cmd);
system(cmd); /* Create a new link to alt kernel partition */
} else {
snprintf(cmd, 127, "ln -sf %s /dev/dev-k", devKAlt);
snprintf(cmd, 127, "ln -sf %s %s", devKAlt, devK);
printf("Executing: %s\n", cmd);
system(cmd); /* Create a new link to main kernel partition */
}
......
......@@ -3,8 +3,12 @@ export SURICATTA_URL="https://ops.rigado.com"
export SURICATTA_ID="test-vista-"$(echo "$(cat /sys/fsl_otp/HW_OCOTP_GP36)" | cut -c 3-)
export DEVICE_SETTINGS="/dev/mtd0"
export DEVICE_KERNEL="/dev/mtd-k"
export DEVICE_KERNEL_MAIN="/dev/mtd1"
export DEVICE_KERNEL_ALT="/dev/mtd2"
export DEVICE_FILESYSTEM="/dev/dev-fs"
export DEVICE_FILESYSTEM_MAIN="/dev/mmcblk1p2"
export DEVICE_FILESYSTEM_ALT="/dev/mmcblk1p3"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment