Skip to content

Commit

Permalink
Chore: Fix more permissions problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ruizlenato committed Jan 14, 2024
1 parent 410a514 commit d7eaef0
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions make-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,31 @@ download() {

extract() {
echo -e '\e[1;33mExtracting Arch Linux rootfs\e[m'
tar -zxvf archlinux-bootstrap-x86_64.tar.gz &>/dev/null
sudo chmod +x root.x86_64
sudo tar --xattrs --xattrs-include="security.capability" -zxpf archlinux-bootstrap-x86_64.tar.gz &>/dev/null
printf "\033[A\033[K"
echo -e '\e[1;32m✓\e[m Extract Arch Linux rootfs!'
configure
}


configure() {
echo -e '\e[1;33mSetting up a few basic things in bootstrap\e[m'
sudo curl "https://archlinux.org/mirrorlist/?country=US&protocol=https&ip_version=4" -o root.x86_64/etc/pacman.d/mirrorlist &>/dev/null
sudo sed -i -e "s/#Server/Server/g" root.x86_64/etc/pacman.d/mirrorlist
sudo cp wsl.conf root.x86_64/etc/wsl.conf
sudo cp bash_profile root.x86_64/root/.bash_profile
sudo cp -f /etc/resolv.conf root.x86_64/etc/resolv.conf
sudo sed -i -e "s/#en_US.UTF-8/en_US.UTF-8/" root.x86_64/etc/locale.gen
echo "LANG=en_US.UTF-8" >> root.x86_64/etc/locale.conf
sudo ln -sf /etc/locale.conf root.x86_64/etc/default/locale
echo "LANG=en_US.UTF-8" | sudo tee root.x86_64/etc/locale.conf
sudo ln -sf /etc/locale.conf root.x86_64/etc/default/locale
sudo rm -rf root.x86_64/etc/resolv.conf
echo "# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line." >> root.x86_64/etc/resolv.conf
echo "# This file was automatically generated by WSL." | sudo tee root.x86_64/etc/resolv.conf
printf "\033[A\033[K"
echo -e '\e[1;32m✓\e[m Complete setup!'
compress
}


compress() {
echo -e '\e[1;33mBuilding bootstrap\e[m'
sudo chown -R root:root root.x86_64
sudo tar -czvf ArchWSLBootstrap-$(date -u +%Y-%m-%d).tar.gz -C root.x86_64 . &>/dev/null
sudo tar --xattrs --xattrs-include="security.capability" -zcpf ArchWSLBootstrap-$(date -u +%Y-%m-%d).tar.gz -C root.x86_64 .
sudo chown root:root ArchWSLBootstrap-$(date -u +%Y-%m-%d).tar.gz
printf "\033[A\033[K"
echo -e '\e[1;32m✓\e[m Building bootstrap!'
Expand All @@ -64,7 +59,6 @@ compress() {

cleanup() {
sudo rm -rf archlinux-bootstrap-x86_64.tar.gz root.x86_64/
clear
echo -e '\e[1;32mAll done.\e[m'
}

Expand Down

0 comments on commit d7eaef0

Please sign in to comment.