[isar-cip-core 3/4] customizations: add custom modifications for swupdate


Kunijadar Shivanand
 

From: Shivanand Kunijadar <Shivanand.Kunijadar@...>

Add /boot entry at /etc/fstab for /etc/fw_config and also add network
settings for SSH connection

Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@...>
---
recipes-core/customizations/common.inc | 5 ++++-
recipes-core/customizations/files/interfaces | 6 ++++++
recipes-core/images/cip-core-image.bb | 9 +++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
create mode 100644 recipes-core/customizations/files/interfaces

diff --git a/recipes-core/customizations/common.inc b/recipes-core/customizations/common.inc
index 1124ff2..e5f31ca 100644
--- a/recipes-core/customizations/common.inc
+++ b/recipes-core/customizations/common.inc
@@ -17,7 +17,8 @@ SRC_URI = " \
file://postinst \
file://ethernet \
file://99-silent-printk.conf \
- file://99-watchdog.conf"
+ file://99-watchdog.conf \
+ file://interfaces"

WIRELESS_FIRMWARE_PACKAGE ?= ""
INSTALL_WIRELESS_TOOLS ??= "0"
@@ -38,4 +39,6 @@ do_install() {

install -v -d ${D}/etc/systemd/system.conf.d
install -v -m 644 ${WORKDIR}/99-watchdog.conf ${D}/etc/systemd/system.conf.d/
+
+ install -v -m 644 ${WORKDIR}/interfaces ${D}/etc/network/interfaces.d/
}
diff --git a/recipes-core/customizations/files/interfaces b/recipes-core/customizations/files/interfaces
new file mode 100644
index 0000000..be04284
--- /dev/null
+++ b/recipes-core/customizations/files/interfaces
@@ -0,0 +1,6 @@
+auto eth0
+iface eth0 inet static
+ address 192.168.2.2
+ netmask 255.255.255.0
+ network 192.168.2.0
+ broadcast 192.168.2.255
diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb
index 3f8c320..7bf0f22 100644
--- a/recipes-core/images/cip-core-image.bb
+++ b/recipes-core/images/cip-core-image.bb
@@ -18,3 +18,12 @@ IMAGE_INSTALL += "customizations"

CIP_IMAGE_OPTIONS ?= ""
include ${CIP_IMAGE_OPTIONS}
+
+image_configure_fstab_append () {
+ # Add /boot to /etc/fstab for fw_printenv
+ echo "/dev/mmcblk0p1 /boot vfat defaults,nofail 0 0" | sudo tee -a ${IMAGE_ROOTFS}/etc/fstab
+ # remove /var partition
+ sudo sed -i '/LABEL=var/d' ${IMAGE_ROOTFS}/etc/fstab
+ # make /dev/root as read-write
+ sudo sed -i 's/defaults,ro/defaults/' ${IMAGE_ROOTFS}/etc/fstab
+}
--
2.20.1