2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 static const char *grub_module_template
=
26 "# Copyright (c) 2009 Janosch Graef"
34 "# Default-Start: 1 2 3 5"
36 "# Short-Description: Pseudo RC script for grub module '%s'"
37 "# Description: Pseudo RC script for grub module '%s'"
42 " echo \"This is a GRUB module. It should already run.\""
45 " echo \"Cannot stop GRUB modules.\" > 2"
51 " echo \"Usage: $0 {start|stop|status}\" > 2"
55 static int make_grub_module_script(const char *name
) {
60 asprintf(&path
,"/etc/init.d/%s",name
);
61 asprintf(&script
,grub_module_template
,name
,name
,name
);
63 FILE *fd
= fopen(path
,"w");
73 make_rc_symlink(name
,1,1,'S');
74 make_rc_symlink(name
,2,1,'S');
75 make_rc_symlink(name
,3,1,'S');
76 make_rc_symlink(name
,5,1,'S');
77 make_rc_symlink(name
,1,1,'K');
78 make_rc_symlink(name
,2,1,'K');
79 make_rc_symlink(name
,3,1,'K');
80 make_rc_symlink(name
,5,1,'K');
85 int main(int argc
,char *argv
[]) {
86 /// @todo get GRUB modules and create module scripts
87 make_grub_module_script("vfs");