!96 Refactoring file system packaging process

Merge pull request !96 from pilipala195/master
This commit is contained in:
openharmony_ci 2021-04-10 09:02:24 +08:00 committed by Gitee
commit 432907dbf6
3 changed files with 16 additions and 7 deletions

View File

@ -182,18 +182,14 @@ endif
$(ROOTFSDIR): prepare $(APPS)
$(HIDE)$(MAKE) clean -C apps
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/rootfsdir.sh $(OUT)/bin $(OUT)/musl $(ROOTFS_DIR)
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/rootfsdir.sh $(OUT)/bin $(OUT)/musl $(ROOTFS_DIR) $(LITEOS_TARGET_DIR)
ifneq ($(VERSION),)
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/releaseinfo.sh "$(VERSION)" $(ROOTFS_DIR)
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/releaseinfo.sh "$(VERSION)" $(ROOTFS_DIR) $(LITEOS_TARGET_DIR)
endif
$(ROOTFS): $(ROOTFSDIR)
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/rootfsimg.sh $(ROOTFS_DIR) $(FSTYPE)
$(HIDE)cd $(ROOTFS_DIR)/.. && zip -r $(ROOTFS_ZIP) $(ROOTFS)
ifneq ($(OUT), $(LITEOS_TARGET_DIR))
rm -rf $(LITEOS_TARGET_DIR)rootfs
$(HIDE)mv $(ROOTFS_DIR) $(LITEOS_TARGET_DIR)rootfs
endif
clean:
$(HIDE)for dir in $(LITEOS_SUBDIRS); \

View File

@ -30,13 +30,18 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -e
if [ $# -ne 2 ];then
if [ $# -ne 3 ];then
exit 1
fi
VERSION=$1
ROOTFS_DIR=$2
OUT_DIR=$3
RELEASE_TIME=$(date "+%Y-%m-%d %H:%M:%S")
echo VERSION=\"${VERSION}\" > ${ROOTFS_DIR}/etc/os-release
echo RELEASE_TIME=\"${RELEASE_TIME}\" >> ${ROOTFS_DIR}/etc/os-release
if [ ! -d ${OUT_DIR}etc ]; then
mkdir -p ${OUT_DIR}etc
fi
cp ${ROOTFS_DIR}/etc/os-release ${OUT_DIR}etc

View File

@ -33,10 +33,18 @@ set -e
BIN_DIR=$1
LIB_DIR=$2
ROOTFS_DIR=$3
OUT_DIR=$4
mkdir -p ${ROOTFS_DIR}/bin ${ROOTFS_DIR}/lib ${ROOTFS_DIR}/usr/bin ${ROOTFS_DIR}/usr/lib ${ROOTFS_DIR}/etc \
${ROOTFS_DIR}/app ${ROOTFS_DIR}/data ${ROOTFS_DIR}/proc ${ROOTFS_DIR}/dev ${ROOTFS_DIR}/data/system ${ROOTFS_DIR}/data/system/param \
${ROOTFS_DIR}/system ${ROOTFS_DIR}/system/internal ${ROOTFS_DIR}/system/external
if [ -d "${BIN_DIR}" ] && [ "$(ls -A "${BIN_DIR}")" != "" ]; then
cp -f ${BIN_DIR}/* ${ROOTFS_DIR}/bin
if [ -e ${BIN_DIR}/shell ]; then
cp -f ${BIN_DIR}/shell ${OUT_DIR}/bin/shell
fi
if [ -e ${BIN_DIR}/tftp ]; then
cp -f ${BIN_DIR}/tftp ${OUT_DIR}/bin/tftp
fi
fi
cp -f ${LIB_DIR}/* ${ROOTFS_DIR}/lib
cp -f ${LIB_DIR}/* ${OUT_DIR}/libs