2014-01-22 21:30:33 +01:00
|
|
|
# Copyright 1999-2014 Gentoo Foundation
|
2013-04-17 08:03:13 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Header: $
|
|
|
|
|
|
|
|
EAPI=4
|
|
|
|
|
|
|
|
inherit eutils rpm
|
|
|
|
|
|
|
|
RPM_VER="1.1"
|
2014-01-22 21:30:33 +01:00
|
|
|
KVER="compile"
|
|
|
|
OPSI="opsi40-testing"
|
|
|
|
SUSE="openSUSE_13.1"
|
|
|
|
|
2013-04-17 08:03:13 +02:00
|
|
|
|
|
|
|
DESCRIPTION="opsi linux bootimage"
|
|
|
|
HOMEPAGE="http://opsi.org/"
|
2014-01-22 21:30:33 +01:00
|
|
|
SRC_URI="http://download.opensuse.org/repositories/home:/uibmz:/opsi:/${OPSI}/${SUSE}/src/${P}-${RPM_VER}.src.rpm"
|
2013-04-17 08:03:13 +02:00
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
IUSE=""
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
|
|
|
|
RDEPEND="net-misc/opsi-utils"
|
|
|
|
DEPEND="${RDEPEND}"
|
|
|
|
RESTRICT=""
|
|
|
|
SLOT="0"
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
einfo "Nothing to compile"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2013-04-21 20:39:11 +02:00
|
|
|
insinto /tftpboot/linux
|
2013-04-17 08:03:13 +02:00
|
|
|
doins syslinux/chain.c32 syslinux/menu.c32 syslinux/pxelinux.0
|
|
|
|
newins miniroot.bz2 miniroot-${PV}.bz2
|
|
|
|
newins vmlinuz vmlinuz-${KVER}
|
2013-04-21 20:39:11 +02:00
|
|
|
dosym miniroot-${PV}.bz2 tftpboot/linux/miniroot.bz2
|
|
|
|
dosym vmlinuz-${KVER} tftpboot/linux/install
|
2013-04-17 08:03:13 +02:00
|
|
|
|
2013-04-21 20:39:11 +02:00
|
|
|
insinto /tftpboot/linux/pxelinux.cfg
|
2013-04-17 08:03:13 +02:00
|
|
|
doins default.menu default.nomenu install
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
fileadmingroup=$(grep "fileadmingroup" /etc/opsi/opsi.conf | cut -d "=" -f 2 | sed 's/ //g')
|
|
|
|
|
2013-04-21 20:39:11 +02:00
|
|
|
chown -R opsiconfd:$fileadmingroup /tftpboot/linux || true
|
|
|
|
chmod 2775 /tftpboot/linux
|
|
|
|
chmod 2775 /tftpboot/linux/pxelinux.cfg
|
|
|
|
find /tftpboot/linux -type f -exec chmod 664 {} \;
|
|
|
|
if [ ! -e /tftpboot/linux/pxelinux.cfg/default ]; then
|
|
|
|
cd /tftpboot/linux/pxelinux.cfg
|
2013-04-17 08:03:13 +02:00
|
|
|
ln -s default.menu default
|
|
|
|
cd - >/dev/null
|
|
|
|
fi
|
|
|
|
serviceentry=$(opsi-admin --no-depot -Sd method config_getObjects '[]' '{"id":"clientconfig.configserver.url"}' | grep defaultValues | cut -d "'" -f2)
|
|
|
|
if [ "$serviceentry" != "" ]; then
|
|
|
|
sed -i "s,append.*$,& service=$serviceentry,g" /tmp/default.menu
|
|
|
|
fi
|
|
|
|
}
|