galeb

Једноставна статичка дистрибуција заснована на musl-у
git clone https://git.sr.ht/~strahinja/galeb
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

remountroot.c (348B)


      1 #include <stdio.h>
      2 #include <string.h>
      3 #include <sys/mount.h>
      4 
      5 static const char roottype[] = "ext4";
      6 static int quiet = 0;
      7 
      8 int
      9 main(int argc, char** argv)
     10 {
     11 	if (*argv[1] && !strcmp(argv[1], "-q"))
     12 		quiet = 1;
     13 
     14 	if (mount(NULL, "/", roottype, MS_REMOUNT | MS_RDONLY, NULL))
     15 	{
     16 		if (!quiet)
     17 			perror("remountroot");
     18 		return 1;
     19 	}
     20 	return 0;
     21 }