kern.post.mk.diff

stefan.johannesdal, 09/23/2008 12:14 PM

Download (3.17 KB)

View differences:

kern.post.mk 2008-09-23 13:37:47 +0200
111 111
		echo "You must build a kernel first." ; \
112 112
		exit 1 ; \
113 113
	fi
114
.  if exists(${DESTDIR}/boot/${DESTKERNNAME})
114
.  if exists(${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME})
115 115
.ifndef NOFSCHG
116
	-chflags noschg ${DESTDIR}/boot/${DESTKERNNAME}
116
	-chflags noschg ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME}
117 117
.endif
118 118
.    ifdef NO_KERNEL_OLD_STRIP
119
	cp -p ${DESTDIR}/boot/${DESTKERNNAME} ${DESTDIR}/boot/${DESTKERNNAME}.old
119
	cp -p ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME} ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME}.old
120 120
.    else
121
	${OBJCOPY} --strip-debug ${DESTDIR}/boot/${DESTKERNNAME} ${DESTDIR}/boot/${DESTKERNNAME}.old
121
	${OBJCOPY} --strip-debug ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME} ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME}.old
122 122
.    endif
123 123
.  endif
124 124
.ifdef NOFSCHG
125 125
	${INSTALL} -m 555 -o root -g wheel \
126
		${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
126
		${SELECTEDKERNEL} ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME}
127 127
.else
128 128
	${INSTALL} -m 555 -o root -g wheel -fschg \
129
		${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
129
		${SELECTEDKERNEL} ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME}
130 130
.endif
131 131

  
132 132
kernel-reinstall: kernel-installable
133 133
.ifdef NOFSCHG
134 134
	${INSTALL} -m 555 -o root -g wheel \
135
		${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
135
		${SELECTEDKERNEL} ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME}
136 136
.else
137 137
	${INSTALL} -m 555 -o root -g wheel -fschg \
138
		${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
138
		${SELECTEDKERNEL} ${DESTDIR}${DESTKERNDIR}/${DESTKERNNAME}
139 139
.endif
140 140

  
141 141
# Require DESTDIR to be manually specified when installing a
......
143 143
#
144 144
kernel-installable:
145 145
.if ${P} == vkernel
146
.if !defined(DESTDIR)
147
	@echo "When installing a virtual kernel, DESTDIR must be manually specified"
146
.if ( !defined(DESTDIR) && ( !defined(DESTKERNDIR) || ${DESTKERNDIR} == /boot ) )
147
	@echo "When installing a virtual kernel,"
148
	@echo "DESTKERNDIR or DESTDIR must be manually specified"
148 149
	@exit 1
149 150
.endif
150 151
.endif
......
199 200
modules-install:
200 201
.if !defined(NO_MODULES_OLD)
201 202
.  ifdef NO_KERNEL_OLD_STRIP
202
	set -- ${DESTDIR}/boot/modules/*; \
203
	set -- ${DESTDIR}${DESTKERNDIR}/${DESTMODULESNAME}/*; \
203 204
	if [ -f "$$1" ]; then \
204
		mkdir -p ${DESTDIR}/boot/modules.old; \
205
		mkdir -p ${DESTDIR}${DESTKERNDIR}/${DESTMODULESNAME}.old; \
205 206
		for file; do \
206
		cp -p $$file ${DESTDIR}/boot/modules.old; \
207
		cp -p $$file ${DESTDIR}${DESTKERNDIR}/${DESTMODULESNAME}.old; \
207 208
		done; \
208 209
	fi
209 210
.  else
210
	set -- ${DESTDIR}/boot/modules/*; \
211
	set -- ${DESTDIR}${DESTKERNDIR}/${DESTMODULESNAME}/*; \
211 212
	if [ -f "$$1" ]; then \
212
		mkdir -p ${DESTDIR}/boot/modules.old; \
213
		mkdir -p ${DESTDIR}${DESTKERNDIR}/${DESTMODULESNAME}.old; \
213 214
		for file; do \
214
		${OBJCOPY} --strip-debug $$file ${DESTDIR}/boot/modules.old/$${file##*/}; \
215
		${OBJCOPY} --strip-debug $$file ${DESTDIR}${DESTKERNDIR}/${DESTMODULESNAME}.old/$${file##*/}; \
215 216
		done; \
216 217
	fi
217 218
.  endif
218 219
.endif
219
	mkdir -p ${DESTDIR}/boot/modules # Ensure that the modules directory exists!
220
	mkdir -p ${DESTDIR}${DESTKERNDIR}/${DESTMODULESNAME} # Ensure that the modules directory exists!
220 221
	cd $S ; env ${MKMODULESENV} ${MAKE} -f Makefile.modules install
221 222

  
222 223
modules-reinstall: