PSA
As the original repo is back, I no longer have the intention to maintain this. You are encouraged to download latest release from sileshn/ManjaroWSL2 instead.
Preparation
- Rootfs
- Makefile: ManjaroWSL
Process
Rootfs
The makefile of ManjaroWSL gets the rootfs.tar
by exporting from manjarolinux/base docker image. I think it was a dumb idea (which turns out to be wrong).
After checking manjaro-docker repo, I notice that there is a Makefile
in x86_docker
folder which would generate the rootfs before building Docker image, so I try to directly make it.
Through trial and error, I learn that arch-install-scripts
and manjaro-tools-base-git
packages are required and I should make rootfs using root (sudo make
).
WSL
Build rootfs
# 1. Install all the dependencies:
sudo pacman -S --needed arch-install-scripts curl jq libarchive make manjaro-tools-base-git patch tar unzip wget
# 2. Clone the repo
git clone --depth=1 https://github.com/manjaro/manjaro-docker.git
git clone --depth=1 https://git.vinfall.com/Vinfall/MalayaWSL.git
# 3. Apply the patch & build the rootfs, this could take a while
cp MalayaWSL/manjaro-rootfs.patch manjaro-docker/x86_docker/
cd manjaro-docker/x86_docker
patch Makefile < manjaro-rootfs.patch
sudo make
Package WSL
# Place the `base.tar` generated above inside the folder
mv base.tar ../../MalayaWSL/base.tar
cd ../../MalayaWSL
make
Problems
env: ‘pacstrap’: No such file or directory
Symptoms:
$ make
env -i pacstrap -C /usr/share/manjaro-tools/pacman-default.conf -c -d -G -M /tmp/tmp.ILpBfo23QF archlinux-keyring awk coreutils gzip manjaro-keyring pacman sed systemd
env: ‘pacstrap’: No such file or directory
make: *** [Makefile:3: rootfs] Error 127
Scrutiny:
I really hope distros other than Debian-like would have a similar tool as command-not-found . I checked Arch Linux Forums and could not find a solution. But simply typing a command in DevuanWSL shows me the answer:
$ pacstrap
Command 'pacstrap' not found, but can be installed with:
apt install arch-install-scripts
Solution:
sudo pacman -S arch-install-scripts
error: config file /usr/share/manjaro-tools/pacman-default.conf could not be read: No such file or directory
Symptoms:
$sudo make
env -i pacstrap -C /usr/share/manjaro-tools/pacman-default.conf -c -d -G -M /tmp/tmp.x9lEVOzYEI archlinux-keyring awk coreutils gzip manjaro-keyring pacman sed systemd
==> Creating install root at /tmp/tmp.x9lEVOzYEI
==> Installing packages to /tmp/tmp.x9lEVOzYEI
error: config file /usr/share/manjaro-tools/pacman-default.conf could not be read: No such file or directory
==> ERROR: Failed to install packages to new root
make: *** [Makefile:3: rootfs] Error 1
Scrutiny:
This one is super straightforward, just run sudo pacman -Ss manjaro-tools
and get the idea.
Solution:
sudo pacman -S manjaro-tools-base-git