--- rbootd-2.0.orig/README +++ rbootd-2.0/README @@ -0,0 +1,76 @@ +README -- rbootd under Debian Linux +=================================== + -- Peter Maydell (pmaydell@chiark.greenend.org.uk), 08/1998 + +rbootd is a Remote Boot Daemon. Specifically, it is used to +bootstrap some flavours of Hewlett Packard unix machines. You +probably won't have installed this package unless you have some +idea what you want to do with it, but I'll summarise the ideas here. +This document isn't intended to be a complete guide to configuring +your Linux box as a server for your HP; it just addresses some +Debian-specific issues, and particularly those concerning rbootd. +For more general information on what you're supposed to be doing, see +http://www.netbsd,org/Documentation/network/netboot/index.html which +is some very good documentation on the whole process of getting an HP +to boot NetBSD for a number of possible server OSes. I'll also mention +http://www.netbsd.org/ for completeness -- this will have links to general +documentation on booting NetBSD/hp300 and also links to the nearest +mirror site (which will have the boot images you require to use rbootd). + + +The process of booting one of these workstations has several stages, +of which rbootd is the first. It is used to download a fairly simple +bootloader to the HP. What happens then depends entirely on the second +stage boot loader, but the NetBSD one (which is the only one I have +any familiarity with) will then proceed to boot in a similar way to Sun +workstations, using RARP, bootparams and NFS mounting a root filesystem. + +The Debian package isn't supplied with any boot images, because I +consider these to be an integral part of the HP OS you're trying to +boot (the HPUX ones will be non-free, for example). Also, for practical +reasons, including the NetBSD bootblock would make the Debian source +package enormous because the bootblock sources are intertwined with +the NetBSD kernel source tree... At this point I'll assume you've +obtained a boot image file from somewhere. It will probably be +named something like SYS_INST or SYS_UBOOT. Put it in /var/lib/rbootd +(this directory should have been created for you when the package +was installed). + +Now you need to add a suitable line or lines to /etc/rbootd.conf +to describe the machine you're trying to boot. The config file +format is described in rbootd(8), but here it is for easy reference: + # + # ethernet addr boot file(s) comments + # + 08:00:09:0:66:ad SYSHPBSD # snake (4.3BSD) + 08:00:09:0:59:5b # vandy (anything) + 8::9:1:C6:75 SYSHPBSD,SYSHPUX # jaguar (either) + +If you don't know the ethernet (MAC) address of the client, it should +be displayed to the console at boot up, or you can just put something +random in that column for now and look in the logfiles: rbootd logs +the MAC address of clients who requested a boot but were denied. + +If the network your HP is on is not on the Linux server's eth0 +ethernet interface, you'll need to change the line "IFACE=eth0" +in the /etc/init.d/rbootd script. +Not being able to specify the interface in the config file is a +deficiency I'm aware of, and will fix when I get around to it :-> + +Finally you need to restart the daemon: as root run +/etc/init.d/rbootd restart + +Hopefully now if you try to boot your HP the Linux box will respond +to the rbootd request. + +For more information on what to do next and on the NetBSD booting +process in general, please read the Diskless NetBSD HOW-TO, which +can be found at: +http://www.netbsd.org/Documentation/network/netboot/index.html +This documents the whole process of setting up a diskless NetBSD +box, including hp300-specific information and information about using +a Linux box as the server. +Note that bootparamd and nfsd are both in the Debian netstd package, +and rarp is in netbase so all you need to do there is install those +packages if you don't have them and configure them for your setup. + --- rbootd-2.0.orig/pathnames.h +++ rbootd-2.0/pathnames.h @@ -49,5 +49,5 @@ #define _PATH_BPF "/dev/bpf%d" #define _PATH_RBOOTDCONF "/etc/rbootd.conf" #define _PATH_RBOOTDDBG "/tmp/rbootd.dbg" -#define _PATH_RBOOTDLIB "/export/hp/rbootd" +#define _PATH_RBOOTDLIB "/var/lib/rbootd" #define _PATH_RBOOTDPID "/var/run/rbootd.pid" --- rbootd-2.0.orig/pcap.c +++ rbootd-2.0/pcap.c @@ -4,6 +4,9 @@ * Peter Maydell , and revised * in 1998 to clean it up a little... * + * Revised to use PF_PACKET instead of SOCK_PACKET (thanks to patch from + * Kars de Jong ) + * * On the positive side, this code is rather less nasty than bpf.c, * primarily because a lot of lower-level stuff has vanished into libpcap. * @@ -27,7 +30,8 @@ #include /* close() */ #include /* syslog() */ #include /* struct ifreq */ -#include /* ETH_P_ALL */ +#include /* ETH_P_802_3 */ +#include /* PF_PACKET stuff */ #include /* strncpy(), bcopy() */ #include "defs.h" @@ -186,53 +190,46 @@ * rconn->bootfd filedesc of open bootfile * rconn->next ptr to next RMPCONN... * - * All we need to do is fill out source addr and send rconn->rmp. - * This is all BpfWrite does, although there it's the BPF that does - * the adding of source address. - * NOTE : we do *not* just set the source addr in the rconn we get given! - * We copy the old source addr and reset it, since code in rmpproto.c - * depends on the source address being the address of the *destination* - * machine. (see the comment in rmp - * - * Bits of this code borrowed from a post by - * Jamie Lokier (jamie@rebellion.co.uk) giving source for a program that - * used SOCK_PACKET. Documentation on this facility is *really* rare... + * We use a PF_PACKET socket in IEEE 802.3 mode. + * All we need to do is fill out the destination addres and send rconn->rmp, + * skipping the Ethernet header (it will be filled in by the kernel). */ int s,cs; - struct sockaddr sa; - char saveaddr[RMP_ADDRLEN]; - - sa.sa_family = AF_INET; - strcpy (sa.sa_data, IntfName); - - s=socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL)); + struct sockaddr_ll sa; + + memset (&sa, 0, sizeof(sa)); + s=socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_802_3)); if (s == -1) { syslog(LOG_ERR, "attempt to open socket for write failed!"); return 1; } - /* Get the source address for the packets. */ + /* Get the interface index to be used. */ { struct ifreq req; int status; strcpy (req.ifr_name, IntfName); - status = ioctl (s, SIOCGIFHWADDR, &req); + status = ioctl (s, SIOCGIFINDEX, &req); if (status == -1) { - syslog(LOG_ERR, "SIOCGIFHWADDR: couldn't get source address!"); + syslog(LOG_ERR, "SIOCGIFINDEX: couldn't get interface index!"); return 0; } - /* save old source addr, then write real source addr into packet */ - memcpy (saveaddr, &(rconn->rmp.hp_hdr.saddr), RMP_ADDRLEN); - memcpy (&(rconn->rmp.hp_hdr.saddr), req.ifr_hwaddr.sa_data, RMP_ADDRLEN); + sa.sll_ifindex = req.ifr_ifindex; } - /* perform the actual raw packet send */ - cs = sendto(s, &(rconn->rmp), rconn->rmplen, 0, &sa, sizeof(sa)); - /* restore previous contents of the source address field before return */ - memcpy (&(rconn->rmp.hp_hdr.saddr),saveaddr, RMP_ADDRLEN); + /* Fill in the socket address */ + sa.sll_protocol = htons(ETH_P_802_3); + sa.sll_family = AF_PACKET; + memcpy (&sa.sll_addr, &(rconn->rmp.hp_hdr.daddr), RMP_ADDRLEN); + sa.sll_halen = RMP_ADDRLEN; + + /* perform the actual packet send */ + cs = sendto(s, &(rconn->rmp.hp_llc), rconn->rmplen - sizeof(struct hp_hdr), + 0, (struct sockaddr *)&sa, sizeof(sa)); + close (s); if (cs == -1) --- rbootd-2.0.orig/rbootd.8 +++ rbootd-2.0/rbootd.8 @@ -135,14 +135,12 @@ Turn off debugging, do nothing if already off. .El .Sh "FILES" -.Bl -tag -width /usr/libexec/rbootd -compact -.It /dev/bpf# -packet-filter device +.Bl -tag -width /usr/bin/rbootd -compact .It /etc/rbootd.conf configuration file .It /tmp/rbootd.dbg debug output -.It /usr/mdec/rbootd +.It /var/lib/rbootd directory containing boot files .It /var/run/rbootd.pid process id @@ -152,7 +150,9 @@ .Xr socket 2 , .Xr signal 3 , .Xr syslog 3 , -.Xr rmp 4 .Sh BUGS If multiple servers are started on the same interface, each will receive and respond to the same boot packets. +The interface should be specified in a configuration file rather than +having to be put on the command line as an argument. Also the location +of the boot images is hardcoded into the binary at compile time. --- rbootd-2.0.orig/rbootd.c +++ rbootd-2.0/rbootd.c @@ -58,7 +58,7 @@ #endif /* not lint */ #include -#include +#include #include #ifndef __linux__ /* not relevant to Linux */ #include @@ -173,7 +173,7 @@ #else if ((IntfName = BpfGetIntfName(&errmsg)) == NULL) { #endif - syslog(LOG_NOTICE, "restarted (??)"); + syslog(LOG_NOTICE, "restarted (%s)", "??"); syslog(LOG_ERR, errmsg); Exit(0); } --- rbootd-2.0.orig/rmpproto.c +++ rbootd-2.0/rmpproto.c @@ -341,7 +341,14 @@ * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = rindex(filepath,'/'))? ++filename: filepath; + filename = rindex(filepath, '/'); + if (filename) { + /* yes, there is a directory component to file. Forget it. */ + filename++; + } else { + /* No, no / in that. Use whole filename */ + filename=filepath; + } /* * Check that this is a valid boot file name. @@ -350,6 +357,15 @@ if (STREQN(filename, filelist[i])) goto match; + if (strlen(filename)==0) { + /* Apparently some HPs don't send a filename; for these + * we return the first image name on the list. -- PMM + */ + filename=filepath; + strncpy(filename, filelist[0],RMPBOOTDATA); + goto match; + } + /* * Invalid boot file name, set error and send reply packet. */ --- rbootd-2.0.orig/skeleton +++ rbootd-2.0/skeleton @@ -0,0 +1,69 @@ +#! /bin/sh +# +# skeleton example file to build /etc/init.d/ scripts. +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux +# by Ian Murdock . +# +# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/daemon +NAME=daemon +DESC="some daemon" + +test -f $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON + echo "$NAME." + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/$NAME.pid --exec $DAEMON + #;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- rbootd-2.0.orig/debian/changelog +++ rbootd-2.0/debian/changelog @@ -0,0 +1,141 @@ +rbootd (2.0-10) unstable; urgency=low + + * New-Maintainer upload (closes: Bug#465907) + * Added support for nostrip build option (closes: Bug#437883) + * Improved packaging + * Let rbootd decide the interface to use (closes: Bug#474709) + * Added support for default file with interface setting + * Adjusted changelog + * Code improvements + . Avoid trigraph + . Include instead of for time() + . Removed obfuscated C line that was supposed to be dropped in 2.0-4 + + -- Martin Schulze Mon, 07 Apr 2008 17:20:32 +0200 + +rbootd (2.0-9) unstable; urgency=low + + * QA upload. + * Set maintainer to Debian QA Group + * Added LSB formatted dependency info in init.d script (closes: #469713) + * Updated standards version + + -- Peter Eisentraut Wed, 02 Apr 2008 11:27:50 +0200 + +rbootd (2.0-8.1) unstable; urgency=low + + * Non-maintainer upload. + * Use invoke-rc.d; closes: #367729. + * Remove bashisms from debian/rules; closes: #379635. + + -- Robert S. Edmonds Sun, 02 Sep 2007 02:04:31 -0400 + +rbootd (2.0-8) unstable; urgency=low + + * Removed debian/changelog.{rej,orig} + * Corrected PF_SOCKET to PF_PACKET in pcap.c + + -- Alan Bain Mon, 19 Sep 2005 22:18:57 +0100 + +rbootd (2.0-7) unstable; urgency=low + + * Changed to use PF_PACKET socket instead of SOCK_PACKET + * updated copyright to point to common-licenses + * removed /usr/doc symlink creation + * updated debian standards + + -- Alan Bain Tue, 13 Sep 2005 23:20:23 +0100 + +rbootd (2.0-6.1) unstable; urgency=low + + * Non maintainer upload + * Rebuilt with new libpcap to remove dependency on libpcap0, which I + got removed from unstable by accident. Sorry about this... + + -- Torsten Landschoff Sat, 10 Aug 2002 11:37:29 +0200 + +rbootd (2.0-6) unstable; urgency=low + + * Added build-depends on libpcap-dev closing bug #84507 + * Corrected upstream source files + + -- Alan Bain Tue, 3 Jul 2001 16:00:00 +0100 + +rbootd (2.0-5) unstable; urgency=low + + * Fixed a mistake in the control file + * Package (2.0-3) didn't print a warning when upgraded to 2.0-4; + this has now been corrected. + * README no longer refers to /usr/local/lib + * URL in README updated (closing bug #49456) + * Package now suggests bootparamd and nfs-server rather than + netstd (closing bug #49384) + + -- Alan Bain Sat, 4 Nov 1999 20:00:00 +0000 + +rbootd (2.0-4) unstable; urgency=low + + * Updated the control file to cover PA-RISC workstations + * Fixed a potential buffer overrun problem + * Incorporated a patch from Peter Maydell removing obfuscated C line + * Corrected an error in the manpage + * Removed a skeleton file accidentally left in distribution + * Removed creation of /usr/local/lib/rbootd directory + * postinst now displays a message about the move + * Moved documentation to /usr/share directories + + -- Alan Bain Tue, 23 Nov 1999 14:05:00 +0000 + +rbootd (2.0-3.2) unstable; urgency=low + + * Non-maintainer release + * (Joey Added rbootd-singlefile.diff from The Puffin Group / PA-RISC + porters from the srpm as found at + ftp://puffin.external.hp.com/pub/parisc/binaries/SRPMS/rbootd-2.0-2.src.rpm + + -- Martin Schulze Mon, 25 Oct 1999 02:41:10 +0200 + +rbootd (2.0-3.1) unstable; urgency=low + + * Non-maintainer release + * Extended changelog + * Changed from /usr/local/lib/rbootd to /var/lib/rbootd (closes: + Bug#47618) + * Added that directory to .deb files + + -- Martin Schulze Sun, 24 Oct 1999 19:23:12 +0200 + +rbootd (2.0-3) unstable; urgency=low + + * Added README file provided by Peter Maydell which gives + useful instructions on how to set up rbootd on a debian + system. + + -- Alan Bain Tue, 2 Feb 1999 18:00:00 +0000 + +rbootd (2.0-2) unstable; urgency=low + + * Changed init script name to rbootd rather than rbootd_init + * Moved bootfile location to /usr/local/lib/rboot rather than + /export/hp/root (!) + * compile options now include -g + * strip binary in situ rather than before installing + * sequence no is 20 rather than 35 + * copyright now refers to BSD copyright + * capitalisation fixed + * manpage paths fixed + + -- Alan Bain Sun, 21 Jun 1998 01:30:00 +0100 + +rbootd (2.0-1) unstable; urgency=low + + * Created package for first time from files on Peter Maydell's + website http://www.chiark.greenend.org.uk/~pmaydell + * Created scripts to start and stop rbootd with a null config + file to start with. + + -- Alan Bain Mon, 15 Jun 1998 10:00:00 +0100 + +Local variables: +mode: debian-changelog +End: --- rbootd-2.0.orig/debian/conffiles +++ rbootd-2.0/debian/conffiles @@ -0,0 +1,3 @@ +/etc/rbootd.conf +/etc/default/rbootd +/etc/init.d/rbootd --- rbootd-2.0.orig/debian/control +++ rbootd-2.0/debian/control @@ -0,0 +1,18 @@ +Source: rbootd +Section: net +Priority: extra +Maintainer: Martin Schulze +Standards-Version: 3.7.3 +Build-Depends: libpcap-dev + +Package: rbootd +Architecture: any +Depends: netbase (>=3.00), ${shlibs:Depends} +Suggests: bootparamd,nfs-server +Description: Remote Boot Daemon + The rbootd daemon is used for booting some HP workstations + over the network (such as the 9000/300 and 9000/400 series). + It can also boot PA RISC workstations. It handles the first + stage of the boot sequence and can be used to start booting + Linux, NetBSD or HPUX. + --- rbootd-2.0.orig/debian/copyright +++ rbootd-2.0/debian/copyright @@ -0,0 +1,20 @@ +/* + * Copyright (c) 1988, 1992 The University of Utah and the Center + * for Software Science (CSS). + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * Sections Copyright (c) 1996,1998 Peter Maydell + * + * This code is derived from software contributed to Berkeley by + * the Center for Software Science of the University of Utah Computer + * Science Department. CSS requests users of this software to return + * to css-dist@cs.utah.edu any improvements that they make and grant + * CSS redistribution rights. + */ + +rbootd may be distributed under the terms of the BSD license, +found on Debian systems in the file /usr/share/common-licenses/BSD. + +The source of the Debian package is managed using CVS. It is publically +available at or as +<:pserver:anonymous@cvs.infodrom.org/var/cvs/debian/rbootd/>. --- rbootd-2.0.orig/debian/default +++ rbootd-2.0/debian/default @@ -0,0 +1,8 @@ +# +# Top configuration file for rbootd +# + +# +# To limit listening to a particular interface, mention it below +# +# IFACE="eth0" --- rbootd-2.0.orig/debian/dirs +++ rbootd-2.0/debian/dirs @@ -0,0 +1,5 @@ +usr/sbin +etc/default +etc/init.d +usr/share/man/man8 +usr/share/doc/rbootd --- rbootd-2.0.orig/debian/postinst +++ rbootd-2.0/debian/postinst @@ -0,0 +1,28 @@ +#!/bin/sh + +# post install script for Debian GNU/Linux rbootd package + +set -e + +## install startup files +update-rc.d rbootd defaults >/dev/null + +if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d rbootd stop + invoke-rc.d rbootd start +else + /etc/init.d/rbootd stop + /etc/init.d/rbootd start +fi + +if [ "$1" = "configure" ]; then + if [ ! -z $2 ]; then + if dpkg --compare-versions $2 le 2.0-3; then + echo "This version of rbootd now stores its boot images in /var/lib/rbootd" + echo "and not in /usr/local/lib/rbootd. Debian policy prevents the package" + echo "from making changes in /usr/local/lib, so you should move all your" + echo "boot files from there to /var/lib/rbootd; then run" + echo "/etc/init.d/rbootd restart" + fi + fi +fi --- rbootd-2.0.orig/debian/postrm +++ rbootd-2.0/debian/postrm @@ -0,0 +1,10 @@ +#!/bin/sh +# post removal script for the Debian GNU/Linux rbootd package + +set -e + +if [ $1 = "purge" ] +then + update-rc.d rbootd remove >/dev/null +fi + --- rbootd-2.0.orig/debian/prerm +++ rbootd-2.0/debian/prerm @@ -0,0 +1,21 @@ +#!/bin/sh + +# pre remove script for Debian GNU/Linux rbootd package + +set -e + +if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d rbootd stop +else + /etc/init.d/rbootd stop +fi + +## Remove the local files dir if emtpy -- leave alone o/w +test ! -d /usr/local/lib/rbootd || rmdir /usr/local/lib/rbootd || true + + +## Remove the old doc directory +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/rbootd ]; then + rm -f /usr/doc/rbootd +fi + --- rbootd-2.0.orig/debian/rbootd.init.d +++ rbootd-2.0/debian/rbootd.init.d @@ -0,0 +1,83 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: rbootd +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO + +# rbootd init file. Modified from Debian skeleton by +# Alan Bain . +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux +# by Ian Murdock . +# +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/rbootd +NAME=rbootd +DESC="remote boot daemon" + +test -f $DAEMON || exit 0 + +test ! -r /etc/default/rbootd || . /etc/default/rbootd + +if [ -n "$IFACE" ] +then + ARGS="-- -i $IFACE" +fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON $ARGS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$NAME.pid \ + --exec $DAEMON + echo "$NAME." + ;; + reload|force-reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + echo "Reloading $DESC configuration files." + start-stop-daemon --stop --oknodo --signal 1 --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + ;; + restart) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $DESC: " + start-stop-daemon --stop --oknodo --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON $ARGS + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- rbootd-2.0.orig/debian/rules +++ rbootd-2.0/debian/rules @@ -0,0 +1,103 @@ +#!/usr/bin/make -f +# Sample debian.rules file - for GNU Hello (1.3). +# Copyright 1994,1995 by Ian Jackson. + +# Modified to be rules for rbootd by Alan Bain 1998 + +# I hereby give you perpetual unlimited permission to copy, +# modify and relicense this file, provided that you do not remove +# my name from the file itself. (I assert my moral right of +# paternity under the Copyright, Designs and Patents Act 1988.) +# This file may have to be extensively modified + +package=rbootd + +ARCH := $(shell dpkg --print-architecture) + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS = -g -O2 -Wall $(shell getconf LFS_CFLAGS) +else +CFLAGS = -O2 -Wall $(shell getconf LFS_CFLAGS) +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +STRIP = -s +endif + +export BASEDIR=$(shell pwd)/debian/tmp + +## Note must use the special makefile to avoid needing BSD make + +build: + $(checkdir) + $(MAKE) -f Makefile.linux CFLAGS="$(CFLAGS)" rbootd + touch build + +clean: + $(checkdir) + $(MAKE) -f Makefile.linux clean + -rm -f build + -rm -rf debian/tmp debian/files* core debian/substvars + +binary-indep: checkroot build + $(checkdir) +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +# Install and strip rather than strip binary left here + +binary-arch: checkroot build + $(checkdir) + rm -rf debian/tmp + install -d debian/tmp + cd debian/tmp;install -d `cat ../dirs` + install -d ${BASEDIR}/DEBIAN + install -o root -g root -m 0755 $(STRIP) rbootd ${BASEDIR}/usr/sbin + install -o root -g root -m 0644 debian/default ${BASEDIR}/etc/default/rbootd + install -o root -g root -m 0755 debian/rbootd.init.d ${BASEDIR}/etc/init.d/rbootd + install -o root -g root -m 0644 etc-rbootd/rbootd.conf ${BASEDIR}/etc + install -o root -g root -m 0644 rbootd.8 ${BASEDIR}/usr/share/man/man8 + @if [ -f ${BASEDIR}/usr/share/man/man8/rbootd.8 ]; then \ + gzip -9v ${BASEDIR}/usr/share/man/man8/rbootd.8 ; \ + fi + + install -o root -g root -m 0644 README \ + ${BASEDIR}/usr/share/doc/rbootd/README + @if [ -f ${BASEDIR}/usr/share/doc/rbootd/README ]; then \ + gzip -9v ${BASEDIR}/usr/share/doc/rbootd/README ;\ + fi + install -o root -g root -m 0644 debian/copyright \ + ${BASEDIR}/usr/share/doc/rbootd/copyright + install -o root -g root -m 0644 debian/changelog \ + ${BASEDIR}/usr/share/doc/rbootd/changelog.Debian + + @if [ -f ${BASEDIR}/usr/share/doc/rbootd/changelog.Debian ]; then \ + gzip -9v ${BASEDIR}/usr/share/doc/rbootd/changelog.Debian ; \ + fi + install -o root -g root -m 0644 debian/conffiles \ + ${BASEDIR}/DEBIAN + install -o root -g root -m 0755 debian/postinst debian/prerm debian/postrm \ + ${BASEDIR}/DEBIAN + install -d ${BASEDIR}/var/lib/rbootd + dpkg-shlibdeps rbootd + dpkg-gencontrol -isp + chown -R root.root debian/tmp + chmod -R go-ws debian/tmp + dpkg --build debian/tmp .. + +define checkdir + test -f debian/rules +endef + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot --- rbootd-2.0.orig/etc-rbootd/rbootd.conf +++ rbootd-2.0/etc-rbootd/rbootd.conf @@ -0,0 +1,8 @@ +# /etc/rbootd.conf: provides machines with remote boot loaders +# see rbootd(8) for further information: +# +# +# Format: +# ethernet address bootfile + +