Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: chown and chgrp in files module

James Antill wrote:
> Which begs the question, who's working on the C compiler ?:)

Actually, the friend that asked for builtin chown started off asking for
tar as a builtin (the aim being to restore the system from tape backup
using only the running root shell).  Once I pointed at zftp he conceded
that zftp plus builtins for ln, chown and chmod (next thing for me to do)
would be sufficient.  Actually, I think we need mknod too.  mount and
umount wouldn't be a bad idea, although somewhat system-dependent.
And halt and reboot would be nice... hmm, maybe we need an admintools

Anyway, the thing about tar got me thinking, maybe GNU tar could be
modified so that it can be compiled as a zsh module.  Certain other
tools may be worth modifying this way too.  Not gcc, I think.

I remember one of the other free shells -- I think it was ash -- had a way
of doing its builtins so that they could also be compiled as standalone
programs.  With such a well-defined interface, we could probably produce
some automated way to compile a group of ash builtins as a zsh module.

>ObZsh: Would it be possible to have a statically linked sys-admin
>shell built as part of the build process. Then you could literally
>just have it[1] on a floppy and boot Linux with init=/bin/zsh_admin.

You can do that manually already.  Set LDFLAGS for static linking when
you configure, and edit Src/xmods.conf to list all (and only) the modules
that you want to link in.  You shouldn't need to do --disable-dynamic;
module loading won't work with static linking anyway, and configure will
detect that.

Another thing I'd like to do is to make that easier: a configure switch to
change LDFLAGS to do static linking, and another switch to control which
modules get linked in and which get autoloaded.  Then one could build an
admin zsh from a script just as readily as one can build the normal zsh.

Come to think of it, a shorthand configure switch --enable-admin-config
to do all of that would be a good idea.


Messages sorted by: Reverse Date, Date, Thread, Author