-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* beta3 发布重新构建 * 新增 riscv64、loong64、i386 架构 * 取消 systemd 预装 * 使用 mmdebstrap 构建根文件系统 * 将 usr 内容合并到根目录 Log: new releases
- Loading branch information
1 parent
86090a4
commit e19da64
Showing
8 changed files
with
111 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -e -u -x | ||
|
||
apt update | ||
sudo apt update | ||
|
||
# 不进行交互安装 | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
apt install multistrap -y | ||
|
||
mkdir -p /beige-rootfs/etc/apt/trusted.gpg.d | ||
cp deepin.gpg /beige-rootfs/etc/apt/trusted.gpg.d | ||
|
||
arch=${1} | ||
echo -e "[General]\n\ | ||
arch=$arch\n\ | ||
directory=/beige-rootfs/\n\ | ||
cleanup=true\n\ | ||
noauth=false\n\ | ||
unpack=true\n\ | ||
explicitsuite=false\n\ | ||
multiarch=\n\ | ||
aptsources=Debian\n\ | ||
bootstrap=Deepin\n\ | ||
[Deepin]\n\ | ||
packages=apt ca-certificates locales-all sudo systemd\n\ | ||
source=https://community-packages.deepin.com/beige/\n\ | ||
suite=beige\n\ | ||
" >/beige.multistrap | ||
|
||
multistrap -f /beige.multistrap | ||
|
||
echo "deb https://community-packages.deepin.com/beige/ beige main commercial community" > /beige-rootfs/etc/apt/sources.list && \ | ||
echo "deb-src https://community-packages.deepin.com/beige/ beige main commercial community" >> /beige-rootfs/etc/apt/sources.list | ||
|
||
# 微软提供的 wsl 启动器会调用adduser,需要将 USERS_GID 和 USERS_GROUP 注释。 | ||
sed -i -e 's/USERS_GID=100/#USERS_GID=100/' -e 's/USERS_GROUP=users/#USERS_GROUP=users/' /beige-rootfs/etc/adduser.conf | ||
|
||
# 生成压缩包 | ||
tar -cf deepin-rootfs-$arch.tar.gz -C /beige-rootfs . | ||
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 | ||
|
||
sudo apt update -y && sudo apt install -y curl git mmdebstrap qemu-user-static usrmerge systemd-container | ||
# 开启异架构支持 | ||
sudo systemctl start systemd-binfmt | ||
|
||
# for arch in amd64 arm64 riscv64 loong64 i386; do | ||
for arch in amd64; do | ||
sudo mmdebstrap \ | ||
--hook-dir=/usr/share/mmdebstrap/hooks/merged-usr \ | ||
--include=$PACKAGES \ | ||
--components="main,commercial,community" \ | ||
--variant=minbase \ | ||
--architectures=${arch} \ | ||
--customize=./config/hooks.chroot/second-stage \ | ||
$dist_version \ | ||
$ROOTFS \ | ||
"${REPOS[@]}" | ||
# 生成压缩包 | ||
pushd $OUT_DIR | ||
rm -rf $dist_name-rootfs-$arch.tar.gz | ||
sudo tar -cf $dist_name-rootfs-$arch.tar.gz -C $ROOTFS . | ||
# 删除临时文件夹 | ||
sudo rm -rf $ROOTFS | ||
popd | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deb https://community-packages.deepin.com/beige/ beige main commercial community |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
rootdir="$1" | ||
|
||
# 执行命令的辅助函数 | ||
run_in_chroot() { | ||
systemd-nspawn -D "$rootdir" bash -c "$@" | ||
} | ||
|
||
# 设置语言 | ||
run_in_chroot " | ||
sed -i -E 's/#[[:space:]]?(en_US.UTF-8[[:space:]]+UTF-8)/\1/g' /etc/locale.gen | ||
sed -i -E 's/#[[:space:]]?(zh_CN.UTF-8[[:space:]]+UTF-8)/\1/g' /etc/locale.gen | ||
locale-gen | ||
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales | ||
" | ||
|
||
# 微软提供的 wsl 启动器会调用adduser,需要将 USERS_GID 和 USERS_GROUP 注释。 | ||
run_in_chroot "sed -i -e 's/USERS_GID=100/#USERS_GID=100/' -e 's/USERS_GROUP=users/#USERS_GROUP=users/' /etc/adduser.conf" | ||
|
||
# 清理缓存 | ||
run_in_chroot " | ||
apt clean | ||
rm -rf /var/cache/apt/archives/* | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ca-certificates | ||
locales | ||
sudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.0 | ||
1.2.0 |