Skip to content
This repository was archived by the owner on Dec 30, 2021. It is now read-only.

Commit 013b1be

Browse files
committed
Wrote Makefile for CentOS8
1 parent 140c2f9 commit 013b1be

File tree

3 files changed

+61
-59
lines changed

3 files changed

+61
-59
lines changed

.travis.yml

+4-31
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,22 @@ language: bash
33
addons:
44
apt:
55
packages:
6-
- aria2
6+
- curl
77
- zip
88
- unzip
99
before_script:
1010
- sudo apt-get update -qq
11-
- sudo apt-get install aria2 zip unzip check -qq
11+
- sudo apt-get install curl zip unzip check -qq
1212
script:
13-
- source ./env.sh
14-
- "${DLR} ${ROOTFS_URL} -o ${ROOTFS_TGZ}"
15-
- "${DLR} ${LNCR_URL} -o ${LNCR_ZIP}"
16-
-
17-
- unzip ${LNCR_ZIP} ${LNCR_FN}
18-
- sudo tar -zxpf ${ROOTFS_TGZ}
19-
-
20-
- sudo losetup --partscan /dev/loop0 ${ROOTFS_FN}
21-
- sudo mkdir mntfs
22-
- sudo mount -o ro /dev/loop0p1 mntfs
23-
- sudo cp -a mntfs rootfs
24-
- sudo umount mntfs
25-
-
26-
- echo "# This file was automatically generated by WSL. To stop automatic generation
27-
of this file, remove this line." | sudo tee ./rootfs/etc/resolv.conf
28-
-
29-
- cd rootfs
30-
- sudo tar -zcpf ../rootfs.tar.gz *
31-
- sudo chown `id -un` ../rootfs.tar.gz
32-
- cd ..
33-
-
34-
- mkdir out
35-
- mkdir dist
36-
- mv -f ${LNCR_FN} ./out/${LNCR_ZIPFN}
37-
- mv -f rootfs.tar.gz ./out/
38-
- cd out
39-
- zip ../dist/CentOS${OS_VER}.zip *
40-
- cd ..
13+
- make
4114
notifications:
4215
email: false
4316
deploy:
4417
provider: releases
4518
api_key:
4619
secure: c3go1osy/T3T7qhZvQQnxR09ck5anmwGVQyQtrlx9B6QnQhLRF0NpV0CYt4PD6/4MUedCC0/EFmZpVogUyea/3F+F/j2fxsg4xUdm6gUNBKUH5wfdbHEW01JVfvwgtlZKFZmCrgNxS931yVM9yvPv02uPC4qjv2wP459wUbnEq5UkhOSaNd8rra1kaUnHdvqlJsBEKc7+lcElRuW5gFMknLXD2X3irXYr5+L2idVSmmApDwU9ufN5zAEUsh+4s3W7YZVxkrYuR2qZVHvA6jaFkKmdkO0giBaz9Tpz6UVErkWNtR6F3OWtjG3dj9dMOSIX4yjuugyDxhQsHZIbErg8TGYIIoW3tMydbgwmTOOCSKZoPSg07kByjiAQSlyVe9ISevUwyCU1TTcnQRF93/CMdDV7bnT8OAfFMkmTL/vqGNyijz5QhRVSswP8jfITx/L1jEXszEcB6hiTZu0y68tBy5ovW3o/V1Yhf03Ny941LG4AMkEuQytw5kALH8r/GKBy1HEbxSVvlaHb1ygwPh2AZoANXPGjvpBZ4gh3+95Tm0W2hMnPkbHtlXMQjfxVHabS96GB6l174aWxHD/u97bbL9AUUr2J2wx5LOoQf9Bf5mMRfPvHn8+JWgqLrO2D4LtOxNF2cGyip61uaMO36wyhbUyeFOMJEeGCNJv1wGVtK8=
4720
file_glob: true
48-
file: 'dist/*.{zip}'
21+
file: 'CentOS*.{zip}'
4922
on:
5023
repo: yuk7/CentWSL
5124
tags: true

Makefile

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
OUT_ZIP=CentOS8.zip
2+
LNCR_EXE=CentOS8.exe
3+
4+
DLR=curl
5+
DLR_FLAGS=-L
6+
BASE_URL=http://cloud.centos.org/centos/8/x86_64/images/CentOS-8-Container-8.1.1911-20200113.3-layer.x86_64.tar.xz
7+
LNCR_ZIP_URL=https://github.com/yuk7/wsldl/releases/download/20013100/icons.zip
8+
LNCR_ZIP_EXE=CentOS.exe
9+
10+
all: $(OUT_ZIP)
11+
12+
zip: $(OUT_ZIP)
13+
$(OUT_ZIP): ziproot
14+
@echo -e '\e[1;31mBuilding $(OUT_ZIP)\e[m'
15+
cd ziproot; zip ../$(OUT_ZIP) *
16+
17+
ziproot: Launcher.exe rootfs.tar.gz
18+
@echo -e '\e[1;31mBuilding ziproot...\e[m'
19+
mkdir ziproot
20+
cp Launcher.exe ziproot/${LNCR_EXE}
21+
cp rootfs.tar.gz ziproot/
22+
23+
exe: Launcher.exe
24+
Launcher.exe: icons.zip
25+
@echo -e '\e[1;31mExtracting Launcher.exe...\e[m'
26+
unzip icons.zip $(LNCR_ZIP_EXE)
27+
mv $(LNCR_ZIP_EXE) Launcher.exe
28+
29+
icons.zip:
30+
@echo -e '\e[1;31mDownloading icons.zip...\e[m'
31+
$(DLR) $(DLR_FLAGS) $(LNCR_ZIP_URL) -o icons.zip
32+
33+
rootfs.tar.gz: rootfs
34+
@echo -e '\e[1;31mBuilding rootfs.tar.gz...\e[m'
35+
cd rootfs; sudo tar -zcpf ../rootfs.tar.gz `sudo ls`
36+
sudo chown `id -un` rootfs.tar.gz
37+
38+
rootfs: base.tar.xz
39+
@echo -e '\e[1;31mBuilding rootfs...\e[m'
40+
mkdir rootfs
41+
sudo tar -xpf base.tar.xz -C rootfs
42+
echo "# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line." | sudo tee rootfs/etc/resolv.conf
43+
sudo chmod +x rootfs
44+
45+
base.tar.xz:
46+
@echo -e '\e[1;31mDownloading base.tar.xz...\e[m'
47+
$(DLR) $(DLR_FLAGS) $(BASE_URL) -o base.tar.xz
48+
49+
clean:
50+
@echo -e '\e[1;31mCleaning files...\e[m'
51+
-rm ${OUT_ZIP}
52+
-rm -r ziproot
53+
-rm Launcher.exe
54+
-rm icons.zip
55+
-rm rootfs.tar.gz
56+
-sudo rm -r rootfs
57+
-rm base.tar.gz

env.sh

-28
This file was deleted.

0 commit comments

Comments
 (0)