* add yaboot as per user request
This commit is contained in:
parent
344b2824a9
commit
670439c1c9
@ -1,42 +1,79 @@
|
||||
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
|
||||
# Maintainer: Alexaner Baldeck <alex.bldck@gmail.com>
|
||||
pkgname=yaboot
|
||||
pkgver=1.3.17
|
||||
pkgrel=1
|
||||
pkgdesc="A PowerPC bootloader for Open Firmware based machines"
|
||||
pkgdesc="A PowerPC bootloader"
|
||||
arch=(powerpc)
|
||||
url="http://yaboot.ozlabs.org/"
|
||||
url="http://yaboot.ozlabs.org"
|
||||
license=('GPL')
|
||||
depends=('powerpc-utils' 'hfsprogs')
|
||||
makedepends=('git')
|
||||
_commont='dc5421b84b9633b00e4d9ea53fc97e1cf36cf3a9'
|
||||
_e2fsprogs_ver=1.41.14
|
||||
source=("git://ozlabs.org/srv/projects/yaboot/yaboot.git#commit=dc5421b84b9633b00e4d9ea53fc97e1cf36cf3a9"
|
||||
yaboot-modern.patch
|
||||
http://ftp.be.debian.org/pub/linux/kernel/people/tytso/e2fsprogs/e2fsprogs-${_e2fsprogs_ver}.tar.gz)
|
||||
sha256sums=('SKIP'
|
||||
'9b4add400d98835a0d872e5864f4fa18b46670de5e01c21fec1703f69b283067'
|
||||
'3f8ac1fedd7c4bec480afcbe4acabdd4ac59ec0446a0fd50c8975cd0aad7b176')
|
||||
validpgpkeys=('4774128D015CF860AA791D625E442088ED632E87' # Tony Breeds (Signing Key) <tony@bakeyournoodle.com>
|
||||
'3AB057B7E78D945C8C5591FBD36F769BC11804F0') # Theodore Ts'o <tytso@mit.edu>
|
||||
depends=('bash')
|
||||
_e2fsprogs_version="1.42.13"
|
||||
source=("http://ftp.osuosl.org/pub/clfs/conglomeration/yaboot/$pkgname-$pkgver.tar.gz"
|
||||
"https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${_e2fsprogs_version}/e2fsprogs-${_e2fsprogs_version}.tar.gz"
|
||||
e2fsprogs-1.42.13-sysmacros.h.patch
|
||||
yaboot-1.3.17-nopiessp-gcc4.patch
|
||||
yabootconfig-1.3.13.patch
|
||||
yaboot-stubfuncs.patch
|
||||
chrpfix.patch
|
||||
new-ofpath
|
||||
new-ofpath-devspec.patch)
|
||||
sha256sums=('2fb738d8fd48b94ab2534a4fdf63738ad02c1a30f4b2add91f837baff8fa2aa1'
|
||||
'e59e1b9973339f48024afaf19ec47a37c84181173eeade4f318f62e61a326622'
|
||||
'0651d0df445c98a6ab07366a61151871a44319ea41dad80b235892eac0e57688'
|
||||
'0c00ec6c191723d2bd5621ee193ab4b0483cb3bb2443d7ac4b7f8ba859952917'
|
||||
'ee662c068ba7800d1d0c85a927f3990658cc488ebd3672e40740b7473ba3bb20'
|
||||
'0ea38eca5f0bd31fb9e62965227936b4aca2071ab20b3a7b64677b654e64ebbf'
|
||||
'640bc4012dff8cfb53a13a345c3bfd919f70c653a1d1e82e0d7b7111342cb62a'
|
||||
'7a20474bdb92f0f99b1142c45583883932807bcb3534cdc14c1238a438152dcc'
|
||||
'd9d1dcaaa60ec7ab2fb436d0d2b33db8e4fbd4533594111b327a094bd6c62674')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/e2fsprogs-${_e2fsprogs_ver}"
|
||||
CFLAGS="-Os -fno-stack-protector -no-pie -fgnu89-inline -fno-builtin-malloc -DNDEBUG" \
|
||||
./configure --disable-testio-debug --disable-debugfs --disable-tls
|
||||
make -C lib/et
|
||||
make -C lib/ext2fs
|
||||
cp lib/libcom_err.a lib/libext2fs.a ${srcdir}/${pkgname}/
|
||||
pushd e2fsprogs-${_e2fsprogs_version}
|
||||
patch -Np1 -i ${srcdir}/e2fsprogs-1.42.13-sysmacros.h.patch
|
||||
popd
|
||||
|
||||
cd "${srcdir}/${pkgname}"
|
||||
patch -Np1 -i ${srcdir}/yaboot-modern.patch
|
||||
pushd ${pkgname}-${pkgver}
|
||||
|
||||
patch -Np1 -i ${srcdir}/yaboot-1.3.17-nopiessp-gcc4.patch
|
||||
patch -Np1 -i ${srcdir}/yabootconfig-1.3.13.patch
|
||||
patch -Np1 -i ${srcdir}/yaboot-stubfuncs.patch
|
||||
patch -Np1 -i ${srcdir}/chrpfix.patch
|
||||
|
||||
|
||||
cp -v ${srcdir}/new-ofpath ybin/ofpath
|
||||
patch -Np1 -i ${srcdir}/new-ofpath-devspec.patch
|
||||
|
||||
sed -i \
|
||||
-e 's:-I/usr/include::' \
|
||||
-e 's:-Werror:-Wno-error:g' \
|
||||
Makefile
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}"
|
||||
make -j1
|
||||
pushd e2fsprogs-${_e2fsprogs_version}
|
||||
./configure --enable-libblkid \
|
||||
--enable-libuuid \
|
||||
--disable-fsck \
|
||||
--disable-quota
|
||||
make DESTDIR=${srcdir}/e2fslibs V=1
|
||||
make DESTDIR=${srcdir}/e2fslibs install-libs V=1
|
||||
popd
|
||||
|
||||
pushd "$pkgname-$pkgver"
|
||||
make ROOT=${pkgdir}/ PREFIX=/usr MANDIR=share/man \
|
||||
CC="gcc -std=gnu90 -fcommon" \
|
||||
LD="ld -L${srcdir}/e2fslibs/usr/lib"
|
||||
popd
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${pkgname}"
|
||||
make ROOT="${pkgdir}" PREFIX="/usr" install
|
||||
cd "$pkgname-$pkgver"
|
||||
make ROOT=${pkgdir}/ PREFIX=/usr MANDIR=share/man \
|
||||
CC="gcc -std=gnu90 -fcommon" \
|
||||
LD="ld -L${srcdir}/e2fslibs/usr/lib" \
|
||||
install
|
||||
|
||||
mv ${pkgdir}/usr/{s,}bin
|
||||
}
|
||||
|
23
yaboot/chrpfix.patch
Normal file
23
yaboot/chrpfix.patch
Normal file
@ -0,0 +1,23 @@
|
||||
--- a/Makefile.orig 2004-03-22 12:04:32.056149336 -0600
|
||||
+++ b/Makefile 2004-03-22 12:05:51.824138328 -0600
|
||||
@@ -103,9 +103,11 @@
|
||||
|
||||
all: yaboot addnote mkofboot
|
||||
|
||||
-yaboot: $(OBJS)
|
||||
+yaboot: $(OBJS) addnote
|
||||
$(LD) $(LFLAGS) $(OBJS) $(LLIBS) $(lgcc) -o second/$@
|
||||
chmod -x second/yaboot
|
||||
+ cp second/yaboot second/yaboot.chrp
|
||||
+ util/addnote second/yaboot.chrp
|
||||
|
||||
addnote:
|
||||
$(CC) $(UCFLAGS) -o util/addnote util/addnote.c
|
||||
@@ -185,6 +187,7 @@
|
||||
install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man5/
|
||||
install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man8/
|
||||
install -o root -g root -m 0644 second/yaboot ${ROOT}/$(PREFIX)/lib/yaboot
|
||||
+ install -o root -g root -m 0644 second/yaboot.chrp ${ROOT}/$(PREFIX)/lib/yaboot
|
||||
install -o root -g root -m 0755 util/addnote ${ROOT}/${PREFIX}/lib/yaboot/addnote
|
||||
install -o root -g root -m 0644 first/ofboot ${ROOT}/${PREFIX}/lib/yaboot/ofboot
|
||||
install -o root -g root -m 0755 ybin/ofpath ${ROOT}/${PREFIX}/sbin/ofpath
|
85
yaboot/e2fsprogs-1.42.13-sysmacros.h.patch
Normal file
85
yaboot/e2fsprogs-1.42.13-sysmacros.h.patch
Normal file
@ -0,0 +1,85 @@
|
||||
From 3fb715b55426875902dfef3056b2cf7335953178 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Fri, 19 May 2017 13:25:59 -0400
|
||||
Subject: [PATCH] include sys/sysmacros.h as needed
|
||||
|
||||
The minor/major/makedev macros are not entirely standard. glibc has had
|
||||
the definitions in sys/sysmacros.h since the start, and wants to move away
|
||||
from always defining them implicitly via sys/types.h (as this pollutes the
|
||||
namespace in violation of POSIX). Other C libraries have already dropped
|
||||
them. Since the configure script already checks for this header, use that
|
||||
to pull in the header in files that use these macros.
|
||||
|
||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
||||
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
||||
---
|
||||
lib/blkid/devname.c | 3 +++
|
||||
lib/blkid/devno.c | 3 +++
|
||||
lib/ext2fs/finddev.c | 3 +++
|
||||
lib/ext2fs/ismounted.c | 3 +++
|
||||
misc/mk_hugefiles.c | 3 +++
|
||||
7 files changed, 22 insertions(+)
|
||||
|
||||
--- a/lib/blkid/devname.c
|
||||
+++ b/lib/blkid/devname.c
|
||||
@@ -36,6 +36,9 @@
|
||||
#if HAVE_SYS_MKDEV_H
|
||||
#include <sys/mkdev.h>
|
||||
#endif
|
||||
+#ifdef HAVE_SYS_SYSMACROS_H
|
||||
+#include <sys/sysmacros.h>
|
||||
+#endif
|
||||
#include <time.h>
|
||||
|
||||
#include "blkidP.h"
|
||||
--- a/lib/blkid/devno.c
|
||||
+++ b/lib/blkid/devno.c
|
||||
@@ -31,6 +31,9 @@
|
||||
#if HAVE_SYS_MKDEV_H
|
||||
#include <sys/mkdev.h>
|
||||
#endif
|
||||
+#ifdef HAVE_SYS_SYSMACROS_H
|
||||
+#include <sys/sysmacros.h>
|
||||
+#endif
|
||||
|
||||
#include "blkidP.h"
|
||||
|
||||
--- a/lib/ext2fs/finddev.c
|
||||
+++ b/lib/ext2fs/finddev.c
|
||||
@@ -31,6 +31,9 @@
|
||||
#if HAVE_SYS_MKDEV_H
|
||||
#include <sys/mkdev.h>
|
||||
#endif
|
||||
+#ifdef HAVE_SYS_SYSMACROS_H
|
||||
+#include <sys/sysmacros.h>
|
||||
+#endif
|
||||
|
||||
#include "ext2_fs.h"
|
||||
#include "ext2fs.h"
|
||||
--- a/lib/ext2fs/ismounted.c
|
||||
+++ b/lib/ext2fs/ismounted.c
|
||||
@@ -49,6 +49,9 @@
|
||||
#endif /* HAVE_GETMNTINFO */
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
+#ifdef HAVE_SYS_SYSMACROS_H
|
||||
+#include <sys/sysmacros.h>
|
||||
+#endif
|
||||
|
||||
#include "ext2_fs.h"
|
||||
#include "ext2fs.h"
|
||||
--- a/misc/mk_hugefiles.c
|
||||
+++ b/misc/mk_hugefiles.c
|
||||
@@ -35,6 +35,9 @@ extern int optind;
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
+#ifdef HAVE_SYS_SYSMACROS_H
|
||||
+#include <sys/sysmacros.h>
|
||||
+#endif
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <blkid/blkid.h>
|
||||
--
|
||||
2.20.1
|
||||
|
143
yaboot/new-ofpath
Normal file
143
yaboot/new-ofpath
Normal file
@ -0,0 +1,143 @@
|
||||
#!/bin/sh
|
||||
###############################################################################
|
||||
# Determines the Open Firmware path based on the linux device name
|
||||
#
|
||||
# Joseph Jezak <josejx@gentoo.org> Copyright (C) 2010
|
||||
# Rewrite of OFPath for newer kernels/scsi configurations
|
||||
#
|
||||
# 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 2
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
### Set this to 1 to turn on debugging messages
|
||||
DEBUG=0
|
||||
|
||||
### Find the device tree
|
||||
if [ ! -e /proc/device-tree ]; then
|
||||
echo 1>&2 "ofpath: Cannot find the device tree!"
|
||||
exit 1
|
||||
fi
|
||||
DEV_TREE="/proc/device-tree"
|
||||
|
||||
### Check if sys is mounted
|
||||
if ! (grep -q '.* .* sysfs ' /proc/mounts 2> /dev/null) ; then
|
||||
echo 1>&2 "ofpath: sysfs must be mounted for ofpath to support this system"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### Get the sysfs mount point
|
||||
SYS="$(m=`grep '.* .* sysfs ' /proc/mounts | head -n 1` ; echo `d=${m#* };echo ${d%% *}`)"
|
||||
if [ -z "$SYS" -o ! -d "$SYS" ] ; then
|
||||
echo 1>&2 "ofpath: Unable to determine sysfs mountpoint"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
### Get the device from the user
|
||||
### We dereference links to support devices like /dev/cdrom1
|
||||
DEVICE=$1
|
||||
if [ -z "$DEVICE" ]; then
|
||||
echo 1>&2 "ofpath: No device specified!"
|
||||
exit 1
|
||||
fi
|
||||
DEVICE=$(readlink -f "$DEVICE")
|
||||
DEVICE=$(basename $DEVICE)
|
||||
if [ -z "$DEVICE" ] || [ ! -e "/dev/$DEVICE" ]; then
|
||||
echo 1>&2 "ofpath: Invalid device: /dev/$DEVICE"
|
||||
exit 1
|
||||
fi
|
||||
[ "$DEBUG" = 1 ] && echo "Device is: $DEVICE"
|
||||
|
||||
### Get the partition if we have it
|
||||
case ${DEVICE} in
|
||||
sd*) PARTITION="${DEVICE#sd?}" ;;
|
||||
### No partition for sr/sg devices
|
||||
sr*|sg*) PARTITION="${DEVICE#sr?}" ;;
|
||||
hd*) PARTITION="${DEVICE#hd?}" ;;
|
||||
*) echo "Unknown device string."; exit 1;;
|
||||
esac
|
||||
if [ ! -z "$PARTITION" ] && [ "$DEBUG" = 1 ]; then
|
||||
echo "Partition: $PARTITION"
|
||||
fi
|
||||
|
||||
### Get the disk device name
|
||||
DISK_NAME="${DEVICE%%${PARTITION}}"
|
||||
[ "$DEBUG" = 1 ] && echo "Disk Name: $DISK_NAME"
|
||||
|
||||
### Find the devspec for the controller
|
||||
DEVPATH=$(cd -P "$SYS/block/${DISK_NAME}/device" && pwd)
|
||||
if [ -z "$DEVPATH" ]; then
|
||||
echo "Unable to determine device path!"
|
||||
exit 1
|
||||
fi
|
||||
[ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
|
||||
|
||||
### Get the OF Path of the controller
|
||||
case ${DISK_NAME} in
|
||||
sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
|
||||
hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
|
||||
*) CONTROLLER_PATH="" ;;
|
||||
esac
|
||||
if [ -z "$CONTROLLER_PATH" ]; then
|
||||
echo "Unable to determine controller path!"
|
||||
exit 1
|
||||
fi
|
||||
[ "$DEBUG" = 1 ] && echo "Controller Path is: $CONTROLLER_PATH"
|
||||
|
||||
### Generate the disk number and partition info
|
||||
case ${DISK_NAME} in
|
||||
sd*|sg*|sr*)
|
||||
DISK_NO="$(cd ${DEVPATH}/../; pwd)";
|
||||
DISK_NO="${DISK_NO##*:}";
|
||||
;;
|
||||
hd*)
|
||||
DISK_NO="$(cd ${DEVPATH}/../; pwd)";
|
||||
DISK_NO="${DISK_NO##*ide}";
|
||||
;;
|
||||
*) echo "Unsupported disk type!"; exit 1 ;;
|
||||
esac
|
||||
DISK_NO="disk@${DISK_NO}:"
|
||||
[ "$DEBUG" = 1 ] && echo "Disk Number: ${DISK_NO}"
|
||||
|
||||
### We need to get the controller port path (if it has one)
|
||||
if [ ! -d "$DEV_TREE/$CONTROLLER_PATH/disk" ] && [ ! -d "$DEV_TREE/$CONTROLLER_PATH/$DISK_NO" ]; then
|
||||
### FIXME I don't know if every scsi device uses the host nomenclature
|
||||
case ${DISK_NAME} in
|
||||
sd*|sg*|sr*)
|
||||
PORT="$(cd ${DEVPATH}/../../; pwd)";
|
||||
PORT="${PORT##*host}";
|
||||
CTL_PORT="${CONTROLLER_PATH##*/}";
|
||||
CTL_PORT="${CTL_PORT%%-root*}";
|
||||
PORT="$CTL_PORT@$PORT"
|
||||
[ "$DEBUG" = 1 ] && echo "Port: $PORT"
|
||||
;;
|
||||
*) echo "Unsupported disk type!"; exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
### Add the partition information if required
|
||||
if [ ! -z $PARTITION ]; then
|
||||
DISK_NO="$DISK_NO$PARTITION"
|
||||
fi
|
||||
|
||||
### Build the OF Path
|
||||
if [ -z "$PORT" ]; then
|
||||
OFPATH="$CONTROLLER_PATH/$DISK_NO"
|
||||
else
|
||||
OFPATH="$CONTROLLER_PATH/${PORT}/$DISK_NO"
|
||||
fi
|
||||
|
||||
### Print out the ofpath
|
||||
echo $OFPATH
|
28
yaboot/new-ofpath-devspec.patch
Normal file
28
yaboot/new-ofpath-devspec.patch
Normal file
@ -0,0 +1,28 @@
|
||||
--- a/ybin/ofpath.bak 2012-05-09 12:24:51.709911981 -0400
|
||||
+++ b/ybin/ofpath 2012-05-09 12:32:19.661560544 -0400
|
||||
@@ -85,11 +85,20 @@
|
||||
[ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
|
||||
|
||||
### Get the OF Path of the controller
|
||||
-case ${DISK_NAME} in
|
||||
- sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
|
||||
- hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
|
||||
- *) CONTROLLER_PATH="" ;;
|
||||
-esac
|
||||
+if [ -e "${DEVPATH}/../../devspec" ]; then
|
||||
+ ### /dev/hd*
|
||||
+ CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec);
|
||||
+elif [ -e "${DEVPATH}/../../../devspec" ]; then
|
||||
+ ### /dev/sd* on kernel <3.3
|
||||
+ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec);
|
||||
+elif [ -e "${DEVPATH}/../../../../devspec" ]; then
|
||||
+ ### /dev/sd* on kernel 3.3+
|
||||
+ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../../devspec);
|
||||
+else
|
||||
+ ### None of the above...
|
||||
+ CONTROLLER_PATH="";
|
||||
+fi
|
||||
+
|
||||
if [ -z "$CONTROLLER_PATH" ]; then
|
||||
echo "Unable to determine controller path!"
|
||||
exit 1
|
38
yaboot/yaboot-1.3.17-nopiessp-gcc4.patch
Normal file
38
yaboot/yaboot-1.3.17-nopiessp-gcc4.patch
Normal file
@ -0,0 +1,38 @@
|
||||
disable ssp usage in yaboot itself
|
||||
|
||||
unfortunately, since we link against external libs that themselves were built
|
||||
with ssp turned on, we have to provide stubs to keep the linking from failing
|
||||
|
||||
--- yaboot-1.3.13/Config.gentoo
|
||||
+++ yaboot-1.3.13/Config.gentoo
|
||||
@@ -0,0 +1,6 @@
|
||||
+check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
|
||||
+ then echo "$(1)"; else echo "$(2)"; fi)
|
||||
+
|
||||
+CFLAGS += $(call check_gcc, -fno-stack-protector)
|
||||
+CFLAGS += $(call check_gcc, --nopie)
|
||||
+
|
||||
--- yaboot-1.3.13/Makefile
|
||||
+++ yaboot-1.3.13/Makefile
|
||||
@@ -1,6 +1,7 @@
|
||||
## Setup
|
||||
|
||||
include Config
|
||||
+include Config.gentoo
|
||||
|
||||
VERSION = 1.3.13
|
||||
# Debug mode (spam/verbose)
|
||||
@@ -79,7 +80,7 @@ HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/
|
||||
second/fs_of.o second/fs_ext2.o second/fs_iso.o second/fs_swap.o \
|
||||
second/iso_util.o \
|
||||
lib/nonstd.o \
|
||||
- lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o
|
||||
+ lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o
|
||||
|
||||
ifeq ($(USE_MD5_PASSWORDS),y)
|
||||
OBJS += second/md5.o
|
||||
--- yaboot-1.3.14/lib/ssp.c
|
||||
+++ yaboot-1.3.14/lib/ssp.c
|
||||
@@ -0,0 +1,2 @@
|
||||
+void __stack_chk_fail(void) {}
|
||||
+void __stack_chk_fail_local(void) {}
|
231
yaboot/yaboot-stubfuncs.patch
Normal file
231
yaboot/yaboot-stubfuncs.patch
Normal file
@ -0,0 +1,231 @@
|
||||
Stub out some functions that are not provided (and unneeded)
|
||||
|
||||
--- a/lib/malloc.c
|
||||
+++ b/lib/malloc.c
|
||||
@@ -64,6 +64,15 @@ void *malloc (unsigned int size)
|
||||
return caddr;
|
||||
}
|
||||
|
||||
+/* Calloc wrapper for malloc */
|
||||
+void *memset(void *s, int c, size_t n);
|
||||
+void *calloc(size_t nmemb, size_t size) {
|
||||
+ void *caddr;
|
||||
+ caddr = malloc(nmemb * size);
|
||||
+ memset(caddr, 0, nmemb * size);
|
||||
+ return caddr;
|
||||
+}
|
||||
+
|
||||
/* Do not fall back to the malloc above as posix_memalign is needed by
|
||||
* external libraries not yaboot */
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size)
|
||||
--- a/lib/nonstd.c
|
||||
+++ b/lib/nonstd.c
|
||||
@@ -65,3 +65,208 @@
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
+
|
||||
+int lseek(int fd, int offset, int whence) {
|
||||
+ // XXX: This whence addition seems wrong ..
|
||||
+ return prom_lseek((void *)fd, whence + offset);
|
||||
+}
|
||||
+
|
||||
+int lseek64(int fd, int64_t offset, int whence) {
|
||||
+ return lseek(fd, offset, whence);
|
||||
+}
|
||||
+
|
||||
+int open(const char *pathname, int flags) {
|
||||
+ return (int) prom_open((char *)pathname);
|
||||
+}
|
||||
+
|
||||
+int open64(const char *pathname, int flags) {
|
||||
+ return open(pathname, flags);
|
||||
+}
|
||||
+
|
||||
+// Internal glibc fortify calls.
|
||||
+int __open64_2(const char *path, int flags) {
|
||||
+ return open64(path, flags);
|
||||
+}
|
||||
+
|
||||
+int read(int fd, void *buf, size_t count) {
|
||||
+ return prom_read((void *)fd, buf, count);
|
||||
+}
|
||||
+
|
||||
+int write(int fd, const void *buf, size_t count) {
|
||||
+ return prom_write((void *)fd, (void *)buf, count);
|
||||
+}
|
||||
+
|
||||
+int close(int fd) {
|
||||
+ prom_close((void *)fd);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int pread(int fd, void *buf, size_t count, int32_t offset) {
|
||||
+ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/);
|
||||
+ lseek(fd, offset, 0 /*SEEK_SET*/);
|
||||
+ int ret = read(fd, buf, count);
|
||||
+ lseek(fd, curr, 0 /*SEEK_SET*/);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int pread64(int fd, void *buf, int64_t count, int64_t offset) {
|
||||
+ return pread(fd, buf, count, offset);
|
||||
+}
|
||||
+
|
||||
+int pwrite(int fd, const void *buf, size_t count, int32_t offset) {
|
||||
+ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/);
|
||||
+ lseek(fd, offset, 0 /*SEEK_SET*/);
|
||||
+ int ret = write(fd, buf, count);
|
||||
+ lseek(fd, curr, 0 /*SEEK_SET*/);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int pwrite64(int fd, const void *buf, int64_t count, int64_t offset) {
|
||||
+ return pwrite(fd, buf, count, offset);
|
||||
+}
|
||||
+
|
||||
+// No fsync, just assume we've sync'd
|
||||
+int fsync(int fd) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+// ext2 libs only use this to turn off caches currently
|
||||
+int fcntl(int fd, int cmd, ...) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void exit(int status) {
|
||||
+ prom_exit();
|
||||
+}
|
||||
+
|
||||
+int __printf_chk(int flag, const char *format, ...) {
|
||||
+ va_list ap;
|
||||
+ va_start (ap, format);
|
||||
+ prom_vfprintf (prom_stdout, format, ap);
|
||||
+ va_end (ap);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int __sprintf_chk(char * str, int flag, size_t strlen, const char * format, ...) {
|
||||
+ va_list ap;
|
||||
+ va_start(ap, format);
|
||||
+ // No sprintf? :(
|
||||
+ va_end(ap);
|
||||
+ return 0;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+int __fprintf_chk(FILE *stream, int flag, const char *format, ...) {
|
||||
+ va_list ap;
|
||||
+ va_start (ap, format);
|
||||
+ prom_vfprintf (prom_stdout, format, ap);
|
||||
+ va_end (ap);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void *memcpy(void *dest, const void *src, size_t n);
|
||||
+void *__memcpy_chk(void *dest, const void *src, size_t n, size_t destlen) {
|
||||
+ return memcpy(dest, src, n);
|
||||
+}
|
||||
+
|
||||
+// But these are all dummy functions
|
||||
+int __xstat64 (int __ver, const char *__filename, void *__stat_buf) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int stat64(const char *path, void *stat_buf) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int fstat64(int fildes, void *stat_buf) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int __fxstat64 (int __ver, int __filedesc, void *__stat_buf) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+signed int random(void) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void srandom(unsigned int seed) {
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+int rand(void) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void srand(unsigned int seed) {
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+unsigned int sleep(unsigned int seconds) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int gettimeofday(void *tv, void *tz) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+long sysconf(int name) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int getpagesize(void) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int gethostname(char *name, size_t len) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int getpid(void) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int getuid(void) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) {
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+int * __errno_location(void) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int ioctl(int d, int request, ...) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int fallocate(int fd, int mode, unsigned int offset, unsigned int len) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int uname(void *buf) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int setrlimit(int resource, void *rlim) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+unsigned long long int strtoull(const char *nptr, char **endptr, int base) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int getrlimit(int resource, void *rlim) {
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int stderr = 0;
|
||||
+int perror = 0;
|
42
yaboot/yabootconfig-1.3.13.patch
Normal file
42
yaboot/yabootconfig-1.3.13.patch
Normal file
@ -0,0 +1,42 @@
|
||||
--- yaboot-1.3.13.orig/ybin/yabootconfig 2004-11-04 21:57:17.000000000 -0500
|
||||
+++ yaboot-1.3.13/ybin/yabootconfig 2004-11-04 22:40:45.503060512 -0500
|
||||
@@ -5,6 +5,8 @@
|
||||
## yabootconfig generates a simple /etc/yaboot.conf
|
||||
## Copyright (C) 2001, 2002, 2003 Ethan Benson
|
||||
##
|
||||
+## Patched for Gentoo and dual boot - Mark Guertin <gerk@gentoo.org>
|
||||
+##
|
||||
## 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 2
|
||||
@@ -264,6 +266,30 @@
|
||||
return 0
|
||||
}
|
||||
|
||||
+dualboot()
|
||||
+{
|
||||
+ DRIVELIST=`ls -d /dev/?d?* | grep "[sh]d[abcdefghijkl]" | cut -b 6-8 | sort -u`
|
||||
+
|
||||
+ for i in $DRIVELIST
|
||||
+ do
|
||||
+ HFS=`mac-fdisk -l "/dev/$i" | grep '\<Apple_HFS\>' | grep -v "CDROM" | cut -d" " -f1`
|
||||
+ for h in $HFS
|
||||
+ do
|
||||
+ if [ !-x `hpmount -r $h` > /dev/null 2>&1 ] ; then
|
||||
+ if [ `hpls mach_kernel 2>/dev/null` ] ; then
|
||||
+ [ "$QUIET" = 0 ] && echo "Found possible OS X/Darwin partition at $h"
|
||||
+ OSX=$h
|
||||
+ fi
|
||||
+ if [ "`hpls "System Folder" 2>/dev/null`" ] ; then
|
||||
+ [ "$QUIET" = 0 ] && echo "Found possible Mac OS partition at $h"
|
||||
+ MACOS=$h
|
||||
+ fi
|
||||
+ hpumount $h > /dev/null 2>&1
|
||||
+ fi
|
||||
+ done
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
##########
|
||||
## Main ##
|
||||
##########
|
Loading…
x
Reference in New Issue
Block a user