From: Ben Gras Date: Sun, 24 Aug 2014 22:19:25 +0000 (+0200) Subject: some small changes X-Git-Tag: v3.3.0~43 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/static/doc/zpipe.c?a=commitdiff_plain;h=d1abad940acd2d96a0b840d4be0f674ca2431e50;p=minix.git some small changes . add /sbin to tests $PATH for ping . take disable file mmap item from default boot menu . ask for feedback in motd . fix ext2fs on arm (the memory alloced with STATICINIT is flaky on arm) Change-Id: I7525207074d62abc47ed3891139f6ef7ef6025be --- diff --git a/etc/boot.cfg.default b/etc/boot.cfg.default index 6246aedaa..2ad2cc404 100644 --- a/etc/boot.cfg.default +++ b/etc/boot.cfg.default @@ -4,6 +4,5 @@ default=2 menu=Start MINIX 3:load_mods /boot/minix_default/mod*;multiboot /boot/minix_default/kernel rootdevname=$rootdevname $args menu=Start latest MINIX 3:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname $args menu=Start latest MINIX 3 in single user mode:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname bootopts=-s $args -menu=Start latest MINIX 3 without file mmap:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname filemap=0 $args menu=Edit menu option:edit menu=Drop to boot prompt:prompt diff --git a/etc/motd b/etc/motd index 7e5020c00..389d21b17 100755 --- a/etc/motd +++ b/etc/motd @@ -16,5 +16,5 @@ MINIX 3 supports multiple virtual terminals. Just use ALT+F1, F2, F3 and F4 to navigate among them. For more information on how to use MINIX 3, see the wiki: -http://wiki.minix3.org. +http://wiki.minix3.org. We'd like your feedback: http://minix3.org/community/ diff --git a/minix/fs/ext2/mount.c b/minix/fs/ext2/mount.c index 5904e832f..3dca64bd9 100644 --- a/minix/fs/ext2/mount.c +++ b/minix/fs/ext2/mount.c @@ -5,6 +5,7 @@ #include "fs.h" #include #include +#include #include #include #include "buf.h" @@ -60,9 +61,9 @@ int fs_readsuper() } /* Fill in the super block. */ - STATICINIT(superblock, 1); - if (!superblock) + if(!(superblock = malloc(sizeof(*superblock)))) panic("Can't allocate memory for superblock."); + superblock->s_dev = fs_dev; /* read_super() needs to know which dev */ r = read_super(superblock); diff --git a/minix/fs/ext2/super.c b/minix/fs/ext2/super.c index 67dc2cea0..15976a064 100644 --- a/minix/fs/ext2/super.c +++ b/minix/fs/ext2/super.c @@ -73,7 +73,6 @@ register struct super_block *sp; /* pointer to a superblock */ int r; /* group descriptors, sp->s_group_desc points to this. */ static struct group_desc *group_descs; - char *buf; block_t gd_size; /* group descriptors table size in blocks */ int gdt_position; static char superblock_buf[1024]; @@ -149,16 +148,10 @@ register struct super_block *sp; /* pointer to a superblock */ gd_size = sp->s_gdb_count * sp->s_block_size; - buf = 0; - STATICINIT(buf, gd_size); - group_descs = (struct group_desc *) buf; - - buf = 0; - STATICINIT(buf, gd_size); - ondisk_group_descs = (struct group_desc *) buf; - - if (!group_descs || !ondisk_group_descs) - panic("can't allocate memory for gdt buffer"); + if(!(group_descs = malloc(gd_size * sizeof(struct group_desc)))) + panic("can't allocate group desc array"); + if(!(ondisk_group_descs = malloc(gd_size * sizeof(struct group_desc)))) + panic("can't allocate group desc array"); /* s_first_data_block (block number, where superblock is stored) * is 1 for 1Kb blocks and 0 for larger blocks. diff --git a/minix/tests/run b/minix/tests/run index 86cc90e59..6d939e179 100755 --- a/minix/tests/run +++ b/minix/tests/run @@ -7,7 +7,7 @@ then ROOT=yes fi # Initialization -PATH=:/bin:/usr/bin +PATH=:/bin:/usr/bin:/sbin export PATH rm -rf DIR* # remove any old junk lying around