123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- diff --git a/UpdateRootfs.sh.in b/UpdateRootfs.sh.in
- index af10b8a..19bece2 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
- @@ -390,6 +405,14 @@ else
- fi
- fi
-
- +if [ "$XRES" == "416" -a "$YRES" == "1280" ]; then
- +if [ "$BASEBOARD" == "DISPLAY002_784" ]; then
- + echo "4.7 x 7.5 Inch long Display 2"
- + sh /root/Display2To_784inch_rs485.sh
- + DONE=1
- +fi
- +fi
- +
- if [ "$DONE" == "0" ]; then
- echo "Unknown Display Resolution"
- fi
- @@ -404,6 +427,7 @@ echo "restart system !!!"
- sleep 2
- #-----------------
- reboot
- +exit 0
- fi
- fi
- #====================== DoRealUpdate ==== Ende =====
- @@ -641,7 +665,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 +732,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 \\
- @@ -727,6 +765,7 @@ iface lo inet loopback
- EOF
- ) > \$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
-
- @@ -744,6 +783,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
- @@ -794,7 +848,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 +893,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
- @@ -924,6 +984,14 @@ else
- fi
- fi
-
- +if [ "\$XRES" == "416" -a "\$YRES" == "1280" ]; then
- +if [ "\$BASEBOARD" == "DISPLAY002_784" ]; then
- + echo "15 Inch Display 2"
- + cp \$EMMC_BOOTPATH/Display002_784_rs485.dtb \$EMMC_BOOTPATH/Display001.dtb
- + DONE=1
- +fi
- +fi
- +
- if [ "\$DONE" == "0" ]; then
- echo "Unknown Display Resolution"
- fi
- @@ -941,17 +1009,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
|