rpms/petitboot/devel getctty.c, NONE, 1.1 .cvsignore, 1.1, 1.2 petitboot-init, 1.1, 1.2 petitboot.spec, 1.4, 1.5 sources, 1.2, 1.3

David Woodhouse (dwmw2) fedora-extras-commits at redhat.com
Mon Apr 9 03:30:36 UTC 2007


Author: dwmw2

Update of /cvs/extras/rpms/petitboot/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22818

Modified Files:
	.cvsignore petitboot-init petitboot.spec sources 
Added Files:
	getctty.c 
Log Message:
Build static against libtwin and own libpng



--- NEW FILE getctty.c ---
/*
 * getctty.c - Exec a process, giving it a controlling tty
 *
 * Written 2005 by Werner Almesberger
 */

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/ioctl.h>


int main(int argc,char **argv)
{
    int tty;

    if (argc < 3) {
	fprintf(stderr,"usage: %s tty command ...\n",*argv);
	return 1;
    }
    tty = open(argv[1],O_RDWR);
    if (tty < 0) {
	perror(argv[1]);
	return 1;
    }
    if (dup2(tty,0) < 0 || dup2(tty,1) < 0 || dup2(tty,2) < 0) {
	perror("dup2");
	return 1;
    }
    (void) close(tty);
    if (setsid() < 0) {
	perror("setsid");
	return 1;
    }
    if (ioctl(0,TIOCSCTTY,1) < 0) {
	perror("ioctl(TIOCSCTTY)");
	return 1;
    }
    execvp(argv[2],argv+2);
    perror("execvp");
    return 1;
}


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/petitboot/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	5 Apr 2007 20:04:09 -0000	1.1
+++ .cvsignore	9 Apr 2007 03:30:01 -0000	1.2
@@ -0,0 +1 @@
+libpng-1.2.16.tar.bz2


Index: petitboot-init
===================================================================
RCS file: /cvs/extras/rpms/petitboot/devel/petitboot-init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- petitboot-init	7 Apr 2007 04:01:02 -0000	1.1
+++ petitboot-init	9 Apr 2007 03:30:01 -0000	1.2
@@ -1,42 +1,21 @@
 #!/bin/sh
-#
-# kboot - Kboot initialization and command-line interface
-#
-# Written 2005, 2006 by Werner Almesberger
-#
-
-if [ "x$0" = x/init ]; then
-    __sysinit=true
-else
-    __sysinit=false
-fi
-
-###############################################################################
-#
-# System setup and internal initialization
-#
-
-if $__sysinit; then
-    if [ ! -f /proc/partitions ]; then
-	mount -n -t proc none /proc
-    fi
-    if [ ! -d /sys/block ]; then
-	mount -n -t sysfs none /sys
-
-	# Borrowed from initramfs tools. No more hard coded sleep
-	echo "" > /proc/sys/kernel/hotplug
-	udevd --daemon
-	udevtrigger
-	udevsettle --timeout=15
-    fi
-fi
+
+/bin/mount -n -t proc none /proc
+mount -n -t sysfs none /sys
+
+# Borrowed from initramfs tools. No more hard coded sleep
+echo "" > /proc/sys/kernel/hotplug
+udevd --daemon
+udevtrigger
+udevsettle --timeout=15
 
 cat > /etc/udev/rules.d/99-petitboot.rules <<EOF
-SUBSYSTEM=="block",RUN+="/sbin/udev-helper"
+SUBSYSTEM=="block",RUN+="/usr/sbin/udev-helper"
 EOF
+
 while /bin/true;
 do
-	/sbin/petitboot -u
+	/usr/sbin/petitboot -u
 
 	# clean up after petitboot
 	for dir in /var/tmp/mnt-*;
@@ -48,5 +27,5 @@
 
 while /bin/true;
 do
-	/sbin/getctty /dev/console /bin/sh
+	/usr/sbin/getctty /dev/console /bin/sh
 done


Index: petitboot.spec
===================================================================
RCS file: /cvs/extras/rpms/petitboot/devel/petitboot.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- petitboot.spec	7 Apr 2007 04:38:26 -0000	1.4
+++ petitboot.spec	9 Apr 2007 03:30:01 -0000	1.5
@@ -1,6 +1,8 @@
+%define pngver 1.2.16
+
 Name:		petitboot
 Version:	0.0.1
-Release:	3%{?dist}
+Release:	5%{?dist}
 Summary:	Graphical kexec-based bootloader, originally for PlayStation 3
 
 Group:		System Environment/Base
@@ -8,12 +10,17 @@
 URL:		http://ozlabs.org/~jk/projects/petitboot/
 Source0:	http://ozlabs.org/~jk/projects/petitboot/downloads/%{name}-%{version}.tar.gz
 Source1:	petitboot-init
+Source2:	getctty.c
+Source3:	ftp://ftp.simplesystems.org/pub/png/src/libpng-%{pngver}.tar.bz2
+
 Patch0:		petitboot-0.0.1-artwork-not-executable.patch
 Patch1:		petitboot-0.0.1-defaults.patch
+Patch2:		petitboot-0.0.1-makefile.patch
+Patch3:		libpng-1.2.16-minimal.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libpng-devel zlib-devel libX11-devel libjpeg-devel
-BuildRequires:	freetype-devel libtwin-devel
+BuildRequires:	freetype-devel libtwin-devel autoconf
 
 %description
 Petitboot is a graphical bootloader for the PlayStation 3. It's based
@@ -21,18 +28,29 @@
 GUI.
 
 %prep
-%setup -q
+%setup -q -a 3
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+cp %{SOURCE2} .
+pushd libpng-%{pngver}
+%patch3 -p1
+popd
 
 %build
-make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -I."
-
+pushd libpng-%{pngver}
+autoconf
+./configure --disable-shared --without-floating-point --without-write-support --without-pic --without-libpng-compat --without-binconfigs
+make %{?_smp_mflags}
+popd
+make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -I." TWIN_LDFLAGS="-ljpeg -lz %{_libdir}/libtwin.a libpng-1.2.16/.libs/libpng12.a"
+gcc ${RPM_OPT_FLAGS} -o getctty getctty.c
 
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
 install -m0755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sbindir}
+install -m0755 getctty $RPM_BUILD_ROOT/%{_sbindir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -46,6 +64,12 @@
 
 
 %changelog
+* Sun Apr  8 2008 David Woodhouse <dwmw2 at infradead.org> 0.0.1-5
+- Link statically against libtwin and own minimal libpng
+
+* Sat Apr  7 2007 David Woodhouse <dwmw2 at infradead.org> 0.0.1-4
+- Clean up petitboot-init script, add getctty
+
 * Fri Apr  6 2007 David Woodhouse <dwmw2 at infradead.org> 0.0.1-3
 - Add script for initrd /sbin/init
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/petitboot/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	5 Apr 2007 20:45:27 -0000	1.2
+++ sources	9 Apr 2007 03:30:01 -0000	1.3
@@ -1 +1,2 @@
 730e7e4b559d886f01d26f56f70dbe63  petitboot-0.0.1.tar.gz
+7a1ca4f49bcffdec60d50f48460642bd  libpng-1.2.16.tar.bz2




More information about the fedora-extras-commits mailing list