Compare commits

..

10 Commits

Author SHA1 Message Date
3936b2eb46 更新 'common.sh' 2024-10-21 14:33:09 +08:00
9b0c0199f1 更新 'common.sh' 2024-10-21 14:29:14 +08:00
20b7870e55 更新 'common.sh' 2024-10-21 14:17:55 +08:00
d23459926b 更新 'common.sh' 2024-10-21 11:56:09 +08:00
d1752dd9d8 focal 2024-10-19 15:16:40 +08:00
2e06ffeba8 focal 2024-10-19 13:41:24 +08:00
ba4fb2097c 更新脚本 2023-11-29 15:20:37 +08:00
fe644f7026 修改脚本 2023-11-29 02:32:44 +08:00
f9fa7b8d9f 修改脚本 2023-11-28 22:56:54 +08:00
1fbff2b1ad 修改脚本 2023-11-28 22:49:39 +08:00
9 changed files with 65 additions and 26 deletions

View File

@@ -3,8 +3,8 @@ sudo apt install -y debootstrap qemu-user-static
## 越简单越可靠
```
deb http://ports.ubuntu.com/ubuntu-ports xenial main universe
deb http://repo.ubports.com xenial main
deb http://ports.ubuntu.com/ubuntu-ports focal main universe
deb http://repo.ubports.com focal main
ofono
@@ -39,5 +39,15 @@ DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -j4
1. sudo apt install -y debootstrap qemu-user-static expect pinentry-tty
2. sudo update-alternatives --set pinentry /usr/bin/pinentry-tty >/dev/null || gpg-connect-agent reloadagent /bye >/dev/null
3. reprepro 构建仓库签名密钥设置环境变量里SIGNING_PASSWORD可用jenkins插件'Mask passwords'
4. reprepro_expect -- -b /mnt/linux-data/mirrors/repo.ubports-cn remove xenial libgbinder-radio
4. reprepro_expect -- -b /mnt/linux-data/mirrors/repo.ubports-cn remove focal libgbinder-radio
5. reprepro_expect -- 后面所有参数会传递到reprepro中
## 为了ofono ofono-binder-plugin
apt-get install apt-transport-https -y
wget https://mirrors.kuailexs.com/repo.ubports-cn/public.key
apt-key add public.key
echo 'deb https://mirrors.kuailexs.com/repo.ubports-cn focal main' >> /etc/apt/sources.list
apt-get -q update
apt-get -q -y -o DPkg::Options::=--force-confnew dist-upgrade
apt-get install ofono ofono-dev libgbinder libgbinder-dev libgbinder-radio libgbinder-radio-dev git libmce-glib-dev libglibutil-dev

View File

@@ -9,6 +9,8 @@ into_build_dir="build_dir"
jenkins_workspace=`pwd`
work_dir=$TOOLS_COMMOD_DIR/build/$RANDOM
EXTEND_MIRRORS=$1
source /opt/build-tools/common.sh
echo "设置一个带时间的版本号"
@@ -18,7 +20,7 @@ function build_arch_package(){
ARCH=$1
echo "准备编译环境"
# jenkins_before.sh work_dir source_dir build_num
sudo /opt/build-tools/jenkins_before.sh $work_dir $jenkins_workspace $into_build_dir $ARCH
sudo /opt/build-tools/jenkins_before.sh $work_dir $jenkins_workspace $into_build_dir $ARCH $EXTEND_MIRRORS
echo "执行编译动作"
build_in_chroot $work_dir $into_build_dir $user_name

View File

@@ -6,6 +6,10 @@ cd $source_dir
echo "开始检查依赖"
# 先更新一下
apt-get -q update
apt-get -q -y -o DPkg::Options::=--force-confnew dist-upgrade
# 打包工具
apt-get install -y dpkg-dev fakeroot
depends=`dpkg-checkbuilddeps 2>&1`

View File

@@ -159,10 +159,14 @@ function save_base_tgz(){
mkdir -p build lib64
mkdir -p $TOOLS_COMMOD_DIR
base_name="base-$DISTRIBUTION-$ARCH"
if [ "$EXTEND_MIRRORS" == "1" ]
then
base_name="base-$DISTRIBUTION-extend-$ARCH"
fi
rm -f $TOOLS_COMMOD_DIR/$base_name.tgz.tmp
tar -c --use-compress-program gzip -f $TOOLS_COMMOD_DIR/$base_name.tgz.tmp ./bin ./boot ./build ./dev ./etc ./home ./lib ./lib64 ./media ./mnt ./opt ./proc ./root ./run ./sbin ./srv ./sys ./tmp ./usr ./var
mv $TOOLS_COMMOD_DIR/$base_name.tgz.tmp $TOOLS_COMMOD_DIR/$base_name.tgz
echo "$TOOLS_COMMOD_DIR/$base_name.tgz.tmp $TOOLS_COMMOD_DIR/$base_name.tgz"
echo "$TOOLS_COMMOD_DIR/$base_name.tgz.tmp $TOOLS_COMMOD_DIR/$base_name.tgz"
}
#
function decompress_base_tgz(){
@@ -171,7 +175,11 @@ function decompress_base_tgz(){
cd "$mount_dir"
base_name="base-$DISTRIBUTION-$ARCH"
echo "tar -x --use-compress-program gzip -p -f $TOOLS_COMMOD_DIR/$base_name.tgz"
if [ "$EXTEND_MIRRORS" == "1" ]
then
base_name="base-$DISTRIBUTION-extend-$ARCH"
fi
echo "tar -x --use-compress-program gzip -p -f $TOOLS_COMMOD_DIR/$base_name.tgz"
tar -x --use-compress-program gzip -p -f $TOOLS_COMMOD_DIR/$base_name.tgz
}
#
@@ -186,24 +194,37 @@ function set_sources_update(){
mount_dir=$1
check_mount_dir $mount_dir
chroot $mount_dir /bin/bash -c "echo 'deb $MIRRORS xenial main universe multiverse restricted' > /etc/apt/sources.list"
chroot $mount_dir /bin/bash -c "echo 'deb $MIRRORS xenial-updates main universe multiverse restricted' >> /etc/apt/sources.list"
chroot $mount_dir /bin/bash -c "echo 'deb $MIRRORS $DISTRIBUTION main restricted universe multiverse' > /etc/apt/sources.list"
chroot $mount_dir /bin/bash -c "echo 'deb $MIRRORS $DISTRIBUTION-updates main restricted universe multiverse' >> /etc/apt/sources.list"
chroot $mount_dir /bin/bash -c "echo 'deb $MIRRORS $DISTRIBUTION-security main restricted universe multiverse' >> /etc/apt/sources.list"
chroot $mount_dir /bin/bash -c "echo 'deb $MIRRORS $DISTRIBUTION-backports main restricted universe multiverse' >> /etc/apt/sources.list"
chroot $mount_dir /usr/bin/apt-get -q update
chroot $mount_dir /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confnew dist-upgrade
chroot $mount_dir /usr/bin/apt-get -q -y install wget
chroot $mount_dir /usr/bin/apt-get -q -y install wget apt-transport-https gnupg2
# ubports repo
chroot $mount_dir wget http://repo.ubports.com/keyring.gpg
chroot $mount_dir apt-key add keyring.gpg
chroot $mount_dir /bin/bash -c "echo 'deb $UBPORTS_MIRRORS xenial main' >> /etc/apt/sources.list"
chroot $mount_dir /bin/bash -c "echo 'deb $UBPORTS_MIRRORS $DISTRIBUTION main' >> /etc/apt/sources.list"
chroot $mount_dir /usr/bin/apt-get -q update
chroot $mount_dir /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confnew dist-upgrade
chroot $mount_dir /usr/bin/apt-get -q -y install build-essential dpkg-dev wget dpkg-dev fakeroot debhelper dh-autoreconf dh-systemd libtool libdbus-glib-1-dev libudev-dev libc-ares-dev libsystemd-dev udev
chroot $mount_dir /bin/bash -c "echo 'deb $UBPORTS_MIRRORS xenial_-_android9 main' >> /etc/apt/sources.list"
chroot $mount_dir /usr/bin/apt-get -q update
chroot $mount_dir /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confnew dist-upgrade
if [ "$EXTEND_MIRRORS" == "1" ]
then
chroot $mount_dir wget http://mirrors.kuailexs.com/repo.ubports-cn/public.key
chroot $mount_dir apt-key add public.key
chroot $mount_dir /bin/bash -c "echo 'deb http://mirrors.kuailexs.com/repo.ubports-cn $DISTRIBUTION main' >> /etc/apt/sources.list"
chroot $mount_dir /usr/bin/apt-get -q update
chroot $mount_dir /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confnew dist-upgrade
fi
if [ "$DISTRIBUTION" == "focal" ]
then
# Ubuntu 20.04 fails when using fakeroot-sysv with:
# semop(1): encountered an error: Function not implemented
chroot $mount_dir /usr/bin/update-alternatives --set fakeroot /usr/bin/fakeroot-tcp
fi
}
# 设置一个带时间的版本号
@@ -213,7 +234,7 @@ function set_time_version(){
changelog_version=$(dpkg-parsechangelog -l debian/changelog --show-field Version)
new_version="$changelog_version+$tiem_str"
gbp dch --auto -S --multimaint-merge --ignore-branch --new-version=$new_version
debchange --release --distribution xenial --force-distribution ''
debchange --release --distribution focal --force-distribution ''
}
# 复制编译结果

View File

@@ -3,9 +3,9 @@
source /opt/build-tools/default.conf
if [ $# == 1 ] ; then
ARCH=$1
fi
ARCH=$1
EXTEND_MIRRORS=$2
source /opt/build-tools/common.sh

View File

@@ -1,14 +1,12 @@
#
ARCH=arm64
DISTRIBUTION=xenial
DISTRIBUTION=focal
# ubuntu-ports 镜像
MIRRORS=http://mirrors.aliyun.com/ubuntu-ports/
MIRRORS=https://mirrors.aliyun.com/ubuntu-ports/
# ubports 镜像
UBPORTS_MIRRORS=http://repo.ubports.com
UBPORTS_MIRRORS=https://repo.ubports.com/
#工具公共目录
TOOLS_COMMOD_DIR=/var/cache/pbuilder-mini

View File

@@ -8,6 +8,7 @@ build_num=$3
source /opt/build-tools/default.conf
ARCH=$4
EXTEND_MIRRORS=$5
source /opt/build-tools/common.sh

View File

@@ -3,6 +3,9 @@
source /opt/build-tools/default.conf
source /opt/build-tools/common.sh
ARCH=$1
EXTEND_MIRRORS=$2
work_dir="/work/test"
mkdir -p $work_dir

View File

@@ -23,11 +23,11 @@ echo "source_package_name: $source_package_name"
echo "dist_package_list: $dist_package_list"
# 移除老包
for vpg in dist_package_list
for vpg in ${dist_package_list[@]}
do
reprepro_expect -- -b $repository_dir remove xenial $vpg
reprepro_expect -- -b $repository_dir remove focal $vpg
done
# 上传新包
cd $WORKSPACE/dist
reprepro_expect -- -b $repository_dir includedeb xenial *.deb
reprepro_expect -- -b $repository_dir -S $source_package_name includedsc xenial *.dsc
reprepro_expect -- -b $repository_dir includedeb focal *.deb
reprepro_expect -- -b $repository_dir -S $source_package_name includedsc focal *.dsc