[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make release in /usr/src/etc fails unless run by root
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: Re: make release in /usr/src/etc fails unless run by root
- From: Jason Crawford <jasonrcrawford_(_at_)_gmail_(_dot_)_com>
- Date: Wed, 23 Mar 2005 19:18:28 -0500
- Reply-to: Jason Crawford <jasonrcrawford_(_at_)_gmail_(_dot_)_com>
On Wed, 23 Mar 2005 13:27:21 -0500, Jason Crawford
<jasonrcrawford_(_at_)_gmail_(_dot_)_com> wrote:
> I noticed that the make release command, when run with -n, shows
> that ${SUDO} is being used in some places, however there are parts of
> make release that require root privs that aren't run with ${SUDO} in
> the make file. I was wondering if the developers did this
> intentionally to only allow root to run a make release, or if they
> just havn't had time to fix the places in /usr/src/distrib where it
> tries to execute commands that require root privileges. I am currently
> fixing my source tree to use ${SUDO} in make files where neccessary,
> so I can submit patches when I'm done, but I'd like to know if you
> guys would even consider the patches, or if you'd rather keep make
> release something that can only be run by root.
>
> Jason
>
Here is my patch, however it's only for i386 as I don't currently have
another build architecture:
Index: distrib/i386/common/Makefile.inc
===================================================================
RCS file: /home/cvs/src/distrib/i386/common/Makefile.inc,v
retrieving revision 1.15
diff -u -r1.15 Makefile.inc
--- distrib/i386/common/Makefile.inc 25 Nov 2004 22:02:08 -0000 1.15
+++ distrib/i386/common/Makefile.inc 23 Mar 2005 22:25:55 -0000
@@ -28,22 +28,22 @@
${FS}: bsd.gz
dd if=/dev/zero of=${REALIMAGE} bs=10k count=${FLOPPYSIZE}
- vnconfig -v -c ${VND} ${REALIMAGE}
- disklabel -w -r ${VND} ${FLOPPYTYPE}
- newfs -m 0 -o space -i 524288 -c 80 ${VND_RDEV}
- mount ${VND_DEV} ${MOUNT_POINT}
- cp ${BOOT} ${.OBJDIR}/boot
- strip ${.OBJDIR}/boot
- strip -R .comment ${.OBJDIR}/boot
- dd if=${.OBJDIR}/boot of=${MOUNT_POINT}/boot bs=512
- dd if=bsd.gz of=${MOUNT_POINT}/bsd bs=512
- /usr/mdec/installboot -v ${MOUNT_POINT}/boot \
+ ${SUDO} vnconfig -v -c ${VND} ${REALIMAGE}
+ ${SUDO} disklabel -w -r ${VND} ${FLOPPYTYPE}
+ ${SUDO} newfs -m 0 -o space -i 524288 -c 80 ${VND_RDEV}
+ ${SUDO} mount ${VND_DEV} ${MOUNT_POINT}
+ ${SUDO} cp ${BOOT} ${.OBJDIR}/boot
+ ${SUDO} strip ${.OBJDIR}/boot
+ ${SUDO} strip -R .comment ${.OBJDIR}/boot
+ ${SUDO} dd if=${.OBJDIR}/boot of=${MOUNT_POINT}/boot bs=512
+ ${SUDO} dd if=bsd.gz of=${MOUNT_POINT}/bsd bs=512
+ ${SUDO} /usr/mdec/installboot -v ${MOUNT_POINT}/boot \
${DESTDIR}/usr/mdec/biosboot ${VND_CRDEV}
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
- umount ${MOUNT_POINT}
- vnconfig -u ${VND}
+ ${SUDO} umount ${MOUNT_POINT}
+ ${SUDO} vnconfig -u ${VND}
cp ${REALIMAGE} ${FS}
rm ${REALIMAGE}
@@ -73,16 +73,16 @@
rd_setup: ${CBIN}
dd if=/dev/zero of=${REALIMAGE} bs=512 count=${NBLKS}
- vnconfig -v -c ${VND} ${REALIMAGE}
- disklabel -w -r ${VND} ${DISKTYPE}
- newfs ${NEWFSARGS} ${VND_RDEV}
- fsck ${VND_RDEV}
- mount ${VND_DEV} ${MOUNT_POINT}
+ ${SUDO} vnconfig -v -c ${VND} ${REALIMAGE}
+ ${SUDO} disklabel -w -r ${VND} ${DISKTYPE}
+ ${SUDO} newfs ${NEWFSARGS} ${VND_RDEV}
+ ${SUDO} fsck ${VND_RDEV}
+ ${SUDO} mount ${VND_DEV} ${MOUNT_POINT}
rd_teardown:
@df -i ${MOUNT_POINT}
- -umount ${MOUNT_POINT}
- -vnconfig -u ${VND}
+ -${SUDO} umount ${MOUNT_POINT}
+ -${SUDO} vnconfig -u ${VND}
cp ${REALIMAGE} ${IMAGE}
rm ${REALIMAGE}
@@ -113,11 +113,11 @@
awk -f ${UTILS}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CRUNCHCONF}
do_files:
- mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
+ ${SUDO} mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
REV=${REV} TARGDIR=${MOUNT_POINT} UTILS=${UTILS} \
- sh ${UTILS}/runlist.sh ${LISTS}
- rm ${MOUNT_POINT}/${CBIN}
+ ${SUDO} sh ${UTILS}/runlist.sh ${LISTS}
+ ${SUDO} rm ${MOUNT_POINT}/${CBIN}
clean cleandir:
/bin/rm -f core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}*.cache \
Index: etc/etc.i386/Makefile.inc
===================================================================
RCS file: /home/cvs/src/etc/etc.i386/Makefile.inc,v
retrieving revision 1.15
diff -u -r1.15 Makefile.inc
--- etc/etc.i386/Makefile.inc 7 Feb 2005 06:08:10 -0000 1.15
+++ etc/etc.i386/Makefile.inc 23 Mar 2005 22:25:58 -0000
@@ -3,9 +3,9 @@
.ifdef DESTDIR
snap_md: bsd bsd.mp notes bootblocks distrib
- cp ${.CURDIR}/../sys/arch/i386/compile/GENERIC/bsd \
+ ${SUDO} cp ${.CURDIR}/../sys/arch/i386/compile/GENERIC/bsd \
${DESTDIR}/snapshot/bsd
- cp ${.CURDIR}/../sys/arch/i386/compile/GENERIC.MP/bsd \
+ ${SUDO} cp ${.CURDIR}/../sys/arch/i386/compile/GENERIC.MP/bsd \
${DESTDIR}/snapshot/bsd.mp
bsd:
@@ -19,12 +19,12 @@
${MAKE} clean && ${MAKE} depend && exec ${MAKE}
notes:
- cp ${.CURDIR}/etc.i386/INSTALL.* ${DESTDIR}/snapshot
+ ${SUDO} cp ${.CURDIR}/etc.i386/INSTALL.* ${DESTDIR}/snapshot
bootblocks:
- cp ${DESTDIR}/usr/mdec/pxeboot ${DESTDIR}/snapshot
- cp ${DESTDIR}/usr/mdec/cdboot ${DESTDIR}/snapshot
- cp ${DESTDIR}/usr/mdec/cdbr ${DESTDIR}/snapshot
+ ${SUDO} cp ${DESTDIR}/usr/mdec/pxeboot ${DESTDIR}/snapshot
+ ${SUDO} cp ${DESTDIR}/usr/mdec/cdboot ${DESTDIR}/snapshot
+ ${SUDO} cp ${DESTDIR}/usr/mdec/cdbr ${DESTDIR}/snapshot
.PHONY: bsd notes bootblocks
Visit your host, monkey.org