Demo: wait for input before printing GNU
[cascardo/b2hw.git] / init.c
1 /*
2  * Copyright (C) 2016  Thadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, visit the http://fsf.org website.
16  */
17
18 #include "init.h"
19 #include <sys/mount.h>
20 #include <sys/stat.h>
21 #include <stdlib.h>
22
23 int devmount_setup(void)
24 {
25         mkdir("/dev", 0755);
26         return mount(NULL, "/dev", "devtmpfs", MS_NOEXEC | MS_NOSUID | MS_NOATIME, NULL);
27 }
28
29 int sysfsmount_setup(void)
30 {
31         mkdir("/sys", 0755);
32         return mount(NULL, "/sys", "sysfs", MS_NOEXEC | MS_NOSUID | MS_NOATIME, NULL);
33 }