ソースを参照

Build 969 1st

Reinhard Russinger 3 年 前
コミット
54b70a43a0

+ 1 - 1
board/GfA/Display001/BUILD

@@ -1 +1 @@
-695
+696

+ 1 - 1
board/GfA/Display001/post-build_4.4.sh

@@ -6,7 +6,7 @@ echo ">>>$TARGETDIR<<<"
 
 BUILD=`cat ../GfA/board/GfA/Display001/BUILD`
 BUILDDATE=`date +"%Y-%m-%d %H:%M"`
-BUILD=$((BUILD+1))
+# BUILD=$((BUILD+1))
 echo $BUILD > ../GfA/board/GfA/Display001/BUILD
 
 chmod 600  ../GfA/board/GfA/Display001/rootfs/root/.ssh/id*

+ 11 - 0
board/GfA/Display001/rootfs/etc/network/if-post-down.d/gfa-dns

@@ -0,0 +1,11 @@
+#!/bin/bash
+WRKPATH=/etc/network
+DESTFILE=/etc/resolv.conf
+
+readarray -t DNSSERVERS < <(/usr/bin/awk -f $WRKPATH/readInterfaces.awk $WRKPATH/interfaces device=$IFACE output=dns-nameservers)
+for a in "${DNSSERVERS[@]}"; do
+    if [[ ! -z $(/bin/grep "$a" "$DESTFILE") ]]; then
+        /bin/sed --follow-symlinks -i "/$a/d" $DESTFILE
+    fi
+done    
+

+ 13 - 0
board/GfA/Display001/rootfs/etc/network/if-up.d/gfa-dns

@@ -0,0 +1,13 @@
+#!/bin/bash
+WRKPATH=/etc/network
+DESTFILE=/etc/resolv.conf
+
+readarray -t DNSSERVERS < <(/usr/bin/awk -f $WRKPATH/readInterfaces.awk $WRKPATH/interfaces device=$IFACE output=dns-nameservers)
+
+for DNS in "${DNSSERVERS[@]}"; do
+    if [[ -z $(/bin/grep "$DNS" "$DESTFILE") ]]; then
+#        /bin/sed --follow-symlinks -i "1 s/^/$a\n/" $DESTFILE
+        echo "$DNS" >> $DESTFILE
+    fi         
+done    
+

+ 1 - 1
board/GfA/Display001/rootfs/etc/network/interfaces

@@ -7,7 +7,7 @@ iface eth0 inet static
 	address 192.168.0.125
 	netmask 255.255.255.0
 	gateway 192.168.0.10
-	post-up echo "nameserver 192.168.0.10" > /etc/resolv.conf
+	dns-nameservers 192.168.0.10
 
 iface eth1 inet dhcp
 #---

+ 113 - 0
board/GfA/Display001/rootfs/etc/network/readInterfaces.awk

@@ -0,0 +1,113 @@
+BEGIN {
+
+    start = 0;
+
+    if (ARGC < 3 || ARGC > 5) {
+        print "awk -f readInterfaces.awk <interfaces file> device=<eth device> [output=all|dns-nameservers] [debug=1]"
+        exit 1;
+    }
+
+    outAll = 0
+    outDNSNameservers = 0 
+
+    for (i = 2; i < ARGC; i++) {
+        split(ARGV[i], arg, "=");
+        if (arg[1] == "device")
+            device = arg[2];
+        else if (arg[1] == "output" && arg[2] == "all")
+            outAll = 1;
+        else if (arg[1] == "output" && arg[2] == "dns-nameservers")
+            outDNSNameservers = 1;
+        else if (arg[1] == "debug" && arg[2] == "1")
+            debug = 1;
+    }
+
+    if (!length(device)) {
+        print "awk -f readInterfaces.awk <interfaces file> device=<eth device> [output=all|dns-nameservers] [debug=1]"
+        exit 1;
+    }
+}
+
+{
+    # Look for iface line and if the interface comes with the device name
+    # scan whether it is dhcp or static or manual
+    # e.g. iface eth0 inet [static | dhcp | manual]
+    if ($1 == "iface")  {
+        # Ethernet name matches - switch the line scanning on
+        if ($2 == device) {
+            if (debug)
+                print $0;
+            # It's a DHCP interface
+            if (match($0, / dhcp/)) {
+                print "dhcp";
+                gotTypeNoAddr = 1;
+                exit 0;
+                # It's a static network interface. We want to scan the
+                # addresses after the static line
+            }
+            else if (match ($0, / static/)) {
+                static = 1;
+                next;
+            }
+            else if (match ($0, / manual/)) {
+                print "manual";
+                gotTypeNoAddr = 1;
+                exit 0;
+            }
+            # If it is other inteface line, switch it off
+            # Go to the next line
+        }
+        else {
+            static = 0;
+            next;
+        }
+    }
+    else if ($1 == "auto") {
+        static = 0;
+        next;
+    }
+
+    # At here, it means we are after the iface static line of
+    # after the device we are searching for
+    # Scan for the static content
+    if (static) {
+        # 2nd field to end of the line
+        if (length($1)) {
+            interface[$1] = interface[$1] " " substr($0, index($0, $2));
+            gotAddr = 1;
+        }
+    }
+}
+
+END {
+    if (gotAddr) {
+        if(!outDNSNameservers)
+            printf("%s %s %s\n", interface["address"], interface["netmask"], interface["gateway"]);
+        if (outAll) {
+            delete interface["address"];
+            delete interface["netmask"];
+            delete interface["gateway"];
+            for (field in interface) {
+                printf("%s %s\n", field, interface[field]);
+            }
+        }
+
+        if (outDNSNameservers) {
+            for (field in interface) {
+                if (field == "dns-nameservers") {
+                    split(interface[field], dnsnames);
+                    for (dns in dnsnames) {
+                        printf("nameserver %s\n", dnsnames[dns]);
+                        }
+                    }
+            }
+        }        
+        exit 0;
+    }
+    else {
+        if (gotTypeNoAddr)
+            exit 0;
+        else
+            exit 1;
+    }
+}

+ 16 - 0
board/GfA/Display001/rootfs/etc/ppp/ip-down.d/gfa_dns

@@ -0,0 +1,16 @@
+#!/bin/bash
+WRKPATH=/etc/ppp
+DESTFILE=/etc/resolv.conf
+
+if [ -e "$WRKPATH/resolv.conf" ]; then
+
+    readarray -t DNSSERVERS < <(cat $WRKPATH/resolv.conf)
+
+    for DNS in "${DNSSERVERS[@]}"; do
+        if [[ ! -z $(/bin/grep "$DNS" "$DESTFILE") ]]; then
+            /bin/sed --follow-symlinks -i "/$DNS/d" $DESTFILE
+        fi
+    done
+
+    rm $WRKPATH/resolv.conf
+fi    

+ 15 - 0
board/GfA/Display001/rootfs/etc/ppp/ip-up.d/gfa_dns

@@ -0,0 +1,15 @@
+#!/bin/bash
+WRKPATH=/etc/ppp
+DESTFILE=/etc/resolv.conf
+
+if [ -e "$WRKPATH/resolv.conf" ]; then
+
+    readarray -t DNSSERVERS < <(cat $WRKPATH/resolv.conf)
+
+    for DNS in "${DNSSERVERS[@]}"; do
+        if [[ -z $(/bin/grep "$DNS" "$DESTFILE") ]]; then
+            /bin/sed --follow-symlinks -i "1 s/^/$DNS\n/" $DESTFILE
+    #        echo "$DNS" #>> $DESTFILE
+        fi
+    done
+fi    

+ 1 - 1
configs/Display001_4.4.145_bone23_Qt5.7_defconfig

@@ -2,7 +2,7 @@ BR2_arm=y
 BR2_cortex_a8=y
 BR2_ARM_INSTRUCTIONS_THUMB2=y
 BR2_DL_DIR="~/buildroot_dl"
-BR2_HOST_DIR="/opt/GfA/TC_L44104_C493_QT57"
+BR2_HOST_DIR="/opt/GfA/TC_L44104_C493_QT57_V02"
 # BR2_COMPILER_PARANOID_UNSAFE_PATH is not set
 BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
 BR2_KERNEL_HEADERS_4_4=y

+ 1 - 1
package/gfaservices/gfaservices.mk

@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GFASERVICES_VERSION = 2021.10.28
+GFASERVICES_VERSION = 2022.04.07
 GFASERVICES_SITE = https://gogs.reru.org/GfA/libgfaservices.git
 GFASERVICES_SITE_METHOD = git
 GFASERVICES_DEPENDENCIES = qt5base libulfius

+ 1 - 1
package/gfaservicesdebug/gfaservicesdebug.mk

@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GFASERVICESDEBUG_VERSION = 2021.10.28
+GFASERVICESDEBUG_VERSION = 2022.04.07
 GFASERVICESDEBUG_SITE = https://gogs.reru.org/GfA/libgfaservices.git
 GFASERVICESDEBUG_SITE_METHOD = git
 GFASERVICESDEBUG_DEPENDENCIES = qt5base libulfius

+ 103 - 0
patches/0113-UpdateRootfs_pre_post_custom_path.patch

@@ -0,0 +1,103 @@
+diff --git a/UpdateRootfs.sh.in b/UpdateRootfs.sh.in
+index af10b8a..26a41b3 100644
+--- a/UpdateRootfs.sh.in
++++ b/UpdateRootfs.sh.in
+@@ -641,7 +641,13 @@ cat << XEOF
+ 
+ CALLDIR=\`pwd\`
+ WRKDIR=/opt/GfA/SDUpdateTool
+-  
++
++if [ -z "\$1" ]; then
++    CUSTOM_ROOT=\$WRKDIR/custom_root
++else
++    CUSTOM_ROOT=\$WRKDIR/\$1
++fi  
++
+ DESTDEV="/dev/mmcblk1"
+ 
+ EMMC_BOOTPATH="/tmp/EMMCBOOT"
+@@ -702,6 +708,14 @@ then
+         rm \$GFA_PREFIX/etc/wpa_supplicant/wpa_supplicant.conf
+ fi
+ 
++#=== execute custom_pre script =====
++GFA_NEWROOTFS=\$WRKDIR/_BootRoot
++if [ -x "\$WRKDIR/custom_pre.sh" ]; then
++  SAVEDIR=\`pwd\`
++  \$WRKDIR/custom_pre.sh \$EMMC_ROOTPATH \$GFA_NEWROOTFS
++  cd \$SAVEDIR
++fi
++
+ #=== copy ROOTFS
+ cd \$WRKDIR/_BootRoot
+ rsync -avR --exclude=/_GfABoot \\
+@@ -794,7 +808,7 @@ then
+         sed -i 's/TSYNCCMD=rdate time.memod.de/TSYNCCMD=\/etc\/init.d\/S99rtc_GfA set/' \$GFA_PREFIX/var/GfA/Display_GSM.ini
+ fi
+ #================================
+-#--create mountable run folder insted of link
++#--create mountable run folder instead of link
+ RUNDIR=\$GFA_PREFIX/run
+ if [ -L \$RUNDIR ]; then
+   mv \$RUNDIR \$RUNDIR'_WRK'
+@@ -839,12 +853,18 @@ chown -Rv \${UID_PG}:\${GID_PG} \$GFA_PREFIX/var/lib/pgsql
+ 
+ chmod 700 \$GFA_PREFIX/root/.ssh
+ #===== copy custom_root files if folder exists
+-if [ -d "\$WRKDIR/custom_root" ]; then
+-  cd \$WRKDIR/custom_root
++if [ -d "\$CUSTOM_ROOT" ]; then
++  cd \$CUSTOM_ROOT
+   rsync -avR  \\
+    ./ \$EMMC_ROOTPATH/
+ fi
+ #==============================================================================
++#=== execute custom_post script =====
++if [ -x "\$WRKDIR/custom_post.sh" ]; then
++  SAVEDIR=\`pwd\`
++  \$WRKDIR/custom_post.sh \$EMMC_ROOTPATH \$GFA_NEWROOTFS
++  cd \$SAVEDIR
++fi
+ #=== copy BOOTFS
+ rm -rf \$EMMC_BOOTPATH/*
+ cd \$WRKDIR/_BootRoot/_GfABoot
+@@ -941,17 +961,25 @@ fi
+ #===== MakeSDUpdateTool === End
+ 
+ #====== HELP on unknown Command =======
+-echo -e "Unknown Command :: $1"
+-echo -e "Usage: $0 \e[32m[Command]\e[0m"
+-echo -e "\t without command ... update to new system"
+-echo -e "\t \e[32mMakeBootableSD\e[0m ... create bootable SD card with factory defaults"
+-echo -e "\t \e[32mMakeBootableEMMC\e[0m ... create bootable EMMC with factory defaults"
+-echo -e "\t \e[32mMakeSDUpdateTool\e[0m ... create Folders and scripts for"
+-echo -e "\t\t updating system from SD Card in /opt/GfA/SDUpdateTool"
+-echo -e "\t\t To Do UpdateEMMC:"
+-echo -e "\t\t\t cd /opt/GfA/SDUpdateTool"
+-echo -e "\t\t\t ./UpdateEMMC.sh"
+-echo -e "\t\t\t if folder /opt/GfASDupdateTool/custom_root exists"
+-echo -e "\t\t\t whole tree will be copied to root filesystem as is"
+-
++if [ $# > 1 ]; then
++  echo -e "Unknown Command :: $1"
++  echo -e "Usage: $0 \e[32m[Command]\e[0m"
++  echo -e "\t without command ... update to new system"
++  echo -e "\t \e[32mMakeBootableSD\e[0m ... create bootable SD card with factory defaults"
++  echo -e "\t \e[32mMakeBootableEMMC\e[0m ... create bootable EMMC with factory defaults"
++  echo -e "\t \e[32mMakeSDUpdateTool\e[0m ... create Folders and scripts for"
++  echo -e "\t\t updating system from SD Card in /opt/GfA/SDUpdateTool"
++  echo -e "\t\t To Do UpdateEMMC:"
++  echo -e "\t\t\t cd /opt/GfA/SDUpdateTool"
++  echo -e "\t\t\t ./UpdateEMMC.sh [custom_root_path relative to /opt/GfA/SDUpdateTool]"
++  echo -e "\t\t\t 	default ... custom_root"
++  echo -e "\t\t\t if folder /opt/GfASDupdateTool/custom_root exists"
++  echo -e "\t\t\t whole tree will be copied to root filesystem as is"
++  echo -e "\t\t\t if script (+x) /opt/GfASDupdateTool/custom_pre.sh exists"
++  echo -e "\t\t\t script will be called with parameters \$1=PATH_TO_EXISTING_ROOTFS \$2=PATH_TO_NEW_ROOTFS"
++  echo -e "\t\t\t before copy to EMMC starts"
++  echo -e "\t\t\t if script (+x) /opt/GfASDupdateTool/custom_post. exists"
++  echo -e "\t\t\t script will be called with parameters \$1=PATH_TO_EXISTING_ROOTFS \$2=PATH_TO_NEW_ROOTFS"
++  echo -e "\t\t\t after copy to EMMC is finished"
++fi
+ exit 0

+ 19 - 0
patches/0114-PPPD-resolve-conf-in-etc-ppp.patch

@@ -0,0 +1,19 @@
+diff --git a/package/pppd/0001-resolv_conf_in_etc_ppp.patch b/package/pppd/0001-resolv_conf_in_etc_ppp.patch
+new file mode 100644
+index 0000000..6373c0d
+--- /dev/null
++++ b/package/pppd/0001-resolv_conf_in_etc_ppp.patch
+@@ -0,0 +1,13 @@
++diff --git a/pppd/pathnames.h b/pppd/pathnames.h
++index b0a1cd9..a33f046 100644
++--- a/pppd/pathnames.h
+++++ b/pppd/pathnames.h
++@@ -30,7 +30,7 @@
++ #define _PATH_TTYOPT	 _ROOT_PATH "/etc/ppp/options."
++ #define _PATH_CONNERRS	 _ROOT_PATH "/etc/ppp/connect-errors"
++ #define _PATH_PEERFILES	 _ROOT_PATH "/etc/ppp/peers/"
++-#define _PATH_RESOLV	 _ROOT_PATH "/etc/resolv.conf"
+++#define _PATH_RESOLV	 _ROOT_PATH "/etc/ppp/resolv.conf"
++ 
++ #define _PATH_USEROPT	 ".ppprc"
++ #define	_PATH_PSEUDONYM	 ".ppp_pseudonym"

+ 48 - 0
patches/0115-UpdateScript-fixes.patch

@@ -0,0 +1,48 @@
+diff --git a/UpdateRootfs.sh.in b/UpdateRootfs.sh.in
+index 26a41b3..212ef68 100644
+--- a/UpdateRootfs.sh.in
++++ b/UpdateRootfs.sh.in
+@@ -218,6 +218,21 @@ iface wlan0 inet dhcp
+ EOF
+ ) >> $GFA_PREFIX/etc/network/interfaces
+ 
++FIXINTERFACES=$(
++cat $GFA_PREFIX/etc/network/interfaces |
++awk '
++{
++# remove old version of resolv.conf filling
++if( ($1 == "post-up") && ($2 == "echo") && ($3 == "\"nameserver")) {
++    printf("\tdns-nameservers %s\n", substr($4,1,length($4) - 1));
++        } else {
++        printf("%s\n", $0);
++    }
++
++}'
++)
++echo  "$FIXINTERFACES" > $GFA_PREFIX/etc/network/interfaces
++
+ if [ -e $GFA_PREFIX/etc/init.d/S98usb_g_ether ]
+ then
+ 	cp $GFA_PREFIX/etc/init.d/S98usb_g_ether $GFA_PREFIX/etc/init.d/M98usb_g_ether
+@@ -741,6 +756,21 @@ iface lo inet loopback
+ EOF
+ ) > \$GFA_PREFIX/etc/network/interfaces
+ 
++FIXINTERFACES=\$(
++cat \$GFA_PREFIX/etc/network/interfaces |
++awk '
++{
++# remove old version of resolv.conf filling
++if( (\$1 == "post-up") && (\$2 == "echo") && (\$3 == "\"nameserver")) {
++    printf("\tdns-nameservers %s\n", substr(\$4,1,length(\$4) - 1));
++        } else {
++        printf("%s\n", \$0);
++    }
++
++}'
++)
++echo  "\$FIXINTERFACES" > \$GFA_PREFIX/etc/network/interfaces
++
+ awk -v par=\$INTERFACE '/^iface/ && \$2==par {f=1}/^iface/ && \$2!=par {f=0}f && !/^\s*#/d && !/^\s*\$/d  {print \$0 }' \$TMP_PATH/bu_cfg/interfaces \\
+ >> \$GFA_PREFIX/etc/network/interfaces
+   

+ 47 - 0
patches/0116-UpdateScript-fixes_2.patch

@@ -0,0 +1,47 @@
+diff --git a/UpdateRootfs.sh.in b/UpdateRootfs.sh.in
+index 212ef68..da6b7ea 100644
+--- a/UpdateRootfs.sh.in
++++ b/UpdateRootfs.sh.in
+@@ -756,20 +756,6 @@ iface lo inet loopback
+ EOF
+ ) > \$GFA_PREFIX/etc/network/interfaces
+ 
+-FIXINTERFACES=\$(
+-cat \$GFA_PREFIX/etc/network/interfaces |
+-awk '
+-{
+-# remove old version of resolv.conf filling
+-if( (\$1 == "post-up") && (\$2 == "echo") && (\$3 == "\"nameserver")) {
+-    printf("\tdns-nameservers %s\n", substr(\$4,1,length(\$4) - 1));
+-        } else {
+-        printf("%s\n", \$0);
+-    }
+-
+-}'
+-)
+-echo  "\$FIXINTERFACES" > \$GFA_PREFIX/etc/network/interfaces
+ 
+ awk -v par=\$INTERFACE '/^iface/ && \$2==par {f=1}/^iface/ && \$2!=par {f=0}f && !/^\s*#/d && !/^\s*\$/d  {print \$0 }' \$TMP_PATH/bu_cfg/interfaces \\
+ >> \$GFA_PREFIX/etc/network/interfaces
+@@ -788,6 +774,21 @@ iface wlan0 inet dhcp
+ EOF
+ ) >> \$GFA_PREFIX/etc/network/interfaces
+ 
++FIXINTERFACES=\$(
++cat \$GFA_PREFIX/etc/network/interfaces |
++awk '
++{
++# remove old version of resolv.conf filling
++if( (\$1 == "post-up") && (\$2 == "echo") && (\$3 == "\"nameserver")) {
++    printf("\tdns-nameservers %s\n", substr(\$4,1,length(\$4) - 1));
++        } else {
++        printf("%s\n", \$0);
++    }
++
++}'
++)
++echo  "\$FIXINTERFACES" > \$GFA_PREFIX/etc/network/interfaces
++
+ if [ -e \$GFA_PREFIX/etc/init.d/S98usb_g_ether ]
+ then
+         cp \$GFA_PREFIX/etc/init.d/S98usb_g_ether \$GFA_PREFIX/etc/init.d/M98usb_g_ether