mirror of
https://github.com/yuk7/AlpineWSL.git
synced 2026-01-18 16:47:21 +01:00
61 lines
1.7 KiB
Makefile
61 lines
1.7 KiB
Makefile
OUT_ZIP=Alpine.zip
|
|
LNCR_EXE=Alpine.exe
|
|
|
|
DLR=curl
|
|
DLR_FLAGS=-L
|
|
BASE_URL=https://dl-cdn.alpinelinux.org/alpine/v3.9/releases/aarch64/alpine-minirootfs-3.9.6-aarch64.tar.gz
|
|
LNCR_ZIP_URL=https://github.com/yuk7/wsldl/releases/download/21062500/icons_arm64.zip
|
|
LNCR_ZIP_EXE=Alpine.exe
|
|
|
|
all: $(OUT_ZIP)
|
|
|
|
zip: $(OUT_ZIP)
|
|
$(OUT_ZIP): ziproot
|
|
@echo -e '\e[1;31mBuilding $(OUT_ZIP)\e[m'
|
|
cd ziproot; bsdtar -a -cf ../$(OUT_ZIP) *
|
|
|
|
ziproot: Launcher.exe rootfs.tar.gz
|
|
@echo -e '\e[1;31mBuilding ziproot...\e[m'
|
|
mkdir ziproot
|
|
cp Launcher.exe ziproot/${LNCR_EXE}
|
|
cp rootfs.tar.gz ziproot/
|
|
|
|
exe: Launcher.exe
|
|
Launcher.exe: icons.zip
|
|
@echo -e '\e[1;31mExtracting Launcher.exe...\e[m'
|
|
bsdtar -xvf icons.zip $(LNCR_ZIP_EXE)
|
|
mv $(LNCR_ZIP_EXE) Launcher.exe
|
|
|
|
icons.zip:
|
|
@echo -e '\e[1;31mDownloading icons.zip...\e[m'
|
|
$(DLR) $(DLR_FLAGS) $(LNCR_ZIP_URL) -o icons.zip
|
|
|
|
rootfs.tar.gz: rootfs
|
|
@echo -e '\e[1;31mBuilding rootfs.tar.gz...\e[m'
|
|
cd rootfs; sudo tar -zcpf ../rootfs.tar.gz `sudo ls`
|
|
sudo chown `id -un` rootfs.tar.gz
|
|
|
|
rootfs: base.tar.gz profile
|
|
@echo -e '\e[1;31mBuilding rootfs...\e[m'
|
|
mkdir rootfs
|
|
sudo tar -zxpf base.tar.gz -C rootfs
|
|
sudo cp -f /etc/resolv.conf rootfs/etc/resolv.conf
|
|
sudo cp -f profile rootfs/etc/profile
|
|
echo "# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line." | sudo tee rootfs/etc/resolv.conf
|
|
sudo rm -rf `sudo find rootfs/var/cache/apk/ -type f`
|
|
sudo chmod +x rootfs
|
|
|
|
base.tar.gz:
|
|
@echo -e '\e[1;31mDownloading base.tar.gz...\e[m'
|
|
$(DLR) $(DLR_FLAGS) $(BASE_URL) -o base.tar.gz
|
|
|
|
clean:
|
|
@echo -e '\e[1;31mCleaning files...\e[m'
|
|
-rm ${OUT_ZIP}
|
|
-rm -r ziproot
|
|
-rm Launcher.exe
|
|
-rm icons.zip
|
|
-rm rootfs.tar.gz
|
|
-sudo rm -r rootfs
|
|
-rm base.tar.gz
|