My yaboot changes for PPCRCD
Przemek Iskra
sparky at pld-linux.org
Thu Mar 30 23:39:52 EST 2006
On Sun, Mar 26, 2006 at 06:20:57PM -0500, Paul Nasrat wrote:
> On Sun, 2006-03-26 at 22:22 +0200, Przemek Iskra wrote:
> > I was working on yaboot (binary part only) for a while, because I need
> > some additional functionality for my PPCRCD:
I have more patches from PLD I think you should consider;
1. shell scripts are not POSIX compliant, theh use some bash-specyfic
features, but it may be difficlut to fix them, so execute scripts
using /bin/bash
2. when installing it should not force to change file owner to root, or
there should be way to disable it
3. paths in man pages should be changed dinamically when installing;
PREFIX may not to be /usr
--
____ Sparky{PI] -- Przemyslaw _ ___ _ _ ........... LANG...Pl..Ca..Es..En
/____) ___ ___ _ _ || Iskra | | _ \| | | : WWW........ppcrcd.pld-linux.org
\____\| -_)'___| ||^'||//\\// < | _/| | | : JID......sparky<at>jabberes.org
(____/|| (_-_|_|| ||\\ || |_ |_| |_| _| : Mail....sparky<at>pld-linux.org
-------------- next part --------------
diff -uNr yaboot-1.3.6.orig/man.patch yaboot-1.3.6/man.patch
--- yaboot-1.3.6.orig/man.patch Wed Nov 21 14:19:21 2001
+++ yaboot-1.3.6/man.patch Tue Mar 19 03:03:23 2002
@@ -26,7 +26,7 @@
The Debian mktemp is derived from OpenBSD and thus should be secure.
-\fI/usr/local/lib/yaboot/ofboot\fR now contains code executed by /bin/sh (by
-+\fI/usr/lib/yaboot/ofboot\fR now contains code executed by /bin/sh (by
++\fI/usr/lib/yaboot/ofboot\fR now contains code executed by /bin/bash (by
\fBmkofboot\fR) it is thus critical that it not be writable by anyone
but root. It is also critical that \fI/etc/yaboot.conf\fR not be
writable by anyone but root since a different \fIofboot\fR script could be
@@ -126,7 +126,7 @@
The Debian mktemp is derived from OpenBSD and thus should be secure.
-\fI/usr/local/lib/yaboot/ofboot\fR now contains code executed by /bin/sh (by
-+\fI/usr/lib/yaboot/ofboot\fR now contains code executed by /bin/sh (by
++\fI/usr/lib/yaboot/ofboot\fR now contains code executed by /bin/bash (by
\fBybin\fR). It is thus critical that it not be writable by anyone but
root. It is also critical that \fI/etc/yaboot.conf\fR not be writable
by anyone but root since a different \fIofboot\fR script could be
diff -uNr yaboot-1.3.6.orig/ybin/mkofboot yaboot-1.3.6/ybin/mkofboot
--- yaboot-1.3.6.orig/ybin/mkofboot Sat Dec 1 10:58:11 2001
+++ yaboot-1.3.6/ybin/mkofboot Tue Mar 19 03:02:02 2002
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
###############################################################################
##
@@ -1192,8 +1192,8 @@
## call ofboot,
## Usage: OS-count defaultos timeout fgc bgc osname oslabel oskey osdev osfile ...
- [ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: /bin/sh $magicboot $OS $defaultos $delay $fbc $bgc $YB $BSD $MAC $MX $DW $CD $NET $OF\n"
- FIRST="$(/bin/sh "$magicboot" "$OS" "$defaultos" "$delay" $fgc $bgc ${YB} ${BSD} ${MAC} ${MX} ${DW} ${CD} ${NET} ${OF})" || return 1
+ [ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: /bin/bash $magicboot $OS $defaultos $delay $fbc $bgc $YB $BSD $MAC $MX $DW $CD $NET $OF\n"
+ FIRST="$(/bin/bash "$magicboot" "$OS" "$defaultos" "$delay" $fgc $bgc ${YB} ${BSD} ${MAC} ${MX} ${DW} ${CD} ${NET} ${OF})" || return 1
return 0
}
diff -uNr yaboot-1.3.6.orig/ybin/ofpath yaboot-1.3.6/ybin/ofpath
--- yaboot-1.3.6.orig/ybin/ofpath Thu Sep 20 15:15:32 2001
+++ yaboot-1.3.6/ybin/ofpath Tue Mar 19 03:01:31 2002
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
###############################################################################
##
diff -uNr yaboot-1.3.6.orig/ybin/yabootconfig yaboot-1.3.6/ybin/yabootconfig
--- yaboot-1.3.6.orig/ybin/yabootconfig Wed Nov 21 13:55:37 2001
+++ yaboot-1.3.6/ybin/yabootconfig Tue Mar 19 03:01:42 2002
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
###############################################################################
##
diff -uNr yaboot-1.3.6.orig/ybin/ybin yaboot-1.3.6/ybin/ybin
--- yaboot-1.3.6.orig/ybin/ybin Sat Dec 1 10:58:11 2001
+++ yaboot-1.3.6/ybin/ybin Tue Mar 19 03:02:02 2002
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
###############################################################################
##
@@ -1192,8 +1192,8 @@
## call ofboot,
## Usage: OS-count defaultos timeout fgc bgc osname oslabel oskey osdev osfile ...
- [ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: /bin/sh $magicboot $OS $defaultos $delay $fbc $bgc $YB $BSD $MAC $MX $DW $CD $NET $OF\n"
- FIRST="$(/bin/sh "$magicboot" "$OS" "$defaultos" "$delay" $fgc $bgc ${YB} ${BSD} ${MAC} ${MX} ${DW} ${CD} ${NET} ${OF})" || return 1
+ [ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: /bin/bash $magicboot $OS $defaultos $delay $fbc $bgc $YB $BSD $MAC $MX $DW $CD $NET $OF\n"
+ FIRST="$(/bin/bash "$magicboot" "$OS" "$defaultos" "$delay" $fgc $bgc ${YB} ${BSD} ${MAC} ${MX} ${DW} ${CD} ${NET} ${OF})" || return 1
return 0
}
-------------- next part --------------
diff -urN yaboot-1.3.6.org/Makefile yaboot-1.3.6/Makefile
--- yaboot-1.3.6.org/Makefile Sat Mar 2 19:52:46 2002
+++ yaboot-1.3.6/Makefile Sat Mar 2 19:53:59 2002
@@ -172,32 +172,32 @@
strip --remove-section=.comment --remove-section=.note util/addnote
install: all strip
- install -d -o root -g root -m 0755 ${ROOT}/etc/
- install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/sbin/
- install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/lib
- install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/lib/yaboot
- 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 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
- install -o root -g root -m 0755 ybin/ybin ${ROOT}/${PREFIX}/sbin/ybin
- install -o root -g root -m 0755 ybin/yabootconfig ${ROOT}/${PREFIX}/sbin/yabootconfig
+ install -d -m 0755 ${ROOT}/etc/
+ install -d -m 0755 ${ROOT}/${PREFIX}/sbin/
+ install -d -m 0755 ${ROOT}/${PREFIX}/lib
+ install -d -m 0755 ${ROOT}/${PREFIX}/lib/yaboot
+ install -d -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man5/
+ install -d -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man8/
+ install -m 0644 second/yaboot ${ROOT}/$(PREFIX)/lib/yaboot
+ install -m 0755 util/addnote ${ROOT}/${PREFIX}/lib/yaboot/addnote
+ install -m 0644 first/ofboot ${ROOT}/${PREFIX}/lib/yaboot/ofboot
+ install -m 0755 ybin/ofpath ${ROOT}/${PREFIX}/sbin/ofpath
+ install -m 0755 ybin/ybin ${ROOT}/${PREFIX}/sbin/ybin
+ install -m 0755 ybin/yabootconfig ${ROOT}/${PREFIX}/sbin/yabootconfig
rm -f ${ROOT}/${PREFIX}/sbin/mkofboot
ln -s ybin ${ROOT}/${PREFIX}/sbin/mkofboot
@gzip -9 man/*.[58]
- install -o root -g root -m 0644 man/bootstrap.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/bootstrap.8.gz
- install -o root -g root -m 0644 man/mkofboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/mkofboot.8.gz
- install -o root -g root -m 0644 man/ofpath.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ofpath.8.gz
- install -o root -g root -m 0644 man/yaboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yaboot.8.gz
- install -o root -g root -m 0644 man/yabootconfig.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yabootconfig.8.gz
- install -o root -g root -m 0644 man/ybin.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ybin.8.gz
- install -o root -g root -m 0644 man/yaboot.conf.5.gz ${ROOT}/${PREFIX}/${MANDIR}/man5/yaboot.conf.5.gz
+ install -m 0644 man/bootstrap.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/bootstrap.8.gz
+ install -m 0644 man/mkofboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/mkofboot.8.gz
+ install -m 0644 man/ofpath.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ofpath.8.gz
+ install -m 0644 man/yaboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yaboot.8.gz
+ install -m 0644 man/yabootconfig.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yabootconfig.8.gz
+ install -m 0644 man/ybin.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ybin.8.gz
+ install -m 0644 man/yaboot.conf.5.gz ${ROOT}/${PREFIX}/${MANDIR}/man5/yaboot.conf.5.gz
@gunzip man/*.gz
@if [ ! -e ${ROOT}/etc/yaboot.conf ] ; then \
- echo "install -o root -g root -m 0644 etc/yaboot.conf ${ROOT}/etc/yaboot.conf"; \
- install -o root -g root -m 0644 etc/yaboot.conf ${ROOT}/etc/yaboot.conf; \
+ echo "install -m 0644 etc/yaboot.conf ${ROOT}/etc/yaboot.conf"; \
+ install -m 0644 etc/yaboot.conf ${ROOT}/etc/yaboot.conf; \
else \
echo "/etc/yaboot.conf already exists, leaving it alone"; \
fi
More information about the Yaboot-devel
mailing list