...
 
Commits (4)
  • Ritesh Sarraf's avatar
    Don't delete uml_util.spec in clean target · 18f4a3d9
    Ritesh Sarraf authored
    The clean target is called in the build workflow. THis leads to the
    repository being in an inconsistent state.
    
    Also, uml_util.spec is something generated during the build
    18f4a3d9
  • Ritesh Sarraf's avatar
    Allow creation of tun IFF_TUN devices · ba6bb494
    Ritesh Sarraf authored
    ba6bb494
  • Ritesh Sarraf's avatar
    Don't link against ncurses · b72b4729
    Ritesh Sarraf authored
    b72b4729
  • Ritesh Sarraf's avatar
    Fix reference to makedev · 80574597
    Ritesh Sarraf authored
    cc -g -Wall -DTUNTAP   -c -o output.o output.c
    cc -g -Wall -DTUNTAP   -c -o slip.o slip.c
    cc -g -Wall -DTUNTAP   -c -o uml_net.o uml_net.c
    cc -g -Wall -DTUNTAP   -c -o tuntap.o tuntap.c
    cc -g -Wall -DTUNTAP -o uml_net ethertap.o host.o output.o slip.o
    uml_net.o tuntap.o
    /usr/bin/ld: host.o: in function `mk_node':
    /build/uml-utilities-20070815.2/uml_net/host.c:215: undefined reference
    to `makedev'
    collect2: error: ld returned 1 exit status
    80574597
......@@ -28,7 +28,6 @@ tarball : clean spec
clean:
rm -rf *~
rm -f uml_util.spec
set -e ; for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@; done
spec:
......
BIN = uml_mconsole
OBJS = $(BIN).o
CFLAGS ?= -g -Wall
LIBS = ../lib/libuml.a -lreadline -lncurses
LIBS = ../lib/libuml.a -lreadline
BIN_DIR ?= /usr/bin
......
......@@ -28,6 +28,7 @@ static void Usage(char *name)
fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
" use\n/dev/misc/net/tun instead\n\n");
fprintf(stderr, "-b will result in brief output (just the device name)\n");
fprintf(stderr, "-3 will open the interface in TUN mode, not TAP mode.\n");
exit(1);
}
......@@ -38,10 +39,10 @@ int main(int argc, char **argv)
struct group *gr;
uid_t owner = -1;
gid_t group = -1;
int tap_fd, opt, delete = 0, brief = 0;
int tap_fd, opt, delete = 0, brief = 0, tun_mode = 0;
char *tun = "", *file = "/dev/net/tun", *name = argv[0], *end;
while((opt = getopt(argc, argv, "bd:f:t:u:g:")) > 0){
while((opt = getopt(argc, argv, "3bd:f:t:u:g:")) > 0){
switch(opt) {
case 'b':
brief = 1;
......@@ -83,6 +84,9 @@ int main(int argc, char **argv)
case 't':
tun = optarg;
break;
case '3':
tun_mode = 1;
break;
case 'h':
default:
Usage(name);
......@@ -102,8 +106,7 @@ int main(int argc, char **argv)
}
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
ifr.ifr_flags = (tun_mode ? IFF_TUN : IFF_TAP) | IFF_NO_PI;
strncpy(ifr.ifr_name, tun, sizeof(ifr.ifr_name) - 1);
if(ioctl(tap_fd, TUNSETIFF, (void *) &ifr) < 0){
perror("TUNSETIFF");
......
......@@ -12,6 +12,7 @@
#include <sys/stat.h>
#include "output.h"
#include "host.h"
#include <sys/sysmacros.h>
int do_exec(char **args, int need_zero, struct output *output)
{
......
# Generated by RPM Workshop. v0.1
# Macro definitions
%define ver 20070815
%define rel 1
Name: uml_utilities
Version: %{ver}
Release: %{rel}
Copyright: GPL
Packager: Someone
URL: http://user-mode-linux.sourceforge.net/index.html
Source: http://prdownloads.sourceforge.net/user-mode-linux/uml_utilities_%{ver}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{ver}-root
Group: System
Summary: Utilities for user-mode linux kernel
%description
This package contains the utilities for user-mode linux for networking,
COW, etc.
%prep
%setup -n tools
%build
make CFLAGS="-g -Wall -O2" DESTDIR=$RPM_BUILD_ROOT
%install
make install DESTDIR=$RPM_BUILD_ROOT
%files
%attr(755,root,root) %{_bindir}/jailtest
#%attr(755,root,root) %{_bindir}/mkrootfs
%attr(755,root,root) %{_bindir}/tunctl
%attr(755,root,root) %{_bindir}/uml_mconsole
%attr(755,root,root) %{_bindir}/uml_moo
%attr(4755,root,root) %{_bindir}/uml_net
%attr(755,root,root) %{_bindir}/uml_switch
%attr(755,root,root) %dir %{_libdir}/uml
%attr(755,root,root) %{_bindir}/uml_mkcow
%attr(755,root,root) %{_bindir}/uml_watchdog
#%attr(755,root,root) %{_libdir}/uml/functions
%attr(755,root,root) %{_libdir}/uml/port-helper
%clean