-
Notifications
You must be signed in to change notification settings - Fork 26
/
rootfs.sh
executable file
·35 lines (27 loc) · 1.07 KB
/
rootfs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
DIR=$PWD
. "${DIR}/version.sh"
if [ -d ${DIR}/dl ] ; then
mkdir -p "${DIR}/dl"
fi
if [ -d ${DIR}/dl ] ; then
mkdir -p "${DIR}/dl"
fi
if [ -f "${DIR}/dl/${base_rootfs_name}" ] ; then
echo "File downloaded: ${DIR}/dl/${base_rootfs_name}"
#exit 0 ;
else
wget -P "${DIR}/dl" "${link_ubuntu_relese}/${base_rootfs_name}" || { exit 1 ; }
fi
# https://drive.google.com/file/d/1kEco22WrjYhaFoAfxaGbd41blzu6kYSC/view?usp=sharing
fileid="1kEco22WrjYhaFoAfxaGbd41blzu6kYSC"
rootfs_name="ubuntu-22.04-base-stm32mp1-armhf-16-05-2022.tar.gz"
URL="https://docs.google.com/uc?export=download&id=${fileid}"
cd "${DIR}/dl"
if [ -f "${DIR}/dl/${rootfs_name}" ] ; then
echo "File downloaded: ${DIR}/dl/${rootfs_name}"
else
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=${fileid}" -O ${rootfs_name} && rm -rf /tmp/cookies.txt || { cd "${DIR}" ; exit 1 ; }
fi
cd "${DIR}"
exit 0 ;