This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 3.x development tree".
The branch, master has been updated via 5bb1864c7cc2e46b2a359ca690e0eca6d92defe0 (commit) via 147366a618361c07856ecbd16c2843aa89d63528 (commit) via 7518e62a17511930abb88c5b530dfea8dc63ab4a (commit) via 6f28c98408ff128ef5d46e7065d1f438ec59b043 (commit) via c3c7b47cf428a1a21a05cfb4df35aea24c2f1340 (commit) via 0dcf554f170b28ffd9d57a5e23c26a7365c1ad86 (commit) via fc2e8556caf2e5a5de8f12b10527157296e3ab4f (commit) via 0943900b95b896ca8ca2c702fb6498d399e1b783 (commit) via 38fa6f0076982b4bf6f3bdca4981831555c6db2b (commit) via 7610cae86d0238d539abd37ba9a7ef733494752b (commit) via 1cfaaa5aabbe8dbfc07098150173ba9cd2250009 (commit) via 4af7ee910807e71a830883a10ef60bd33b0a014e (commit) via 1ffa820d6f46a8c500a92caa3bb7b209cbbaf6a1 (commit) via e1244b71defa4c483b1ff9b895f5839a20a72f32 (commit) via 55183ead9de483c1e961ccaa5f253895742460e3 (commit) via d7cd2adcf45765d1ad98481386a2362cba110c42 (commit) via 879812f8c715471be52972c8ef5e8c9cb8fcffe6 (commit) via 4e1e773e36a97ded61a47915aedc9f265fe36396 (commit) via 04f7b64726c689ceaa3645451b02a7d3795cdd50 (commit) via d38b9a202dfc38c50248a4be01f46787ce28fc61 (commit) from 1deaaa3ee1578d8a4ea2de38520e900821161b90 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 5bb1864c7cc2e46b2a359ca690e0eca6d92defe0 Merge: 7518e62 147366a Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Sep 26 23:15:03 2010 +0200
Merge remote branch 'stevee/X' into next
commit 147366a618361c07856ecbd16c2843aa89d63528 Author: Schantl Stefan Stevee@ipfire.org Date: Sun Sep 26 20:43:31 2010 +0200
xorg-x11-drv-nv: New package.
Fixes #72
commit 7518e62a17511930abb88c5b530dfea8dc63ab4a Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Sep 25 00:29:23 2010 +0200
naoki: Proper filename for ISO images.
commit 6f28c98408ff128ef5d46e7065d1f438ec59b043 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Sep 25 00:29:06 2010 +0200
Cleanup unused files.
commit c3c7b47cf428a1a21a05cfb4df35aea24c2f1340 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Sep 24 23:53:04 2010 +0200
naoki: Change LiveCD to dm-squash (was aufs).
commit 0dcf554f170b28ffd9d57a5e23c26a7365c1ad86 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Sep 24 23:37:22 2010 +0200
installer: Remove autologin feature.
commit fc2e8556caf2e5a5de8f12b10527157296e3ab4f Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Sep 19 23:18:06 2010 +0200
naoki: Add optional support for loop devices in chroot.
I do not normally want them here because they can be a risk for the host system.
commit 0943900b95b896ca8ca2c702fb6498d399e1b783 Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Sep 19 23:15:52 2010 +0200
dracut: Depend on eject.
commit 38fa6f0076982b4bf6f3bdca4981831555c6db2b Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Sep 19 23:15:13 2010 +0200
eject: New package.
commit 7610cae86d0238d539abd37ba9a7ef733494752b Author: Schantl Stefan Stevee@ipfire.org Date: Sun Sep 19 15:45:13 2010 +0200
X11vnc: New package.
Fixes #73.
commit 1cfaaa5aabbe8dbfc07098150173ba9cd2250009 Author: Schantl Stefan Stevee@ipfire.org Date: Sun Sep 19 15:44:56 2010 +0200
libVNCServer: New package.
commit 4af7ee910807e71a830883a10ef60bd33b0a014e Author: Schantl Stefan Stevee@ipfire.org Date: Sun Sep 19 15:44:35 2010 +0200
libXtst: New package.
commit 1ffa820d6f46a8c500a92caa3bb7b209cbbaf6a1 Merge: e1244b7 1deaaa3 Author: Schantl Stefan Stevee@ipfire.org Date: Sat Sep 18 22:11:12 2010 +0200
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x into X
commit e1244b71defa4c483b1ff9b895f5839a20a72f32 Author: Schantl Stefan Stevee@ipfire.org Date: Sat Sep 18 22:09:00 2010 +0200
xorg-x11-drv-intel: New package.
commit 55183ead9de483c1e961ccaa5f253895742460e3 Author: Schantl Stefan Stevee@ipfire.org Date: Sat Sep 18 22:01:52 2010 +0200
libXvMC: New package.
commit d7cd2adcf45765d1ad98481386a2362cba110c42 Author: Schantl Stefan Stevee@ipfire.org Date: Sat Sep 18 22:01:33 2010 +0200
libXv: New package.
commit 879812f8c715471be52972c8ef5e8c9cb8fcffe6 Merge: 4e1e773 efa6b00 Author: Schantl Stefan Stevee@ipfire.org Date: Sat Sep 18 21:22:07 2010 +0200
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x into X
commit 4e1e773e36a97ded61a47915aedc9f265fe36396 Author: Schantl Stefan Stevee@ipfire.org Date: Fri Sep 17 21:52:27 2010 +0200
xorg-x11-drv-synaptics: New package.
commit 04f7b64726c689ceaa3645451b02a7d3795cdd50 Author: Schantl Stefan Stevee@ipfire.org Date: Fri Sep 17 21:51:56 2010 +0200
libXi: New package.
commit d38b9a202dfc38c50248a4be01f46787ce28fc61 Author: Schantl Stefan Stevee@ipfire.org Date: Thu Sep 16 20:10:02 2010 +0200
xorg-x11-server: Only disable BIND_NOW for the modules.
This fixes #65.
-----------------------------------------------------------------------
Summary of changes: naoki/environ.py | 11 +- naoki/generators.py | 6 +- .../smartmontools.nm => X11vnc/X11vnc.nm} | 33 +- .../x11vnc-0.9.8-XShm-explicit-include.patch | 10 + .../X11vnc/patches/x11vnc-0.9.8-disableRpath.patch | 103 ++ pkgs/core/dracut/dracut.nm | 6 +- pkgs/core/{pam_ldap/pam_ldap.nm => eject/eject.nm} | 23 +- pkgs/core/eject/patches/eject-2.1.1-verbose.patch | 15 + pkgs/core/eject/patches/eject-2.1.5-lock.patch | 171 +++ .../eject/patches/eject-2.1.5-opendevice.patch | 39 + pkgs/core/eject/patches/eject-2.1.5-spaces.patch | 62 + pkgs/core/eject/patches/eject-2.1.5-umount.patch | 176 +++ pkgs/core/eject/patches/eject-timeout.patch | 11 + .../libsoup.nm => libVNCServer/libVNCServer.nm} | 26 +- .../libvncserver-0.9.1-close_server_socket.patch | 11 + .../patches/libvncserver-0.9.1-multilib.patch | 20 + .../patches/libvncserver-0.9.7-Linux.patch | 16 + pkgs/core/{libXdmcp/libXdmcp.nm => libXi/libXi.nm} | 13 +- .../libXxf86vm.nm => libXtst/libXtst.nm} | 9 +- .../{libXrandr/libXrandr.nm => libXv/libXv.nm} | 10 +- pkgs/core/{libICE/libICE.nm => libXvMC/libXvMC.nm} | 9 +- pkgs/core/xorg-x11-drv-intel/intel.xinf | 28 + .../patches/intel-2.10.0-add-mbp-backlight.patch | 12 + .../patches/intel-2.11-lvds-first.patch | 37 + .../patches/intel-2.11-no-pageflipping.patch | 33 + .../patches/intel-2.11.0-vga-clock-max.patch | 16 + .../patches/intel-2.12-fix-uxa-planemask.patch | 40 + .../patches/intel-2.8.0-kms-get-crtc.patch | 23 + .../xorg-x11-drv-intel/patches/kill-svideo.patch | 23 + pkgs/core/xorg-x11-drv-intel/patches/uevent.patch | 146 +++ .../xorg-x11-drv-intel.nm} | 25 +- .../patches/nv-2.1.6-panel-fix.patch | 36 + .../patches/nv-2.1.6-starvation.patch | 24 + .../patches/nv-2.1.8-g80-no-doublescan.patch | 24 + .../patches/nv-reserve-fbarea.patch | 55 + .../core/xorg-x11-drv-nv/patches/nv-save-rom.patch | 45 + .../xorg-x11-drv-nv.nm} | 19 +- pkgs/core/xorg-x11-drv-synaptics/50-synaptics.conf | 22 + .../70-touchpad-quirks.rules | 15 + .../xorg-x11-drv-synaptics.nm} | 27 +- pkgs/core/xorg-x11-server/xorg-x11-server.nm | 23 +- src/bootloader/installer.conf | 8 +- src/install/etc/init/serial.conf | 24 - src/install/etc/init/tty1.conf | 8 - src/install/etc/init/tty2.conf | 8 - src/install/etc/init/tty3.conf | 8 - src/install/etc/init/tty4.conf | 8 - src/install/root/.bash_profile | 44 - src/install/root/autologin | 4 - tools/generator | 152 +++- tools/mkliveramfs | 1213 -------------------- tools/toolchain | 107 -- 52 files changed, 1515 insertions(+), 1522 deletions(-) copy pkgs/core/{smartmontools/smartmontools.nm => X11vnc/X11vnc.nm} (73%) create mode 100644 pkgs/core/X11vnc/patches/x11vnc-0.9.8-XShm-explicit-include.patch create mode 100644 pkgs/core/X11vnc/patches/x11vnc-0.9.8-disableRpath.patch copy pkgs/core/{pam_ldap/pam_ldap.nm => eject/eject.nm} (78%) create mode 100644 pkgs/core/eject/patches/eject-2.1.1-verbose.patch create mode 100644 pkgs/core/eject/patches/eject-2.1.5-lock.patch create mode 100644 pkgs/core/eject/patches/eject-2.1.5-opendevice.patch create mode 100644 pkgs/core/eject/patches/eject-2.1.5-spaces.patch create mode 100644 pkgs/core/eject/patches/eject-2.1.5-umount.patch create mode 100644 pkgs/core/eject/patches/eject-timeout.patch copy pkgs/core/{libsoup/libsoup.nm => libVNCServer/libVNCServer.nm} (78%) create mode 100644 pkgs/core/libVNCServer/patches/libvncserver-0.9.1-close_server_socket.patch create mode 100644 pkgs/core/libVNCServer/patches/libvncserver-0.9.1-multilib.patch create mode 100644 pkgs/core/libVNCServer/patches/libvncserver-0.9.7-Linux.patch copy pkgs/core/{libXdmcp/libXdmcp.nm => libXi/libXi.nm} (87%) copy pkgs/core/{libXxf86vm/libXxf86vm.nm => libXtst/libXtst.nm} (90%) copy pkgs/core/{libXrandr/libXrandr.nm => libXv/libXv.nm} (90%) copy pkgs/core/{libICE/libICE.nm => libXvMC/libXvMC.nm} (90%) create mode 100644 pkgs/core/xorg-x11-drv-intel/intel.xinf create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/intel-2.10.0-add-mbp-backlight.patch create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-lvds-first.patch create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-no-pageflipping.patch create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/intel-2.11.0-vga-clock-max.patch create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/intel-2.12-fix-uxa-planemask.patch create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/intel-2.8.0-kms-get-crtc.patch create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/kill-svideo.patch create mode 100644 pkgs/core/xorg-x11-drv-intel/patches/uevent.patch copy pkgs/core/{xorg-x11-drv-ati/xorg-x11-drv-ati.nm => xorg-x11-drv-intel/xorg-x11-drv-intel.nm} (76%) create mode 100644 pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-panel-fix.patch create mode 100644 pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-starvation.patch create mode 100644 pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.8-g80-no-doublescan.patch create mode 100644 pkgs/core/xorg-x11-drv-nv/patches/nv-reserve-fbarea.patch create mode 100644 pkgs/core/xorg-x11-drv-nv/patches/nv-save-rom.patch copy pkgs/core/{xorg-x11-drv-ati/xorg-x11-drv-ati.nm => xorg-x11-drv-nv/xorg-x11-drv-nv.nm} (85%) create mode 100644 pkgs/core/xorg-x11-drv-synaptics/50-synaptics.conf create mode 100644 pkgs/core/xorg-x11-drv-synaptics/70-touchpad-quirks.rules copy pkgs/core/{xorg-x11-drv-evdev/xorg-x11-drv-evdev.nm => xorg-x11-drv-synaptics/xorg-x11-drv-synaptics.nm} (72%) delete mode 100644 src/install/etc/init/serial.conf delete mode 100644 src/install/etc/init/tty1.conf delete mode 100644 src/install/etc/init/tty2.conf delete mode 100644 src/install/etc/init/tty3.conf delete mode 100644 src/install/etc/init/tty4.conf delete mode 100644 src/install/root/.bash_profile delete mode 100755 src/install/root/autologin delete mode 100755 tools/mkliveramfs delete mode 100755 tools/toolchain
Difference in files: diff --git a/naoki/environ.py b/naoki/environ.py index 4987eac..2c32233 100644 --- a/naoki/environ.py +++ b/naoki/environ.py @@ -30,9 +30,14 @@ def set(e): class _Environment(object): kernel_version = os.uname()[2]
- def __init__(self, arch): + def __init__(self, arch, **settings): self.arch = arch
+ self._settings = { + "enable_loop" : False, + } + self._settings.update(settings) + logging.debug("Successfully initialized %s" % self)
# XXX check if already locked @@ -107,6 +112,10 @@ class _Environment(object): (stat.S_IFCHR | 0600, os.makedev(5, 1), "dev/console") ]
+ if self._settings["enable_loop"]: + for i in range(0, 7): + devNodes.append((stat.S_IFBLK | 0660, os.makedev(7, i), "dev/loop%d" % i)) + # make device node for el4 and el5 if self.kernel_version < "2.6.19": devNodes.append((stat.S_IFCHR | 0666, os.makedev(5, 2), "dev/ptmx")) diff --git a/naoki/generators.py b/naoki/generators.py index bcb027b..b3f2f01 100644 --- a/naoki/generators.py +++ b/naoki/generators.py @@ -13,7 +13,7 @@ from environ import _Environment
class Generator(_Environment): def __init__(self, type, arch=None): - _Environment.__init__(self, arch) + _Environment.__init__(self, arch, enable_loop=True)
self.type = type
@@ -27,8 +27,12 @@ class Generator(_Environment): deps = [ "basesystem", "dracut", + "e2fsprogs", + "kernel", "squashfs-tools", "syslinux", + "util-linux-ng", + "/sbin/dmsetup", "/usr/bin/mkisofs", ] for dep in deps: diff --git a/pkgs/core/X11vnc/X11vnc.nm b/pkgs/core/X11vnc/X11vnc.nm new file mode 100644 index 0000000..e2b9cda --- /dev/null +++ b/pkgs/core/X11vnc/X11vnc.nm @@ -0,0 +1,57 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = X11vnc +PKG_VER = 0.9.12 +PKG_REL = 0 + +PKG_MAINTAINER = +PKG_GROUP = Development/Tools +PKG_URL = http://www.karlrunge.com/x11vnc/ +PKG_LICENSE = GPLv2 +PKG_SUMMARY = VNC server for the current X11 session. + +PKG_BUILD_DEPS+= libX11-devel libXdamage-devel libXext-devel libXfixes-devel \ + libXtst-devel libjpeg-devel libVNCServer-devel zlib-devel +PKG_DEPS += xorg-x11-server + +define PKG_DESCRIPTION + X11vnc provides a VNC access to the current X11 session. +endef + +PKG_TARBALL = x11vnc-$(PKG_VER).tar.gz + +DIR_APP = $(DIR_SRC)/x11vnc-$(PKG_VER) + +CONFIGURE_OPTIONS += \ + --mandir=/usr/share/man \ + --with-system-libvncserver \ + --without-tightvnc-filetransfer + +# Remove java executables +define STAGE_INSTALL_CMDS + cd $(BUILDROOT) && find -name '*.jar' -exec rm {} ; +endef diff --git a/pkgs/core/X11vnc/patches/x11vnc-0.9.8-XShm-explicit-include.patch b/pkgs/core/X11vnc/patches/x11vnc-0.9.8-XShm-explicit-include.patch new file mode 100644 index 0000000..8ef1e3c --- /dev/null +++ b/pkgs/core/X11vnc/patches/x11vnc-0.9.8-XShm-explicit-include.patch @@ -0,0 +1,10 @@ +--- a/x11vnc/cleanup.c.orig 2009-06-14 19:29:17.000000000 +0400 ++++ b/x11vnc/cleanup.c 2009-08-07 02:44:14.000000000 +0400 +@@ -50,6 +50,7 @@ + #include "screen.h" + #include "xrecord.h" + #include "xevents.h" ++#include <X11/extensions/shmproto.h> // For X_ShmAttach in Fedora 12 + + /* + * Exiting and error handling routines diff --git a/pkgs/core/X11vnc/patches/x11vnc-0.9.8-disableRpath.patch b/pkgs/core/X11vnc/patches/x11vnc-0.9.8-disableRpath.patch new file mode 100644 index 0000000..81be9a7 --- /dev/null +++ b/pkgs/core/X11vnc/patches/x11vnc-0.9.8-disableRpath.patch @@ -0,0 +1,103 @@ +--- a/configure.orig 2009-06-19 18:44:21.000000000 +0400 ++++ b/configure 2009-07-29 16:01:13.000000000 +0400 +@@ -4183,7 +4183,7 @@ + "SunOS 5"*) + echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 + echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 +- ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ++ ac_xsave_LIBS=$LIBS; LIBS="$LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -4233,9 +4233,9 @@ + if test $ac_R_nospace = yes; then + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 +- X_LIBS="$X_LIBS -R$x_libraries" ++ X_LIBS="$X_LIBS" + else +- LIBS="$ac_xsave_LIBS -R $x_libraries" ++ LIBS="$ac_xsave_LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -4285,7 +4285,7 @@ + if test $ac_R_space = yes; then + echo "$as_me:$LINENO: result: yes" >&5 + echo "${ECHO_T}yes" >&6 +- X_LIBS="$X_LIBS -R $x_libraries" ++ X_LIBS="$X_LIBS" + else + echo "$as_me:$LINENO: result: neither works" >&5 + echo "${ECHO_T}neither works" >&6 +@@ -6705,7 +6705,7 @@ + if test ! -z "$HAVE_LIBXFIXES" -o ! -z "$HAVE_LIBXDAMAGE"; then + # need /usr/sfw/lib in RPATH for Solaris 10 and later + case `(uname -sr) 2>/dev/null` in +- "SunOS 5"*) X_EXTRA_LIBS="$X_EXTRA_LIBS -R/usr/sfw/lib" ;; ++ "SunOS 5"*) X_EXTRA_LIBS="$X_EXTRA_LIBS" ;; + esac + fi + if test ! -z "$HAVE_LIBXRANDR"; then +@@ -7026,9 +7026,9 @@ + if test "x$ld_minus_R" = "xno"; then + : + elif test "x$GCC" = "xyes"; then +- LDFLAGS="$LDFLAGS -Xlinker -R$with_ssl/lib" ++ LDFLAGS="$LDFLAGS -Xlinker" + else +- LDFLAGS="$LDFLAGS -R$with_ssl/lib" ++ LDFLAGS="$LDFLAGS" + fi + fi + echo "$as_me:$LINENO: checking for RAND_file_name in -lcrypto" >&5 +@@ -7910,13 +7910,6 @@ + fi + if test "x$with_system_libvncserver" != "xyes"; then + rflag="" +- if test "x$ld_minus_R" = "xno"; then +- : +- elif test "x$GCC" = "xyes"; then +- rflag="-Xlinker -R$with_system_libvncserver/lib" +- else +- rflag="-R$with_system_libvncserver/lib" +- fi + cmd="$with_system_libvncserver/bin/libvncserver-config" + if $cmd --version 1>/dev/null 2>&1; then + cvers=`$cmd --version 2>/dev/null` +@@ -7958,9 +7951,9 @@ + if test "x$ld_minus_R" = "xno"; then + : + elif test "x$GCC" = "xyes"; then +- rflag=" -Xlinker -R$rprefix/lib " ++ rflag=" -Xlinker " + else +- rflag=" -R$rprefix/lib " ++ rflag=" " + fi + cvers=`libvncserver-config --version 2>/dev/null` + cscore=`echo "$cvers" | tr '.' ' ' | awk '{print 10000 * $1 + 100 * $2 + $3}'` +@@ -8039,9 +8032,9 @@ + : + elif test "x$GCC" = "xyes"; then + # this is not complete... in general a rat's nest. +- LDFLAGS="$LDFLAGS -Xlinker -R$with_jpeg/lib" ++ LDFLAGS="$LDFLAGS -Xlinker" + else +- LDFLAGS="$LDFLAGS -R$with_jpeg/lib" ++ LDFLAGS="$LDFLAGS" + fi + fi + if test "${ac_cv_header_jpeglib_h+set}" = set; then +@@ -8320,9 +8313,9 @@ + if test "x$ld_minus_R" = "xno"; then + : + elif test "x$GCC" = "xyes"; then +- LDFLAGS="$LDFLAGS -Xlinker -R$with_zlib/lib" ++ LDFLAGS="$LDFLAGS -Xlinker" + else +- LDFLAGS="$LDFLAGS -R$with_zlib/lib" ++ LDFLAGS="$LDFLAGS" + fi + fi + if test "${ac_cv_header_zlib_h+set}" = set; then diff --git a/pkgs/core/dracut/dracut.nm b/pkgs/core/dracut/dracut.nm index ff17f89..e467063 100644 --- a/pkgs/core/dracut/dracut.nm +++ b/pkgs/core/dracut/dracut.nm @@ -26,7 +26,7 @@ include $(PKGROOT)/Include
PKG_NAME = dracut PKG_VER = 007 -PKG_REL = 0 +PKG_REL = 1
PKG_MAINTAINER = PKG_GROUP = System/Boot @@ -34,8 +34,8 @@ PKG_URL = http://sourceforge.net/apps/trac/dracut/wiki PKG_LICENSE = GPLv2+ PKG_SUMMARY = Initramfs generator using udev.
-PKG_DEPS += bash bzip2 cpio coreutils dmraid e2fsprogs gzip iproute2 \ - iputils kbd less lvm2 mdadm multipath-tools sysvinit udev \ +PKG_DEPS += bash bzip2 cpio coreutils dmraid e2fsprogs eject gzip \ + iproute2 iputils kbd less lvm2 mdadm multipath-tools sysvinit udev \ util-linux-ng which
define PKG_DESCRIPTION diff --git a/pkgs/core/eject/eject.nm b/pkgs/core/eject/eject.nm new file mode 100644 index 0000000..5370f2f --- /dev/null +++ b/pkgs/core/eject/eject.nm @@ -0,0 +1,51 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = eject +PKG_VER = 2.1.5 +PKG_REL = 0 + +PKG_MAINTAINER = +PKG_GROUP = System/Base +PKG_URL = http://www.pobox.com/~tranter +PKG_LICENSE = GPLv2+ +PKG_SUMMARY = A program that ejects removable media using software control. + +PKG_BUILD_DEPS+= gettext libtool + +define PKG_DESCRIPTION + The eject program allows the user to eject removable media (typically \ + CD-ROMs, floppy disks or Iomega Jaz or Zip disks) using software \ + control. Eject can also control some multi-disk CD changers and even \ + some devices' auto-eject features. +endef + +PKG_TARBALL = $(THISAPP).tar.gz + +DIR_APP = $(DIR_SRC)/$(PKG_NAME) + +CONFIGURE_OPTIONS += \ + --mandir=/usr/share/man diff --git a/pkgs/core/eject/patches/eject-2.1.1-verbose.patch b/pkgs/core/eject/patches/eject-2.1.1-verbose.patch new file mode 100644 index 0000000..44c05d8 --- /dev/null +++ b/pkgs/core/eject/patches/eject-2.1.1-verbose.patch @@ -0,0 +1,15 @@ +diff --git a/eject.c b/eject.c +index b14d5f2..662ba54 100644 +--- a/eject.c ++++ b/eject.c +@@ -709,7 +709,9 @@ static int EjectScsi(int fd) + unsigned char sense_buffer[32]; + + if ((ioctl(fd, SG_GET_VERSION_NUM, &k) < 0) || (k < 30000)) { +- printf("not an sg device, or old sg driver\n"); ++ if (v_option) { ++ printf(_("not an sg device, or old sg driver\n")); ++ } + return 0; + } + diff --git a/pkgs/core/eject/patches/eject-2.1.5-lock.patch b/pkgs/core/eject/patches/eject-2.1.5-lock.patch new file mode 100644 index 0000000..25f8465 --- /dev/null +++ b/pkgs/core/eject/patches/eject-2.1.5-lock.patch @@ -0,0 +1,171 @@ + eject.1 | 13 +++++++++++-- + eject.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 63 insertions(+), 4 deletions(-) + +diff --git a/eject.1 b/eject.1 +index 3c388c6..315dc6d 100644 +--- a/eject.1 ++++ b/eject.1 +@@ -17,6 +17,8 @@ eject [-vn] -a on|off|1|0 [<name>] + .br + eject [-vn] -c slot [<name>] + .br ++eject [-vn] -i on|off|1|0 [<name>] ++.br + eject [-vn] -t [<name>] + .br + eject [-vn] -T [<name>] +@@ -83,6 +85,13 @@ for a change request to work. Please also note that the first slot of + the changer is referred to as 0, not 1. + + .TP 0.5i ++.B -i on|1|off|0 ++This option controls locking of the hardware eject button. When ++enabled, the drive will not be ejected when the button is pressed. ++This is useful when you are carrying a laptop in a bag or case and ++don't want it to eject if the button is inadvertently pressed. ++ ++.TP 0.5i + .B -t + With this option the drive is given a CD-ROM tray close command. Not + all devices support this command. +@@ -121,8 +130,8 @@ performed. + .B -r + This option specifies that the drive should be ejected using a + CDROM eject command. +-.TP 0.5i + ++.TP 0.5i + .B -s + This option specifies that the drive should be ejected using + SCSI commands. +@@ -145,7 +154,7 @@ also passes the -n option to umount(1). + .TP 0.5i + .B -m + This option allows eject to work with device drivers which automatically +-mount removable media and therefore must be always mount()ed. ++mount removable media and therefore must be always mount(1)ed. + The option tells eject to not try to unmount the given device, + even if it is mounted according to /etc/mtab or /proc/mounts. + +diff --git a/eject.c b/eject.c +index f7b2a2e..4175756 100644 +--- a/eject.c ++++ b/eject.c +@@ -116,6 +116,7 @@ int d_option = 0; + int f_option = 0; + int h_option = 0; + int n_option = 0; ++int i_option = 0; + int q_option = 0; + int r_option = 0; + int s_option = 0; +@@ -129,6 +130,7 @@ int m_option = 0; + int a_arg = 0; + int c_arg = 0; + int x_arg = 0; ++int i_arg = 0; + static char *programName; /* used in error messages */ + + /* +@@ -163,6 +165,7 @@ static void usage() + " eject [-vn] -c <slot> [<name>] -- switch discs on a CD-ROM changer\n" + " eject [-vn] -t [<name>] -- close tray\n" + " eject [-vn] -T [<name>] -- toggle tray\n" ++" eject [-vn] -i on|off|1|0 [<name>] -- toggle manual eject protection on/off\n" + " eject [-vn] -x <speed> [<name>] -- set CD-ROM max speed\n" + " eject [-vn] -X [<name>] -- list CD-ROM available speeds\n" + "Options:\n" +@@ -200,7 +203,7 @@ static void usage() + #endif + "\n" + " -n --noop -V --version\n" +-" -p --proc -m --no-unmount -T --traytoggle\n")); ++" -p --proc -m --no-unmount -T --traytoggle -i --manualeject\n")); + #endif /* GETOPTLONG */ + fprintf(stderr,_( + "Parameter <name> can be a device file or a mount point.\n" +@@ -214,7 +217,7 @@ static void usage() + /* Handle command line options. */ + static void parse_args(int argc, char **argv, char **device) + { +- const char *flags = "a:c:x:dfhnqrstTXvVpm"; ++ const char *flags = "a:c:x:i:dfhnqrstTXvVpm"; + #ifdef GETOPTLONG + static struct option long_options[] = + { +@@ -223,6 +226,7 @@ static void parse_args(int argc, char **argv, char **device) + {"default", no_argument, NULL, 'd'}, + {"auto", required_argument, NULL, 'a'}, + {"changerslot", required_argument, NULL, 'c'}, ++ {"manualeject", required_argument, NULL, 'i'}, + {"trayclose", no_argument, NULL, 't'}, + {"traytoggle", no_argument, NULL, 'T'}, + {"cdspeed", required_argument, NULL, 'x'}, +@@ -297,6 +301,21 @@ static void parse_args(int argc, char **argv, char **device) + usage(); + exit(0); + break; ++ case 'i': ++ i_option = 1; ++ if (!strcmp(optarg, "0")) ++ i_arg = 0; ++ else if (!strcmp(optarg, "off")) ++ i_arg = 0; ++ else if (!strcmp(optarg, "1")) ++ i_arg = 1; ++ else if (!strcmp(optarg, "on")) ++ i_arg = 1; ++ else { ++ fprintf(stderr, _("%s: invalid argument to -i option\n"), programName); ++ exit(1); ++ } ++ break; + case 'm': + m_option = 1; + break; +@@ -482,6 +501,30 @@ static char *FindDevice(const char *name) + } + + ++/* ++ * Stops CDROM from opening on manual eject pressing the button. ++ * This can be useful when you carry your laptop ++ * in your bag while it's on and no CD inserted in it's drive. ++ * Implemented as found in Documentation/ioctl/cdrom.txt ++ * ++ * TODO: Maybe we should check this also: ++ * EDRIVE_CANT_DO_THIS Door lock function not supported. ++ * EBUSY Attempt to unlock when multiple users ++ * have the drive open and not CAP_SYS_ADMIN ++ */ ++static void ManualEject(int fd, int onOff) ++{ ++ if (ioctl(fd, CDROM_LOCKDOOR, onOff) < 0) { ++ perror("ioctl on CDROM_LOCKDOOR"); ++ } else { ++ if (onOff) ++ printf("CD-Drive may NOT be ejected with device button\n"); ++ else ++ printf("CD-Drive may be ejected with device button\n"); ++ } ++} ++ ++ + /* Set or clear auto-eject mode. */ + static void AutoEject(int fd, int onOff) + { +@@ -1233,6 +1276,13 @@ int main(int argc, char **argv) + exit(0); + } + ++ /* handle -i option */ ++ if (i_option) { ++ fd = OpenDevice(deviceName); ++ ManualEject(fd, i_arg); ++ exit(0); ++ } ++ + /* handle -a option */ + if (a_option) { + if (v_option) { diff --git a/pkgs/core/eject/patches/eject-2.1.5-opendevice.patch b/pkgs/core/eject/patches/eject-2.1.5-opendevice.patch new file mode 100644 index 0000000..c85a910 --- /dev/null +++ b/pkgs/core/eject/patches/eject-2.1.5-opendevice.patch @@ -0,0 +1,39 @@ +diff --git a/eject.c b/eject.c +index 79fd01b..d67089c 100644 +--- a/eject.c ++++ b/eject.c +@@ -543,10 +543,11 @@ static void ToggleTray(int fd) + + #ifdef CDROMCLOSETRAY + +- /* Try to open the CDROM tray and measure the time therefor +- * needed. In my experience the function needs less than 0.05 ++ /* Try to open the CDROM tray and measure the time needed. ++ * In my experience the function needs less than 0.05 + * seconds if the tray was already open, and at least 1.5 seconds +- * if it was closed. */ ++ * if it was closed. ++ */ + gettimeofday(&time_start, NULL); + + /* Send the CDROMEJECT command to the device. */ +@@ -815,10 +816,17 @@ static void Unmount(const char *fullName) + } + + +-/* Open a device file. */ ++/* Open a device file. Try opening first read/write, and if that fails then read only. */ + static int OpenDevice(const char *fullName) + { +- int fd = open(fullName, O_RDONLY|O_NONBLOCK); ++ int fd; ++ ++ fd = open(fullName, O_RDWR|O_NONBLOCK); ++ if (fd != -1) { ++ return fd; ++ } ++ ++ fd = open(fullName, O_RDONLY|O_NONBLOCK); + if (fd == -1) { + fprintf(stderr, _("%s: unable to open `%s'\n"), programName, fullName); + exit(1); diff --git a/pkgs/core/eject/patches/eject-2.1.5-spaces.patch b/pkgs/core/eject/patches/eject-2.1.5-spaces.patch new file mode 100644 index 0000000..40834d9 --- /dev/null +++ b/pkgs/core/eject/patches/eject-2.1.5-spaces.patch @@ -0,0 +1,62 @@ +diff --git a/eject.c b/eject.c +index d67089c..f7b2a2e 100644 +--- a/eject.c ++++ b/eject.c +@@ -370,6 +370,30 @@ static int FileExists(const char *name, const int try, int *found) + + + /* ++ * Linux mangles spaces in mount points by changing them to an octal string ++ * of '\040'. So lets scan the mount point and fix it up by replacing all ++ * occurrences off '\0##' with the ASCII value of 0##. Requires a writable ++ * string as input as we mangle in place. Some of this was taken from the ++ * util-linux package. ++ */ ++#define octalify(a) ((a) & 7) ++#define tooctal(s) (64*octalify(s[1]) + 8*octalify(s[2]) + octalify(s[3])) ++#define isoctal(a) (((a) & ~7) == '0') ++static char *DeMangleMount(char *s) ++{ ++ char *tmp = s; ++ while ((tmp = strchr(tmp, '\')) != NULL) { ++ if (isoctal(tmp[1]) && isoctal(tmp[2]) && isoctal(tmp[3])) { ++ tmp[0] = tooctal(tmp); ++ memmove(tmp+1, tmp+4, strlen(tmp)-3); ++ } ++ ++tmp; ++ } ++ return s; ++} ++ ++ ++/* + * Given name, such as foo, see if any of the following exist: + * + * foo (if foo starts with '.' or '/') +@@ -882,6 +906,8 @@ static int MountedDevice(const char *name, char **mountName, char **deviceName) + rc = sscanf(line, "%1023s %1023s", s1, s2); + if (rc >= 2) { + int mtabmaj, mtabmin; ++ DeMangleMount(s1); ++ DeMangleMount(s2); + GetMajorMinor(s1, &mtabmaj, &mtabmin); + if (((strcmp(s1, name) == 0) || (strcmp(s2, name) == 0)) || + ((maj != -1) && (maj == mtabmaj) && (min == mtabmin))) { +@@ -928,6 +954,8 @@ static int MountableDevice(const char *name, char **mountName, char **deviceName + + while (fgets(line, sizeof(line), fp) != 0) { + rc = sscanf(line, "%1023s %1023s", s1, s2); ++ DeMangleMount(s1); ++ DeMangleMount(s2); + if (rc >= 2 && s1[0] != '#' && strcmp(s2, name) == 0) { + FCLOSE(fp); + *deviceName = strdup(s1); +@@ -968,6 +996,8 @@ static void UnmountDevices(const char *pattern) + while (fgets(line, sizeof(line), fp) != 0) { + status = sscanf(line, "%1023s %1023s", s1, s2); + if (status >= 2) { ++ DeMangleMount(s1); ++ DeMangleMount(s2); + status = regexec(&preg, s1, 0, 0, 0); + if (status == 0) { + if (v_option) diff --git a/pkgs/core/eject/patches/eject-2.1.5-umount.patch b/pkgs/core/eject/patches/eject-2.1.5-umount.patch new file mode 100644 index 0000000..2c588a0 --- /dev/null +++ b/pkgs/core/eject/patches/eject-2.1.5-umount.patch @@ -0,0 +1,176 @@ +diff --git a/eject.c b/eject.c +index 4175756..057d2ea 100644 +--- a/eject.c ++++ b/eject.c +@@ -42,6 +42,7 @@ + #include <string.h> + #include <fcntl.h> + #include <limits.h> ++#include <dirent.h> + + #ifdef GETOPTLONG + #include <getopt.h> +@@ -1133,6 +1134,145 @@ static char *MultiplePartitions(const char *name) + return 0; + } + ++/* ++ * Find device name in /sys/block/. Returns NULL if not ++ * found. The returned pointer must be free()'d. ++ */ ++static char* FindDeviceSysBlock(const char* deviceName) ++{ ++ DIR *dir = opendir("/sys/block"); ++ struct dirent *d; ++ const char *baseName = strrchr(deviceName, '/'); ++ char *device; ++ int len; ++ ++ baseName = baseName ? baseName + 1 : deviceName; ++ if (!dir) { ++ fprintf(stderr, _("%s: can not open directory /sys/block/"), programName); ++ return NULL; ++ } ++ while ((d = readdir(dir)) != NULL) { ++ if (d->d_type != DT_DIR && d->d_type != DT_LNK && d->d_type != DT_UNKNOWN) ++ continue; ++ len = strlen(d->d_name); ++ if (!strncmp(baseName, d->d_name, len)) { ++ if ((*(baseName+len) >= '0' && ++ *(baseName+len) <= '9') || ++ *(baseName+len) == '\0') { ++ device = strdup(d->d_name); ++ closedir(dir); ++ return device; ++ } ++ } ++ } ++ closedir(dir); ++ return NULL; ++} ++ ++/* ++ * From given path gets a subsystem. Returns subsystem if any found ++ * otherwise returns NULL. Returned value must not be free()'d ++ */ ++static char *GetSubSystem(const char *sysfspath) ++{ ++ static char subsystem[PATH_MAX]; ++ char link_subsystem[PATH_MAX]; ++ struct stat buf; ++ char *pos; ++ ++ snprintf(link_subsystem, sizeof(link_subsystem), "%s/subsystem", sysfspath); ++ ++ if (lstat(link_subsystem, &buf) == -1) ++ return NULL; ++ if (!S_ISLNK(buf.st_mode)) ++ return NULL; ++ if (readlink(link_subsystem, subsystem, sizeof(subsystem)) == -1) ++ return NULL; ++ if ((pos = strrchr(subsystem, '/')) == NULL) ++ return NULL; ++ strncpy(subsystem, pos+1, sizeof(subsystem)); ++ ++ return subsystem; ++} ++ ++/* ++ * Check content of /sys/block/<dev>/removable. Returns 1 if the file ++ * contains '1' otherwise returns 0. ++ */ ++static int CheckRemovable(const char* deviceName) ++{ ++ FILE *fp; ++ int removable = 0; ++ char *device; ++ char path[PATH_MAX]; ++ ++ if ((device = FindDeviceSysBlock(deviceName)) == NULL) { ++ fprintf(stderr, ++ _("%s: did not find a device %s in /sys/block/\n"), ++ programName, deviceName); ++ exit(1); ++ } ++ snprintf(path, sizeof(path), "/sys/block/%s/removable", device); ++ free(device); ++ if((fp = fopen(path, "r")) == NULL) ++ return removable; ++ if (fgetc(fp) == '1') ++ removable = 1; ++ ++ fclose(fp); ++ return removable; ++} ++ ++/* Check if a device is on hotpluggable subsystem. Returns 1 if is ++ * otherwise returns 0. ++ */ ++static int CheckHotpluggable(const char* deviceName) ++{ ++ int hotpluggable = 0; ++ char *device; ++ char path[PATH_MAX]; ++ char *device_chain; ++ struct stat buf; ++ char *subsystem; ++ char *pos; ++ ++ if ((device = FindDeviceSysBlock(deviceName)) == NULL) { ++ fprintf(stderr, _("%s: did not find a device %s in /sys/block/\n"), ++ programName, deviceName); ++ exit(1); ++ } ++ snprintf(path, sizeof(path), "/sys/block/%s/device", device); ++ free(device); ++ ++ if (lstat(path, &buf) == -1) ++ return hotpluggable; ++ if (!S_ISLNK(buf.st_mode)) ++ return hotpluggable; ++ if ((device_chain = SymLink(path)) == NULL) ++ return hotpluggable; ++ while ( strncmp(device_chain, "", sizeof(device_chain) != 0)) { ++ subsystem = GetSubSystem(device_chain); ++ if (subsystem) { ++ /* as hotpluggable we assume devices on these buses */ ++ if (strncmp("usb", subsystem, sizeof("usb")) == 0 || ++ strncmp("ieee1394", subsystem, sizeof("ieee1394")) == 0 || ++ strncmp("pcmcia", subsystem, sizeof("pcmcia")) == 0 || ++ strncmp("mmc", subsystem, sizeof("mmc")) == 0 || ++ strncmp("ccw", subsystem, sizeof("ccw")) == 0) { ++ hotpluggable = 1; ++ break; ++ } ++ } ++ /* remove one member from devicechain */ ++ pos = strrchr(device_chain, '/'); ++ if (pos) ++ pos[0] = '\0'; ++ else ++ device_chain[0] = '\0'; ++ } ++ ++ return hotpluggable; ++} + + /* handle -x option */ + static void HandleXOption(char *deviceName) +@@ -1276,6 +1416,17 @@ int main(int argc, char **argv) + exit(0); + } + ++ /* Check if device has removable flag*/ ++ if (v_option) ++ printf(_("%s: checking if device "%s" has a removable or hotpluggable flag\n"), ++ programName, deviceName); ++ if (!CheckRemovable(deviceName) && !CheckHotpluggable(deviceName)) ++ { ++ fprintf(stderr, _("%s: device "%s" doesn't have a removable or hotpluggable flag\n"), ++ programName, deviceName); ++ exit(1); ++ } ++ + /* handle -i option */ + if (i_option) { + fd = OpenDevice(deviceName); diff --git a/pkgs/core/eject/patches/eject-timeout.patch b/pkgs/core/eject/patches/eject-timeout.patch new file mode 100644 index 0000000..a542d2c --- /dev/null +++ b/pkgs/core/eject/patches/eject-timeout.patch @@ -0,0 +1,11 @@ +--- eject/eject.c.orig 2006-08-07 16:35:15.000000000 +0200 ++++ eject/eject.c 2006-08-07 16:35:54.000000000 +0200 +@@ -723,7 +723,7 @@ + io_hdr.dxfer_len = 0; + io_hdr.dxferp = inqBuff; + io_hdr.sbp = sense_buffer; +- io_hdr.timeout = 2000; ++ io_hdr.timeout = 10000; + + io_hdr.cmdp = allowRmBlk; + status = ioctl(fd, SG_IO, (void *)&io_hdr); diff --git a/pkgs/core/libVNCServer/libVNCServer.nm b/pkgs/core/libVNCServer/libVNCServer.nm new file mode 100644 index 0000000..ef35ea7 --- /dev/null +++ b/pkgs/core/libVNCServer/libVNCServer.nm @@ -0,0 +1,52 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = libVNCServer +PKG_VER = 0.9.7 +PKG_REL = 0 + +PKG_MAINTAINER = +PKG_GROUP = System/Libraries +PKG_URL = http://libvncserver.sourceforge.net/ +PKG_LICENSE = GPLv2+ +PKG_SUMMARY = Library to make writing a vnc server easy. + +PKG_BUILD_DEPS+= libjpeg-devel zlib-devel + +PKG_PACKAGES += $(PKG_NAME)-devel + +define PKG_DESCRIPTION + LibVNCServer makes writing a VNC server (or more correctly, a program\ + exporting a framebuffer via the Remote Frame Buffer protocol) easy. +endef + +PKG_TARBALL = LibVNCServer-$(PKG_VER).tar.gz + +DIR_APP = $(DIR_SRC)/LibVNCServer-$(PKG_VER) + +CONFIGURE_OPTIONS += \ + --disable-static \ + --without-tightvnc-filetransfer diff --git a/pkgs/core/libVNCServer/patches/libvncserver-0.9.1-close_server_socket.patch b/pkgs/core/libVNCServer/patches/libvncserver-0.9.1-close_server_socket.patch new file mode 100644 index 0000000..b1076f7 --- /dev/null +++ b/pkgs/core/libVNCServer/patches/libvncserver-0.9.1-close_server_socket.patch @@ -0,0 +1,11 @@ +diff -up LibVNCServer-0.9.1/libvncclient/vncviewer.c~ LibVNCServer-0.9.1/libvncclient/vncviewer.c +--- LibVNCServer-0.9.1/libvncclient/vncviewer.c~ 2007-02-01 17:05:56.000000000 +0200 ++++ LibVNCServer-0.9.1/libvncclient/vncviewer.c 2009-05-20 22:26:35.000000000 +0300 +@@ -316,6 +316,7 @@ void rfbClientCleanup(rfbClient* client) + #endif + #endif + ++ if (client->sock > 0) close(client->sock); + free(client->desktopName); + free(client->serverHost); + free(client); diff --git a/pkgs/core/libVNCServer/patches/libvncserver-0.9.1-multilib.patch b/pkgs/core/libVNCServer/patches/libvncserver-0.9.1-multilib.patch new file mode 100644 index 0000000..d54a470 --- /dev/null +++ b/pkgs/core/libVNCServer/patches/libvncserver-0.9.1-multilib.patch @@ -0,0 +1,20 @@ +diff -up LibVNCServer-0.9.1/libvncserver-config.in.multilib LibVNCServer-0.9.1/libvncserver-config.in +--- LibVNCServer-0.9.1/libvncserver-config.in.multilib 2007-05-26 21:28:25.000000000 -0500 ++++ LibVNCServer-0.9.1/libvncserver-config.in 2008-01-22 14:51:08.000000000 -0600 +@@ -4,7 +4,6 @@ prefix=@prefix@ + exec_prefix=@exec_prefix@ + exec_prefix_set=no + includedir=@includedir@ +-libdir=@libdir@ + + # if this script is in the same directory as libvncserver-config.in, assume not installed + if [ -f "`dirname "$0"`/libvncserver-config.in" ]; then +@@ -63,7 +62,7 @@ while test $# -gt 0; do + libs="$libs -R$dir" + fi + done +- echo "$libs" -lvncserver -lvncclient @LIBS@ @WSOCKLIB@ ++ echo "$libs" -lvncserver -lvncclient + ;; + --link) + echo @CC@ diff --git a/pkgs/core/libVNCServer/patches/libvncserver-0.9.7-Linux.patch b/pkgs/core/libVNCServer/patches/libvncserver-0.9.7-Linux.patch new file mode 100644 index 0000000..02c7b29 --- /dev/null +++ b/pkgs/core/libVNCServer/patches/libvncserver-0.9.7-Linux.patch @@ -0,0 +1,16 @@ +Index: configure.ac +=================================================================== +--- a/configure.ac.orig ++++ b/configure.ac +@@ -636,9 +636,10 @@ fi + AC_CHECK_LIB(cygipc,shmget) + AM_CONDITIONAL(CYGIPC, test "$HAVE_CYGIPC" = "true") + + # Check if /dev/vcsa1 exists, if so, define LINUX +-AM_CONDITIONAL(LINUX, test -c /dev/vcsa1) ++dnl AM_CONDITIONAL(LINUX, test -c /dev/vcsa1) ++AM_CONDITIONAL(LINUX, test `uname` = Linux) + + # Check for OS X specific header + AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, HAVE_OSX="true") + AM_CONDITIONAL(OSX, test "$HAVE_OSX" = "true") diff --git a/pkgs/core/libXi/libXi.nm b/pkgs/core/libXi/libXi.nm new file mode 100644 index 0000000..76f2f27 --- /dev/null +++ b/pkgs/core/libXi/libXi.nm @@ -0,0 +1,49 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = libXi +PKG_VER = 1.3.2 +PKG_REL = 0 + +PKG_MAINTAINER = Stefan Schantl stefan.schantl@ipfire.org +PKG_GROUP = X/Libraries +PKG_URL = http://xcb.freedesktop.org/ +PKG_LICENSE = MIT +PKG_SUMMARY = X.Org X11 libXi runtime library. + +PKG_BUILD_DEPS+= libX11-devel libXext-devel pkg-config \ + xorg-x11-proto-devel xorg-x11-util-macros + +PKG_PACKAGES += $(PKG_NAME)-devel + +define PKG_DESCRIPTION + X.Org X11 libXi runtime library. +endef + +PKG_TARBALL = $(THISAPP).tar.bz2 + +CONFIGURE_OPTIONS += \ + --disable-static diff --git a/pkgs/core/libXtst/libXtst.nm b/pkgs/core/libXtst/libXtst.nm new file mode 100644 index 0000000..1b2c2ff --- /dev/null +++ b/pkgs/core/libXtst/libXtst.nm @@ -0,0 +1,49 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = libXtst +PKG_VER = 1.1.0 +PKG_REL = 0 + +PKG_MAINTAINER = Stefan Schantl stefan.schantl@ipfire.org +PKG_GROUP = X/Libraries +PKG_URL = http://www.x.org/ +PKG_LICENSE = MIT +PKG_SUMMARY = X.Org X11 libXtst runtime library. + +PKG_BUILD_DEPS+= libX11-devel libXext-devel libXi-devel pkg-config \ + xorg-x11-proto-devel + +PKG_PACKAGES += $(PKG_NAME)-devel + +define PKG_DESCRIPTION + X.Org X11 libXtst development package. +endef + +PKG_TARBALL = $(THISAPP).tar.bz2 + +CONFIGURE_OPTIONS += \ + --disable-static diff --git a/pkgs/core/libXv/libXv.nm b/pkgs/core/libXv/libXv.nm new file mode 100644 index 0000000..ef05661 --- /dev/null +++ b/pkgs/core/libXv/libXv.nm @@ -0,0 +1,49 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = libXv +PKG_VER = 1.0.5 +PKG_REL = 0 + +PKG_MAINTAINER = Stefan Schantl stefan.schantl@ipfire.org +PKG_GROUP = X/Libraries +PKG_URL = http://www.x.org/ +PKG_LICENSE = MIT +PKG_SUMMARY = X.Org X11 libXv runtime library. + +PKG_BUILD_DEPS+= libX11-devel libXext-devel pkg-config \ + xorg-x11-proto-devel + +PKG_PACKAGES += $(PKG_NAME)-devel + +define PKG_DESCRIPTION + X.Org X11 libXv runtime library. +endef + +PKG_TARBALL = $(THISAPP).tar.bz2 + +CONFIGURE_OPTIONS += \ + --disable-static diff --git a/pkgs/core/libXvMC/libXvMC.nm b/pkgs/core/libXvMC/libXvMC.nm new file mode 100644 index 0000000..e8b8fd7 --- /dev/null +++ b/pkgs/core/libXvMC/libXvMC.nm @@ -0,0 +1,49 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = libXvMC +PKG_VER = 1.0.6 +PKG_REL = 0 + +PKG_MAINTAINER = Stefan Schantl stefan.schantl@ipfire.org +PKG_GROUP = X/Libraries +PKG_URL = http://www.x.org/ +PKG_LICENSE = MIT +PKG_SUMMARY = X.Org X11 libXvMC runtime library. + +PKG_BUILD_DEPS+= libX11-devel libXext-devel libXv-devel \ + pkg-config xorg-x11-proto-devel + +PKG_PACKAGES += $(PKG_NAME)-devel + +define PKG_DESCRIPTION + X.Org X11 libXvMC runtime library. +endef + +PKG_TARBALL = $(THISAPP).tar.bz2 + +CONFIGURE_OPTIONS += \ + --disable-static diff --git a/pkgs/core/xorg-x11-drv-intel/intel.xinf b/pkgs/core/xorg-x11-drv-intel/intel.xinf new file mode 100644 index 0000000..5867523 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/intel.xinf @@ -0,0 +1,28 @@ +alias pcivideo:v00008086d00001132sv*sd*bc*sc*i* intel # i815 +alias pcivideo:v00008086d00002562sv*sd*bc*sc*i* intel # 845G +alias pcivideo:v00008086d00002572sv*sd*bc*sc*i* intel # 865G +alias pcivideo:v00008086d00002582sv*sd*bc*sc*i* intel # 915G +alias pcivideo:v00008086d0000258Asv*sd*bc*sc*i* intel # E7221G ("915G") +alias pcivideo:v00008086d00002592sv*sd*bc*sc*i* intel # 915GM +alias pcivideo:v00008086d00002772sv*sd*bc*sc*i* intel # 945G +alias pcivideo:v00008086d000027A2sv*sd*bc*sc*i* intel # 945GM +alias pcivideo:v00008086d000027AEsv*sd*bc*sc*i* intel # 945GME +alias pcivideo:v00008086d00002972sv*sd*bc*sc*i* intel # 946GZ, really a 965 +alias pcivideo:v00008086d00002982sv*sd*bc*sc*i* intel # 965G1 +alias pcivideo:v00008086d00002992sv*sd*bc*sc*i* intel # 965Q +alias pcivideo:v00008086d000029A2sv*sd*bc*sc*i* intel # 965G +alias pcivideo:v00008086d000029B2sv*sd*bc*sc*i* intel # Q35 +alias pcivideo:v00008086d000029C2sv*sd*bc*sc*i* intel # G33 +alias pcivideo:v00008086d000029D2sv*sd*bc*sc*i* intel # Q33 +alias pcivideo:v00008086d00002A02sv*sd*bc*sc*i* intel # 965GM +alias pcivideo:v00008086d00002A12sv*sd*bc*sc*i* intel # 965GME +alias pcivideo:v00008086d00002A42sv*sd*bc*sc*i* intel # GM45 +alias pcivideo:v00008086d00002e02sv*sd*bc*sc*i* intel # IGD_E_G +alias pcivideo:v00008086d00002e12sv*sd*bc*sc*i* intel # Q45 +alias pcivideo:v00008086d00002e22sv*sd*bc*sc*i* intel # G45 +alias pcivideo:v00008086d00002e32sv*sd*bc*sc*i* intel # G41 +alias pcivideo:v00008086d00003577sv*sd*bc*sc*i* intel # i830 +alias pcivideo:v00008086d00003582sv*sd*bc*sc*i* intel # 855GM +alias pcivideo:v00008086d00007121sv*sd*bc*sc*i* intel # i810 +alias pcivideo:v00008086d00007123sv*sd*bc*sc*i* intel # i810 DC100 +alias pcivideo:v00008086d00007125sv*sd*bc*sc*i* intel # i810E diff --git a/pkgs/core/xorg-x11-drv-intel/patches/intel-2.10.0-add-mbp-backlight.patch b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.10.0-add-mbp-backlight.patch new file mode 100644 index 0000000..ddaab89 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.10.0-add-mbp-backlight.patch @@ -0,0 +1,12 @@ +Index: xf86-video-intel-2.11.0/src/drmmode_display.c +=================================================================== +--- xf86-video-intel-2.11.0/src/drmmode_display.c ++++ xf86-video-intel-2.11.0/src/drmmode_display.c 2010-04-29 00:18:34.000000000 +0200 +@@ -103,6 +103,7 @@ + "asus-laptop", + "eeepc", + "thinkpad_screen", ++ "mbp_backlight", + "acpi_video1", + "acpi_video0", + "fujitsu-laptop", diff --git a/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-lvds-first.patch b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-lvds-first.patch new file mode 100644 index 0000000..5e4a44d --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-lvds-first.patch @@ -0,0 +1,37 @@ +diff -up xf86-video-intel-20100319/src/drmmode_display.c.jx xf86-video-intel-20100319/src/drmmode_display.c +--- xf86-video-intel-20100319/src/drmmode_display.c.jx 2010-03-22 13:24:13.483183499 -0400 ++++ xf86-video-intel-20100319/src/drmmode_display.c 2010-03-22 13:25:59.810184060 -0400 +@@ -1452,7 +1452,7 @@ Bool drmmode_pre_init(ScrnInfoPtr scrn, + intel_screen_private *intel = intel_get_screen_private(scrn); + struct drm_i915_getparam gp; + drmmode_ptr drmmode; +- unsigned int i; ++ unsigned int i, lvds = -1; + int has_flipping = 0; + + drmmode = xnfalloc(sizeof *drmmode); +@@ -1473,9 +1473,22 @@ Bool drmmode_pre_init(ScrnInfoPtr scrn, + drmmode->mode_res->max_height); + for (i = 0; i < drmmode->mode_res->count_crtcs; i++) + drmmode_crtc_init(scrn, drmmode, i); ++ ++ /* do LVDS first */ ++ for (i = 0; i < drmmode->mode_res->count_connectors; i++) { ++ drmModeConnectorPtr koutput = ++ drmModeGetConnector(drmmode->fd, ++ drmmode->mode_res->connectors[i]); ++ if (koutput->connector_type == DRM_MODE_CONNECTOR_LVDS) { ++ drmmode_output_init(scrn, drmmode, i); ++ lvds = i; ++ } ++ drmModeFreeConnector(koutput); ++ } + + for (i = 0; i < drmmode->mode_res->count_connectors; i++) +- drmmode_output_init(scrn, drmmode, i); ++ if (i != lvds) ++ drmmode_output_init(scrn, drmmode, i); + + xf86InitialConfiguration(scrn, TRUE); + + diff --git a/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-no-pageflipping.patch b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-no-pageflipping.patch new file mode 100644 index 0000000..39500e2 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11-no-pageflipping.patch @@ -0,0 +1,33 @@ +diff -up xf86-video-intel-2.11.0/src/drmmode_display.c.no-flip xf86-video-intel-2.11.0/src/drmmode_display.c +--- xf86-video-intel-2.11.0/src/drmmode_display.c.no-flip 2010-05-03 15:30:19.000000000 -0400 ++++ xf86-video-intel-2.11.0/src/drmmode_display.c 2010-05-03 15:30:59.000000000 -0400 +@@ -1504,10 +1504,15 @@ Bool drmmode_pre_init(ScrnInfoPtr scrn, + gp.value = &has_flipping; + (void)drmCommandWriteRead(intel->drmSubFD, DRM_I915_GETPARAM, &gp, + sizeof(gp)); ++ ++ xf86DrvMsg(scrn->scrnIndex, X_INFO, ++ "Pageflipping %s in kernel, %s disabled in X\n", ++ has_flipping ? "enabled" : "disabled", ++ has_flipping ? "but" : "and"); + if (has_flipping) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, +- "Kernel page flipping support detected, enabling\n"); +- intel->use_pageflipping = TRUE; ++ "Don't panic: https://bugzilla.redhat.com/588421%5Cn"); ++ intel->use_pageflipping = FALSE; + drmmode->flip_count = 0; + drmmode->event_context.version = DRM_EVENT_CONTEXT_VERSION; + drmmode->event_context.vblank_handler = drmmode_vblank_handler; +diff -up xf86-video-intel-2.11.0/src/i830_dri.c.no-flip xf86-video-intel-2.11.0/src/i830_dri.c +--- xf86-video-intel-2.11.0/src/i830_dri.c.no-flip 2010-03-29 14:23:02.000000000 -0400 ++++ xf86-video-intel-2.11.0/src/i830_dri.c 2010-05-03 15:30:19.000000000 -0400 +@@ -1013,7 +1013,7 @@ Bool I830DRI2ScreenInit(ScreenPtr screen + + info.CopyRegion = I830DRI2CopyRegion; + #if DRI2INFOREC_VERSION >= 4 +- if (intel->use_pageflipping) { ++ if (intel->use_pageflipping || 1) { + info.version = 4; + info.ScheduleSwap = I830DRI2ScheduleSwap; + info.GetMSC = I830DRI2GetMSC; diff --git a/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11.0-vga-clock-max.patch b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11.0-vga-clock-max.patch new file mode 100644 index 0000000..80eeb07 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.11.0-vga-clock-max.patch @@ -0,0 +1,16 @@ +diff -up xf86-video-intel-2.11.0/src/drmmode_display.c.jx xf86-video-intel-2.11.0/src/drmmode_display.c +--- xf86-video-intel-2.11.0/src/drmmode_display.c.jx 2010-04-16 10:28:08.000000000 -0400 ++++ xf86-video-intel-2.11.0/src/drmmode_display.c 2010-04-26 15:28:58.000000000 -0400 +@@ -689,6 +689,12 @@ drmmode_output_mode_valid(xf86OutputPtr + else + return MODE_OK; + } ++ ++ /* I don't actually believe any VGA is this good */ ++ if (koutput->connector_type == DRM_MODE_CONNECTOR_VGA) ++ if (pModes->Clock > 250000) ++ return MODE_CLOCK_HIGH; ++ + return MODE_OK; + } + diff --git a/pkgs/core/xorg-x11-drv-intel/patches/intel-2.12-fix-uxa-planemask.patch b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.12-fix-uxa-planemask.patch new file mode 100644 index 0000000..eb89433 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.12-fix-uxa-planemask.patch @@ -0,0 +1,40 @@ +From feff2ec80eeeba5074d19efcddf4867adf639b4f Mon Sep 17 00:00:00 2001 +From: Dave Airlie airlied@redhat.com +Date: Mon, 5 Jul 2010 09:07:08 +1000 +Subject: [PATCH] uxa: don't compare planemask with FB_ALLONES. + +planemask is an unsigned long initialised to ~0, on 64-bit this is not equal +to an (unsigned int)-1. + +Use the macro provided to do this. + +Signed-off-by: Dave Airlie airlied@redhat.com +--- + uxa/uxa-accel.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c +index ded66a1..633b433 100644 +--- a/uxa/uxa-accel.c ++++ b/uxa/uxa-accel.c +@@ -81,7 +81,7 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n, + if (!dst_pixmap) + goto fallback; + +- if (pGC->alu != GXcopy || pGC->planemask != FB_ALLONES) ++ if (pGC->alu != GXcopy || !UXA_PM_IS_SOLID(pDrawable, pGC->planemask)) + goto solid; + + format = PictureMatchFormat(screen, +@@ -1048,7 +1048,7 @@ uxa_fill_region_solid(DrawablePtr pDrawable, + extents = REGION_EXTENTS(screen, pRegion); + + /* Using GEM, the relocation costs outweigh the advantages of the blitter */ +- if (nbox == 1 || (alu != GXcopy && alu != GXclear) || planemask != FB_ALLONES) { ++ if (nbox == 1 || (alu != GXcopy && alu != GXclear) || !UXA_PM_IS_SOLID(&pixmap->drawable, planemask)) { + try_solid: + if (uxa_screen->info->check_solid && + !uxa_screen->info->check_solid(&pixmap->drawable, alu, planemask)) +-- +1.7.1 + diff --git a/pkgs/core/xorg-x11-drv-intel/patches/intel-2.8.0-kms-get-crtc.patch b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.8.0-kms-get-crtc.patch new file mode 100644 index 0000000..e7e8569 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/intel-2.8.0-kms-get-crtc.patch @@ -0,0 +1,23 @@ +diff -up xf86-video-intel-20090908/src/drmmode_display.c.jx xf86-video-intel-20090908/src/drmmode_display.c +--- xf86-video-intel-20090908/src/drmmode_display.c.jx 2009-09-08 14:30:55.000000000 -0400 ++++ xf86-video-intel-20090908/src/drmmode_display.c 2009-09-08 14:31:09.000000000 -0400 +@@ -1195,8 +1195,19 @@ drmmode_output_get_property(xf86OutputPt + return TRUE; + } + ++#ifdef RANDR_GET_CRTC_INTERFACE ++static xf86CrtcPtr ++drmmode_get_crtc(xf86OutputPtr output) ++{ ++ return output->crtc; ++} ++#endif ++ + static const xf86OutputFuncsRec drmmode_output_funcs = { + .create_resources = drmmode_output_create_resources, ++#ifdef RANDR_GET_CRTC_INTERFACE ++ .get_crtc = drmmode_get_crtc, ++#endif + #ifdef RANDR_12_INTERFACE + .set_property = drmmode_output_set_property, + .get_property = drmmode_output_get_property, diff --git a/pkgs/core/xorg-x11-drv-intel/patches/kill-svideo.patch b/pkgs/core/xorg-x11-drv-intel/patches/kill-svideo.patch new file mode 100644 index 0000000..607c5a7 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/kill-svideo.patch @@ -0,0 +1,23 @@ +diff --git a/src/drmmode_display.c b/src/drmmode_display.c +index d50e640..d6c7cd3 100644 +--- a/src/drmmode_display.c ++++ b/src/drmmode_display.c +@@ -412,6 +412,18 @@ drmmode_output_detect(xf86OutputPtr output) + drmmode_output->mode_output = + drmModeGetConnector(drmmode->fd, drmmode_output->output_id); + ++ switch (drmmode_output->mode_output->connector_type) { ++ case DRM_MODE_CONNECTOR_SVIDEO: ++ /* FIXME: KMS svideo detection is flaky an causes X to ++ * come up in 1024x768 when it tries to pick a clone ++ * mode that fits both the panel and the tv out. Once ++ * KMS learns how to detect svideo better we can ++ * remove this. */ ++ return DRM_MODE_UNKNOWNCONNECTION; ++ default: ++ break; ++ } ++ + switch (drmmode_output->mode_output->connection) { + case DRM_MODE_CONNECTED: + status = XF86OutputStatusConnected; diff --git a/pkgs/core/xorg-x11-drv-intel/patches/uevent.patch b/pkgs/core/xorg-x11-drv-intel/patches/uevent.patch new file mode 100644 index 0000000..ab040fa --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/patches/uevent.patch @@ -0,0 +1,146 @@ +diff -up xf86-video-intel-2.12.0/src/i830_driver.c.uevent xf86-video-intel-2.12.0/src/i830_driver.c +--- xf86-video-intel-2.12.0/src/i830_driver.c.uevent 2010-06-24 16:29:49.000000000 -0400 ++++ xf86-video-intel-2.12.0/src/i830_driver.c 2010-06-25 11:40:01.335975581 -0400 +@@ -81,6 +81,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. + #include "i915_drm.h" + #include <xf86drmMode.h> + ++#include "libudev.h" ++ + #define BIT(x) (1 << (x)) + #define MAX(a,b) ((a) > (b) ? (a) : (b)) + #define NB_OF(x) (sizeof (x) / sizeof (*x)) +@@ -996,6 +998,80 @@ int i830_crtc_to_pipe(xf86CrtcPtr crtc) + return drmmode_get_pipe_from_crtc_id(intel->bufmgr, crtc); + } + ++static void ++I830HandleUEvents(int fd, void *closure) ++{ ++ ScrnInfoPtr scrn = closure; ++ intel_screen_private *intel = intel_get_screen_private(scrn); ++ struct udev_device *dev; ++ ++ dev = udev_monitor_receive_device(intel->uevent_monitor); ++ if (!dev) ++ return; ++ ++ /* ++ * technically we should inspect the event to see that it's a hotplug. ++ * but we know it's a hotplug, we don't get events for anything else. ++ * XXX but we should definitely trim by drm node ++ */ ++ ++ RRGetInfo(screenInfo.screens[scrn->scrnIndex], TRUE); ++ ++ udev_device_unref(dev); ++} ++ ++static void ++I830UeventInit(ScrnInfoPtr scrn) ++{ ++ intel_screen_private *intel = intel_get_screen_private(scrn); ++ struct udev *u; ++ struct udev_monitor *mon; ++ ++ u = udev_new(); ++ if (!u) ++ return; ++ ++ mon = udev_monitor_new_from_netlink(u, "udev"); ++ ++ if (!mon) { ++ udev_unref(u); ++ return; ++ } ++ ++ if (udev_monitor_filter_add_match_subsystem_devtype(mon, ++ "drm", ++ "drm_minor") < 0 || ++ udev_monitor_enable_receiving(mon) < 0) ++ { ++ udev_monitor_unref(mon); ++ udev_unref(u); ++ return; ++ } ++ ++ intel->uevent_handler = ++ xf86AddGeneralHandler(udev_monitor_get_fd(mon), ++ I830HandleUEvents, ++ scrn); ++ ++ intel->uevent_monitor = mon; ++} ++ ++static void ++I830UeventFini(ScrnInfoPtr scrn) ++{ ++ intel_screen_private *intel = intel_get_screen_private(scrn); ++ ++ if (intel->uevent_handler) ++ { ++ struct udev *u = udev_monitor_get_udev(intel->uevent_monitor); ++ ++ xf86RemoveGeneralHandler(intel->uevent_handler); ++ ++ udev_monitor_unref(intel->uevent_monitor); ++ udev_unref(u); ++ } ++} ++ + static Bool + I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv) + { +@@ -1233,6 +1309,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr + + intel->suspended = FALSE; + ++ I830UeventInit(scrn); ++ + return uxa_resources_init(screen); + } + +@@ -1306,7 +1384,8 @@ static Bool I830CloseScreen(int scrnInde + { + ScrnInfoPtr scrn = xf86Screens[scrnIndex]; + intel_screen_private *intel = intel_get_screen_private(scrn); +- ++ ++ I830UeventFini(scrn); + if (scrn->vtSema == TRUE) { + I830LeaveVT(scrnIndex, 0); + } +diff -up xf86-video-intel-2.12.0/src/i830.h.uevent xf86-video-intel-2.12.0/src/i830.h +--- xf86-video-intel-2.12.0/src/i830.h.uevent 2010-06-24 16:29:49.000000000 -0400 ++++ xf86-video-intel-2.12.0/src/i830.h 2010-06-25 11:39:15.665029821 -0400 +@@ -47,6 +47,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN + #ifndef _I830_H_ + #define _I830_H_ + ++#include "libudev.h" ++ + #include "xf86_OSproc.h" + #include "compiler.h" + #include "xf86PciInfo.h" +@@ -432,6 +434,9 @@ typedef struct intel_screen_private { + */ + Bool fallback_debug; + unsigned debug_flush; ++ ++ struct udev_monitor *uevent_monitor; ++ InputHandlerProc uevent_handler; + } intel_screen_private; + + enum { +diff -up xf86-video-intel-2.12.0/src/Makefile.am.uevent xf86-video-intel-2.12.0/src/Makefile.am +--- xf86-video-intel-2.12.0/src/Makefile.am.uevent 2010-06-24 16:29:37.000000000 -0400 ++++ xf86-video-intel-2.12.0/src/Makefile.am 2010-06-25 11:39:15.665029821 -0400 +@@ -32,7 +32,7 @@ AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @ + intel_drv_la_LTLIBRARIES = intel_drv.la + intel_drv_la_LDFLAGS = -module -avoid-version + intel_drv_ladir = @moduledir@/drivers +-intel_drv_la_LIBADD = -lm @DRM_LIBS@ -ldrm_intel ../uxa/libuxa.la ++intel_drv_la_LIBADD = -ludev -lm @DRM_LIBS@ -ldrm_intel ../uxa/libuxa.la + intel_drv_la_LIBADD += @PCIACCESS_LIBS@ + + INTEL_DRI_SRCS = \ diff --git a/pkgs/core/xorg-x11-drv-intel/xorg-x11-drv-intel.nm b/pkgs/core/xorg-x11-drv-intel/xorg-x11-drv-intel.nm new file mode 100644 index 0000000..9c5b29c --- /dev/null +++ b/pkgs/core/xorg-x11-drv-intel/xorg-x11-drv-intel.nm @@ -0,0 +1,63 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = xorg-x11-drv-intel +PKG_VER = 2.12.0 +PKG_REL = 0 + +PKG_MAINTAINER = Stefan Schantl stefan.schantl@ipfire.org +PKG_GROUP = X/Driver +PKG_URL = http://www.x.org/ +PKG_LICENSE = MIT +PKG_SUMMARY = Xorg X11 intel video driver. + +PKG_BUILD_DEPS += autoconf automake libdrm-devel libudev-devel libxcb-devel \ + libXvMC-devel libtool mesa-devel pkg-config xorg-x11-server-devel xorg-x11-util-macros + +define PKG_DESCRIPTION + X.Org X11 intel video driver. +endef + +PKG_TARBALL = xf86-video-intel-$(PKG_VER).tar.bz2 + +DIR_APP = $(DIR_SRC)/xf86-video-intel-$(PKG_VER) + +CFLAGS += -Wl,-z,lazy + +QUALITY_AGENT_PERMIT_NOT_FULL_RELRO = yes + +CONFIGURE_OPTIONS += \ + --enable-dri \ + --enable-xvmc \ + --disable-static + +define STAGE_PREPARE_CMDS + cd $(DIR_APP) && autoreconf -vi +endef + +define STAGE_INSTALL_CMDS + install -Dm 0644 $(DIR_SOURCE)/intel.xinf $(BUILDROOT)/usr/share/hwdata/videoaliases/intel.xinf +endef diff --git a/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-panel-fix.patch b/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-panel-fix.patch new file mode 100644 index 0000000..afe2e5a --- /dev/null +++ b/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-panel-fix.patch @@ -0,0 +1,36 @@ +diff -up xf86-video-nv-2.1.6/src/nv_setup.c.jx xf86-video-nv-2.1.6/src/nv_setup.c +--- xf86-video-nv-2.1.6/src/nv_setup.c.jx 2007-09-17 17:17:51.000000000 -0400 ++++ xf86-video-nv-2.1.6/src/nv_setup.c 2008-02-12 10:19:54.000000000 -0500 +@@ -668,27 +668,14 @@ NVCommonSetup(ScrnInfoPtr pScrn) + } + + if(monitorA) { +- if((monitorA->features.input_type && pNv->FlatPanel) || +- (!monitorA->features.input_type && !pNv->FlatPanel)) +- { +- if(monitorB) { +- free(monitorB); +- monitorB = NULL; +- } +- } else { +- free(monitorA); +- monitorA = NULL; +- } ++ if(monitorB) { ++ free(monitorB); ++ monitorB = NULL; ++ } + } + + if(monitorB) { +- if((monitorB->features.input_type && !pNv->FlatPanel) || +- (!monitorB->features.input_type && pNv->FlatPanel)) +- { +- free(monitorB); +- } else { +- monitorA = monitorB; +- } ++ monitorA = monitorB; + monitorB = NULL; + } + diff --git a/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-starvation.patch b/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-starvation.patch new file mode 100644 index 0000000..ca00e61 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.6-starvation.patch @@ -0,0 +1,24 @@ +diff -up xf86-video-nv-2.1.6/src/nv_driver.c.jx xf86-video-nv-2.1.6/src/nv_driver.c +--- xf86-video-nv-2.1.6/src/nv_driver.c.jx 2007-09-26 20:59:50.000000000 -0400 ++++ xf86-video-nv-2.1.6/src/nv_driver.c 2008-01-22 16:11:24.000000000 -0500 +@@ -1148,12 +1148,19 @@ NVFreeScreen(int scrnIndex, int flags) + static ModeStatus + NVValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) + { +- NVPtr pNv = NVPTR(xf86Screens[scrnIndex]); ++ ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; ++ NVPtr pNv = NVPTR(pScrn); + + if(pNv->fpWidth && pNv->fpHeight) + if((pNv->fpWidth < mode->HDisplay) || (pNv->fpHeight < mode->VDisplay)) + return (MODE_PANEL); + ++ /* avoid starving the chip on scanout */ ++ if (pNv->Architecture == NV_ARCH_04 && ++ (mode->HDisplay * mode->VDisplay * (pScrn->bitsPerPixel / 8) > ++ pScrn->videoRam * 952)) /* 1024 * 0.93, yay magic numbers */ ++ return MODE_BANDWIDTH; ++ + return (MODE_OK); + } + diff --git a/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.8-g80-no-doublescan.patch b/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.8-g80-no-doublescan.patch new file mode 100644 index 0000000..6c75db1 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-nv/patches/nv-2.1.8-g80-no-doublescan.patch @@ -0,0 +1,24 @@ +diff -up xf86-video-nv-2.1.8/src/g80_dac.c.jx xf86-video-nv-2.1.8/src/g80_dac.c +--- xf86-video-nv-2.1.8/src/g80_dac.c.jx 2008-01-29 20:55:21.000000000 -0500 ++++ xf86-video-nv-2.1.8/src/g80_dac.c 2008-04-29 16:44:08.000000000 -0400 +@@ -205,7 +205,7 @@ G80CreateDac(ScrnInfoPtr pScrn, ORNum or + pPriv->set_pclk = G80DacSetPClk; + output->driver_private = pPriv; + output->interlaceAllowed = TRUE; +- output->doubleScanAllowed = TRUE; ++ output->doubleScanAllowed = FALSE; + + return output; + } +diff -up xf86-video-nv-2.1.8/src/g80_sor.c.jx xf86-video-nv-2.1.8/src/g80_sor.c +--- xf86-video-nv-2.1.8/src/g80_sor.c.jx 2008-03-06 15:33:15.000000000 -0500 ++++ xf86-video-nv-2.1.8/src/g80_sor.c 2008-04-29 16:44:16.000000000 -0400 +@@ -510,7 +510,7 @@ G80CreateSor(ScrnInfoPtr pScrn, ORNum or + pPriv->set_pclk = G80SorSetPClk; + output->driver_private = pPriv; + output->interlaceAllowed = TRUE; +- output->doubleScanAllowed = TRUE; ++ output->doubleScanAllowed = FALSE; + + return output; + } diff --git a/pkgs/core/xorg-x11-drv-nv/patches/nv-reserve-fbarea.patch b/pkgs/core/xorg-x11-drv-nv/patches/nv-reserve-fbarea.patch new file mode 100644 index 0000000..b86b83c --- /dev/null +++ b/pkgs/core/xorg-x11-drv-nv/patches/nv-reserve-fbarea.patch @@ -0,0 +1,55 @@ +diff --git a/src/nv_driver.c b/src/nv_driver.c +index 4bcc391..6252dd2 100644 +--- a/src/nv_driver.c ++++ b/src/nv_driver.c +@@ -32,6 +32,8 @@ + #include "xf86int10.h" + #include "vbeModes.h" + ++#define NV_ALIGN(x,bytes) (((x) + ((bytes) - 1)) & ~((bytes) - 1)) ++ + const OptionInfoRec * RivaAvailableOptions(int chipid, int busid); + Bool RivaGetScrnInfoRec(PciChipsets *chips, int chip); + Bool G80GetScrnInfoRec(PciChipsets *chips, int chip); +@@ -2266,7 +2268,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) + unsigned char *FBStart; + int width, height, displayWidth, offscreenHeight, shadowHeight; + BoxRec AvailFBArea; +- ++ FBAreaPtr fbarea; + /* + * First get the ScrnInfoRec + */ +@@ -2421,7 +2423,31 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) + AvailFBArea.y1 = 0; + AvailFBArea.x2 = pScrn->displayWidth; + AvailFBArea.y2 = offscreenHeight; +- xf86InitFBManager(pScreen, &AvailFBArea); ++ ++ ++ if (!xf86InitFBManager(pScreen, &AvailFBArea)) { ++ xf86DrvMsg(scrnIndex, X_ERROR, ++ "Memory manager initialized to (%d,%d) (%d,%d) failed\n", ++ AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2); ++ return FALSE; ++ } ++ ++ xf86DrvMsg(scrnIndex, X_INFO, ++ "Memory manager initialized to (%d,%d) (%d,%d)\n", ++ AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2); ++ ++ if ((fbarea = xf86AllocateOffscreenArea(pScreen, ++ pScrn->displayWidth, ++ NV_ALIGN(pScrn->virtualY, 64) - ++ pScrn->virtualY + 2, ++ 0, NULL, NULL, NULL))) { ++ xf86DrvMsg(scrnIndex, X_INFO, ++ "Reserved area from (%d,%d) to (%d,%d)\n", ++ fbarea->box.x1, fbarea->box.y1, ++ fbarea->box.x2, fbarea->box.y2); ++ } else { ++ xf86DrvMsg(scrnIndex, X_ERROR, "Unable to reserve area\n"); ++ } + + if (!pNv->NoAccel) + NVAccelInit(pScreen); diff --git a/pkgs/core/xorg-x11-drv-nv/patches/nv-save-rom.patch b/pkgs/core/xorg-x11-drv-nv/patches/nv-save-rom.patch new file mode 100644 index 0000000..98564ba --- /dev/null +++ b/pkgs/core/xorg-x11-drv-nv/patches/nv-save-rom.patch @@ -0,0 +1,45 @@ +diff -up xf86-video-nv-2.1.14/src/g80_driver.c.da xf86-video-nv-2.1.14/src/g80_driver.c +--- xf86-video-nv-2.1.14/src/g80_driver.c.da 2009-08-04 16:03:45.000000000 +1000 ++++ xf86-video-nv-2.1.14/src/g80_driver.c 2009-08-04 16:04:06.000000000 +1000 +@@ -27,6 +27,9 @@ + #endif + + #include <string.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <fcntl.h> + + #include <xf86.h> + #include <xf86_OSproc.h> +@@ -163,6 +166,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags) + char *s; + CARD32 tmp; + memType BAR1sizeKB; ++ int fd; + + if(flags & PROBE_DETECT) + return TRUE; +@@ -390,6 +394,14 @@ G80PreInit(ScrnInfoPtr pScrn, int flags) + else + pNv->table1 -= 0x10000; + ++ /* Gag me with a horse */ ++ ++ fd = open ("/var/run/video.rom", O_CREAT|O_RDWR|O_EXCL, 0700); ++ if(fd != -1) { ++ write (fd, pNv->table1, 0x10000); ++ close (fd); ++ } ++ + xf86CrtcConfigInit(pScrn, &randr12_screen_funcs); + xf86CrtcSetSizeRange(pScrn, 320, 200, 8192, 8192); + +@@ -939,6 +951,8 @@ G80EnterVT(int scrnIndex, int flags) + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + G80Ptr pNv = G80PTR(pScrn); + ++ G80DispPreInit(pScrn); ++ + /* Reinit the hardware */ + if(pNv->xaa) + G80InitHW(pScrn); diff --git a/pkgs/core/xorg-x11-drv-nv/xorg-x11-drv-nv.nm b/pkgs/core/xorg-x11-drv-nv/xorg-x11-drv-nv.nm new file mode 100644 index 0000000..8f3c53e --- /dev/null +++ b/pkgs/core/xorg-x11-drv-nv/xorg-x11-drv-nv.nm @@ -0,0 +1,57 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = xorg-x11-drv-nv +PKG_VER = 2.1.18 +PKG_REL = 0 + +PKG_MAINTAINER = Stefan Schantl stefan.schantl@ipfire.org +PKG_GROUP = X/Driver +PKG_URL = http://www.x.org/ +PKG_LICENSE = MIT +PKG_SUMMARY = Xorg X11 nv video driver. + +PKG_BUILD_DEPS += autoconf automake libX11-devel libdrm-devel libtool \ + pkg-config xorg-x11-server-devel xorg-x11-util-macros + +define PKG_DESCRIPTION + X.Org X11 nv video driver. +endef + +PKG_TARBALL = xf86-video-nv-$(PKG_VER).tar.bz2 + +DIR_APP = $(DIR_SRC)/xf86-video-nv-$(PKG_VER) + +CFLAGS += -Wl,-z,lazy + +QUALITY_AGENT_PERMIT_NOT_FULL_RELRO = yes + +CONFIGURE_OPTIONS += \ + --disable-static + +define STAGE_PREPARE_CMDS + cd $(DIR_APP) && autoreconf -vi +endef diff --git a/pkgs/core/xorg-x11-drv-synaptics/50-synaptics.conf b/pkgs/core/xorg-x11-drv-synaptics/50-synaptics.conf new file mode 100644 index 0000000..54979f0 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-synaptics/50-synaptics.conf @@ -0,0 +1,22 @@ +Section "InputClass" + Identifier "touchpad catchall" + Driver "synaptics" + MatchIsTouchpad "on" + MatchDevicePath "/dev/input/event*" +EndSection + + +# Quirks for special touchpads + +# Some devices have the buttons as part of the lower edge of the +# touchpad. Pressing a button moves the cursor, causing cursor jumps and +# erroneous clicks. +# Use the synaptics area property to work around this, udev labels these +# devices for us as touchpad_button_overlap. +# Affected: Dell Mini +Section "InputClass" + Identifier "touchpad button overlap" + MatchIsTouchpad "on" + MatchTag "touchpad_button_overlap" + Option "AreaBottomEdge" "4000" +EndSection diff --git a/pkgs/core/xorg-x11-drv-synaptics/70-touchpad-quirks.rules b/pkgs/core/xorg-x11-drv-synaptics/70-touchpad-quirks.rules new file mode 100644 index 0000000..6c65c29 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-synaptics/70-touchpad-quirks.rules @@ -0,0 +1,15 @@ +ACTION!="add|change", GOTO="touchpad_quirks_end" +KERNEL!="event*", GOTO="touchpad_quirks_end" + +ENV{ID_INPUT_TOUCHPAD}!="1", GOTO="touchpad_quirks_end" + +# model specific quirks + +# Dell Minis have a touchpad where the buttons and the touchpad area +# overlap. Clicking a button thus moves the pointer, this requires special +# Xorg configuration. + +ATTR{[dmi/id]product_name}=="Inspiron 1011|Inspiron 1012", \ + ENV{ID_INPUT.tags}="touchpad_button_overlap" + +LABEL="touchpad_quirks_end" diff --git a/pkgs/core/xorg-x11-drv-synaptics/xorg-x11-drv-synaptics.nm b/pkgs/core/xorg-x11-drv-synaptics/xorg-x11-drv-synaptics.nm new file mode 100644 index 0000000..70e74d9 --- /dev/null +++ b/pkgs/core/xorg-x11-drv-synaptics/xorg-x11-drv-synaptics.nm @@ -0,0 +1,63 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = xorg-x11-drv-synaptics +PKG_VER = 1.3.0 +PKG_REL = 0 + +PKG_MAINTAINER = Stefan Schantl stefan.schantl@ipfire.org +PKG_GROUP = X/Driver +PKG_URL = http://www.x.org/ +PKG_LICENSE = MIT +PKG_SUMMARY = Xorg X11 synaptics input driver. + +PKG_BUILD_DEPS += libX11-devel libXi-devel pkg-config xorg-x11-server-devel\ + xorg-x11-util-macros + +PKG_PACKAGES += $(PKG_NAME)-devel + +define PKG_DESCRIPTION + This is the Synaptics touchpad driver for the X.Org X server. +endef + +PKG_TARBALL = xf86-input-synaptics-$(PKG_VER).tar.bz2 + +DIR_APP = $(DIR_SRC)/xf86-input-synaptics-$(PKG_VER) + +QUALITY_AGENT_PERMIT_NOT_FULL_RELRO = yes + +CONFIGURE_OPTIONS += \ + --disable-static + +# Disable BIND_NOW for the X server module +define STAGE_CONFIGURE_CMDS + cd $(DIR_APP) && sed -e "s/^CFLAGS.*/& -Wl,-z,lazy/" -i src/Makefile +endef + +define STAGE_INSTALL_CMDS + install -Dm 0664 $(DIR_SOURCE)/50-synaptics.conf $(BUILDROOT)/etc/X11/xorg.conf.d/50-synaptics.conf + install -Dm 0664 $(DIR_SOURCE)/70-touchpad-quirks.rules $(BUILDROOT)/lib/udev/rules.d/70-touchpad-quirks.rules +endef diff --git a/pkgs/core/xorg-x11-server/xorg-x11-server.nm b/pkgs/core/xorg-x11-server/xorg-x11-server.nm index 6c82065..dec6412 100644 --- a/pkgs/core/xorg-x11-server/xorg-x11-server.nm +++ b/pkgs/core/xorg-x11-server/xorg-x11-server.nm @@ -53,7 +53,7 @@ endef
PKG_TARBALL = xorg-server-$(PKG_VER).tar.bz2
-CFLAGS += -Wstrict-overflow -rdynamic -Wl,-z,lazy +CFLAGS += -Wstrict-overflow -rdynamic
QUALITY_AGENT_PERMIT_NOT_FULL_RELRO = yes
@@ -90,6 +90,27 @@ define STAGE_PREPARE_CMDS cd $(DIR_APP) && autoreconf -vfi endef
+# Remove BIND_NOW flag from server modules to provide autoloading of them if needed +# by the server itself. +define STAGE_CONFIGURE_CMDS + cd $(DIR_APP) && sed -i \ + -e "s/^CFLAGS.*/& -Wl,-z,lazy/" \ + -e "s/^CCASFLAGS.*/& -Wl,-z,lazy/" \ + \ + hw/xfree86/dixmods/Makefile \ + hw/xfree86/dixmods/extmod/Makefile \ + hw/xfree86/dri/Makefile \ + hw/xfree86/dri2/Makefile \ + hw/xfree86/exa/Makefile \ + hw/xfree86/fbdevhw/Makefile \ + hw/xfree86/i2c/Makefile \ + hw/xfree86/int10/Makefile \ + hw/xfree86/shadowfb/Makefile \ + hw/xfree86/vbe/Makefile \ + hw/xfree86/vgahw/Makefile \ + hw/xfree86/xaa/Makefile +endef + define STAGE_INSTALL cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT) \ moduledir=/usr/lib/xorg/modules diff --git a/src/bootloader/installer.conf b/src/bootloader/installer.conf index 4e1ac98..bfb6735 100644 --- a/src/bootloader/installer.conf +++ b/src/bootloader/installer.conf @@ -22,12 +22,12 @@ MENU hiddenrow 5 LABEL install MENU label ^Install a new @NAME@ system MENU default - KERNEL vmlinuz - APPEND initrd=initrd root=CDLABEL=@NAME@_@VERSION@ rootfstype=iso9660 mode=install quiet ro + KERNEL vmlinuz0 + APPEND initrd=initrd0 root=live:CDLABEL=@NAME@_@VERSION@ rootfstype=auto liveimg mode=install quiet label rescue MENU label ^Rescue installed @NAME@ system - KERNEL vmlinuz - APPEND initrd=initrd root=CDLABEL=@NAME@_@VERSION@ rootfstype=iso9660 mode=rescue quiet ro + KERNEL vmlinuz0 + APPEND initrd=initrd0 root=live:CDLABEL=@NAME@_@VERSION@ rootfstype=auto liveimg mode=rescue quiet label local MENU label Boot from ^local drive LOCALBOOT 0xffff diff --git a/src/install/etc/init/serial.conf b/src/install/etc/init/serial.conf deleted file mode 100644 index 7663989..0000000 --- a/src/install/etc/init/serial.conf +++ /dev/null @@ -1,24 +0,0 @@ -description "Start a tty" -author "IPFire Team" - -# Automatically start a configured serial console -# -# How this works: -# -# On boot, a udev helper examines /dev/console. If a serial console is the -# primary console (last console on the commandline in grub), the event -# 'serial-console-available <port name> <speed>' is emitted, which -# triggers this script. -# -# If your serial console is not the primary console, or you want a getty -# on serial even if it's not the console, create your own event by copying -# /etc/init/tty[2-6], and changing the getty line in that file. - -start on serial-console-available * -stop on starting shutdown or starting reboot - -pre-start script - /sbin/securetty $DEV -end script - -exec /sbin/agetty -n -l /root/autologin $DEV $SPEED vt100-nav diff --git a/src/install/etc/init/tty1.conf b/src/install/etc/init/tty1.conf deleted file mode 100644 index ab40e15..0000000 --- a/src/install/etc/init/tty1.conf +++ /dev/null @@ -1,8 +0,0 @@ -description "Start a tty" -author "IPFire Team" - -start on stopped mountfs -stop on starting shutdown - -respawn -exec /sbin/agetty -n -l /root/autologin tty1 9600 diff --git a/src/install/etc/init/tty2.conf b/src/install/etc/init/tty2.conf deleted file mode 100644 index 83bafd5..0000000 --- a/src/install/etc/init/tty2.conf +++ /dev/null @@ -1,8 +0,0 @@ -description "Start a tty" -author "IPFire Team" - -start on stopped mountfs -stop on starting shutdown - -respawn -exec /sbin/agetty -n -l /root/autologin tty2 9600 diff --git a/src/install/etc/init/tty3.conf b/src/install/etc/init/tty3.conf deleted file mode 100644 index 8045bd4..0000000 --- a/src/install/etc/init/tty3.conf +++ /dev/null @@ -1,8 +0,0 @@ -description "Start a tty" -author "IPFire Team" - -start on stopped mountfs -stop on starting shutdown - -respawn -exec /sbin/agetty -n -l /root/autologin tty3 9600 diff --git a/src/install/etc/init/tty4.conf b/src/install/etc/init/tty4.conf deleted file mode 100644 index b9f4217..0000000 --- a/src/install/etc/init/tty4.conf +++ /dev/null @@ -1,8 +0,0 @@ -description "Start a tty" -author "IPFire Team" - -start on stopped mountfs -stop on starting shutdown - -respawn -exec /sbin/agetty -n -l /root/autologin tty4 9600 diff --git a/src/install/root/.bash_profile b/src/install/root/.bash_profile deleted file mode 100644 index 00680d6..0000000 --- a/src/install/root/.bash_profile +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -############################################################################### -# # -# IPFire.org - A linux based firewall # -# Copyright (C) 2008 Michael Tremer & Christian Schmidt # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see http://www.gnu.org/licenses/. # -# # -############################################################################### - -LANG=en_US.UTF-8 -export LANG - -command=/sbin/pomona -debug=off -mode= - -for o in $(cat /proc/cmdline) ; do - case $o in - mode=*) - mode=${o#mode=} - ;; - debug) - debug=on - esac -done - -if [ "$mode" = "install" ] && [[ "$(tty)" =~ "tty1" ]]; then - if [ "$debug" == "on" ]; then - command="$command --debug" - fi - exec $command -fi diff --git a/src/install/root/autologin b/src/install/root/autologin deleted file mode 100755 index c8e4251..0000000 --- a/src/install/root/autologin +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -echo "Logging in "root"" -exec /bin/login -f root diff --git a/tools/generator b/tools/generator index 7f673ff..9c615f7 100755 --- a/tools/generator +++ b/tools/generator @@ -1,9 +1,13 @@ -#!/bin/bash +#!/bin/bash -x
BOOTLOADER_DIR=/usr/src/src/bootloader IMAGES_DIR=/usr/src/images
-ISO_FILENAME=${DISTRO_SNAME}-${DISTRO_VERSION}-${TARGET}.iso +# Size of the ext filesystem in gigabytes +FSSIZE=2 +FSTYPE=ext4 + +ISO_FILENAME=${DISTRO_SNAME}-${DISTRO_VERSION}.${PKG_ARCH}.iso
. $(dirname ${0})/common-functions
@@ -19,10 +23,143 @@ function find_latest_kernel_release() { KERNEL_RELEASE=$(find_latest_kernel_release)
function installer_image() { + local target=${1} + local dir=${2} + + # Create target directory if not existant + mkdir -p ${target} 2>/dev/null + + # Create installer images: + # (1) osmin.img (minimal cow image) + # (2) squashfs.img (installer) + + local i + for i in dev proc sys; do + mkdir -p ${dir}/${i} 2>/dev/null + done + + cp -vfr /usr/src/src/install/* ${dir} + + _installer_image_ext3fs \ + ${target}/$(basename ${target})/ext3fs.img /installer + _installer_image_osmin \ + ${target}/osmin.img \ + ${target}/$(basename ${target})/ext3fs.img + + cd ${target} + mksquashfs * ${target}/squashfs.img -no-progress + rm -fr $(basename ${target}) +} + +function _installer_image_osmin() { + local file=${1} + local image=${2} + + local tmp=$(mktemp -d) + + local image_loop=$(losetup -f) + + # Setting up loop for image + losetup ${image_loop} ${image} + + # Setting up loop for an empty 64byte sparse file + sparse=${tmp}/osmin + sparse_loop=$(losetup -f) + + dd if=/dev/zero of=${sparse} bs=1 count=0 seek=64M + losetup ${sparse_loop} ${sparse} + + # Create a DM snapshot device... + local name="imgcreate-$$" + local size=$(stat --format="%s" ${image}) + size=$(( ${size} / 512 )) + + dmsetup create ${name} \ + --table "0 ${size} snapshot ${image_loop} ${sparse_loop} p 8" + + # ...and resize it to its minimal size + _ext3fs_resize /dev/mapper/${name} + + # Get size of the bytes used by the cow image + local cow_size=( $(dmsetup status | grep "^${name}") ) + cow_size=${cow_size[4]} + cow_size=$(awk -F"/" '{ print $1 }' <<<${cow_size}) + + sleep 2 + dmsetup remove ${name} + + # ... and truncate it to its minimal size + truncate -s ${cow_size} ${sparse} + + losetup -d ${sparse_loop} + losetup -d ${image_loop} + + rm -f ${file} + ( cd ${tmp} && \ + mksquashfs * ${file} -no-progress ) +} + +function _ext3fs_blocks() { + local device=${1} + + dumpe2fs -h ${device} 2>/dev/null | \ + grep "Block count" | awk '{ print $NF }' +} + +function _ext3fs_bytes() { + echo $(( $(_ext3fs_blocks $@) * 512 )) +} + +function _ext3fs_resize() { + local device=${1} + local size=${2} + + [ -z "${size}" ] && size="-M" + + e2fsck -f -y ${device} + resize2fs ${device} ${size} +} + +function _installer_image_ext3fs() { local file=${1} local dir=${2}
- cd ${dir} && mksquashfs * ${file} -no-progress -e boot + local zero=$(mktemp) + + mkdir -p $(dirname ${file}) 2>/dev/null + + # Create a zeroed file + dd if=/dev/zero of=${file} bs=1 count=0 seek=${FSSIZE}G + + # Create a temporary directory + # and get a free loop device + local tmp_dir=$(mktemp -d) + local loop=$(losetup -f) + + # Set up the loop device + losetup ${loop} ${file} + + # Create filesystem + mkfs.${FSTYPE} \ + -L "$(basename ${file})" \ + -m 1 \ + ${loop} + + # Tune the FS + tune2fs -c0 -i0 -Odir_index -ouser_xattr,acl ${loop} + + # Mount and copy all files to the FS + mount ${loop} ${tmp_dir} + cp -frp ${dir}/* ${tmp_dir} + umount ${tmp_dir} + + # Shrink FS to minimal size + _ext3fs_resize ${loop} + truncate -s $(_ext3fs_blocks ${loop}) ${loop} + + losetup -d ${loop} + + rm -rf ${tmp_dir} }
function install_config() { @@ -60,20 +197,23 @@ function install_kernel() { mkdir -p ${dest} 2>/dev/null
local file - for file in vmlinuz initrd; do - cp -f /boot/${file}-${KERNEL_RELEASE}* ${dest}/${file} + for file in vmlinuz; do + cp -f /boot/${file}-${KERNEL_RELEASE}* ${dest}/${file}0 done + + dracut -f ${dest}/initrd0 ${KERNEL_RELEASE} }
case "${1}" in iso) log DEBUG "Creating ISO image..." + set
ISO_DIR=$(mktemp -d) ISO_FILE=$(mktemp)
# Copy installer image to ISO - installer_image ${ISO_DIR}/installer.sfs /installer + installer_image ${ISO_DIR}/LiveOS /installer
# Install bootloader install_isolinux ${ISO_DIR}/isolinux diff --git a/tools/mkliveramfs b/tools/mkliveramfs deleted file mode 100755 index 5584dc0..0000000 --- a/tools/mkliveramfs +++ /dev/null @@ -1,1213 +0,0 @@ -#!/bin/bash -HEADER="\ -############################################################################### -# # -# IPFire.org - A linux based firewall # -# Copyright (C) 2009 Michael Tremer & Christian Schmidt # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see http://www.gnu.org/licenses/. # -# # -############################################################################### -" - -## GLOBAL VARIABLES ARE UPPERCASE -## LOCAL VARIABLES ARE LOWERCASE - -VERBOSE= -FORCE= -TARGET= -KERNEL=$(uname -r) -MODULES= - -TMPDIR=$(mktemp -d) - -# Check if we are root -if [ $UID != 0 ]; then - error "$0 must be run as root." - exit 1 -fi - -# Usage -function usage() { - echo "$0 [--help] [-f] [-v] <out-initrd-image> <kernel-version>" - echo " [--with=<module>]" - echo - echo "example: $0 /boot/myinitramfs.img `uname -r`" -} - -# Setting verbose mode -function set_verbose() { - case "$1" in - yes|y|on|1) - VERBOSE=-v - ;; - no|n|off|0) - VERBOSE= - ;; - esac -} - -# Returns if verbose is on or not -function is_verbose() { - [ -n "$VERBOSE" ] && return 0 - return 1 -} - -# Like is_verbose but prints -# the content of $VERBOSE -function get_verbose() { - echo "$VERBOSE" - is_verbose -} - -# Prints text if verbose is on -function vecho() { - is_verbose && echo "$@" -} - -# Prints error if verbose is on -function error() { - vecho "$@" >&2 -} - -function compress() { - cd - >/dev/null - IMAGE=$(mktemp) - vecho "[TASK] Compressing image $TARGET..." - (cd $TMPDIR && find . | cpio -H newc --quiet -o >| $IMAGE) || exit 1 - gzip -c9 $IMAGE > $TARGET -} - -function findone() { - find "$@" | awk '{ print $1; exit; }' -} - -function findall() { - find "$@" -} - -qpushd() { - pushd "$1" >/dev/null 2>&1 -} - -qpopd() { - popd >/dev/null 2>&1 -} - -function read_link() { - READLINK=$(readlink $1) - if grep -q "^/" <<< $READLINK; then - echo $READLINK - else - echo "$(dirname $1)/$READLINK" - fi -} - -function get_dso_deps() { - local bin="$1" - shift - - declare -a FILES - declare -a NAMES - - local LDSO="/lib/ld-linux.so.2" - - declare -i n=0 - while read NAME I0 FILE ADDR I1 ; do - [ "$FILE" == "not" ] && FILE="$FILE $ADDR" - [ "$NAME" == "not" ] && NAME="$NAME $I0" - NAMES[$n]="$NAME" - FILES[$n]="$FILE" - let n++ - done << EOF - $(LD_TRACE_PRELINKING=1 LD_WARN= LD_TRACE_LOADED_OBJECTS=1 \ - $LDSO $bin 2>/dev/null) -EOF - - [ ${#FILES[*]} -eq 0 ] && return 1 - - # we don't want the name of the binary in the list - if [ "${FILES[0]}" == "$bin" ]; then - FILES[0]="" - NAMES[0]="" - [ ${#FILES[*]} -eq 1 ] && return 1 - fi - - declare -i n=0 - while [ $n -lt ${#FILES[*]} ]; do - local FILE="${FILES[$n]}" - local NAME="${NAMES[$n]}" - if [ "$FILE" == "not found" -o "$NAME" == "not found" ]; then - cat 1>&2 <<EOF -There are missing files on your system. The dynamic object $bin -requires ${NAMES[$n]} n order to properly function. mkinitramfs cannot continue. -EOF - return 1 - fi - case "$FILE" in - /lib*) - TLIBDIR=`echo "$FILE" | sed 's,(/lib[^/]*)/.*$,\1,'` - BASE=`basename "$FILE"` - if [ -f "$TLIBDIR/$BASE" ]; then - FILE="$TLIBDIR/$BASE" - fi - FILES[$n]="$FILE" - ;; - esac - let n++ - done - echo "${FILES[@]}" -} - -function install() { - local file dest - for file in $@; do - local msg="[FILE]" - - ## Check if this is an absolute path - if [ "$(basename $file)" = "$file" ]; then - file=$(which $file) - fi - - # Destination file - dest="$TMPDIR$file" - [ -e "$dest" ] && continue - - mkdir -p "$(dirname $dest)" 2>/dev/null - - local old_indent=$INDENT - INDENT=" $INDENT" - - [ "${file%%.ko}" != "${file}" ] && msg="[KMOD]" - [ -L "$file" ] && msg="[SYML]" - #vecho "$msg$INDENT$file -> $dest" - vecho "$msg$INDENT$file" - - # Check if $file is a symlink - if [ -L "$file" ]; then - install $(read_link $file) - fi - - if [ "${file%%.ko}" != "${file}" ]; then - for i in $(moduledep $file); do - [ "$(locatemodule $i)" = "$file" ] && continue - installmodule $i - done - fi - - cp -ld $file $dest - - # Check if file is a script file - if [ "$(dd if=$file bs=2 count=1 2>/dev/null)" = "#!" ]; then - install $(head -n 1 $file | cut -c3-) - # Check if file is a kernel module - elif [ "${file%%.ko}" != "${file}" ]; then - local firmware - for firmware in $(modinfo -F firmware $file 2>/dev/null); do - firmware="/lib/firmware/$firmware" - [ -e "$firmware" ] && install $firmware - done - else - for dep in $(get_dso_deps "$file"); do - install $dep - done - fi - - INDENT=$old_indent - done -} - -# find module dependencies -function moduledep() { - local deps mpargs - if [ "$1" == "--ignore-install" ]; then - mpargs="$mpargs --ignore-install" - shift - fi - local module=$(basename ${1%%.ko}) - modprobe $mpargs --set-version $KERNEL --show-depends $module 2>/dev/null | \ - awk '/^insmod / { print gensub(".*/","","g",$2) }' | \ - while read foo; do \ - [ "${foo%%.ko}" != "$1" ] && \ - echo -n "${foo%%.ko} "; \ - done -} - -# XXX May be, we can drop this... -# This loops to make sure it resolves dependencies of dependencies of... -function resolvemoduledeps () { - local dep - local deps - local module - local newmodules - local modules=$@ - - before=0; after=1 - while [ $before != $after ]; do - newmodules= - before=$(wc -c <<< $modules) - for module in $modules; do - deps=$(moduledep $module) - is_verbose && echo "Module $module depends on: $deps" - newmodules="$newmodules $module $deps" - done - modules=$(for i in $newmodules; do echo $i; done | sort -u) - after=$(wc -c <<< $modules) - done - echo $modules -} - -function locatemodule() { - local mpargs="" - if [ "$1" == "--ignore-install" ]; then - mpargs="$mpargs --ignore-install" - shift - fi - local path=$(modprobe $mpargs --set-version $KERNEL --show-depends $1 2>/dev/null | \ - awk '/^insmod / { print $2; }' | tail -n 1) - [ -n "$path" -a -f "$path" ] && echo $path -} - -function installmodule() { - local module - local load - for module in $@; do - [ "$module" = "--load" ] && load=1 - module=$(locatemodule $module) - [ -z "$module" ] && continue - - install $module - done - if [ "$load" = "1" ]; then - for module in $@; do - [ "$module" = "--load" ] && continue - cat >> $TMPDIR/sbin/real-init <<EOF -vecho "Loading module $i..." -modprobe $i -EOF - done - fi -} - -resolve_device_name() { - if [[ "$1" =~ ^/dev ]]; then - echo $1 - else - findfs $1 - fi -} - -function finalize() { - qpopd - - # Adding modules - depmod -a $KERNEL - installmodule $MODULES - - # Build module deps file so we can use modprobe - vecho "[TASK] Running depmod..." - depmod -a -b "$TMPDIR" $KERNEL - - # ldconfig - install /etc/ld.so.conf - [ -d "/etc/ld.so.conf.d" ] && \ - for i in $(find /etc/ld.so.conf.d -type f); do - install $i - done - vecho "[TASK] Running ldconfig..." - ldconfig -r $TMPDIR - - # Compressing - compress - rm -rf $TMPDIR 2>/dev/null -} - -# resolve a device node to its major:minor numbers in decimal or hex -function get_numeric_dev() { - ( fmt="%d:%d" - if [ "$1" == "hex" ]; then - fmt="%x:%x" - fi - ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }' - ) 2>/dev/null -} - -function resolve_device_name() { - if [[ "$1" =~ ^/dev ]]; then - echo $1 - else - findfs $1 - fi -} - -function finddevnoinsys() { - majmin="$1" - if [ -n "$majmin" ]; then - dev=$(for x in /sys/block/* ; do find $x/ -name dev ; done | while read device ; do \ - echo "$majmin" | cmp -s $device && echo $device ; done) - if [ -n "$dev" ]; then - dev=${dev%%/dev} - dev=${dev%%/} - echo "$dev" - return 0 - fi - fi - return 1 -} - -findblockdevinsys() { - devname=$(resolve_device_name "$1") - if [[ "$devname" =~ ^/sys/block/ ]]; then - echo "$devname" - fi - majmin=$(get_numeric_dev dec $devname) - finddevnoinsys "$majmin" -} - -findstoragedriverinsys () { - while [ ! -L device ]; do - for slave in $(ls -d slaves/* 2>/dev/null) ; do - slavename=${slave##*/} - case " $slavestried " in - *" $slavename "*) - continue - ;; - *) - slavestried="$slavestried $slavename" - qpushd $slave - findstoragedriverinsys - qpopd - ;; - esac - done - [ "$PWD" = "/sys" ] && return - cd .. - done - cd $(read_link ./device) - if echo $PWD | grep -q /virtio-pci/ ; then - installmodule --load virtio_pci - fi - while [ "$PWD" != "/sys/devices" ]; do - deps= - if [ -f modalias ]; then - installmodule --load $(cat modalias) - fi - - [ -z "$deps" -a -L driver/module ] && \ - deps=$(basename $(read_link driver/module)) - installmodule --load $deps - cd .. - done -} - -function findstoragedriver() { - for device in $@; do - case " $handleddevices " in - *" $device "*) - continue ;; - *) handleddevices="$handleddevices $device" ;; - esac - vecho "[INFO] Looking for driver for device $device" - if [[ "$device" =~ ^/sys ]]; then - device=${device##*/} - fi - sysfs="" - device=$(echo "$device" | sed 's,/,!,g') - if [ -d /sys/block/$device/ ]; then - sysfs="/sys/block/$device" - else - sysfs=$(for x in /sys/block/*; do findone $x/ -type d -name $device; done) - fi - [ -z "$sysfs" ] && return - qpushd $sysfs - findstoragedriverinsys - qpopd - done -} - -# Main -while [ $# -gt 0 ] ; do - case $1 in - --help) - usage - exit 0 - ;; - -f|--force) - FORCE=yes - ;; - -v|--verbose) - set_verbose on - ;; - --with=*) - MODULES="$MODULES ${1#--with=*}" - ;; - --with-net) - WITH_NET=1 - ;; - *) - if [ -z "$target" ] ; then - target=$1 - elif [ -z "$kernel" ] ; then - kernel=$1 - else - echo "Unknown option or parameter "$1"" - usage - exit 1 - fi - ;; - esac - - shift -done - -TARGET=${target-$TARGET} -KERNEL=${kernel-$KERNEL} - -if [ -z "$TARGET" ]; then - usage - exit 1 -fi - -[[ "$TARGET" =~ "^/" ]] && TARGET="$PWD/$TARGET" - -if [ -z "$FORCE" ] && [ -e "$TARGET" ]; then - echo "Image $TARGET already exists. Use -f to overwrite" - exit 1 -fi - -# Changing to our dir, where we do our actions in -qpushd $TMPDIR || exit 1 - -# Make directory structure -mkdir -p bin sbin dev sys proc sysroot \ - etc/udev/rules.d lib/udev/rules.d - -# Install some essential binaries -install bash blkid chmod cat cut dmesg env find grep head ip kbd_mode \ - kill killall5 less ln \ - ls lsmod mkdir mknod modprobe mount mountpoint openvt pidof ps rm sed \ - setfont sh sleep switch_root udevadm udevd umount \ - /lib/udev/console_init - -# Copy modprobe.conf and friends over -[ -e /etc/modprobe.conf ] && install /etc/modprobe.conf -for f in $(find /etc/modprobe.d -type f); do - install $f -done - -# Install an empty fstab -touch $TMPDIR/etc/fstab - -# terminfo bits make things work better if you fall into interactive mode -[ -d "/usr/lib/terminfo" ] && \ - for f in $(find /usr/lib/terminfo -type f); do - install $f - done - -# Add localization -if [ -e "/etc/sysconfig/console" ]; then - install /etc/sysconfig/console - . /etc/sysconfig/console -fi -[ -z "$FONT" ] && FONT="LatArCyrHeb-16" -for i in /lib/kbd/consolefonts/$FONT.*; do - mkdir -p $TMPDIR/$(dirname $i) 2>/dev/null || true - cp -f $i $TMPDIR/$i - case "$i" in - *.gz) - gzip -fd $TMPDIR/$i - ;; - *.bz2) - bzip2 -fd $TMPDIR/$i - ;; - esac -done - -cat > init <<'EOF' -#!/bin/sh - -# Mounting directories -mount -t proc proc /proc -mount -t sysfs /sys /sys -mount -t tmpfs -o mode=0755 udev /dev - -# Silencing kernel -echo > /proc/sys/kernel/printk "1 4 1 7" - -# Adding important dev nodes -mknod /dev/console c 5 1 -mknod /dev/null c 1 3 -mknod /dev/kmsg c 1 11 -mknod /dev/ptmx c 5 2 -mknod /dev/fb c 29 0 -mknod /dev/systty c 4 0 - -# XXX really we need to openvt too, in case someting changes the -# color palette and then changes vts on fbcon before gettys start. -# (yay, fbcon bugs!) -for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 ; do - mknod /dev/tty$i c 4 $i -done - -for i in 0 1 2 3 ; do - mknod /dev/ttyS$i c 4 $(($i + 64)) -done - -mkdir -m 1777 /dev/shm -ln -s /proc/self/fd /dev/fd -ln -s fd/0 /dev/stdin -ln -s fd/1 /dev/stdout -ln -s fd/2 /dev/stderr - -mkdir /dev/pts -mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts - -exec sbin/real-init -EOF -chmod 755 init - -# Write out real-init -touch sbin/real-init; chmod 755 sbin/real-init -cat > sbin/real-init <<'EOF' -#!/bin/bash -$HEADER - -export PATH=/sbin:/bin:/usr/sbin:/usr/bin -export TERM=linux - -init="/sbin/init" -VERBOSE=-v - -READONLY=0 -SHELL=0 -ESHELL=0 - -function emergency_shell() -{ - echo "Bug in initramfs /init detected. Dropping to a shell. Good luck!" - echo - bash -} -trap "emergency_shell" 0 2 - -# exit immediately if a command fails -set -e - -# Setting verbose mode -function set_verbose() { - case "$1" in - yes|y|on|1) - VERBOSE=-v - ;; - no|n|off|0) - VERBOSE= - ;; - esac -} - -# Returns if verbose is on or not -function is_verbose() { - [ -n "$VERBOSE" ] && return 0 - return 1 -} - -# Like is_verbose but prints -# the content of $VERBOSE -function get_verbose() { - echo "$VERBOSE" - is_verbose -} - -# Prints text if verbose is on -function vecho() { - if is_verbose; then echo "$@"; fi -} - -# Prints error if verbose is on -function error() { - vecho "$@" >&2 -} - -/lib/udev/console_init tty0 - -# Disable hotplugging -echo "" > /proc/sys/kernel/hotplug - -# Parse kernel commandline options -for o in $(cat /proc/cmdline) ; do - case $o in - init=*) - init=${o#init=} - ;; - ro) - READONLY=1 - ;; - rw) - READONLY=0 - ;; - quiet) - set_verbose no - ;; - shell) - SHELL=1 - ;; - eshell) - ESHELL=1 - ;; - blacklist=*) - echo "blacklist ${o#blacklist=}" >> /etc/modprobe.conf - ;; - *) - m=$(echo $o |cut -s -d . -f 1) - opt=$(echo $o |cut -s -d . -f 2-) - if [ -z "$m" -o -z "$opt" ]; then - continue - fi - p=$(echo $opt |cut -s -d = -f 1) - v=$(echo $opt |cut -s -d = -f 2-) - if [ -z "$p" -o -z "$v" ]; then - continue - fi - echo "options $m $p=$v" >> /etc/modprobe.conf - ;; - esac -done - -vecho "kernel commandline: $(cat /proc/cmdline)" -EOF - -if [ "${WITH_NET}" = "1" ]; then - MODULES="$MODULES af_packet" - for module in /lib/modules/$KERNEL/kernel/drivers/net/{,*/}*; do - MODULES="$MODULES $(basename ${module/.ko})" - done - - install arping curl dhclient ip ping sha1sum /etc/nsswitch.conf \ - /usr/lib/libnsl.so /usr/lib/libnss_{dns,files}.so - touch etc/hosts - mkdir -p $TMPDIR/var/lib/dhclient 2>/dev/null - - cat > sbin/dhclient-script <<'EOF' -#!/bin/sh - -PATH=/usr/sbin:/sbin:/usr/bin:/bin - -function ip_encode() { - IFS=. - - local int=0 - for field in $1; do - int=$(( $(( $int << 8 )) | $field )) - done - - echo $int - unset IFS -} - -function mask_to_cidr() { - local mask - mask=$(ip_encode $1) - local cidr - cidr=0 - local x - x=$(( 128 << 24 )) # 0x80000000 - - while [ $(( $x & $mask )) -ne 0 ]; do - [ $mask -eq $x ] && mask=0 || mask=$(( $mask << 1 )) - cidr=$(($cidr + 1)) - done - - if [ $(( $mask & 2147483647 )) -ne 0 ]; then # 2147483647 = 0x7fffffff - echo "Invalid net mask: $1" >&2 - else - echo $cidr - fi -} - -function ip_in_subnet() { - local netmask - netmask=$(_netmask $2) - [ $(( $(ip_encode $1) & $netmask)) = $(( $(ip_encode ${2%/*}) & $netmask )) ] -} - -function _netmask() { - local vlsm - vlsm=${1#*/} - [ $vlsm -eq 0 ] && echo 0 || echo $(( -1 << $(( 32 - $vlsm )) )) -} - -dhconfig() { - if [ -n "${old_ip_address}" ] && - [ ! "${old_ip_address}" = "${new_ip_address}" ]; then - # IP address changed. Bringing down the interface will delete all - # routes, and clear the ARP cache. - ip -family inet addr flush dev ${interface} >/dev/null 2>&1 - ip -family inet link set dev ${interface} down - fi - - if [ "${reason}" = "BOUND" ] || [ "${reason}" = "REBOOT" ] || - [ ! "${old_ip_address}" = "${new_ip_address}" ] || - [ ! "${old_subnet_mask}" = "${new_subnet_mask}" ] || - [ ! "${old_network_number}" = "${new_network_number}" ] || - [ ! "${old_broadcast_address}" = "${new_broadcast_address}" ] || - [ ! "${old_routers}" = "${new_routers}" ] || - [ ! "${old_interface_mtu}" = "${new_interface_mtu}" ]; then - ip -family inet addr add ${new_ip_address}/${new_prefix} \ - broadcast ${new_broadcast_address} dev ${interface} - - if [ -n "${new_interface_mtu}" ]; then - ip link set ${interface} mtu ${new_interface_mtu} - fi - - for router in ${new_routers}; do - if ! ip_in_subnet ${router} ${new_ip_address}/${new_prefix}; then - continue - fi - ip route replace default via ${router} - break - done - fi - - if [ "${reason}" = "RENEW" ] && \ - [ "${new_domain_name}" = "${old_domain_name}" ] && \ - [ "${new_domain_name_servers}" = "${old_domain_name_servers}" ]; then - return - fi - - if [ -n "${new_domain_name}" ] || [ -n "${new_domain_name_servers}" ] || \ - [ -n "${new_domain_search}" ]; then - - echo "; generated by $0" > /etc/resolv.conf - - if [ -n "${new_domain_search}" ]; then - echo "search ${new_domain_search//\032/ }" >> /etc/resolv.conf - elif [ -n "${new_domain_name}" ]; then - echo "search ${new_domain_name//\032/ }" >> /etc/resolv.conf - fi - - for nameserver in ${new_domain_name_servers} ; do - echo "nameserver ${nameserver}" >> /etc/resolv.conf - done - fi - - if [ -n "${new_host_name}" ]; then - hostname ${new_host_name} - fi -} - -new_prefix=$(mask_to_cidr ${new_subnet_mask}) - -case "${reason}" in - MEDIUM) - exit 0 - ;; - - PREINIT) - ip -family inet addr flush dev ${interface} >/dev/null 2>&1 - ip -family inet link set ${interface} up - exit 0 - ;; - - ARPCHECK|ARPSEND) - if [ -z "${new_ip_address}" ] || [ -z "${interface}" ] || \ - arping -q -f -c 2 -w 3 -D -I ${interface} ${new_ip_address}; then - exit 0 - else - exit 1 - fi - ;; - - BOUND|RENEW|REBIND|REBOOT) - dhconfig - exit 0 - ;; - - EXPIRE|FAIL|RELEASE|STOP) - if [ -n "${old_ip_address}" ]; then - # Shut down interface, which will delete routes and clear arp cache. - ip -family inet addr flush dev ${interface} >/dev/null 2>&1 - ip -family inet link set ${interface} down - fi - exit 0 - ;; - - *) - echo "Unhandled state: ${reason}" >&2 - exit 1 - ;; -esac - -EOF - chmod 755 sbin/dhclient-script -fi - -# Modules needed by the live system -MODULES="$MODULES aufs squashfs loop vfat ehci-hcd ohci-hcd uhci-hcd usb-storage" - -# Add all storage modules -for module in /lib/modules/$KERNEL/kernel/drivers/{ata,message/fusion,pcmcia,scsi{,/*}}/*; do - MODULES="$MODULES $(basename ${module/.ko})" -done - -# Creating folders -mkdir -p mnt/{source,tmpfs,overlayfs,squashfs} - -cat >> sbin/real-init <<'EOF' - -netdevice=eth0 - -# Users can override rootfs target on the kernel commandline -for o in $(cat /proc/cmdline); do - case $o in - root=*) - root=${o#root=} - ;; - rootflags=*) - rootflags=${o#rootflags=} - ;; - rootfstype=*) - rootfstype=${o#rootfstype=} - ;; - net=*) - net=${o#net=} - ;; - netdevice=*) - netdevice=${o#netdevice=} - ;; - gateway=*) - gateway=${o#gateway=} - ;; - dns=*) - dns="$dns ${o#dns=}" - ;; - esac -done - -# generate udev rules to generate /dev/root symlink -if [ -z $root ] ; then - root=/dev/something -else - case $root in - /dev/disk/by-label/*) - type="block" - LABEL=${root#/dev/disk/by-label/} - echo "SUBSYSTEM=="block", PROGRAM="/sbin/blkid -s LABEL -o value %N", RESULT=="$LABEL", SYMLINK+="root"" > /etc/udev/rules.d/00-label.rules - if is_verbose; then - echo "Added udev rule 00-label.rules:" - cat /etc/udev/rules.d/00-label.rules - fi - type="block" - ;; - CDLABEL=*) - CDLABEL=${root#CDLABEL=} - echo "KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", ATTRS{media}=="cdrom", PROGRAM="/sbin/blkid -s LABEL -o value %N", RESULT=="$CDLABEL", SYMLINK+="root"" > /etc/udev/rules.d/00-cdlabel.rules - echo "KERNEL=="sr[0-9]", PROGRAM="/sbin/blkid -s LABEL -o value %N", RESULT=="$CDLABEL", SYMLINK+="root"" >> /etc/udev/rules.d/00-cdlabel.rules - echo "KERNEL=="scd[0-9]", PROGRAM="/sbin/blkid -s LABEL -o value %N", RESULT=="$CDLABEL", SYMLINK+="root"" >> /etc/udev/rules.d/00-cdlabel.rules - echo "KERNEL=="pcd[0-9]", PROGRAM="/sbin/blkid -s LABEL -o value %N", RESULT=="$CDLABEL", SYMLINK+="root"" >> /etc/udev/rules.d/00-cdlabel.rules - if is_verbose; then - echo "Added udev rule 00-cdlabel.rules:" - cat /etc/udev/rules.d/00-cdlabel.rules - fi - type="block" - ;; - LABEL=*) - LABEL=${root#LABEL=} - echo "SUBSYSTEM=="block", PROGRAM="/sbin/blkid -s LABEL -o value %N", RESULT=="$LABEL", SYMLINK+="root"" > /etc/udev/rules.d/00-label.rules - if is_verbose; then - echo "Added udev rule 00-label.rules:" - cat /etc/udev/rules.d/00-label.rules - fi - type="block" - ;; - /dev/disk/by-id/*) - UUID=${root#/dev/disk/by-id/} - echo "SUBSYSTEM=="block", PROGRAM="/sbin/blkid -s UUID -o value %N", RESULT=="$UUID", SYMLINK+="root"" > /etc/udev/rules.d/01-uuid.rules - if is_verbose; then - echo "Added udev rule 01-uuid.rules:" - cat /etc/udev/rules.d/01-uuid.rules - fi - type="block" - ;; - UUID=*) - UUID=${root#UUID=} - echo "SUBSYSTEM=="block", PROGRAM="/sbin/blkid -s UUID -o value %N", RESULT=="$UUID", SYMLINK+="root"" > /etc/udev/rules.d/01-uuid.rules - if is_verbose; then - echo "Added udev rule 01-uuid.rules:" - cat /etc/udev/rules.d/01-uuid.rules - fi - type="block" - ;; - http://*%7Chttps://*%7Cftp*://*%7Cftps://*%7Cscp://*%7Csftp://*) - thingtofetch="${root}" - type="download" - - # When doing http(s) transfers, compress the data - if [ "${thingtofetch:0:4}" = "http" ]; then - curloptions="--compressed" - fi - ;; - /dev/*) - ln -s $root /dev/root - type="block" - ;; - *) - thingtomount=$root - ;; - esac -fi - -if [ "$type" = "block" ]; then - thingtomount=/dev/root - -elif [ "$type" = "download" ]; then - rootflags="loop" - thingtomount=/${thingtofetch##*/} - - # If no network configuration was given, - # we'll try dhcp - if [ -z "${net}" ]; then - net="dhcp" - fi -fi - -echo "udev_log="error"" >> /etc/udev/udev.conf - -# rules for loading modules -echo -n "ACTION=="add", SUBSYSTEM=="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $" >> /etc/udev/rules.d/10-modprobe.rules -echo "env{MODALIAS}"" >> /etc/udev/rules.d/10-modprobe.rules -echo "ACTION=="add", SUBSYSTEM=="scsi_device" RUN+="/sbin/modprobe sg"" >> /etc/udev/rules.d/10-modprobe.rules -echo "ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="0|7|14", RUN+="/sbin/modprobe sd_mod"" >> /etc/udev/rules.d/10-modprobe.rules -echo "ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="[45]", RUN+="/sbin/modprobe sr_mod"" >> /etc/udev/rules.d/10-modprobe.rules -echo "SUBSYSTEM=="mmc", RUN+="/sbin/modprobe mmc_block"" >> /etc/udev/rules.d/10-modprobe.rules - -if [ "${type}" = "block" ]; then - # FIXME: hack since sr_mod seems to fail to get loaded sometimes (#239657) - modprobe sr_mod -fi - -modprobe loop max_loop=16 - -vecho "Starting udevd..." -udevd --daemon - -vecho "Creating devices..." -udevadm trigger --action=add - -if [ "${type}" = "download" ]; then - # Wait 30 seconds for network to appear. - COUNTDOWN=30 - while [ "x$COUNTDOWN" != "x0" ] ; do - is_verbose && echo -n "." - - if ip link show $netdevice &>/dev/null; then - COUNTDOWN=0 - continue - fi - - COUNTDOWN=$(($COUNTDOWN - 1)) - sleep 1 - done - vecho # Blank line - - ip link set $netdevice up - if [ "$net" = "dhcp" ]; then - vecho "Getting an IP address by DHCP..." - dhclient $(get_verbose) $netdevice - else - vecho "Setting IP address $net..." - ip addr add $net dev $netdevice - fi - if [ -n "$gateway" ]; then - vecho "Setting default gateway $gateway..." - ip route add default via $gateway - fi - if [ -n "$dns" ]; then - vecho "Setting up dns server $dns..." - echo "nameserver $dns" > /etc/resolv.conf - fi - if [ -n "$gateway" ]; then - vecho "Pinging gateway $gateway..." - if ! ping -c3 -w10 $gateway &>/dev/null; then - echo "This box does not seem to have a connection" - echo "to the default gateway $gateway." - echo "You may fix this now and continue then:" - echo - bash - fi - fi -fi - -if [ "$type" = "download" ]; then - curloptions="${curloptions} --connect-timeout 30 --output ${thingtomount}" - #curloptions="${curloptions} --write-out="Fetched %{url_effective} in %{time_total}s (%{speed_download} bytes/s)."" - - vecho "Running donwload..." - vecho " $thingtofetch" - - curl ${curloptions} ${thingtofetch} - - if [ "$?" != "0" ]; then - echo "An error occured when fetching ${thingtomount}:" - echo " Command: ${curl} ${thingtofetch}" - echo - echo "You now get a shell to download the file manually." - echo "Exit to continue booting." - echo - bash - fi -fi - -if [ "$SHELL" == "1" ] ; then - echo "Shell requested on kernel commandline. Exit to continue booting." - echo - bash -fi - -if [ "${type}" = "block" ]; then - # Wait 90 seconds for $thingtomount to appear. - COUNTDOWN=90 - while [ "x$COUNTDOWN" != "x0" ] ; do - is_verbose && echo -n "." - - if [ -e $thingtomount ]; then - COUNTDOWN=0 - continue - fi - # this is kind of lame, but we could have had a situation - # where we were unable to read the volume id. so trigger - # another run through the block devs - if [ "x$COUNTDOWN" = "x30" ]; then - udevadm trigger --action=add --subsystem-match=block - fi - - COUNTDOWN=$(($COUNTDOWN - 1)) - sleep 1 - done - vecho # Blank line -fi - -if [ ! -e $thingtomount ] ; then - echo - echo "--------------------------------------" - echo "WARNING: Cannot find root file system!" - echo "--------------------------------------" - echo - echo "Create symlink $thingtomount and then exit this shell to continue" - echo "the boot sequence." - echo - bash -fi - -if is_verbose; then - vecho "Mounting $thingtomount..." - ls -lh $thingtomount -fi - -if [ "x$READONLY" == "x1" ] ; then - rootflags="$rootflags,ro" -else - rootflags="$rootflags,rw" -fi - -if [ -n $rootflags ]; then - mountoptions=" -o$rootflags" -fi - -[ -n "$rootfstype" ] && rootfstype="-t $rootfstype" - -mount -n $rootfstype $mountoptions $thingtomount /mnt/source - -if [ "$?" != "0" ]; then - echo "---------------------------------" - echo "WARNING: Cannot mount rootfs!" - echo "---------------------------------" - echo - echo "Dropping to a shell. " - echo "Mount /mnt/source and exit shell to continue. Good luck!" - echo - bash -fi - -mount -n -t tmpfs none /mnt/tmpfs -aufsmountoptions="br:/mnt/tmpfs=rw" - -count=0 -for overlay in $(find /mnt/source -name "*.overlay" 2>/dev/null); do - vecho "Setting up overlay ${overlay}..." - mkdir -p /mnt/overlay${count} 2>/dev/null - mount -n -t squashfs -o loop,ro ${overlay} /mnt/overlay${count} - aufsmountoptions="$aufsmountoptions:/mnt/overlay${count}=rr" - count=$((${count} + 1)) -done - -count=0 -for sfs in $(find /mnt/source -name "*.sfs" 2>/dev/null); do - vecho "Setting up squashed fs ${sfs}..." - mount -n -t squashfs -o loop,ro ${sfs} /mnt/squashfs - aufsmountoptions="$aufsmountoptions:/mnt/squashfs=rr" - break -done - -mount -t aufs -o $aufsmountoptions none /sysroot - -for i in $(cd /mnt; ls); do - mountpoint /mnt/$i >/dev/null || continue - mkdir -p /sysroot/mnt/$i || : - mount --move /mnt/$i /sysroot/mnt/$i -done - -# Shutting down network -if [ "${type}" = "download" ]; then - if [ "${net}" = "dhcp" ]; then - kill $(pidof dhclient) - else - ip address flush dev ${netdevice} - fi - ip link set ${netdevice} down - ip route flush table main -fi - -if [ "$ESHELL" == "1" ]; then - echo "Shell requested on kernel commandline." - echo "Rootfs is mounted ro on /sysroot. Exit to continue booting." - echo - bash -fi - -if [ -x /sysroot$init ]; then - # Leave initramfs and transition to rootfs - kill $(pidof udevd) - vecho "Transfering control to $init" - - exec switch_root /sysroot ${init} - echo "---------------------------------" - echo "WARNING: Error switching to real rootfs!" - echo "---------------------------------" - echo - echo "Dropping to a shell. Good luck!" - echo - bash -else - echo "---------------------------------------------------------" - echo "WARNING: Requested $init binary does not exist on rootfs." - echo "---------------------------------------------------------" - echo - echo "Dropping to a shell. Good luck!" - echo - bash -fi - -EOF - -finalize diff --git a/tools/toolchain b/tools/toolchain deleted file mode 100755 index 30a24e3..0000000 --- a/tools/toolchain +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -. $(dirname ${0})/common-functions - -gzip=gzip -if [ -x "/usr/bin/pigz" ]; then - gzip=pigz -fi - -case "${1}" in - adjust) - TARGET_PATH=${2} - TOOLS_DIR="${TARGET_PATH}/tools_i686" - - #if [ -z "${TOOLS_DIR}" ]; then - # echo "$0: TOOLS_DIR not set." >&2 - # exit 1 - #fi - - # If glibc is not compiled yet... - if [ -e "${TARGET_PATH}/lib/libc.so.6" ]; then - # Adjust linker - mv -f ${TOOLS_DIR}/bin/ld{-new,} - ln -sf ../../bin/ld \ - ${TOOLS_DIR}/$(${TOOLS_DIR}/bin/gcc -dumpmachine)/bin/ld - - # Adjust spec file - SPECS=$(dirname $(${TOOLS_DIR}/bin/gcc --print-libgcc-file-name))/specs - rm -f ${SPECS} - - ${TOOLS_DIR}/bin/gcc -dumpspecs | sed -e 's@/tools_i686@@g' \ - -e '/*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ - -e '/*cpp:/{n;s@$@ -isystem /usr/include@}' > ${SPECS} - fi - - for i in bin/bash bin/cat bin/echo bin/ln bin/mv bin/stty bin/pwd bin/rm bin/sh; do - if [ -e "${TARGET_PATH}/${i}" ]; then - continue - fi - mkdir -p $(dirname ${TARGET_PATH}/${i}) 2>/dev/null - ln -sf ../$(basename ${TOOLS_DIR})/${i} ${TARGET_PATH}/${i} - done - - for i in libgcc_s.so{,.1} libstdc++.so{,.6}; do - if [ -e "${TARGET_PATH}/usr/lib/${i}" ]; then - continue - fi - mkdir -p ${TARGET_PATH}/usr/lib 2>/dev/null - ln -sf ../../$(basename ${TOOLS_DIR})/lib/${i} ${TARGET_PATH}/usr/lib/${i} - done - - if ! [ -e "${TARGET_PATH}/lib/cpp" ]; then - for path in /usr/bin/cpp $(basename ${TOOLS_DIR})/bin/cpp; do - if [ -e "${TARGET_PATH}/${path}" ]; then - ln -sf /${path} ${TARGET_PATH}/lib/cpp - break - fi - done - fi - ;; - - compress) - TARGET=${2} - COMPRESS_PATH=${3} - - target=$(mktemp) - - # Remove unneeded files - rm -rf ${COMPRESS_PATH}/{info,man,share/{doc,info,locale,man}} - rm -rf ${COMPRESS_PATH}/usr/src/* - - # Remove all static libs - for i in $(find ${COMPRESS_PATH} -name "*.a"); do - grep -q "_nonshared" <<<${i} && continue - grep -q "libgcc" <<<${i} && continue - rm -rf ${i} - done - rm -rf ${COMPRESS_PATH}/{lib/pkgconfig,libexec,var} - - for i in $(find ${COMPRESS_PATH} -name "*.la"); do - rm -rf ${i} - done - - # Strip all files - for file in $(find_elf_files ${COMPRESS_PATH}); do - strip --strip-debug ${file} - done - - # Strip executeable files - for file in $(find_elf_files ${COMPRESS_PATH}/bin ${COMPRESS_PATH}/*/bin); do - strip --strip-all ${file} - done - - cd ${COMPRESS_PATH} && tar --posix -c -p -S * | ${gzip} -9 > ${target} - - cat ${target} > ${TARGET} - rm -f ${target} - ;; - - extract) - ARCHIVE=${2} - TARGET_PATH=${3} - - ${gzip} -d < ${ARCHIVE} | tar x -C ${TARGET_PATH} - ;; - -esac
hooks/post-receive -- IPFire 3.x development tree