Skip to content

Commit

Permalink
chore: release 1.4.0
Browse files Browse the repository at this point in the history
- 区分 docker 和 wsl 的根文件系统,wsl 需要systemd,polkitd,dbus-daemon
- 新增一些常用的工具包curl,vim,ssh,net-tools,iputils,ping,lshw,iproute2,iptables,procps
  • Loading branch information
chenchongbiao committed Aug 31, 2024
1 parent f9ffff0 commit df04621
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 19 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build-rootfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ jobs:
prerelease: true
title: "v${{ env.VERSION }}"
files: |
rootfs/deepin-rootfs-amd64.tar.gz
rootfs/deepin-rootfs-arm64.tar.gz
rootfs/deepin-rootfs-riscv64.tar.gz
rootfs/deepin-rootfs-loong64.tar.gz
rootfs/deepin-rootfs-i386.tar.gz
rootfs/deepin-wsl-rootfs-amd64.tar.gz
rootfs/deepin-wsl-rootfs-arm64.tar.gz
rootfs/deepin-docker-rootfs-amd64.tar.gz
rootfs/deepin-docker-rootfs-arm64.tar.gz
rootfs/deepin-docker-rootfs-riscv64.tar.gz
rootfs/deepin-docker-rootfs-loong64.tar.gz
rootfs/deepin-docker-rootfs-i386.tar.gz
30 changes: 25 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ ROOTFS=`mktemp -d`
dist_version="beige"
dist_name="deepin"
SOURCES_FILE=config/apt/sources.list
PACKAGES_FILE=config/packages.list/packages.list
readarray -t REPOS < $SOURCES_FILE
PACKAGES=`cat $PACKAGES_FILE | grep -v "^-" | xargs | sed -e 's/ /,/g'`
OUT_DIR=rootfs

mkdir -p $OUT_DIR
Expand All @@ -21,7 +19,7 @@ sudo apt update -y && sudo apt install -y curl git mmdebstrap qemu-user-static u
# 开启异架构支持
sudo systemctl start systemd-binfmt

for arch in amd64 arm64 riscv64 loong64 i386; do
function build_rootfs() {
sudo mmdebstrap \
--hook-dir=/usr/share/mmdebstrap/hooks/merged-usr \
--include=$PACKAGES \
Expand All @@ -32,11 +30,33 @@ for arch in amd64 arm64 riscv64 loong64 i386; do
$dist_version \
$ROOTFS \
"${REPOS[@]}"

# 判断是否构建 wsl 的根文件系统,体内钾 wsl.conf 默认开启systemd
if [[ $TARGET=="wsl" ]];
then
sudo tee $ROOTFS/etc/wsl.conf <<EOF
[boot]
systemd=true
EOF
fi

# 生成压缩包
pushd $OUT_DIR
rm -rf $dist_name-rootfs-$arch.tar.gz
sudo tar -zcf $dist_name-rootfs-$arch.tar.gz -C $ROOTFS .
rm -rf $dist_name-$TARGET-rootfs-$arch.tar.gz
sudo tar -zcf $dist_name-$TARGET-rootfs-$arch.tar.gz -C $ROOTFS .
# 删除临时文件夹
sudo rm -rf $ROOTFS
popd
}

TARGET=wsl
PACKAGES=`cat config/packages.list/$TARGET-packages.list | grep -v "^-" | xargs | sed -e 's/ /,/g'`
for arch in amd64 arm64; do
build_rootfs
done

TARGET=docker
PACKAGES=`cat config/packages.list/$TARGET-packages.list | grep -v "^-" | xargs | sed -e 's/ /,/g'`
for arch in amd64 arm64 riscv64 loong64 i386; do
build_rootfs
done
18 changes: 18 additions & 0 deletions config/packages.list/docker-packages.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ca-certificates
locales
sudo
apt
adduser
apt-utils
bash-completion
curl
vim
bash
deepin-keyring
ssh
net-tools
iputils-ping
lshw
iproute2
iptables
procps
8 changes: 0 additions & 8 deletions config/packages.list/packages.list

This file was deleted.

22 changes: 22 additions & 0 deletions config/packages.list/wsl-packages.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ca-certificates
locales
sudo
apt
adduser
polkitd
systemd
dbus-daemon
apt-utils
bash-completion
curl
vim
bash
deepin-keyring
init
ssh
net-tools
iputils-ping
lshw
iproute2
iptables
procps
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.4.0

0 comments on commit df04621

Please sign in to comment.