This commit is contained in:
Kuoi 2022-07-19 20:48:20 +01:00
commit 2d5fffdf80
6 changed files with 86 additions and 0 deletions

19
Dockerfile Normal file
View file

@ -0,0 +1,19 @@
FROM archlinux:latest
# import bioarchlinux keyring
RUN pacman -Syu --noconfirm
RUN pacman-key --recv-keys B1F96021DB62254D
RUN pacman-key --finger B1F96021DB62254D
RUN pacman-key --init
RUN pacman-key --lsign-key B1F96021DB62254D
# add bioarchlinux to pacman.conf
RUN curl https://raw.githubusercontent.com/BioArchLinux/mirror/main/pacman.conf.bio -o /etc/pacman.conf
RUN curl https://raw.githubusercontent.com/BioArchLinux/mirror/main/mirrorlist.bio -o /etc/pacman.d/mirrorlist.bio
RUN sed -i '2,2s/# //g' /etc/pacman.d/mirrorlist.bio
# install keyring and mirrorlist packages
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm bioarchlinux-keyring
RUN pacman -S --noconfirm --overwrite '*' bioarchlinux-mirrorlist
RUN rm -rf /var/cache/pacman/pkg

32
README.md Normal file
View file

@ -0,0 +1,32 @@
# BioArchLinux on WSL
## Usage
Download [wsl tar file](https://repo.bioarchlinux.org/wsl) from [any mirror](https://raw.githubusercontent.com/BioArchLinux/mirror/main/mirrorlist.bio) of BioArchLinux.
Specific a `StoragePath` and run the following command under the tar file directory.
```
wsl --import BioArchLinux StoragePath .\bioarchlinux.tar
wsl -d BioArchLinux
```
then you need to choose a mirror of archlinux and bioarchlinux
choose mirror of archlinux from [here](https://archlinux.org/mirrorlist/) and run the following command ( take sdu mirror as the example)
```
echo 'Server = https://mirrors.sdu.edu.cn/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist
```
choose mirror bioarchlinux from [here](https://raw.githubusercontent.com/BioArchLinux/mirror/main/mirrorlist.bio) and run the following command ( take sdu mirror as the example)
```
echo 'Server = https://mirrors.sdu.edu.cn/bioarchlinux/$arch' > /etc/pacman.d/mirrorlist.bio
```
Finally, you can install any packages from BioArchLinux
```
pacman -Syu
pacman -S foo
```

8
gen_img.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
docker build -t bioarchlinux:$(date "+%Y%m%d") .
docker run -d bioarchlinux:$(date "+%Y%m%d")
docker export $(docker ps -a | awk '{print $1}' |sed -n '2p') > bioarchlinux-$(date "+%Y%m%d").tar
docker rm $(docker ps -aq)
docker rmi $(docker images -q)

10
man_img.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
cd /usr/share/lilac/wsl
git pull
./gen_img.sh
rm -rf /usr/share/lilac/Repo/wsl/*
mv bioarchlinux-$(date "+%Y%m%d").tar /usr/share/lilac/Repo/wsl/

8
wsl.service Normal file
View file

@ -0,0 +1,8 @@
[Unit]
Description=wsl tar file generator
Wants=wsl.timer
[Service]
User=root
Type=simple
ExecStart=/usr/share/lilac/wsl/man_img.sh

9
wsl.timer Normal file
View file

@ -0,0 +1,9 @@
[Unit]
Description=Runs wsl generator the first day every month
[Timer]
OnCalendar=*-*-01 01:00:00
Unit=wsl.service
[Install]
WantedBy=multi-user.target