制作openssh
说明
理论上制作的多个rpm在arm64架构(aarch64)都适用
系统信息:4.19.90-17.ky10.aarch64 GNU/Linux
升级前备份好文件/etc/ssh、/etc/pam.d等以及开启telnet
升级后确认正常后关闭telnet
在之前制作过openssh-9.5p1基础上继续操作
yum install rpm-build zlib-devel openssl-devel gcc perl-devel pam-devel xmkmf libXt-devel gtk2-devel make -y
# yum install rpm-build 会自动创建 /root/rpmbuild/SOURCES目录,如未创建,手动创建
# mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp x11-ssh-askpass-1.2.4.1.tar.gz openssh-9.7p1.tar.gz /root/rpmbuild/SOURCES
#只解压 openssh.spec到 /root/rpmbuild/SPECS目录
cd /root/rpmbuild/SPECS
tar -xzvf ../SOURCES/openssh-9.7p1.tar.gz openssh-9.7p1/contrib/redhat/openssh.spec --strip-components=3
#修改openssh.spec配置文件
sed -i -e "s/%global no_gnome_askpass 0/%global no_gnome_askpass 1/g" openssh.spec
sed -i -e "s/%global no_x11_askpass 0/%global no_x11_askpass 1/g" openssh.spec
sed -i -e "s/^BuildRequires: openssl-devel < 1.1/#BuildRequires: openssl-devel < 1.1/g" openssh.spec
#sed -i -e '/with-privsep-path/a\ --with-openssl-includes=/usr/local/openssl/include \\\n --with-ssl-dir=/usr/local/openssl \\' openssh.spec
rpmbuild -ba openssh.spec执行时遇到报错“cannot use --with-ssl-dir when OpenSSL disabled”
后排查为修改openssh.spec配置,执行了上面注释行修改导致
#sed -i -e '/with-privsep-path/a\ --with-openssl-includes=/usr/local/openssl/include \\\n --with-ssl-dir=/usr/local/openssl \\' openssh.spec
需要去掉–with-ssl-dir配置,修改为
sed -i -e '/with-privsep-path/a\ --with-openssl-includes=/usr/local/openssl/include \\' openssh.spec
如图openssh.spec 配置
再执行下面的操作
rpmbuild -ba openssh.spec
ls /root/rpmbuild/RPMS/aarch64/
cd /root/rpmbuild/RPMS/aarch64/
#打包rpm文件
tar -czvf /tmp/openssh-9.7p1-1.ky10.aarch64-rpm.tar.gz *
制作好的麒麟v10系统arm64架构openssh9.7p1的rpm包,下载链接(设置了5积分,制作rpm不难,难点是要有环境):
https://download.csdn.net/download/weixin_43723044/89408673