nrelease - Minor fixes
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Thu, 13 Mar 2014 14:25:24 +0000 (07:25 -0700)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Thu, 13 Mar 2014 14:33:43 +0000 (07:33 -0700)
- 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 <y0netan1@dragonflybsd.org>
DragonFly-bug: <http://bugs.dragonflybsd.org/issues/1496>

This commit closes #1496

nrelease/Makefile

index 9dfd5a1..0bcbbe8 100644 (file)
@@ -204,10 +204,10 @@ buildiso:
        cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
        cd ${.CURDIR}/..; \
        for kernconf in ${KERNCONF}; do \
-               make DESTDIR=${ISOROOT} installkernel KERNCONF=$${kernconf}; \
+               make DESTDIR=${ISOROOT} reinstallkernel KERNCONF=$${kernconf}; \
        done
        rm -rf ${ISOROOT}/boot/kernel.old
-       ln -s kernel ${ISOROOT}/boot/kernel/kernel.BOOTP
+       ln -sf kernel ${ISOROOT}/boot/kernel/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
@@ -265,7 +265,7 @@ customizeiso:
        # Setup some things & mount dports tree.  Use defensive umounts and
        # rm -rf's to allow restarts.  Allow /usr/dports to be read-only.
        #
-       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/distfiles
        -@umount ${ISOROOT}/usr/dports