Patch for update scripts 37/164437/2 submit/sr/20171221.092955 submit/tizen_4.0/20171221.093123
authorSunmin Lee <sunm.lee@samsung.com>
Thu, 9 Nov 2017 12:04:58 +0000 (21:04 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Tue, 19 Dec 2017 06:22:04 +0000 (15:22 +0900)
- Make part_tbl based on lowercase
- Use the same path for update (/opt/data/update)
- Change error code
- Remove delta after update succeeds

Change-Id: I7e4a193b184f7a00119f88c6add9848185c88014
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
packaging/initrd-fota.spec
scripts/fota-init.sh
scripts/fus_rw-init.sh

index 3f4a139f0ae86a1cfeaed225e83ff197f711f800..26e1c695cb682d9eb16550de8b9371ea53e63a16 100755 (executable)
@@ -30,8 +30,7 @@ package for building partition image for RAMDISK2 (ramdisk-recovery.img)
 
 %define init_script_dir %{_libdir}/initrd-recovery/fota
 
-mkdir -p %{buildroot}/opt/data/recovery
-mkdir -p %{buildroot}/opt/usr/data/recovery
+mkdir -p %{buildroot}/opt/data/update
 
 mkdir -p %{buildroot}%{init_script_dir}
 cp ./scripts/fota-init.sh %{buildroot}%{init_script_dir}/fota-init.sh
@@ -48,5 +47,4 @@ cp ./scripts/40-fota.list %{buildroot}%{_datadir}/initrd-recovery/initrd.list.d
 %license LICENSE
 %attr(700,root,root) %{_libdir}/initrd-recovery/fota/*.sh
 %attr(700,root,root) %{_datadir}/initrd-recovery/initrd.list.d/*.list
-%attr(777,system,system) /opt/data/recovery
-%attr(777,system,system) /opt/usr/data/recovery
+%attr(777,system,system) /opt/data/update
index a8632ab3b911f9b990b2117e45552387c24edd20..7588872953b97e531ce50d081c648f022e812438 100755 (executable)
@@ -6,16 +6,16 @@ WITH_USR_PART=
 
 FAKE_ROOT=/system
 
-UPI_NO_DELTA_ERROR=fdfa
-UPI_NO_UA_ERROR=fdfb
+UPI_NO_DELTA_ERROR=fb15
+UPI_NO_UA_ERROR=fa17
 
-STATUS_DIR=${FAKE_ROOT}/opt/data/recovery
+STATUS_DIR=${FAKE_ROOT}/opt/data/update
 STATUS_FILE=${STATUS_DIR}/RW.STATUS
 DELTA_PATH_FILE=${STATUS_DIR}/DELTA.PATH
 INT_LOG_DIR=${STATUS_DIR}
 INT_LOG_FILE=${INT_LOG_DIR}/fota_internal.log
 
-FOTA_LOG_DIR=/opt/data/fota
+FOTA_LOG_DIR=/opt/data/update
 FOTA_RESULT_DIR=${FOTA_LOG_DIR}
 FOTA_TEMP_DIR=${FOTA_LOG_DIR}
 
@@ -127,7 +127,7 @@ do_create_part_table() {
        PART_LIST=$("$BLKID" -o full | "$GREP" ${EMMC_DEVICE}p |
                        "$SED" -e 's/\/dev\/mmcblk0p//g' -e 's/\ .*LABEL=\"\(.*\).*$/\1/' |
                        "$CUT" -d '"' -f 1 | "$SED" 's/\:/\ /' |
-                       "$TR" '[:lower:]' '[:upper:]' |
+                       "$TR" '[:upper:]' '[:lower:]' |
                        "$SORT" -k 1 -n)
        PART_NUM=$(echo "$PART_LIST" | "$WC" -l)
 
@@ -296,6 +296,9 @@ fota_result=$?
 if [ "$FOTA_GUI_ENABLE" = "1" ]; then
        /usr/bin/fota_gui_test -1
 fi
+if [ "$fota_result" = "0" ]; then
+       /bin/rm -fr ${DELTA_DIR}
+fi
 umount_partitions
 
 if [ "$fota_result" = "0" ]; then
index 4877f4befe9832f7bcd241f3a10438a9efa5a1a3..d3c535d0ac69d2fa4f7e2b1830866965a39ad690 100755 (executable)
@@ -7,7 +7,7 @@ FAKE_ROOT=/system
 SYNC="/bin/sync"
 REBOOT="/sbin/reboot"
 
-INT_LOG_DIR=${FAKE_ROOT}/opt/data/recovery
+INT_LOG_DIR=${FAKE_ROOT}/opt/data/update
 INT_LOG_FILE=${INT_LOG_DIR}/fota_internal.log
 
 CAT="/bin/cat"