Move reboot/insmod to /sbin
This commit is contained in:
parent
6e8b36f238
commit
b3747676d2
14
Makefile
14
Makefile
@ -21,13 +21,14 @@ STAGE_BIN=$(STAGE)/init \
|
||||
$(STAGE)/bin/umount \
|
||||
$(STAGE)/bin/date \
|
||||
$(STAGE)/bin/login \
|
||||
$(STAGE)/bin/insmod \
|
||||
$(STAGE)/bin/netctl \
|
||||
$(STAGE)/bin/netdump \
|
||||
$(STAGE)/bin/netmeow \
|
||||
$(STAGE)/bin/reboot \
|
||||
$(STAGE)/bin/ping \
|
||||
$(STAGE)/bin/com \
|
||||
$(STAGE)/bin/wr \
|
||||
$(STAGE)/sbin/insmod \
|
||||
$(STAGE)/sbin/reboot \
|
||||
$(STAGE)/test.ko
|
||||
|
||||
# TODO
|
||||
@ -77,7 +78,11 @@ mkdirs:
|
||||
mkdir -p $(DIRS)
|
||||
|
||||
mkstage-etc:
|
||||
mkdir -p $(STAGE)/dev $(STAGE)/mnt $(STAGE)/bin $(STAGE)/sys
|
||||
mkdir -p $(STAGE)/dev \
|
||||
$(STAGE)/mnt \
|
||||
$(STAGE)/bin \
|
||||
$(STAGE)/sys \
|
||||
$(STAGE)/sbin
|
||||
cp -r etc $(STAGE)
|
||||
|
||||
# Application building
|
||||
@ -88,6 +93,9 @@ $(STAGE)/init: init.c
|
||||
$(STAGE)/bin/%: core/bin/%.c
|
||||
$(CC) -o $@ $(usr_CFLAGS) $(usr_LDFLAGS) $<
|
||||
|
||||
$(STAGE)/sbin/%: core/sbin/%.c
|
||||
$(CC) -o $@ $(usr_CFLAGS) $(usr_LDFLAGS) $<
|
||||
|
||||
$(STAGE)/bin/sh: $(sh_OBJS)
|
||||
$(CC) -o $@ $(usr_LDFLAGS) $(sh_OBJS)
|
||||
|
||||
|
14
core/bin/wr.c
Normal file
14
core/bin/wr.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
FILE *fp = fopen(argv[1], "w");
|
||||
if (!fp) {
|
||||
perror(argv[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fwrite("123\n", 1, 4, fp);
|
||||
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user