Submit #1496

minor fixes for redoing nrelease sub-targets

Added by qhwt+dfly over 5 years ago. Updated 9 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:Other
Target version:3.8.0

Description

minor fixes for redoing nrelease sub-targets

- use reinstall targets for installing kernel/modules; we don't really
want to leave *.old files in ISO image.
- pass -f to ln for kernel.BOOTP
- cp -p resolv.conf inherits file flags, but nrelease attempts to rm it
later on, which may fail if it had schg set.
---
nrelease/Makefile | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/nrelease/Makefile b/nrelease/Makefile
index b56f836..f9152d7 100644
--- a/nrelease/Makefile
+++ b/nrelease/Makefile
@@ -235,16 +235,16 @@ buildiso:
.if make(gui)
if [ ! -d ${ISOROOT}/kernel.smp/boot ]; then mkdir -p ${ISOROOT}/kernel.smp/boot; fi
cd ${.CURDIR}/..; \
- make installkernel DESTDIR=${ISOROOT} \
+ make reinstallkernel DESTDIR=${ISOROOT} \
KERNCONF=DFLYLIVE DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
cd ${.CURDIR}/..; \
- make installkernel DESTDIR=${ISOROOT} \
+ make reinstallkernel DESTDIR=${ISOROOT} \
KERNCONF=VKERNEL DESTKERNNAME=kernel.VKERNEL -DNO_MODULES KERNCONFDIR=${.CURDIR}/gui/root; \
cd ${.CURDIR}/..; \
- make installkernel DESTDIR=${ISOROOT}/kernel.smp \
+ make reinstallkernel DESTDIR=${ISOROOT}/kernel.smp \
KERNCONF=DFLYLIVE-SMP DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
cd ${.CURDIR}/..; \
- make installkernel DESTDIR=${ISOROOT}/kernel.smp \
+ make reinstallkernel DESTDIR=${ISOROOT}/kernel.smp \
KERNCONF=DFLYLIVE-SMP-NOAPIC DESTKERNNAME=kernel.noapic \
KERNCONFDIR=${.CURDIR}/gui/root -DNO_MODULES;
.else
@@ -252,13 +252,13 @@ buildiso:
first=; \
for kernconf in ${KERNCONF}; do \
make DESTDIR=${ISOROOT} \
- installkernel KERNCONF=$${kernconf} \
+ reinstallkernel KERNCONF=$${kernconf} \
$${first:+DESTKERNNAME=kernel.$${kernconf}} \
$${first:+-DNO_MODULES}; \
first=done; \
done
.endif
- ln -s kernel ${ISOROOT}/boot/kernel.BOOTP
+ ln -fs kernel ${ISOROOT}/boot/kernel.BOOTP
mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
@@ -314,7 +314,7 @@ customizeiso:
# /usr/pkg infrastructure. Otherwise we attempt to pick up where
# we left off.
#
- cp -p /etc/resolv.conf ${ISOROOT}/etc
+ cp /etc/resolv.conf ${ISOROOT}/etc
${CHROOT_CMD} "ldconfig -elf /usr/lib /usr/lib/gcc* /usr/lib/compat"
-@umount ${ISOROOT}/usr/pkgsrc/distfiles
-@umount ${ISOROOT}/usr/pkgsrc
--
1.6.4

Associated revisions

Revision 1c9d98d0
Added by tuxillo 9 months ago

nrelease - Minor fixes

- Use 'reinstallkernel' to avoid leaving *.old files
in the ISO image.
- Make sure the '/boot/kernel/kernel.BOOTP' symbolic link
is recreated when it already exists (-f option to ln).
- Do not use '-p' to cp. In the case /etc/resolv.conf file
has schg flag set, a later rm during nrelease would fail.

Submitted-by: YONETANI Tomokazu <>
DragonFly-bug: <http://bugs.dragonflybsd.org/issues/1496>

This commit closes #1496

History

#1 Updated by qhwt+dfly over 5 years ago

On Wed, Sep 09, 2009 at 02:35:06PM +0900, YONETANI Tomokazu wrote:
> - cp -p resolv.conf inherits file flags, but nrelease attempts to rm it
> later on, which may fail if it had schg set.

The rationale for having schg on /etc/resolv.conf is, by the way, so that
dhclient won't replace it, and it's much easier than going through the
manpages (dhclient, dhclient.conf, dhclient-script) and come up with a
workaround (defining an empty function named make_resolv_conf in
/etc/dhclient-enter-hooks, or specifying a modified version of dhclient-
script with doesn't touch resolv.conf in dhclient.conf, and so on).

#2 Updated by tuxillo 10 months ago

  • Tracker changed from Bug to Submit
  • Description updated (diff)
  • Category set to Other
  • Assignee deleted (0)
  • Target version set to 3.8.0

Hi,

So any opinion on this one?

Btw, moving it to to submit.

Cheers,
Antonio Huete

#3 Updated by tuxillo 9 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF