-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdoitall
More file actions
executable file
·63 lines (62 loc) · 2.81 KB
/
Copy pathdoitall
File metadata and controls
executable file
·63 lines (62 loc) · 2.81 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#----------------------------------------------------------------------------#
set -e
export SRC_TREE_ROOT=`pwd`
if [ ! -e ${SRC_TREE_ROOT}/cloonix/cloonix_config ]; then
echo NOT FOUND:
echo ${SRC_TREE_ROOT}/cloonix/cloonix_config
exit 1
fi
VERSION_NUM=$(cat ${SRC_TREE_ROOT}/cloonix/cloonix_config | grep CLOONIX_VERSION)
VERSION_NUM=${VERSION_NUM#*=}
VERSION_NUM=${VERSION_NUM%-*}
BUNDLE="${HOME}/cloonix_bundle"
RESBUNDLE="${HOME}/cloonix-bundle-${VERSION_NUM}"
TARGZ_STORE="${BUNDLE}/targz_store"
#----------------------------------------------------------------------------#
printf "\n\nCREATE BUNDLE VERSION ${VERSION_NUM}\n\n"
#----------------------------------------------------------------------------#
./allclean
#----------------------------------------------------------------------------#
mkdir -p ${BUNDLE}/cloonfs/bin
mkdir -p ${RESBUNDLE}
mkdir -p ${TARGZ_STORE}
#----------------------------------------------------------------------------#
cp -r ${SRC_TREE_ROOT}/targz_store/* ${TARGZ_STORE}
cp -r ${SRC_TREE_ROOT}/cloonix ${BUNDLE}
cp ${SRC_TREE_ROOT}/build_tools/install_cloonfs ${BUNDLE}
cp ${SRC_TREE_ROOT}/build_tools/toolbox/fill_common.c ${BUNDLE}
tar --directory=${BUNDLE} -xf ${TARGZ_STORE}/patchelf_*.tar.gz
mv ${BUNDLE}/patchelf ${BUNDLE}/src_patchelf
#----------------------------------------------------------------------------#
cd ${BUNDLE}
gcc -o copy_libs fill_common.c
rm ${BUNDLE}/fill_common.c
#----------------------------------------------------------------------------#
cd ${BUNDLE}/src_patchelf
make
cp -f ${BUNDLE}/src_patchelf/src/patchelf ${BUNDLE}/cloonfs/bin/patchelf
mv ${BUNDLE}/src_patchelf/src/patchelf ${BUNDLE}/cloonfs/bin/cloonix-patchelf
rm -rf ${BUNDLE}/src_patchelf
strip ${BUNDLE}/cloonfs/bin/patchelf
strip ${BUNDLE}/cloonfs/bin/cloonix-patchelf
cd ${SRC_TREE_ROOT}
#----------------------------------------------------------------------------#
printf "\n\nBUILDING BUNDLE VERSION ${VERSION_NUM}\n\n"
./build_tools/build_cloonfs
printf "\n\nBUILD DONE OK\n\n"
#----------------------------------------------------------------------------#
printf "\n\nPACKING BUNDLE VERSION ${VERSION_NUM}\n\n"
tar --directory=${BUNDLE}/cloonfs -xf ${TARGZ_STORE}/trixie_base_rootfs.tar.gz
#----------------------------------------------------------------------
./build_tools/pack_cloonfs
#----------------------------------------------------------------------
printf "\n\nPACK DONE OK\n\n"
#----------------------------------------------------------------------------#
mv ${BUNDLE}/cloonfs ${RESBUNDLE}
mv ${BUNDLE}/startup_bin ${RESBUNDLE}
mv ${BUNDLE}/insider_agents ${RESBUNDLE}
cp ${SRC_TREE_ROOT}/build_tools/install_cloonfs ${RESBUNDLE}
cd ${HOME}
tar zcvf cloonix-bundle-${VERSION_NUM}.tar.gz cloonix-bundle-${VERSION_NUM}
#----------------------------------------------------------------------------#