Skip to content

Commit

Permalink
add keyring for gpg
Browse files Browse the repository at this point in the history
  • Loading branch information
yuk7 committed Oct 16, 2022
1 parent 7059ae1 commit cd4a660
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ BASE_URL=http://mirrors.edge.kernel.org/archlinux/iso/2022.10.01/archlinux-boots
FRTCP_URL=https://github.com/yuk7/arch-prebuilt/releases/download/21082800/fakeroot-tcp-1.25.3-2-x86_64.pkg.tar.zst
GLIBC_URL=https://github.com/yuk7/arch-prebuilt/releases/download/22100100/glibc-2.36-2-x86_64.pkg.tar.zst
GLIBC_LINUX4_URL=https://github.com/yuk7/arch-prebuilt/releases/download/22100100/lib32-glibc-2.36-2-x86_64.pkg.tar.zst
PAC_PKGS=base less nano sudo vim curl
AL_KEYRING_URL=http://mirrors.edge.kernel.org/archlinux/core/os/x86_64/archlinux-keyring-20220927-1-any.pkg.tar.zst
PAC_PKGS=archlinux-keyring base less nano sudo vim curl

all: $(OUT_TGZ)

Expand All @@ -16,7 +17,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
rootfinal.tmp: glibc.tmp fakeroot.tmp locale.tmp glibc-linux4.pkg.tar.zst archlinux-keyring.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 @@ -31,6 +32,7 @@ rootfinal.tmp: glibc.tmp fakeroot.tmp locale.tmp glibc-linux4.pkg.tar.zst
@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 @@ -89,6 +91,10 @@ 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 @@ -127,6 +133,7 @@ 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
29 changes: 23 additions & 6 deletions bash_profile
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# First run script for ArchWSL
echo Initialize keyring
rm -rf /etc/pacman.d/gnupg/
rm -rf /root/.gnupg/
echo Initialize keyring...
yes | pacman -U /root/archlinux-keyring.pkg.tar.zst
clear
pacman-key --init
pacman-key --populate
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/
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

Expand All @@ -27,5 +42,7 @@ 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
rm /root/.bash_profile
clear

0 comments on commit cd4a660

Please sign in to comment.