Logo
Explore Help
Sign In
public/nixpkgs
1
0
Fork 0
You've already forked nixpkgs
Code Issues Pull Requests Packages Projects Releases Wiki Activity
nixpkgs/modules/system/boot/readonly-mountpoint.c

21 lines
333 B
C
Raw Normal View History

readOnlyStore: Don't do a read-only bind-mount of an already read-only store. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-03-07 19:00:21 -05:00
#include <sys/statvfs.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char ** argv) {
struct statvfs stat;
if (argc != 2) {
fprintf(stderr, "Usage: %s PATH", argv[0]);
exit(2);
}
Don't mount /nix/store ro if it's a mountpoint In principle this could work, but the current remount logic in nix fails to remount mountpoints that are root in their own filesystem (as would be the case with bind-mounting a mountpoint over itself). nixos/nix#98 is aimed at fixing this. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-03-08 10:42:34 -05:00
if (statvfs(argv[1], &stat) != 0) {
readOnlyStore: Don't do a read-only bind-mount of an already read-only store. Signed-off-by: Shea Levy <shea@shealevy.com>
2013-03-07 19:00:21 -05:00
perror("statvfs");
exit(3);
}
if (stat.f_flag & ST_RDONLY)
exit(0);
else
exit(1);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 90ms Template: 9ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API