Reinhard Russinger hace 5 años
padre
commit
581a4aaef0

+ 52 - 0
board/PSG/iot2000/rootfs_overlay/etc/init.d/expandfs.sh

@@ -0,0 +1,52 @@
+#!/bin/sh
+DONE_FILE="/etc/expandfs_done"
+
+LOG_CMD="logger -t expandfs.sh"
+
+if [ -e "${DONE_FILE}" ]; then
+	echo "expandfs allready done ... exit" | ${LOG_CMD}
+	exit 0
+fi
+
+ROOT_DEVICE=$( { findmnt / -o source -n || echo "ERR"; } | sed 's/p\?[0-9]*$//' 2>/dev/null )
+RES=$( echo "${ROOT_DEVICE}" | tail -1 )
+if [ "${RES}" = "ERR" ]; then
+	echo "ERROR: could not find root device." | ${LOG_CMD}
+	exit 1
+fi
+
+CURRENT_TABLE="$( sfdisk -d ${ROOT_DEVICE} || echo ERR )"
+RES=$( echo "${CURRENT_TABLE}" | tail -1 )
+if [ "${RES}" = "ERR" ]; then
+	echo "ERROR: could not read partition table." | ${LOG_CMD}
+	exit 1
+fi
+
+LAST_PART=$( echo "${CURRENT_TABLE}" | awk 'END{print $1}' )
+echo "Resizing "${LAST_PART} | ${LOG_CMD}
+
+RES=$( { echo "${CURRENT_TABLE}" | grep -v last-lba | \
+	sed "\#\(${LAST_PART}\)#s#\(size=\)\s*[0-9]*,##" | \
+	sfdisk --force "${ROOT_DEVICE}"; } 2>&1 || echo "ERR" )
+echo "${RES}" | ${LOG_CMD}
+
+RES=$( echo "${RES}" | tail -1 )
+if [ "${RES}" = "ERR" ]; then
+	echo "ERROR: could not update partition table." | ${LOG_CMD}
+	exit 1
+fi
+
+echo "Informing kernel about new partitioning" | ${LOG_CMD}
+partprobe > /dev/null
+
+echo "Online-Resizing file system" | ${LOG_CMD}
+RES=$( resize2fs ${LAST_PART} 2>&1 || echo "ERR" )
+echo ${RES} | ${LOG_CMD}
+
+RES=$( echo "${RES}" | tail -1 )
+if [ "${RES}" = "ERR" ]; then
+	echo "ERROR: could not resize file system" | ${LOG_CMD}
+	exit 1
+fi
+
+date > $DONE_FILE

+ 3 - 0
board/PSG/iot2000/rootfs_overlay/etc/init.d/rcS

@@ -7,6 +7,9 @@ if [ -c "/dev/ppp" ]
         mknod /dev/ppp c 108 0
 fi
 
+#---- expand rootfs if not done yet
+/etc/init.d/expandfs.sh
+
 # Start all init scripts in /etc/init.d
 # executing them in numerical order.
 #

+ 1 - 1
board/PSG/iot2000/rootfs_overlay/var/psg/Display_GSM.ini

@@ -130,7 +130,7 @@ GNUN=
 GNPW=
 
 [SIEMENS]
-SIEMENS_IP=192.168.100.1
+_SIEMENS_IP=192.168.100.1
 SIEMENS_DBNR=666
 SIEMENS_SLOT=0
 SIEMENS_RACK=0

+ 2 - 0
configs/iot2000_defconfig

@@ -232,7 +232,9 @@ BR2_PACKAGE_TIME=y
 BR2_PACKAGE_HTOP=y
 BR2_PACKAGE_KEYUTILS=y
 BR2_PACKAGE_NUMACTL=y
+BR2_PACKAGE_UTIL_LINUX_BINARIES=y
 BR2_PACKAGE_UTIL_LINUX_LOGGER=y
+BR2_PACKAGE_UTIL_LINUX_PARTX=y
 BR2_PACKAGE_UTIL_LINUX_RFKILL=y
 BR2_PACKAGE_UTIL_LINUX_SETTERM=y
 BR2_PACKAGE_JOE=y