From f31820516332cbd7d9cb7f2ef8e183562f7bbf61568493a02ed9b7e6ed02c347 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 15 Jan 2007 23:23:59 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/linux32?expand=0&rev=1 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + konsole-linux32.png | 3 ++ linux32.1 | 55 ++++++++++++++++++++++++++ linux32.c | 50 ++++++++++++++++++++++++ linux32.changes | 55 ++++++++++++++++++++++++++ linux32.desktop | 63 ++++++++++++++++++++++++++++++ linux32.spec | 94 +++++++++++++++++++++++++++++++++++++++++++++ ready | 0 9 files changed, 344 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 konsole-linux32.png create mode 100644 linux32.1 create mode 100644 linux32.c create mode 100644 linux32.changes create mode 100644 linux32.desktop create mode 100644 linux32.spec create mode 100644 ready diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/konsole-linux32.png b/konsole-linux32.png new file mode 100644 index 0000000..fdbef71 --- /dev/null +++ b/konsole-linux32.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:213dbebb98ea38fa11917615de247e6f46e8c6082b3563dfdbec9e1c2dc5c41a +size 1734 diff --git a/linux32.1 b/linux32.1 new file mode 100644 index 0000000..435adf0 --- /dev/null +++ b/linux32.1 @@ -0,0 +1,55 @@ +.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) + + + + + + + + diff --git a/linux32.c b/linux32.c new file mode 100644 index 0000000..7a14367 --- /dev/null +++ b/linux32.c @@ -0,0 +1,50 @@ +/* Written 2002 by Andi Kleen */ +#include +#undef personality +#include +#include +#include + +/* 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; + if (!av[1]) { + fprintf(stderr, "usage: %s [--3gb] [--4gb] program args ...\n", av[0]); +#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 (!strcmp(av[0],"linux64")) pers= PER_LINUX; + else if (!strcmp(av[0],"linux32")) pers = DFL_PER; + + if (!strcmp(av[1], "--3gb")) { + pers = PER_LINUX32_3GB; + av++; + } + if (!strcmp(av[1], "--4gb")) { + pers = PER_LINUX32; + av++; + } + + 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); +} diff --git a/linux32.changes b/linux32.changes new file mode 100644 index 0000000..d3f4416 --- /dev/null +++ b/linux32.changes @@ -0,0 +1,55 @@ +------------------------------------------------------------------- +Wed Mar 1 11:19:34 CET 2006 - sf@suse.de + +- added -32bit to name and generics name in .desktop file (#52279) + +------------------------------------------------------------------- +Wed Jan 25 21:45:03 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Tue Nov 23 11:07:18 CET 2004 - adrian@suse.de + +- install icon file for desktop entry + +------------------------------------------------------------------- +Sun Aug 3 14:38:17 CEST 2003 - adrian@suse.de + +- install the desktop file according to XDG instead of susewm + +------------------------------------------------------------------- +Fri Jun 20 12:05:35 CEST 2003 - ak@suse.de + +- add linux32.1 as Source + +------------------------------------------------------------------- +Thu Jun 19 20:35:12 CEST 2003 - ak@suse.de + +- eliminate README.linux32 +- use RPM_OPT_FLAGS + +------------------------------------------------------------------- +Thu Jun 19 19:09:49 CEST 2003 - ak@suse.de + +- fix neededforbuild +- make --3gb the default +- add manpage +- use hardlink for linux64 + +------------------------------------------------------------------- +Thu Jun 5 23:25:19 CEST 2003 - ak@suse.de + +- add --3gb support (needs kernel patch) +- fix error handling + +------------------------------------------------------------------- +Thu Feb 20 13:31:07 CET 2003 - adrian@suse.de + +- add menu entry for 32 bit shell in System/Terminals/ + +------------------------------------------------------------------- +Fri May 10 11:41:22 CEST 2002 - stepan@suse.de + +- initial version + diff --git a/linux32.desktop b/linux32.desktop new file mode 100644 index 0000000..b5c1239 --- /dev/null +++ b/linux32.desktop @@ -0,0 +1,63 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Exec=konsole -e linux32 $SHELL +Icon=konsole-linux32 +DocPath=konsole/index.html +Terminal=0 +X-KDE-StartupNotify=true + +Name=Linux 32-bit Konsole + +GenericName=32-bit Terminal Program +GenericName[af]=Terminaal Program +GenericName[be]=Тэрмінал +GenericName[bg]=Терминална програма +GenericName[bs]=Terminalni program +GenericName[ca]=Programa de terminal +GenericName[cs]=Terminálový program +GenericName[da]=Terminalprogram +GenericName[de]=Terminal-Programm +GenericName[el]=Πρόγραμμα τερματικού +GenericName[eo]=Terminalimitaĵo +GenericName[es]=Programa de terminal +GenericName[et]=Terminali emulaator +GenericName[eu]=Terminala Programa +GenericName[fa]=برنامه‌ی پایانه +GenericName[fi]=Terminaaliohjelma +GenericName[fr]=Terminal +GenericName[he]=תוכנית מסוף +GenericName[hr]=Terminal program +GenericName[hu]=parancsértelmező +GenericName[it]=Programma terminale +GenericName[ja]=ターミナルプログラム +GenericName[lt]=Terminalo programa +GenericName[lv]=Termināla Programma +GenericName[mt]=Programm ta' terminal +GenericName[nb]=Terminalprogram +GenericName[nl]=terminalprogramma +GenericName[nn]=Terminalprogram +GenericName[nso]=Lenaneo la Terminal +GenericName[pl]=Program terminala +GenericName[pt]=Programa de Terminal +GenericName[pt_BR]=Terminal +GenericName[ro]=Program terminal +GenericName[ru]=Терминал +GenericName[sk]=Terminál +GenericName[sl]=Terminalski program +GenericName[ss]=Luhlelo lwesikhungo +GenericName[sv]=Terminalprogram +GenericName[ta]=Өɠ¿¢Ãø +GenericName[th]=แอพพลิเคชันเทอร์มินอล +GenericName[tr]=Terminal Programı +GenericName[uk]=Програма терміналу +GenericName[ven]=Mbekanyamushumo ya Mafhedziselo +GenericName[vi]=Trình đầu cuối +GenericName[xh]=Inkqubo Yesixhobo sangaphandle sekhompyutha +GenericName[zh_CN]=终端程序 +GenericName[zh_TW]=終端機程式 +GenericName[zu]=Uhlelo lwemisebenzi lwangaohandle +X-DCOP-ServiceType=Multi +X-KDE-AuthorizeAction=shell_access + + diff --git a/linux32.spec b/linux32.spec new file mode 100644 index 0000000..f8adc89 --- /dev/null +++ b/linux32.spec @@ -0,0 +1,94 @@ +# +# spec file for package linux32 (Version 1.0) +# +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: linux32 +BuildRequires: update-desktop-files +URL: ftp://ftp.x86-64.org/pub/linux/tools/linux32/ +License: GPL +Group: System/Kernel +Summary: 32-Bit Emulation Utility for x86-64 +Version: 1.0 +Release: 347 +BuildRoot: %{_tmppath}/%{name}-%{version}-build +#Recommends: kdebase3 +Source0: linux32.c +Source1: linux32.1 +Source2: %name.desktop +Source3: konsole-linux32.png + +%description +This is a small tool for 32-bit emulation in Linux/x86-64. It allows +you to execute programs that need a uname -m of i386 with uname +emulation. The uname -m is inherited by all child programs, but does +not affect the current shell or processes above it in the process +hierarchy. + + + +Authors: +-------- + Andi Kleen + +%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 -n linux32 +* 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 diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4