From b80171d77577cd3d4f4ac34843c5afcc8b0d3b30 Mon Sep 17 00:00:00 2001 From: BigfootACA Date: Wed, 6 Oct 2021 16:38:17 +0800 Subject: [PATCH] build.sh: fix SimpleInit i18n locale Signed-off-by: BigfootACA --- .github/workflows/main.yml | 2 +- README.md | 2 +- README.zh.md | 2 +- build.sh | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9209a74..c452790 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: - name: Install requires packages run: | sudo apt-get update - sudo apt-get -y install build-essential uuid-dev iasl nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git + sudo apt-get -y install build-essential uuid-dev iasl nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext - name: Build device ${{ matrix.device }} run: | diff --git a/README.md b/README.md index 38841a1..5aec7cd 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ For Ubuntu 20.04: ```bash sudo apt update sudo apt upgrade -sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git +sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext ``` ## Building diff --git a/README.zh.md b/README.zh.md index 6ddec92..183b68a 100644 --- a/README.zh.md +++ b/README.zh.md @@ -66,7 +66,7 @@ Ubuntu 20.04: ```bash sudo apt update sudo apt upgrade -sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git +sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext ``` ## 构建 diff --git a/build.sh b/build.sh index 6fde84e..88bc7d8 100755 --- a/build.sh +++ b/build.sh @@ -191,7 +191,13 @@ export GITCOMMIT echo > ramdisk set -e python3 assets/generate-logo.py "${GITCOMMIT}" -mkdir -p "${_SIMPLE_INIT}/build" +mkdir -p "${_SIMPLE_INIT}/build" "${_SIMPLE_INIT}/usr/share/locale" +for i in "${_SIMPLE_INIT}/po/"*.po +do [ -f "${i}" ]||continue + _name="$(basename "$i" .po)" + _path="${_SIMPLE_INIT}/root/usr/share/locale/${_name}/LC_MESSAGES" + msgfmt -o "${_path}/simple-init.mo" "${i}" +done bash "${_SIMPLE_INIT}/scripts/gen-rootfs-source.sh" \ "${_SIMPLE_INIT}" \ "${_SIMPLE_INIT}/build" -- 2.45.2