Remove tar_fix.sh because hyperbola-bootstrap in current version fixed it's

This commit is contained in:
Jesus 2023-09-25 03:25:00 +08:00
parent 6eeb5fc344
commit 8d7135bb32
No known key found for this signature in database
GPG Key ID: E607CE7149F4D71C
2 changed files with 3 additions and 64 deletions

View File

@ -11,22 +11,15 @@ Usage
======
- `git clone` this repository and move to directory where you have cloned it.
- Generate bootstrap image with [hyperbola-bootstrap](https://git.sr.ht/~heckyel/hyperbola-bootstrap) or download file from [archive.fridu.us](https://archive.fridu.us/hyperbola/iso/)
- Rename hyperbola-bootstrap to bootstrap.tar.gz image
- Converter hyperbola-bootstrap to bootstrap image valid for docker
```console
$ bash tar_fix.sh --input=hyperbola-bootstrap.tar.gz --output=bootstrap.tar.gz
```
mv -T hyperbola-bootstrap-x86_64.tar.gz bootstrap.tar.gz
- Make sure you have my `Dockerfile`, `.dockerignore` and the `bootstrap.tar.gz` in one directory.
- Build the image with a command like:
```console
$ docker build --tag hyperbola:0.4 -f Dockerfile-Hyperbola-v04 .
```
docker build --tag hyperbola:0.4.3 -f Dockerfile-Hyperbola-v04 .
License
=======

View File

@ -1,54 +0,0 @@
#!/bin/bash
set -e
usage() {
echo "Uso: bash $0 --input=<archivo_entrada> --output=<archivo_salida>"
exit 1
}
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Get the current directory path...' '\e[m'
current_dir=$(pwd)
# Check arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--input=*)
input_file="${1#*=}"
shift
;;
--output=*)
output_file="${1#*=}"
shift
;;
*)
usage
;;
esac
done
if [ -z "$input_file" ] || [ -z "$output_file" ]; then
usage
fi
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Unzip the input file to a temporary directory...' '\e[m'
temp_dir=$(mktemp -d)
tar -xzvf "$input_file" -C "$temp_dir" || echo "Info: some tar failed, but the script will continue."
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Rename files ending in .pacnew...' '\e[m'
find "$temp_dir" -type f -name "*.pacnew" -exec sh -c 'mv -f "$1" "${1%.pacnew}"' _ {} \;
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Copy the contents of 'x86_64' to the root...' '\e[m'
rsync -a "$temp_dir/x86_64/" "$temp_dir/"
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Delete the x86_64 directory using doas (requires privileges)...' '\e[m'
doas rm -rf "$temp_dir/x86_64"
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' "Make $output_file..." '\e[m'
(cd "$temp_dir" && tar -czvf "$current_dir/$output_file" *)
printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Clean the temporary directory using doas (requires privileges)...' '\e[m'
doas rm -rf "$temp_dir"
echo "The file $output_file has been successfully created! <3"