2 ===================================================================
3 RCS file: /var/cvs/busybox/AUTHORS,v
4 retrieving revision 1.40
6 --- a/AUTHORS 9 Oct 2003 21:19:21 -0000 1.40
7 +++ b/AUTHORS 5 Mar 2004 07:23:17 -0000
12 +Peter Willis <psyphreak@phreaker.net>
15 Emanuele Aina <emanuele.aina@tiscali.it>
18 Index: coreutils/Config.in
19 ===================================================================
20 RCS file: /var/cvs/busybox/coreutils/Config.in,v
21 retrieving revision 1.23
22 diff -u -r1.23 Config.in
23 --- a/coreutils/Config.in 5 Mar 2004 06:47:25 -0000 1.23
24 +++ b/coreutils/Config.in 5 Mar 2004 07:23:18 -0000
26 a command; without options it displays the current
33 + ejects a cdrom drive.
34 + defaults to /dev/cdrom
39 Index: coreutils/Makefile.in
40 ===================================================================
41 RCS file: /var/cvs/busybox/coreutils/Makefile.in,v
42 retrieving revision 1.8
43 diff -u -r1.8 Makefile.in
44 --- a/coreutils/Makefile.in 27 Jan 2004 09:22:20 -0000 1.8
45 +++ b/coreutils/Makefile.in 5 Mar 2004 07:23:18 -0000
47 COREUTILS-$(CONFIG_DU) += du.o
48 COREUTILS-$(CONFIG_ECHO) += echo.o
49 COREUTILS-$(CONFIG_ENV) += env.o
50 +COREUTILS-$(CONFIG_EJECT) += eject.o
51 COREUTILS-$(CONFIG_EXPR) += expr.o
52 COREUTILS-$(CONFIG_FALSE) += false.o
53 COREUTILS-$(CONFIG_FOLD) += fold.o
54 Index: coreutils/eject.c
55 ===================================================================
56 RCS file: coreutils/eject.c
57 diff -N coreutils/eject.c
58 --- /dev/null 1 Jan 1970 00:00:00 -0000
59 +++ b/coreutils/eject.c 5 Mar 2004 07:23:21 -0000
62 + * eject implementation for busybox
64 + * Copyright (C) 2004 Peter Willis <psyphreak@phreaker.net>
66 + * This program is free software; you can redistribute it and/or modify
67 + * it under the terms of the GNU General Public License as published by
68 + * the Free Software Foundation; either version 2 of the License, or
69 + * (at your option) any later version.
71 + * This program is distributed in the hope that it will be useful,
72 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
73 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74 + * General Public License for more details.
76 + * You should have received a copy of the GNU General Public License
77 + * along with this program; if not, write to the Free Software
78 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
83 + * This is a simple hack of eject based on something Erik posted in #uclibc.
84 + * Most of the dirty work blatantly ripped off from cat.c =)
89 +#include <sys/types.h>
90 +#include <sys/stat.h>
92 +#include <sys/ioctl.h>
94 +#include <linux/cdrom.h> // needs to be after busybox.h or compile problems arise
96 +#define DEFAULT_CDROM "/dev/cdrom"
98 +extern int eject_main(int argc, char **argv)
101 + int flag = CDROMEJECT;
103 + char *device = NULL;
106 + * i'm too lazy to learn bb_getopt_ulflags and this is obscenely large
107 + * for just some argument parsing so mjn3 can clean it up later.
108 + * sorry, but PlumpOS 7.0-pre2 needs this asap :-/
110 + while (++i <= argc) {
111 + if ( (! strncmp(argv[i-1],"-t",2)) || (! strncmp(argv[i-1],"--trayclose",11)) ) {
112 + flag = CDROMCLOSETRAY;
114 + device = argv[i-1];
117 + if ( (fd = open(device == NULL ? DEFAULT_CDROM : device, O_RDONLY | O_NONBLOCK) ) < 0 ) {
118 + perror("eject: Can't open device");
119 + return(EXIT_FAILURE);
121 + if (ioctl(fd, flag)) {
122 + perror("eject: Can't eject cdrom");
123 + return(EXIT_FAILURE);
125 + return EXIT_SUCCESS;
127 Index: include/applets.h
128 ===================================================================
129 RCS file: /var/cvs/busybox/include/applets.h,v
130 retrieving revision 1.111
131 diff -u -r1.111 applets.h
132 --- a/include/applets.h 27 Jan 2004 09:22:20 -0000 1.111
133 +++ b/include/applets.h 5 Mar 2004 07:23:21 -0000
135 #if defined(CONFIG_FEATURE_GREP_EGREP_ALIAS)
136 APPLET_NOUSAGE("egrep", grep_main, _BB_DIR_BIN, _BB_SUID_NEVER)
139 + APPLET(eject, eject_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
142 APPLET(env, env_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
144 Index: include/usage.h
145 ===================================================================
146 RCS file: /var/cvs/busybox/include/usage.h,v
147 retrieving revision 1.191
148 diff -u -r1.191 usage.h
149 --- a/include/usage.h 25 Feb 2004 10:35:55 -0000 1.191
150 +++ b/include/usage.h 5 Mar 2004 07:23:29 -0000
152 "\t-, -i\tstart with an empty environment\n" \
153 "\t-u\tremove variable from the environment\n"
155 +#define eject_trivial_usage \
157 +#define eject_full_usage \
158 + "Ejects the specified FILE or /dev/cdrom if FILE is unspecified.\n\n" \
160 + "\t-t, --trayclose \tclose tray\n"
162 #define expr_trivial_usage \
164 #define expr_full_usage \