forked from pool/linux32
This commit is contained in:
parent
d6c660977a
commit
3129075540
55
linux32.1
55
linux32.1
@ -1,55 +0,0 @@
|
||||
.TH LINUX32 1 "May 2002" "SuSE Labs" "Linux User's Manual"
|
||||
.SH NAME
|
||||
linux32 \- Set i686 uname emulation processes.
|
||||
linux64 \- Reset uname emulation
|
||||
.SH SYNOPSIS
|
||||
.B linux32
|
||||
[
|
||||
.B \-\-3gb
|
||||
]
|
||||
[
|
||||
.B \-\-4gb
|
||||
]
|
||||
command arguments...
|
||||
.br
|
||||
.B linux64
|
||||
command arguments...
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.I linux32
|
||||
changes the personality of command and all its children to
|
||||
return
|
||||
.I i686
|
||||
instead of
|
||||
.I x86_64
|
||||
in
|
||||
.I uname -a.
|
||||
This is useful to fool shell scripts or programs that check for the architecture
|
||||
explicitely into believing that they run on a true
|
||||
.I i686
|
||||
system.
|
||||
In addition it moves the top of stack of the 32bit child processes to
|
||||
.I 0xc0000000.
|
||||
This is useful to execute some broken applications that break when
|
||||
the stack top is at 4GB. On the other hand it limits the usable heap
|
||||
memory more than necessary.
|
||||
When
|
||||
.I --4gb
|
||||
is specified this is not done.
|
||||
|
||||
.I linux64
|
||||
resets the uname personality to default.
|
||||
.SH SEE ALSO
|
||||
.I uname(1)
|
||||
|
||||
.I uname(2)
|
||||
|
||||
.I personality(2)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
69
linux32.c
69
linux32.c
@ -1,69 +0,0 @@
|
||||
/* Written 2002 by Andi Kleen */
|
||||
#include <sys/personality.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <libgen.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* Make --3gb the default for buggy Java */
|
||||
#define STUPID_DEFAULT 1
|
||||
|
||||
#ifdef STUPID_DEFAULT
|
||||
#define DFL_PER PER_LINUX32_3GB
|
||||
#else
|
||||
#define DFL_PER PER_LINUX32
|
||||
#endif
|
||||
|
||||
#define ADDR_LIMIT_3GB 0x8000000
|
||||
#define PER_LINUX32_3GB (0x0008 | ADDR_LIMIT_3GB)
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
int pers = DFL_PER;
|
||||
char *progname;
|
||||
|
||||
progname = basename(av[0]);
|
||||
|
||||
if (!strcmp(progname, "linux64")) {
|
||||
pers= PER_LINUX;
|
||||
|
||||
/* ignore --3gb or --4gb for linux64 */
|
||||
if (av[1] && (!strcmp(av[1], "--3gb") || !strcmp(av[1], "--4gb")))
|
||||
av++;
|
||||
}
|
||||
else if (!strcmp(progname,"linux32")) {
|
||||
pers = DFL_PER;
|
||||
|
||||
if (av[1] && !strcmp(av[1], "--3gb")) {
|
||||
pers = PER_LINUX32_3GB;
|
||||
av++;
|
||||
}
|
||||
if (av[1] && !strcmp(av[1], "--4gb")) {
|
||||
pers = PER_LINUX32;
|
||||
av++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!av[1]) {
|
||||
if (pers == PER_LINUX) { /* 64 bit, no options */
|
||||
fprintf(stderr, "usage: %s program args ...\n", progname);
|
||||
} else {
|
||||
fprintf(stderr, "usage: %s [--3gb] [--4gb] program args ...\n", progname);
|
||||
#if DFL_PER == PER_LINUX32_3GB
|
||||
fprintf(stderr, "Default is --3gb to limit the address space of the 32bit children to 3GB\n");
|
||||
#endif
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (personality(pers) < 0) {
|
||||
fprintf(stderr, "Cannot set %x personality: %s\n", pers,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
execvp(av[1],av+1);
|
||||
fprintf(stderr, "Cannot execute %s: %s\n", av[1], strerror(errno));
|
||||
exit(1);
|
||||
}
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 8 10:25:03 CEST 2009 - coolo@novell.com
|
||||
|
||||
- remove linux32 binaries and require new util-linux, leave the package
|
||||
as convenience
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 22 15:50:47 CEST 2009 - sf@suse.de
|
||||
|
||||
|
64
linux32.spec
64
linux32.spec
@ -24,14 +24,12 @@ License: GPL v2 or later
|
||||
Group: System/Kernel
|
||||
Summary: 32-Bit Emulation Utility for x86-64
|
||||
Version: 1.0
|
||||
Release: 476
|
||||
Release: 477
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: x86_64
|
||||
#Recommends: kdebase3
|
||||
Source0: linux32.c
|
||||
Source1: linux32.1
|
||||
Source2: %name.desktop
|
||||
Source3: konsole-linux32.png
|
||||
Requires: util-linux >= 2.16
|
||||
|
||||
%description
|
||||
This is a small tool for 32-bit emulation in Linux/x86-64. It allows
|
||||
@ -47,73 +45,15 @@ Authors:
|
||||
Andi Kleen <ak@suse.de>
|
||||
|
||||
%prep
|
||||
mkdir -p linux32
|
||||
cd linux32
|
||||
cp $RPM_SOURCE_DIR/linux32.c .
|
||||
cp $RPM_SOURCE_DIR/linux32.1 .
|
||||
|
||||
%build
|
||||
cd linux32
|
||||
gcc $RPM_OPT_FLAGS -o linux32 linux32.c
|
||||
|
||||
%install
|
||||
cd linux32
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/usr/share/man/man1
|
||||
cp linux32 $RPM_BUILD_ROOT/usr/bin
|
||||
cp linux32.1 $RPM_BUILD_ROOT/usr/share/man/man1
|
||||
( cd $RPM_BUILD_ROOT/usr/share/man/man1 ; ln -s linux32.1.gz linux64.1.gz )
|
||||
cd $RPM_BUILD_ROOT/usr/bin
|
||||
ln linux32 linux64
|
||||
%suse_update_desktop_file -i %name TerminalEmulator
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
/usr/bin/linux32
|
||||
/usr/bin/linux64
|
||||
/usr/share/man/man1/linux32.1.gz
|
||||
/usr/share/man/man1/linux64.1.gz
|
||||
/usr/share/applications/*
|
||||
/usr/share/pixmaps/*
|
||||
|
||||
%changelog
|
||||
* Wed Apr 22 2009 sf@suse.de
|
||||
- quote command in linux32.desktop correctly (bnc #496724)
|
||||
* Wed Nov 05 2008 sf@suse.de
|
||||
- fix desktop file to start in an xterm - for non-KDE-user
|
||||
(bnc #408320)
|
||||
* Tue Nov 04 2008 coolo@suse.de
|
||||
- remove outdated translations
|
||||
* Tue Oct 21 2008 kukuk@suse.de
|
||||
- Build only on x86-64
|
||||
- Fix at least on destkop file entry
|
||||
* Wed Oct 10 2007 bwalle@suse.de
|
||||
- fix some problems (#188554)
|
||||
o make linux64 working even if it's called with the full path
|
||||
o don't switch magically to linux32 if linux64 is called with
|
||||
arguments (--3gb/--4gb)
|
||||
o fix segmentation fault
|
||||
* Wed Mar 01 2006 sf@suse.de
|
||||
- added -32bit to name and generics name in .desktop file (#52279)
|
||||
* Wed Jan 25 2006 mls@suse.de
|
||||
- converted neededforbuild to BuildRequires
|
||||
* Tue Nov 23 2004 adrian@suse.de
|
||||
- install icon file for desktop entry
|
||||
* Sun Aug 03 2003 adrian@suse.de
|
||||
- install the desktop file according to XDG instead of susewm
|
||||
* Fri Jun 20 2003 ak@suse.de
|
||||
- add linux32.1 as Source
|
||||
* Thu Jun 19 2003 ak@suse.de
|
||||
- eliminate README.linux32
|
||||
- use RPM_OPT_FLAGS
|
||||
* Thu Jun 19 2003 ak@suse.de
|
||||
- fix neededforbuild
|
||||
- make --3gb the default
|
||||
- add manpage
|
||||
- use hardlink for linux64
|
||||
* Thu Jun 05 2003 ak@suse.de
|
||||
- add --3gb support (needs kernel patch)
|
||||
- fix error handling
|
||||
* Thu Feb 20 2003 adrian@suse.de
|
||||
- add menu entry for 32 bit shell in System/Terminals/
|
||||
* Fri May 10 2002 stepan@suse.de
|
||||
- initial version
|
||||
|
Loading…
Reference in New Issue
Block a user