Commit graph

52 commits

Author SHA1 Message Date
Lionel Sambuc
252a83f614 Fix command line history in ash
Also did some cleanup in ash sources, to make minix modifications
more obvious, as well as some simplifications (by removing code which
is never compiled)

Removed EDITLINE support, use libedit, which does the termcap/terminfo
handling.

Change-Id: I19f7f425ed6a61298844631f9d7f3173cf7f30c0
2013-02-01 11:41:47 +01:00
Lionel Sambuc
0ac803292e Fix warnings trivial warnings.
Fix warnings about:
 . Unused variables
 . format mismatch in printf/scanf format string and arguments
 . Missing parenthesis around assignment as truth values
 . Clang warnings anout unknown GCC pragma
2013-01-14 11:44:31 +01:00
Lionel Sambuc
b8a678ef1d Cross compile on minix support
* Remade patch so it works with minix patch tool.

 * New MINIX tar support -ox, so revert back to it

   In fetch scripts, tar had been replaced by bsdtar as the prebvious
   tar did not support the -o flag under minix, which is required to
   prevent usage of tar file stored user and group information.

   This introduces portability problems. As our new tar tool now
   support that flag revert back to improve portability.
2012-11-15 16:07:30 +01:00
Lionel Sambuc
d19d7d58aa Toolchain upgrade and portability improvements.
upgrade to NetBSD CVS release from 2012/10/17 12:00:00 UTC

Makefiles updates to imporve portability

Made sure to be consistent in the usage of braces/parenthesis at
least on a per file basis. For variables, it is recommended to
continue to use braces.
2012-11-15 16:07:29 +01:00
Lionel Sambuc
9152e1c5a7 Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-11-15 16:07:29 +01:00
Lionel Sambuc
ece05d227f Adding -nt flag to test
This is needed by build.sh.
2012-10-22 11:37:43 +02:00
Thomas Veerman
aab6eb7615 Clean up generated files for ash,ramdisk,libutil,libc 2012-06-18 10:54:56 +00:00
Dirk Vogt
25ae53b165 Make commands cross-compilable 2012-06-18 10:53:23 +00:00
Antoine Leca
b67a7fca8c ash: don't rely on libc signal names
The bsd signal names are out-of-order compared to the minix ones.

I found out (the hard way) that the (MINIX-descending) ordered list of
signals in <sys/signal.h> does not match the (BSD-descending) ordered
list of signals in usr/src/lib/libc/nbsd_libc/gen/sig{name,list}.c

Beyond being unfortunate, it prevents the trap command of ash to handle
correctly a named signal; a funny test case is
        #!/bin/sh
        trap 'echo trapping signal BUS' BUS
        trap 'echo trapping signal 10 (USR1)' 10
        trap # show me what is currently trapped

As a quick workaround, I disabled the use of the libc-provided
sys_sig{name,list} arrays for ash, and reverted to the hand-made array
which is used by the less capable MINIX libc. It allowed me to use
pkgsrc.
2011-07-26 18:59:52 +02:00
Gianluca Guida
cc17b27a2b Build NetBSD libc library in world in ELF mode.
3 sets of libraries are built now:
  . ack: all libraries that ack can compile (/usr/lib/i386/)
  . clang+elf: all libraries with minix headers (/usr/lib/)
  . clang+elf: all libraries with netbsd headers (/usr/netbsd/)

Once everything can be compiled with netbsd libraries and headers, the
/usr/netbsd hierarchy will be obsolete and its libraries compiled with
netbsd headers will be installed in /usr/lib, and its headers
in /usr/include. (i.e. minix libc and current minix headers set
will be gone.)

To use the NetBSD libc system (libraries + headers) before
it is the default libc, see:
   http://wiki.minix3.org/en/DevelopersGuide/UsingNetBSDCode
This wiki page also documents the maintenance of the patch
files of minix-specific changes to imported NetBSD code.

Changes in this commit:
  . libsys: Add NBSD compilation and create a safe NBSD-based libc.
  . Port rest of libraries (except libddekit) to new header system.
  . Enable compilation of libddekit with new headers.
  . Enable kernel compilation with new headers.
  . Enable drivers compilation with new headers.
  . Port legacy commands to new headers and libc.
  . Port servers to new headers.
  . Add <sys/sigcontext.h> in compat library.
  . Remove dependency file in tree.
  . Enable compilation of common/lib/libc/atomic in libsys
  . Do not generate RCSID strings in libc.
  . Temporarily disable zoneinfo as they are incompatible with NetBSD format
  . obj-nbsd for .gitignore
  . Procfs: use only integer arithmetic. (Antoine Leca)
  . Increase ramdisk size to create NBSD-based images.
  . Remove INCSYMLINKS handling hack.
  . Add nbsd_include/sys/exec_elf.h
  . Enable ELF compilation with NBSD libc.
  . Add 'make nbsdsrc' in tools to download reference NetBSD sources.
  . Automate minix-port.patch creation.
  . Avoid using fstavfs() as it is *extremely* slow and unneeded.
  . Set err() as PRIVATE to avoid name clash with libc.
  . [NBSD] servers/vm: remove compilation warnings.
  . u32 is not a long in NBSD headers.
  . UPDATING info on netbsd hierarchy
  . commands fixes for netbsd libc
2011-06-24 11:46:30 +02:00
Ben Gras
d34ab6de9f commands: fix clang errors 2011-06-09 08:27:49 +02:00
Arun Thomas
998af6f111 Move minix/paths.h to paths.h
Also, merge in relevant macros from NetBSD
2010-11-06 20:40:15 +00:00
Ben Gras
01fcee7d71 ash: make test/expr support 'file1 -ot file2' 2010-07-03 22:18:11 +00:00
Ben Gras
b9f53528ee sep ${.OBJDIR} fixes by Antoine Leica. 2010-06-27 23:47:59 +00:00
Arun Thomas
c0c8d25799 Rename mkfiles from minix.*.mk to bsd.*.mk
Makes things easier for pkgsrc
2010-06-25 18:29:09 +00:00
Arun Thomas
042b5bf606 We have sys/cdefs.h now, so remove hacks. 2010-06-17 15:14:57 +00:00
David van Moolenbroek
0964b221e7 ash: expr -e support 2010-06-16 09:33:11 +00:00
Ben Gras
c1b4cc24e4 ash: getmode in global includes now 2010-06-09 12:58:03 +00:00
Ben Gras
6faa2a636c ash: remove setmode() declaration from shell.h, now in library 2010-06-09 12:11:56 +00:00
Arun Thomas
5706670029 Convert boot/ and commands/ over to bsdmake 2010-05-12 16:28:54 +00:00
Kees van Reeuwijk
b412fb7ad5 Code cleanup: remove unused #include, variables and code, 2010-04-15 18:49:36 +00:00
Kees van Reeuwijk
94a81c840a Removed unused variables, added const where possible. 2010-04-07 11:25:51 +00:00
Kees van Reeuwijk
98493805fd Lots of const correctness. 2010-03-27 14:31:00 +00:00
Arun Thomas
2a8fabf4ad Include directory reorg and makefile updates.
-Convert the include directory over to using bsdmake
 syntax
-Update/add mkfiles
-Modify install(1) so that it can create symlinks
-Update makefiles to use new install(1) options
-Rename /usr/include/ibm to /usr/include/i386
-Create /usr/include/machine symlink to arch header files
-Move vm_i386.h to its new home in the /usr/include/i386
-Update source files to #include the header files at their
 new homes.
-Add new gnu-includes target for building GCC headers
2010-03-08 11:04:59 +00:00
Arun Thomas
b706112487 Incorporate bsdmake into buildsystem and reorganize libs 2010-02-16 14:41:33 +00:00
Tomas Hruby
ae75f9d4e5 Removal of the executable flag from files that cannot be executed
- 755 -> 644
2009-11-09 10:26:00 +00:00
David van Moolenbroek
769bed22c8 ash: only execute regular files 2009-11-01 22:25:54 +00:00
David van Moolenbroek
323f0abdd6 Support for setitimer(ITIMER_VIRTUAL/ITIMER_PROF). New test (41) for setitimer. 2009-08-15 21:37:26 +00:00
Ben Gras
c078ec0331 Basic VM and other minor improvements.
Not complete, probably not fully debugged or optimized.
2008-11-19 12:26:10 +00:00
Ben Gras
01c0669075 Bigger shell 2007-04-05 12:30:24 +00:00
Ben Gras
63a271200e Make /dev/c1* device nodes on disk and on the boot ramdisk.
. include c1* nodes in std in MAKEDEV
 . this requires a slightly larger shell
 . this requires a larger blocksize on the boot ramdisk (to fit
   /dev/ in direct blocks for mkfs with a proto file)
 . also more inodes and kB's on the boot ramdisk
2007-02-08 13:51:35 +00:00
Ben Gras
5a6052119f Force yacc to be /usr/bin/yacc, in case someone has /usr/local/bin/yacc
(bison) before /usr/bin/yacc in $PATH
2006-08-15 15:59:04 +00:00
Ben Gras
a284f55473 Bigger bigsh for gcc and binutils 2006-07-27 08:51:08 +00:00
Philip Homburg
3edf4c2854 Prototype for readline. 2006-06-14 13:19:48 +00:00
Philip Homburg
474d137c39 Forgot include some Minix 3 specific changes. 2006-06-07 15:03:42 +00:00
Philip Homburg
eaf9e4cff8 Make sure that line editing is disabled when the shell is not connected to a
tty.
2006-05-29 13:20:28 +00:00
Philip Homburg
7aa4c9ec2f New version of ash. From FreeBSD 5.4 via Minix-vmd. 2006-05-23 12:59:34 +00:00
Philip Homburg
5a3d6ac67f Balance curly braces. 2006-05-10 15:39:52 +00:00
Ben Gras
21aae71cbe Bigger bigsh 2006-03-23 20:31:40 +00:00
Ben Gras
9e1428fb91 Exit status propagation fix from freebsd's sh 2006-03-17 17:33:20 +00:00
Ben Gras
26844e05e7 From: Giovanni <gfalzoni@inwind.it>
To: Ben Gras <beng@few.vu.nl>
Date: Wed, 02 Nov 2005 19:05:13 +0100
Subject: Re: [Minix-devel-l] Symbolic link

Using an alias for cd to set the prompt to display the current path
breaks the cd command.  I use in .ashrc:
PS3=$PS1
hostname=$(expr `cat /etc/hostname.file` : '\([^.]*\)')
cd() {          ## shows current directory as prompt
   command cd "$@"
   PS1="$PS3$USER@$hostname:`pwd` > "
}

If you change the macro in shell.h to:
#define SYMLINKS  0
the correct behaviour is restored.  Could you verify?
I think that the ash package needs the patch.
2005-11-03 15:25:18 +00:00
Ben Gras
742f18a87c Bugfix by Joren 2005-10-18 11:00:03 +00:00
Ben Gras
c42fb551b8 ast@'s build files for easypack. 2005-09-19 13:15:15 +00:00
Ben Gras
5f2d97dfe6 Use exec cc instead of cc (ast) 2005-09-07 08:43:25 +00:00
Ben Gras
f6f6cec7f4 make a /bin/bigsh 2005-09-01 15:23:28 +00:00
Ben Gras
562671cf78 Splitting commands and big commands 2005-08-29 19:39:06 +00:00
Philip Homburg
3ea637a096 More stack for ash. 2005-07-27 11:49:52 +00:00
Philip Homburg
f5c56f3f24 changed ash to use pid_t 2005-06-30 12:58:26 +00:00
Philip Homburg
8f99754d43 more stack for /bin/sh. 2005-06-28 14:53:38 +00:00
Ben Gras
b1fe0aa86f Gave sh more space for configure scripts; connected python to build;
fixed nit in python confused about select definitions
2005-06-27 10:04:55 +00:00