开始整理这几天搭建OBS的问题
obs 搭建相关参考链接:
http://wiki.meego.com/User:Stskeeps/10_easy_steps_to_a_local_OBS
http://blog.youkuaiyun.com/anewhuahua/article/details/6115430
http://wiki.meego.com/Build_Infrastructure/Sysadmin_Distro/OBS_setup_openSUSE114
http://blog.chinaunix.net/space.php?uid=25153965&do=blog&id=160777
可以去wiki.meego.com搜索obs获取更多有用的信息
obs及osc命令使用相关链接:
http://en.opensuse.org//openSUSE:Build_Service_Tutorial
http://jianlee.ylinux.org/Computer/Server/index.html
步骤及细节:
1 在 http://www.opensuse.org/zh-cn/ 下载opensuse操作系统,当前稳定版本为11.4
2 安装opensuse至服务器,按照提示进行操作即可,保持服务器内存大于1G,否则可能安装不成功。
3 安装成功后,为了便于操作,安装启动SAMBA,SSH等工具。
zypper ref
zypper in samba
特别注意关闭opensuse防火墙或者修改防火墙配置添加端口号。
关闭防火墙
rcSuSEfirewall2 stop
或者修改配置
vi /ete/sysconfig/Susefirewall2
FW_SERVICES_EXT_TCP="ssh 445 139 389 telnet 80 81 82 "
FW_SERVICES_EXT_UDP="137 138 "
rcSuSEfirewall2 restart
rcsshd start
rcsmb start
chkconfig --add sshd
chkconfig --add smb
在opensuse下有BUG,rcsmb start不成功,报错可以查看log。
解决方法:
https://bugzilla.novell.com/show_bug.cgi?id=666450
关闭Novoll AppArmor,或更新/etc/apparmor.d/下关于samba的配置,或者从面板设置。
/usr/sbin/smbd (flags=complain) {
...
}
4 可以从其他电脑登陆服务器了,进入ssh后,如果要获取root权限,请使用su - ,使用su可能存在环境变量不对的问题。
5 开始构建obs环境。
cd /etc/zypp/repos.d/;
wget http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.4/openSUSE:Tools.repo
zypper ref
加入工具源并且更新
细节步骤可参考http://blog.chinaunix.net/space.php?uid=25153965&do=blog&id=160561,配合其他参考链接.注意相关127.0.0.1改成我们的服务器IP。可能需要关闭防火墙,OBS好像还用到了类似5232等端口号。
http://IP/ - the web interface for your own OBS :)
http://IP:81/ - API interface, used in 'osc' commands - and also to make new users and change your administrator password
http://IP:82/ - repository, used for downloading final packages
可以通过浏览器访问各个端口。访问http://IP:82/ 如果返回404
mkdir /srv/obs/repos
chown -R obsrun:obsrun /srv/obs/repos
404 while trying to see the package repository
Check, if the /srv/obs/repos directory is owned by obsrun.obsrun - if not, chown it. Failing to do so will prevent publisher from publishing your repositories in repository directory, and when you try accessing them you will get the 404.
6 搭建好环境后,安装obs-worker。
参考http://blog.chinaunix.net/space.php?uid=25153965&do=blog&id=160777启动obs-worker
7 导入meego数据
mkdir -p /obs/imports
mkdir -p /obs/build
ln -s /obs/build /srv/obs/build
注意最后一句不能漏掉 /srv/obs/build是obs的一个默认目录,可以查看/etc/sysconfig/BSConfig.m
可以在网上找到一个脚本进行快速下载导入。
wget http://stskeeps.subnetmask.net/meego/import-meego-release.sh
注意改脚本对于meego 1.2和 armvh7l的版本需要进行相应的修改。
armvh7对应调度器为armv8el。首先打开OBS架构选项。
# vi /etc/sysconfig/obs-server
OBS_SCHEDULER_ARCHITECTURES="i586 armv5el armv8el"
使用脚本还需要下载Meego1.2的prjconf
git clone http://git.gitorious.org/meego-developer-tools/obs-project-config.git
ls obs-project-config
使用脚本命令
mv import-meego-release.sh /usr/sbin
import-meego-release.sh 1.2.0 rsync://mirrors.kernel.org/meego/releases /home/linj/obs-project-config/MeeGo_1.2
如果遇到认证失败的问题,第一次使用osc的时候,配置usr和passwd。譬如使用osc meta prj -e m
此时会要求你配置用户和密码。OBS的默认账户:Admin ,密码是opensuse
也可以修改.oscrc添加
vi /root/.oscrc
[http://192.168.129.171:81]
user=Admin
pass=opensuse
这样就完成了MeeGo 1.2 的仓库导入。