Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/evbarm/liveimage/armimage evbarm: liveimage: use RC_...



details:   https://anonhg.NetBSD.org/src/rev/72f48b68e562
branches:  trunk
changeset: 984805:72f48b68e562
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jul 24 14:00:08 2021 +0000

description:
evbarm: liveimage: use RC_CONF_EXTRA instead of rc.conf.d

diffstat:

 distrib/evbarm/liveimage/armimage/Makefile         |  10 +----
 distrib/evbarm/liveimage/armimage/dhcpcd           |   3 -
 distrib/evbarm/liveimage/armimage/ec2_init         |  31 ------------------
 distrib/evbarm/liveimage/armimage/rc.conf.armimage |  36 ++++++++++++++++++++++
 distrib/evbarm/liveimage/armimage/resize_gpt       |   3 -
 distrib/evbarm/liveimage/armimage/resize_root      |   5 ---
 distrib/evbarm/liveimage/armimage/spec.armimage    |   7 +---
 distrib/evbarm/liveimage/armimage/sshd             |   3 -
 8 files changed, 40 insertions(+), 58 deletions(-)

diffs (143 lines):

diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/Makefile
--- a/distrib/evbarm/liveimage/armimage/Makefile        Sat Jul 24 13:59:28 2021 +0000
+++ b/distrib/evbarm/liveimage/armimage/Makefile        Sat Jul 24 14:00:08 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.1 2021/07/23 21:53:34 jmcneill Exp $
+#      $NetBSD: Makefile,v 1.2 2021/07/24 14:00:08 jmcneill Exp $
 
 LIVEIMGBASE=   NetBSD-${DISTRIBVER}-${MACHINE_ARCH}-live       # gives ${IMGBASE}.img
 
@@ -10,13 +10,9 @@
 FILESDIR!=     cd ${.CURDIR}/../../../utils/embedded/files ; pwd
 
 SPEC_EXTRA=    ${.CURDIR}/spec.armimage
+RC_CONF_EXTRA= ${.CURDIR}/rc.conf.armimage
 IMGFILE_EXTRA=                                                         \
        ${FILESDIR}/ec2_init            etc/rc.d/ec2_init               \
-       ${FILESDIR}/resize_gpt          etc/rc.d/resize_gpt             \
-       ${.CURDIR}/dhcpcd               etc/rc.conf.d/dhcpcd            \
-       ${.CURDIR}/ec2_init             etc/rc.conf.d/ec2_init          \
-       ${.CURDIR}/resize_gpt           etc/rc.conf.d/resize_gpt        \
-       ${.CURDIR}/resize_root          etc/rc.conf.d/resize_root       \
-       ${.CURDIR}/sshd                 etc/rc.conf.d/sshd
+       ${FILESDIR}/resize_gpt          etc/rc.d/resize_gpt
 
 .include "${.CURDIR}/../Makefile.liveimage"
diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/dhcpcd
--- a/distrib/evbarm/liveimage/armimage/dhcpcd  Sat Jul 24 13:59:28 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-# $NetBSD: dhcpcd,v 1.1 2021/07/23 21:53:34 jmcneill Exp $
-
-dhcpcd=YES
diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/ec2_init
--- a/distrib/evbarm/liveimage/armimage/ec2_init        Sat Jul 24 13:59:28 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-# $NetBSD: ec2_init,v 1.1 2021/07/23 21:53:34 jmcneill Exp $
-
-is_ec2() {
-       val=NO
-       # Look for the string "amazon" in one of these sysctl nodes
-       for node in machdep.dmi.system-vendor \
-                   machdep.dmi.system-version \
-                   machdep.dmi.bios-version \
-                   machdep.xen.version ; do
-               if /sbin/sysctl -q $node; then
-                       nodeval="$(/sbin/sysctl -n $node | tr '[A-Z]' '[a-z]')"
-                       case "$nodeval" in
-                       *amazon*)
-                               val=YES
-                               ;;
-                       # OpenStack is not EC2 but it does have a metadata service.
-                       *openstack*)
-                               val=YES
-                               ;;
-                       esac
-               fi
-       done
-       printf $val
-}
-
-# Don't override /etc/rc.conf
-if [ -z "$ec2_init" ]
-then
-       ec2_init=$(is_ec2)
-fi
-
diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/rc.conf.armimage
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/evbarm/liveimage/armimage/rc.conf.armimage        Sat Jul 24 14:00:08 2021 +0000
@@ -0,0 +1,36 @@
+# $NetBSD: rc.conf.armimage,v 1.1 2021/07/24 14:00:08 jmcneill Exp $
+
+is_ec2() {
+       val=NO
+       # Look for the string "amazon" in one of these sysctl nodes
+       for node in machdep.dmi.system-vendor \
+                   machdep.dmi.system-version \
+                   machdep.dmi.bios-version \
+                   machdep.xen.version ; do
+               if /sbin/sysctl -q $node; then
+                       nodeval="$(/sbin/sysctl -n $node | tr '[A-Z]' '[a-z]')"
+                       case "$nodeval" in
+                       *amazon*)
+                               val=YES
+                               ;;
+                       # OpenStack is not EC2 but it does have a metadata service.
+                       *openstack*)
+                               val=YES
+                               ;;
+                       esac
+               fi
+       done
+       printf $val
+}
+
+resize_gpt=YES
+resize_root=YES
+resize_root_flags="-p"
+resize_root_postcmd="/sbin/reboot -n"
+dhcpcd=YES
+sshd=YES
+ec2_init=$(is_ec2)
+
+if checkyesno ec2_init; then
+       dhcpcd_flags="$dhcpcd_flags -w"
+fi
diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/resize_gpt
--- a/distrib/evbarm/liveimage/armimage/resize_gpt      Sat Jul 24 13:59:28 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-# $NetBSD: resize_gpt,v 1.1 2021/07/23 21:53:34 jmcneill Exp $
-
-resize_gpt=YES
diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/resize_root
--- a/distrib/evbarm/liveimage/armimage/resize_root     Sat Jul 24 13:59:28 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-# $NetBSD: resize_root,v 1.1 2021/07/23 21:53:34 jmcneill Exp $
-
-resize_root=YES
-resize_root_flags="-p"
-resize_root_postcmd="/sbin/reboot -n"
diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/spec.armimage
--- a/distrib/evbarm/liveimage/armimage/spec.armimage   Sat Jul 24 13:59:28 2021 +0000
+++ b/distrib/evbarm/liveimage/armimage/spec.armimage   Sat Jul 24 14:00:08 2021 +0000
@@ -1,8 +1,3 @@
-# $NetBSD: spec.armimage,v 1.1 2021/07/23 21:53:34 jmcneill Exp $
-./etc/rc.conf.d/dhcpcd                 type=file mode=0644 uname=root gname=wheel
-./etc/rc.conf.d/ec2_init               type=file mode=0644 uname=root gname=wheel
-./etc/rc.conf.d/resize_gpt             type=file mode=0644 uname=root gname=wheel
-./etc/rc.conf.d/resize_root            type=file mode=0644 uname=root gname=wheel
-./etc/rc.conf.d/sshd                   type=file mode=0644 uname=root gname=wheel
+# $NetBSD: spec.armimage,v 1.2 2021/07/24 14:00:08 jmcneill Exp $
 ./etc/rc.d/ec2_init                    type=file mode=0555 uname=root gname=wheel
 ./etc/rc.d/resize_gpt                  type=file mode=0555 uname=root gname=wheel
diff -r c794dfcc1f67 -r 72f48b68e562 distrib/evbarm/liveimage/armimage/sshd
--- a/distrib/evbarm/liveimage/armimage/sshd    Sat Jul 24 13:59:28 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-# $NetBSD: sshd,v 1.1 2021/07/23 21:53:34 jmcneill Exp $
-
-sshd=YES



Home | Main Index | Thread Index | Old Index