Commit 033706af authored by Michal Suchanek's avatar Michal Suchanek Committed by Alejandro Mery
Browse files

nand-part: Tell kernel to reread partition table after writing it.

parent 5c9e55e1
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mount.h> /* BLKRRPART */
#include "nand-part.h" #include "nand-part.h"
#define MAX_NAME 16 #define MAX_NAME 16
...@@ -261,6 +263,10 @@ int writembrs(int fd, char names[][MAX_NAME], __u32 *lens, unsigned int *user_ty ...@@ -261,6 +263,10 @@ int writembrs(int fd, char names[][MAX_NAME], __u32 *lens, unsigned int *user_ty
lseek(fd,MBR_START_ADDRESS + MBR_SIZE*i,SEEK_SET); lseek(fd,MBR_START_ADDRESS + MBR_SIZE*i,SEEK_SET);
write(fd,mbr,MBR_SIZE); write(fd,mbr,MBR_SIZE);
} }
if (ioctl(fd, BLKRRPART, NULL))
perror("Failed rereading partition table");
return 1; return 1;
} }
......
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