diff options
Diffstat (limited to 'hyper-bootstrap_v0.3.sh')
-rwxr-xr-x | hyper-bootstrap_v0.3.sh | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/hyper-bootstrap_v0.3.sh b/hyper-bootstrap_v0.3.sh index a8f3595..fecd1f3 100755 --- a/hyper-bootstrap_v0.3.sh +++ b/hyper-bootstrap_v0.3.sh @@ -8,11 +8,11 @@ # Usage: # # # ./hyper-bootstrap.sh destination -# # ./hyper-bootstrap.sh -a x86_64 -r https://repo.hyperbola.info:50011/gnu-plus-linux-libre/testing destination-64 +# # ./hyper-bootstrap.sh -a x86_64 -r https://repo.hyperbola.info:50012/gnu-plus-linux-libre/stable destination-64 # # Example: # -# # ./hyper-bootstrap.sh -a x86_64 -r "https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/testing" myhyper +# # ./hyper-bootstrap.sh -a x86_64 -r "https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/stable" myhyper # # ./hyper-bootstrap.sh myhyper # # And then you can chroot to the destination directory (user: root, password: root): @@ -35,7 +35,7 @@ PACMAN_PACKAGES=( libassuan libgpg-error libnghttp2 libssh2 lzo libressl pacman pacman-mirrorlist xz zlib libffi krb5 e2fsprogs keyutils libidn gcc-libs lz4 libpsl icu readline libunistring findutils ncurses pinentry lsb-release ca-certificates ca-certificates-utils p11-kit libtasn1 - libcap shadow pcre + libcap shadow pcre gzip ) CORE_PACKAGES=(${PACMAN_PACKAGES[*]} filesystem) COMMUNITY_PACKAGES=(lzip zstd) @@ -75,7 +75,6 @@ uncompress() { *.gz) tar xzf "$FILEPATH" -C "$DEST";; *.xz) - # tar xzf "$FILEPATH" -C "$DEST" ;; tar -xf "$FILEPATH" -C "$DEST" > /dev/null 2> /dev/null;; *.lz) tar xf "$FILEPATH" -C "$DEST";; @@ -128,7 +127,6 @@ configure_pacman() { local DEST=$1 ARCH=$2 debug "Configuring SERVER" SERVER=$(get_template_repo_url "$REPO_URL" "$ARCH") - echo "Server = $SERVER" > "$DEST/etc/pacman.d/mirrorlist" debug "Configuring CERT" cp -fv certs/1.pem "$DEST/etc/ca-certificates/extracted/tls-ca-bundle.pem" } @@ -137,6 +135,7 @@ clean_chroot() { local DEST=$1 debug "Clean Chroot" rm -rf "$DEST/.BUILDINFO" "$DEST/.INSTALL" "$DEST/.MTREE" "$DEST/.PKGINFO" || true + echo '' > "$DEST/var/log/pacman.log" } configure_minimal_system() { @@ -157,6 +156,14 @@ configure_minimal_system() { sed -i "s|^[[:space:]]*SigLevel[[:space:]]*=.*$|SigLevel = Never|" "$DEST/etc/pacman.conf" } +configure_locale() { + local DEST=$1 + sed -e 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' -i "$DEST/etc/locale.gen" + echo LANG=en_US.UTF-8 > "$DEST/etc/locale.conf" + LC_ALL=C chroot "$DEST" \ + locale-gen +} + fetch_packages_list() { local REPO=$1 @@ -210,7 +217,8 @@ install_packages() { local ARCH=$1 DEST=$2 PACKAGES=$3 debug "Install packages: $PACKAGES" LC_ALL=C chroot "$DEST" \ - /usr/bin/pacman --noconfirm --arch $ARCH -Syy --force $PACKAGES + /usr/bin/pacman --noconfirm --noprogressbar --quiet --arch $ARCH -Syy --force $PACKAGES \ + && /usr/bin/pacman --noconfirm --noprogressbar --quiet -Scc } configure_keyring() { @@ -219,7 +227,7 @@ configure_keyring() { LC_ALL=C chroot "$DEST" \ /usr/bin/pacman-key --init && /usr/bin/pacman-key --populate archlinux hyperbola \ && /usr/bin/pacman-key --refresh-keys \ - && /usr/bin/pacman -Sy hyperbola-keyring --noconfirm + && /usr/bin/pacman -Sy hyperbola-keyring --noconfirm --noprogressbar --quiet } show_usage() { @@ -271,6 +279,7 @@ main() { configure_minimal_system "$DEST" [[ -n "$USE_QEMU" ]] && configure_static_qemu "$ARCH" "$DEST" install_packages "$ARCH" "$DEST" "${CORE_PACKAGES[*]} ${EXTRA_PACKAGES[*]}" + configure_locale "$DEST" configure_keyring "$DEST" clean_chroot "$DEST" # clean [[ -z "$PRESERVE_DOWNLOAD_DIR" ]] && rm -rf "$DOWNLOAD_DIR" |