Re: need conf/kern.post.mk review

From: Bjoern A. Zeeb <bzeeb-lists_at_lists.zabbadoz.net>
Date: Wed, 7 Jan 2009 01:22:39 +0000 (UTC)
On Tue, 16 Dec 2008, Andrzej Tobola wrote:

Hi,

> If we are already on kern.port.mk what about the following patch
> which gives the posibility to instal to fs  without chflags (e.g. nfs) ?
> I am using it from a long time as can be seen from time-stamps.
>
> --- /usr/src/sys/conf/kern.post.mk-OLD	2007-03-24 06:35:08.000000000 +0100
> +++ /usr/src/sys/conf/kern.post.mk	2007-11-24 23:52:03.000000000 +0100
> _at__at_ -14,6 +14,12 _at__at_
> .endif
> MKMODULESENV+=	KERNBUILDDIR="${.CURDIR}"
>
> +.if defined(NO_FSCHG)
> +CHFLAGS=	echo
> +.else
> +CHFLAGS=	chflags -R noschg
> +.endif
> +
> .MAIN: all
>
> .for target in all clean cleandepend cleandir clobber depend install \
> _at__at_ -208,11 +214,11 _at__at_
> .if exists(${DESTDIR}${KODIR})
> 	-thiskernel=`sysctl -n kern.bootfile` ; \
> 	if [ ! "`dirname "$$thiskernel"`" -ef ${DESTDIR}${KODIR} ] ; then \
> -		chflags -R noschg ${DESTDIR}${KODIR} ; \
> +		${CHFLAGS} ${DESTDIR}${KODIR} ; \
> 		rm -rf ${DESTDIR}${KODIR} ; \
> 	else \
> 		if [ -d ${DESTDIR}${KODIR}.old ] ; then \
> -			chflags -R noschg ${DESTDIR}${KODIR}.old ; \
> +			${CHFLAGS} ${DESTDIR}${KODIR}.old ; \
> 			rm -rf ${DESTDIR}${KODIR}.old ; \
> 		fi ; \
> 		mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \
> _at__at_ -231,7 +237,7 _at__at_
>
>
> kernel-reinstall:
> -	_at_-chflags -R noschg ${DESTDIR}${KODIR}
> +	_at_-${CHFLAGS} ${DESTDIR}${KODIR}
> 	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
> .if defined(DEBUG) && !defined(INSTALL_NODEBUG)
> 	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}


I cannot see why you would need any of those changes. All three places
do not care if they fail. the shell commands are using ; so the next
command is just executed and kernel-reinstall has a - which means that
a non-zero exist status is ignored.

/bz

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.
Received on Wed Jan 07 2009 - 00:25:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:40 UTC