diff --git a/config/artik10.cfg b/config/artik10.cfg index 8f0613c..a9ebab3 100644 --- a/config/artik10.cfg +++ b/config/artik10.cfg @@ -29,7 +29,7 @@ export EMMC_TZSW_OFFSET=2110 export EMMC_ENV_OFFSET=4159 export RELEASE_VER=artik_os_1.1.0 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/fedora-spin-kickstarts/releases/download/ +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/fedora-spin-kickstarts/releases export ROOTFS_FILE=fedora-arm-artik-rootfs-20160418194834.tar.gz export ROOTFS_FILE_MD5=b7ced636f0dac7953fc75f5e9617dcad export ROOTFS_TAG=release/artik1020/${RELEASE_VER} diff --git a/config/artik305s_ubuntu.cfg b/config/artik305s_ubuntu.cfg index e312d58..ae3ccd0 100644 --- a/config/artik305s_ubuntu.cfg +++ b/config/artik305s_ubuntu.cfg @@ -1,6 +1,8 @@ . config/artik305s.cfg -OFFICIAL_VERSION=A305s_os_3.0.0 -OS_NAME=ubuntu -UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/armhf/artik305s -UBUNTU_PACKAGE_FILE=config/artik305_ubuntu.package +export OFFICIAL_VERSION=A305s_os_3.0.0 +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases +export ROOTFS_FILE_MD5= +export OS_NAME=ubuntu +export UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/armhf/artik305s +export UBUNTU_PACKAGE_FILE=config/artik305_ubuntu.package diff --git a/config/artik530.cfg b/config/artik530.cfg index 061a521..e4c4ad3 100644 --- a/config/artik530.cfg +++ b/config/artik530.cfg @@ -35,7 +35,7 @@ export BLMON_OFFSET=513 export UBOOT_OFFSET=3841 export ENV_OFFSET=5889 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/fedora-spin-kickstarts/releases/download/ +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/fedora-spin-kickstarts/releases export ROOTFS_FILE=fedora-arm-artik530-rootfs-0530GC0F-44F-01Q5-20170710.170216-4c0d561a2c008d8ff08a6865fc505df8.tar.gz export ROOTFS_FILE_MD5=4c0d561a2c008d8ff08a6865fc505df8 export ROOTFS_TAG=release/${OFFICIAL_VERSION} diff --git a/config/artik530_ubuntu.cfg b/config/artik530_ubuntu.cfg index eb1a7c7..d28a433 100644 --- a/config/artik530_ubuntu.cfg +++ b/config/artik530_ubuntu.cfg @@ -1,10 +1,9 @@ . config/artik530.cfg export OFFICIAL_VERSION=A530_os_3.0.0 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases/download/ -export ROOTFS_FILE=ubuntu-arm-artik530-rootfs-0530GC0F-44U-01Q1-20170824.170641-ea9a114094c13d516370fb6e3bb0412e.tar.gz -export ROOTFS_FILE_MD5=ea9a114094c13d516370fb6e3bb0412e -export ROOTFS_TAG=release/${OFFICIAL_VERSION} +export PREVIOUS_VERSION=A530_os_3.0.0 +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases +export ROOTFS_FILE_MD5= export OS_NAME=ubuntu export UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/armhf/artik530 export UBUNTU_PACKAGE_FILE=config/artik530_ubuntu.package diff --git a/config/artik530s_ubuntu.cfg b/config/artik530s_ubuntu.cfg index d0c345e..7bf13fc 100644 --- a/config/artik530s_ubuntu.cfg +++ b/config/artik530s_ubuntu.cfg @@ -1,11 +1,9 @@ . config/artik530s.cfg export OFFICIAL_VERSION=A530s_os_3.2.0 -export OS_NAME=ubuntu -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases/download/ -export ROOTFS_FILE=ubuntu-arm-artik530s-rootfs-0530GS0F-44U-01Q3-20180316.154231-8c8d75175e3098c14f730e18da7ada36.tar.gz -export ROOTFS_FILE_MD5=8c8d75175e3098c14f730e18da7ada36 -export ROOTFS_TAG=release/A530s_os_3.2.0 +export PREVIOUS_VERSION=A530s_os_3.0.0 +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases +export ROOTFS_FILE_MD5= export OS_NAME=ubuntu export UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/armhf/artik530s export UBUNTU_PACKAGE_FILE=config/artik530_ubuntu.package diff --git a/config/artik533s_ubuntu.cfg b/config/artik533s_ubuntu.cfg index 2d9bcf6..65dce3f 100644 --- a/config/artik533s_ubuntu.cfg +++ b/config/artik533s_ubuntu.cfg @@ -1,10 +1,9 @@ . config/artik533s.cfg export OFFICIAL_VERSION=A533s_os_3.2.0 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases/download/ -export ROOTFS_FILE=ubuntu-arm-artik533s-rootfs-0533GS0F-44U-01Q5-20180212.183723-6f2026df609b3db536805b7ac3175fa1.tar.gz -export ROOTFS_FILE_MD5=6f2026df609b3db536805b7ac3175fa1 -export ROOTFS_TAG=release/A533s_os_3.2.0 +export PREVIOUS_VERSION=A533s_os_3.2.0 +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases +export ROOTFS_FILE_MD5= export OS_NAME=ubuntu export UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/armhf/artik533s export UBUNTU_PACKAGE_FILE=config/artik530_ubuntu.package diff --git a/config/artik710.cfg b/config/artik710.cfg index 262b66e..5570cf5 100644 --- a/config/artik710.cfg +++ b/config/artik710.cfg @@ -34,7 +34,7 @@ export TZSW_OFFSET=769 export UBOOT_OFFSET=3841 export ENV_OFFSET=5889 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/fedora-spin-kickstarts/releases/download/ +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/fedora-spin-kickstarts/releases export ROOTFS_FILE=fedora-arm-artik710-rootfs-0710GC0F-44F-01QC-20170713.175433-f63a17cbfdaffd3385f23ea12388999a.tar.gz export ROOTFS_FILE_MD5=f63a17cbfdaffd3385f23ea12388999a export ROOTFS_TAG=release/${OFFICIAL_VERSION} diff --git a/config/artik710_ubuntu.cfg b/config/artik710_ubuntu.cfg index 2118bd8..52d1235 100644 --- a/config/artik710_ubuntu.cfg +++ b/config/artik710_ubuntu.cfg @@ -1,10 +1,9 @@ . config/artik710.cfg export OFFICIAL_VERSION=A710_os_3.1.0 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases/download/ -export ROOTFS_FILE=ubuntu-arm-artik710-rootfs-0710GC0F-44U-01Q3-20171113.171659-d159d7ed4107f1a6124c7937c24327aa.tar.gz -export ROOTFS_FILE_MD5=d159d7ed4107f1a6124c7937c24327aa -export ROOTFS_TAG=release/A710_os_3.1.0 +export PREVIOUS_VERSION=A710_os_3.0.0 +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases +export ROOTFS_FILE_MD5= export OS_NAME=ubuntu export UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/arm64/artik710 export UBUNTU_PACKAGE_FILE=config/artik710_ubuntu.package diff --git a/config/artik710s_ubuntu.cfg b/config/artik710s_ubuntu.cfg index 8f431cc..f215e0e 100644 --- a/config/artik710s_ubuntu.cfg +++ b/config/artik710s_ubuntu.cfg @@ -1,10 +1,9 @@ . config/artik710s.cfg export OFFICIAL_VERSION=A710s_os_3.2.0 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases/download/ -export ROOTFS_FILE=ubuntu-arm-artik710s-rootfs-0710GS0F-44U-01Q5-20180316.154247-d0167e72641c6ce87504e8922a763b91.tar.gz -export ROOTFS_FILE_MD5=d0167e72641c6ce87504e8922a763b91 -export ROOTFS_TAG=release/A710s_os_3.2.0 +export PREVIOUS_VERSION=A710s_os_3.0.0 +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases +export ROOTFS_FILE_MD5= export OS_NAME=ubuntu export UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/arm64/artik710s export UBUNTU_PACKAGE_FILE=config/artik710_ubuntu.package diff --git a/config/artik711s_ubuntu.cfg b/config/artik711s_ubuntu.cfg index 9a8f019..b7097a9 100644 --- a/config/artik711s_ubuntu.cfg +++ b/config/artik711s_ubuntu.cfg @@ -1,10 +1,9 @@ . config/artik711s.cfg export OFFICIAL_VERSION=A711s_os_3.2.0 -export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases/download/ -export ROOTFS_FILE=ubuntu-arm-artik710s-rootfs-0710GS0F-44U-01Q1-20171020.132455-8432425c4f2343159225752b10e4f4fc.tar.gz -export ROOTFS_FILE_MD5=8432425c4f2343159225752b10e4f4fc -export ROOTFS_TAG=release/A710s_os_3.0.0 +export PREVIOUS_VERSION=A711s_os_3.2.0 +export ROOTFS_BASE_URL=https://github.com/SamsungARTIK/ubuntu-build-service/releases +export ROOTFS_FILE_MD5= export OS_NAME=ubuntu export UBUNTU_MODULE_DEB_DIR=$ARTIK_BUILD_DIR/../ubuntu-build-service/prebuilt/arm64/artik710s export UBUNTU_PACKAGE_FILE=config/artik710_ubuntu.package diff --git a/release_rootfs.sh b/release_rootfs.sh index 30a74c8..58df351 100755 --- a/release_rootfs.sh +++ b/release_rootfs.sh @@ -19,12 +19,29 @@ urlencode() { done } -ROOTFS_TAG=$(urlencode "$ROOTFS_TAG") -ROOTFS_FILE=$(urlencode "$ROOTFS_FILE") +retrieve_rootfs_fileinfo() +{ + ROOTFS_TAG=$(urlencode release/${OFFICIAL_VERSION}) + ROOTFS_FILE=`curl -s ${ROOTFS_BASE_URL}/tag/${ROOTFS_TAG} | grep -e ".*download/${ROOTFS_TAG}" | sed -e 's|.*download\/.*\/\([^\"]*\).*$|\1|'` + # Try to find a rootfs tarball from previous version + if [ "$ROOTFS_FILE" == "" ]; then + ROOTFS_TAG=$(urlencode release/${PREVIOUS_VERSION}) + ROOTFS_FILE=`curl -s ${ROOTFS_BASE_URL}/tag/${ROOTFS_TAG} | grep -e ".*download/${ROOTFS_TAG}" | sed -e 's|.*download\/.*\/\([^\"]*\).*$|\1|'` + fi + if [ "$ROOTFS_FILE" == "" ]; then + echo "Cannot find root filesystem tarball" + exit 1 + fi + ROOTFS_FILE_MD5=$(echo $ROOTFS_FILE | sed -e 's/.*[0-9][0-9][0-9][0-9][0-9][0-9]-\([^\.]*\).*/\1/') +} + +if [ "$ROOTFS_FILE_MD5" == "" ]; then + retrieve_rootfs_fileinfo +fi if [ ! -f $PREBUILT_DIR/$ROOTFS_FILE ]; then echo "Not found rootfs. Download it" - wget ${ROOTFS_BASE_URL}/${ROOTFS_TAG}/${ROOTFS_FILE} -O $PREBUILT_DIR/$ROOTFS_FILE + wget ${ROOTFS_BASE_URL}/download/${ROOTFS_TAG}/${ROOTFS_FILE} -O $PREBUILT_DIR/$ROOTFS_FILE fi while : @@ -35,7 +52,7 @@ do fi echo "Mismatch MD5 hash. Just download again" - wget ${ROOTFS_BASE_URL}/${ROOTFS_TAG}/${ROOTFS_FILE} -O $PREBUILT_DIR/$ROOTFS_FILE + wget ${ROOTFS_BASE_URL}/download/${ROOTFS_TAG}/${ROOTFS_FILE} -O $PREBUILT_DIR/$ROOTFS_FILE CHECK_COUNT=$((CHECK_COUNT + 1))