Skip to content

Commit

Permalink
update base, glibc and fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
yuk7 committed Feb 24, 2024
1 parent 0012efb commit 64d1283
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 37 deletions.
15 changes: 4 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ OUT_TGZ=rootfs.tar.gz

DLR=curl
DLR_FLAGS=-L
BASE_URL=http://mirrors.edge.kernel.org/archlinux/iso/2023.12.01/archlinux-bootstrap-x86_64.tar.gz
BASE_URL=http://mirrors.edge.kernel.org/archlinux/iso/2024.02.01/archlinux-bootstrap-x86_64.tar.gz
FRTCP_URL=https://github.com/yuk7/arch-prebuilt/releases/download/23121300/fakeroot-tcp-1.32.2-1-x86_64.pkg.tar.zst
GLIBC_URL=https://github.com/yuk7/arch-prebuilt/releases/download/23121300/glibc-2.38-7-x86_64.pkg.tar.zst
GLIBC_LINUX4_URL=https://github.com/yuk7/arch-prebuilt/releases/download/23121300/lib32-glibc-2.38-7-x86_64.pkg.tar.zst
AL_KEYRING_URL=http://mirrors.edge.kernel.org/archlinux/core/os/x86_64/archlinux-keyring-20231207-1-any.pkg.tar.zst
GLIBC_URL=https://github.com/yuk7/arch-prebuilt/releases/download/24022400/glibc-linux-2.39-1-x86_64.pkg.tar.zst
GLIBC_LINUX4_URL=https://github.com/yuk7/arch-prebuilt/releases/download/24022400/glibc-linux4-2.39-1-x86_64.pkg.tar.zst
PAC_PKGS=archlinux-keyring base less nano sudo vim curl

all: $(OUT_TGZ)
Expand All @@ -17,7 +16,7 @@ $(OUT_TGZ): rootfinal.tmp
cd root.x86_64; sudo bsdtar -zcpf ../$(OUT_TGZ) *
sudo chown `id -un` $(OUT_TGZ)

rootfinal.tmp: glibc.tmp fakeroot.tmp locale.tmp glibc-linux4.pkg.tar.zst archlinux-keyring.pkg.tar.zst
rootfinal.tmp: glibc.tmp fakeroot.tmp locale.tmp glibc-linux4.pkg.tar.zst
@echo -e '\e[1;31mCleaning files from rootfs...\e[m'
yes | sudo chroot root.x86_64 /usr/bin/pacman -Scc
sudo umount root.x86_64/sys
Expand All @@ -32,7 +31,6 @@ rootfinal.tmp: glibc.tmp fakeroot.tmp locale.tmp glibc-linux4.pkg.tar.zst archli
@echo -e '\e[1;31mCopy Extra files to rootfs...\e[m'
sudo cp bash_profile root.x86_64/root/.bash_profile
sudo cp glibc-linux4.pkg.tar.zst root.x86_64/root/glibc-linux4.pkg.tar.zst
sudo cp archlinux-keyring.pkg.tar.zst root.x86_64/root/archlinux-keyring.pkg.tar.zst
sudo cp wsl.conf root.x86_64/etc/wsl.conf
echo > rootfinal.tmp

Expand Down Expand Up @@ -91,10 +89,6 @@ root.x86_64.tmp: base.tar.gz
sudo chmod +x root.x86_64
touch root.x86_64.tmp

archlinux-keyring.pkg.tar.zst:
@echo -e '\e[1;31mDownloading archlinux-keyring.pkg.tar.zst...\e[m'
$(DLR) $(DLR_FLAGS) $(GLIBC_URL) -o archlinux-keyring.pkg.tar.zst

glibc.pkg.tar.zst:
@echo -e '\e[1;31mDownloading glibc.pkg.tar.zst...\e[m'
$(DLR) $(DLR_FLAGS) $(GLIBC_URL) -o glibc.pkg.tar.zst
Expand Down Expand Up @@ -133,7 +127,6 @@ cleanpkg:
-rm glibc.pkg.tar.zst
-rm glibc-linux4.pkg.tar.zst
-rm fakeroot-tcp.pkg.tar.zst
-rm archlinux-keyring.pkg.tar.zst

cleanbase:
-rm base.tar.gz
27 changes: 1 addition & 26 deletions bash_profile
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
# First run script for ArchWSL
echo Initialize keyring...
yes | pacman -U /root/archlinux-keyring.pkg.tar.zst
clear
count=0
result=1
until [[ $count -eq 10 || $result -eq 0 ]]
do
echo Initialize keyring...
rm -rf /etc/pacman.d/gnupg
rm -rf /root/.gnupg/
pkill gpg-agent
gpg --refresh-keys
clear
echo Initialize keyring...
sleep 1
pacman-key --init
sleep `expr 5 + $count`
pacman-key --populate
result=$?
count=`expr $count + 1`
clear
done

clear

# WSL1 check
# Install glibc-linux4 if using WSL1
FSTYPE_LIST=$(cat /proc/self/mounts | awk '{print $3}')
if [[ $FSTYPE_LIST == *lxfs* || $FSTYPE_LIST == *wslfs* ]] ; then
echo ----- WARNING -----
Expand All @@ -43,7 +19,6 @@ if [[ $FSTYPE_LIST == *lxfs* || $FSTYPE_LIST == *wslfs* ]] ; then
fi
fi

rm /root/archlinux-keyring.pkg.tar.zst
rm /root/glibc-linux4.pkg.tar.zst
rm /root/.bash_profile
clear

0 comments on commit 64d1283

Please sign in to comment.