diff --git a/bootstrap.sh b/bootstrap.sh old mode 100644 new mode 100755 index d617122..d7c9189 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -26,7 +26,9 @@ bs_archlinux () { fi echo '-- Extracting' - tar xzf ./rootfs.tar.gz "root.x86_64/*" -C "$2" || exit 3 + tar xzf ./rootfs.tar.gz -C "$2/" || exit 3 + mv "$2/root.$1"/* "$2" || exit 4 + rmdir "$2/root.$1" echo '-- Removing rootfs archive' rm ./rootfs.tar.gz @@ -36,10 +38,14 @@ bs_archlinux () { cp /etc/hosts "$2/etc/hosts" cp /etc/resolv.conf "$2/etc/resolv.conf" - echo '-- \e[1;32mOK\e[0m -- archlinux bootstrapped' + echo -e '-- \e[1;32mOK\e[0m -- archlinux bootstrapped' echo '-- Use dchr-run to enter the chroot and execute the following commands:' # some day i will rewrite this script and it will do it automatically echo '# pacman-key --init' echo '# pacman-key --populate archlinux' echo '# pacman -Syu' } + +[[ "$1" != "archlinux" || "$1" == "--help" || "$1" == "" || "$2" == "" || "$3" == "" ]] && help && exit 0 + +bs_archlinux "$2" $(readlink -f "$3")