app-portage/virtual-appliace: update

This commit is contained in:
Joerg Deckert 2017-06-20 16:39:02 +02:00
parent 31faa73ce8
commit 044041bdbd
5 changed files with 43 additions and 184 deletions

View File

@ -1,7 +1,5 @@
AUX addparams-0.9.1.diff 6756 SHA256 d384ef312af31c3bb16e71d27a3b6f1c5d36fefe393d7b941f4e6013a7b8b218 SHA512 36bc53c0037a56f111c9ce29eb457555246936058845f71d24ec3bdd97d245006dc21cd332b8bd8de1fbda82962806473362c493ac4e7215b429860cc26220a4 WHIRLPOOL ef659270ad2c339e6bd92aeedc69f99fdaaa1c1bdc526a526f0b4320f81de6ef146ec1943514749fa6dc56a2502200117bd4d4a07abdb0b47ee73ca170daa0c3
AUX locale-de.diff 463 SHA256 b178984896c3c7b804b4e7497e1ce2d4b7d31d003e68765f90235f76fdf92c66 SHA512 b817340d60a32ed30206ae602427fa70c8a18929252192a061667ef4a2c8f2cbcad6241e8c71f5b74b2f2d7f59e6d53e8dd10571c41a61ad02dd4a3b494d8bf1 WHIRLPOOL add55c0fd0515e74f31aac5ccf064c297434c2c0ed35be243ed38b457e4a8635ce6e719d62624cc85626660865a281d3bf3d1ace7959272965fccf77152388f9
AUX mkfs.ext4-64bit.diff 663 SHA256 ebcf393fdb90ce1673d9913c792bceecc1c54229ad8af860484c695275eb99e0 SHA512 71ab1af0dc4bd930ca40545c8680837dc02f97fa85d7003c4444b4332fd9fbc47b9e59d6d11f9697a0d8b735025c21dc8393a7163449d9b79248438a3e894ad9 WHIRLPOOL b1d18e9b105f8452743e5ddfd4f8dd0bfedd59eaa26a348539be40a124d6a8abd930b9112759c8f3414e868a228d95ee9801bcf965fc2083be6a015f260cbd35
AUX varconfpath-0.9.1.diff 409 SHA256 49cde0194d2a22f5b661c28158babed8e5b576df1804bde5a4028e190fa1614d SHA512 2c6118269e9a08cd0533989a57b036977ca6c2579aae2904790645efa95ec87ee9c7affe3b961159a652756122f92b04a1ef9d34b6a55e1e35902f39e8be487e WHIRLPOOL 69b0c3c92aea233405bda4c49a3b418adcb422b571181fc831388e11f6b2186be1c2c84fb4fdc30f5464d13eab592a1db6c7663f8fe7517790a3759505ec981a
DIST virtual-appliance-0.9.1.tar.bz2 49846 SHA256 f0a78d83f3e0e772d5a296b50b2fee93fb7f8271509b12fbc610d736a4710f73 SHA512 1db8eac5b80bde25842b612f077c40b5e8a9631294ca80a5cf663ed1023f5cd70b57a56801c627120f0915402eef6ce8bf7d92126550ce39f3bde5c6925cba99 WHIRLPOOL 5a7cfef86e698e88e9636280d0debae415f2d2d5947837b8af825a1913ae415ddecc2b7269db12914c119a122f02364c0bbb81b9acba37e24c77fe806970f953
EBUILD virtual-appliance-0.9.1.ebuild 1062 SHA256 229e607d1e9256ac698cde814ace83130828a9ca9f7cf9a2c9ff829ff8e5effd SHA512 28bf6b5d00d2c2f0df1e81fd318bee825fafcd11a0ff7a87a468f245b8917b4fb635c71fedb6ef642fc3b3fb0194e0d80ae11ee73cca61f2c427335fc254990d WHIRLPOOL 9a728ed7fc42038d516119eefafe77645c5ad6a677b77c2bc8ea1d8333e601324820180c2e436f843363d29c45c1f9cea338af0ee6abba33d132b33217f6c27c
AUX vmdk-scsi.diff 1309 SHA256 b2d612b158b60987d523219fe9a2b6eff237f69cb74a45249e2fb51e6f73ec03 SHA512 ab01df9c707830804bf8ccc366141360f7ee33b1c423d26aa870ed91f021aa758631243b1d39bc196e063c263e6043715d9ec704fff79d427143ed83496df3e6 WHIRLPOOL f1e202ebf18c560e8bf2adf040c5130cedc4a6298e8e75d505d6127bae3717f7573f2bc172de276e275be1da1eaadfd164ffd169ee5d571b5ff77f54054c2753
EBUILD virtual-appliance-2.0-r20161220.ebuild 1071 SHA256 2c2490af8345956634aff75a3e83045365ff7a6f14f73fe3ede3b754d8f550bf SHA512 bf2bc278c97beb85453993b7162e36c838291f5c168bc4f7f8d1e212f206114a092c7aa154342660062a4dbe95efbb27556794524d6d80ad0e823006db96af24 WHIRLPOOL 77393377916b0a1fcd73b481dabd02008f492038bfacda6f9cee18c084e09cd1b3aaaba571c65fe278d6b2301b2fffe4f2d8098dac545c01625400189c329394
EBUILD virtual-appliance-2.0-r20170528.ebuild 1088 SHA256 e39ca4699977c48ac3d7626951c9fd816dc1a24e4a2e9b080dad86f6db021b8c SHA512 3742ad9f3cd1135362fa9ef7851549ce6830f411b9b882669798de88cc793b1c625d157a63a90d23df3d56e923d356a070309076778c1a65b800cad89231d773 WHIRLPOOL 7d4228fe9f66944cb57dba683be01466aac6ed89c9773b9821c584330a993f9f6b953a181d4bfce446d13a0017793f28109c8ca92dfb5d1737ab01c43855315c

View File

@ -1,160 +0,0 @@
diff -Naur virtual-appliance.orig/configs/locale.gen virtual-appliance/configs/locale.gen
--- virtual-appliance.orig/configs/locale.gen 2015-03-01 12:45:06.000000000 +0100
+++ virtual-appliance/configs/locale.gen 2014-09-23 10:34:00.000000000 +0200
@@ -17,15 +17,6 @@
en_US ISO-8859-1
en_US.UTF-8 UTF-8
-#ja_JP.EUC-JP EUC-JP
-#ja_JP.UTF-8 UTF-8
-#ja_JP EUC-JP
-#en_HK ISO-8859-1
-#en_PH ISO-8859-1
-#de_DE ISO-8859-1
-#de_DE@euro ISO-8859-15
-#es_MX ISO-8859-1
-#fa_IR UTF-8
-#fr_FR ISO-8859-1
-#fr_FR@euro ISO-8859-15
-#it_IT ISO-8859-1
+de_DE ISO-8859-1
+de_DE@euro ISO-8859-15
+de_DE.UTF-8 UTF-8
diff -Naur virtual-appliance.orig/configs/make.conf.amd64-hardened virtual-appliance/configs/make.conf.amd64-hardened
--- virtual-appliance.orig/configs/make.conf.amd64-hardened 1970-01-01 01:00:00.000000000 +0100
+++ virtual-appliance/configs/make.conf.amd64-hardened 2015-03-03 15:54:23.205110169 +0100
@@ -0,0 +1,14 @@
+CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"
+CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"
+CHOST="x86_64-pc-linux-gnu"
+MAKEOPTS="-j2"
+USE="-* berkdb bindist gdbm hardened nls nptl open_perms pam pcre peer_perms ubac unconfined unicode xattr zlib ptpax xtpax"
+ALSA_PCM_PLUGINS="*"
+CLEAN_DELAY="0"
+EMERGE_WARNING_DELAY="0"
+AUTO_CLEAN="yes"
+EPAUSE_IGNORE="1"
+EMERGE_DEFAULT_OPTS="--jobs=2 --autounmask=n"
+FEATURES="noinfo -test nodoc noman nostrip unmerge-orphans buildpkg notitles parallel-fetch -selinux -sesandbox"
+CURL_SSL="openssl"
+PYTHON_TARGETS="python2_7 python3_4"
diff -Naur virtual-appliance.orig/Makefile virtual-appliance/Makefile
--- virtual-appliance.orig/Makefile 2015-03-03 15:11:48.549069120 +0100
+++ virtual-appliance/Makefile 2015-03-03 16:00:36.172702376 +0100
@@ -22,6 +22,9 @@
HEADLESS = NO
EXTERNAL_KERNEL = NO
UDEV = YES
+LOGGER = metalog
+PROFILE = 1
+SELINUX = NO
SOFTWARE = 1
PKGLIST = 0
ACCEPT_KEYWORDS = amd64
@@ -170,7 +173,7 @@
endif
echo ACCEPT_KEYWORDS=$(ACCEPT_KEYWORDS) >> $(CHROOT)/etc/portage/make.conf
-[ -f "appliances/$(APPLIANCE)/make.conf" ] && cat "appliances/$(APPLIANCE)/make.conf" >> $(CHROOT)/etc/portage/make.conf
- $(inroot) eselect profile set 1
+ $(inroot) eselect profile set $(PROFILE)
cp configs/locale.gen $(CHROOT)/etc/locale.gen
$(inroot) locale-gen
for f in $(PACKAGE_FILES); do \
@@ -228,8 +231,8 @@
systools: sysconfig compile_options
@scripts/echo Installing standard system tools
- $(inroot) $(EMERGE) -n $(USEPKG) app-admin/metalog
- $(inroot) /sbin/rc-update add metalog default
+ $(inroot) $(EMERGE) -n $(USEPKG) app-admin/$(LOGGER)
+ $(inroot) /sbin/rc-update add $(LOGGER) default
ifeq ($(DASH),YES)
if ! test -e "$(STAGE4_TARBALL)"; \
then $(inroot) $(EMERGE) -n $(USEPKG) app-shells/dash; \
@@ -238,6 +241,14 @@
fi
$(inroot) ln -sf dash /bin/sh
endif
+ifeq ($(SELINUX),YES)
+ $(inroot) $(EMERGE) -n $(USEPKG) -1 sys-apps/checkpolicy sys-apps/policycoreutils
+ $(inroot) $(EMERGE) -n $(USEPKG) -1 sec-policy/selinux-base
+ $(inroot) $(EMERGE) -n $(USEPKG) sec-policy/selinux-base-policy
+ $(inroot) /sbin/rc-update add selinux_gentoo boot
+ echo "tmpfs /tmp tmpfs defaults,noexec,nosuid,rootcontext=system_u:object_r:tmp_t 0 0" >> $(CHROOT)/etc/fstab
+ echo "tmpfs /run tmpfs mode=0755,nosuid,nodev,rootcontext=system_u:object_r:var_run_t 0 0" >> $(CHROOT)/etc/fstab
+endif
touch systools
grub: stage3 configs/grub.conf kernel scripts/grub-headless.sed
@@ -274,7 +285,11 @@
$(inroot) $(EMERGE) $(USEPKG) --update --newuse --deep world
$(inroot) $(EMERGE) --depclean --with-bdeps=n
$(gcc_config)
+ifdef ETC_UPDATE_AUTO
+ EDITOR=/usr/bin/nano $(inroot) etc-update --automode $(ETC_UPDATE_AUTO)
+else
EDITOR=/usr/bin/nano $(inroot) etc-update
+endif
$(MAKE) -C appliances/$(APPLIANCE) postinstall
ifeq ($(UDEV),NO)
rm -f $(CHROOT)/etc/runlevels/sysinit/udev
@@ -348,6 +363,7 @@
mount -o bind $(CHROOT) gentoo
tar -aScf "$(STAGE4_TARBALL).tmp.xz" --numeric-owner $(COPY_ARGS) -C gentoo --one-file-system .
umount gentoo
+ sleep 5
rmdir gentoo
mv "$(STAGE4_TARBALL).tmp.xz" "$(STAGE4_TARBALL)"
@@ -413,13 +429,18 @@
@echo 'CHROOT= - The directory to build the chroot'
@echo 'DISK_SIZE= - Size of the disk image'
@echo 'SWAP_SIZE= - Size of the swap file'
- @echo 'ARCH= - Architecture to build for (x86 or amd64)'
+ @echo 'ARCH= - Architecture to build for'
+ @echo ' (x86, amd64 or amd64-hardened)'
@echo 'VIRTIO=YES - Configure the stage2/image to use virtio'
@echo 'EXTERNAL_KERNEL=YES - Do not build a kernel in the image'
@echo 'HEADLESS=YES - Build a headless (serial console) image.'
@echo 'REMOVE_PORTAGE_TREE=NO - Do not exclude the portage tree from the image'
@echo 'PKGDIR= - Directory to use/store binary packages'
@echo 'ENABLE_SSHD=YES - Enable sshd to start automatically in the image'
+ @echo 'LOGGER=metalog - Logging daemon (metalog, syslog-ng)'
+ @echo 'PROFILE=1 - select profile'
+ @echo 'SELINUX=NO - enable SELinux'
+ @echo 'ETC_UPDATE_AUTO = - automatic etc-update (e.g. -7: do not ask)'
@echo
@scripts/echo 'Example'
@echo 'make APPLIANCE=mongodb HEADLESS=YES VIRTIO=YES stage4 qcow clean'
diff -Naur virtual-appliance.orig/scripts/kernel.sh virtual-appliance/scripts/kernel.sh
--- virtual-appliance.orig/scripts/kernel.sh 2015-03-01 12:45:06.000000000 +0100
+++ virtual-appliance/scripts/kernel.sh 2015-03-03 15:12:29.900967930 +0100
@@ -24,7 +24,7 @@
make ${MAKEOPTS} oldconfig
make ${MAKEOPTS}
rm -rf /lib/modules/*
-make ${MAKEOPTS} modules_install
+grep -q CONFIG_MODULES=y .config && make ${MAKEOPTS} modules_install
rm -f /boot/vmlinuz*
make ${MAKEOPTS} install
cp -a /usr/src/linux/.config /root/kernel.config
diff -Naur virtual-appliance.orig/scripts/sync-stage3.sh virtual-appliance/scripts/sync-stage3.sh
--- virtual-appliance.orig/scripts/sync-stage3.sh 2015-03-01 12:45:06.000000000 +0100
+++ virtual-appliance/scripts/sync-stage3.sh 2015-03-03 15:12:29.900967930 +0100
@@ -3,14 +3,14 @@
set -e
RSYNC_MIRROR=${RSYNC_MIRROR:-rsync://mirrors.rit.edu/gentoo/}
arch=$1
-g_arch=$(echo ${arch}|sed 's/i.86/x86/')
+g_arch=$(echo ${arch}|sed 's/i.86/x86/'|sed 's/-hardened//')
rsync="rsync --no-motd"
echo -n ${arch}:
latest=/releases/${g_arch}/autobuilds/latest-stage3.txt
${rsync} ${RSYNC_MIRROR}${latest} latest-stage3.txt
-file=$(egrep -v 'nomultilib|hardened|uclibc|^#' latest-stage3.txt \
+file=$(cat latest-stage3.txt \
| grep -E ${arch}\|i686 |head -n 1 \
| cut -d ' ' -f 1)

View File

@ -1,11 +0,0 @@
--- virtual-appliance.orig/Makefile 2015-03-01 12:45:06.000000000 +0100
+++ virtual-appliance/Makefile 2015-03-02 10:23:39.075189065 +0100
@@ -41,7 +41,7 @@
CRITICAL = appliances/$(APPLIANCE)/critical
# Allow appliance to override variables
--include appliance/$(APPLIANCE)/$(APPLIANCE).cfg
+-include appliances/$(APPLIANCE)/$(APPLIANCE).cfg
# Allow user to override variables
-include $(profile).cfg

View File

@ -0,0 +1,31 @@
diff -Naur virtual-appliance.orig/Makefile virtual-appliance/Makefile
--- virtual-appliance.orig/Makefile 2017-06-20 11:53:35.000000000 +0200
+++ virtual-appliance/Makefile 2017-06-20 13:13:14.223967837 +0200
@@ -9,6 +9,7 @@
RAW_IMAGE = $(IMAGES)/$(APPLIANCE).img
QCOW_IMAGE = $(IMAGES)/$(APPLIANCE).qcow
VMDK_IMAGE = $(IMAGES)/$(APPLIANCE).vmdk
+VMDK_TYPE = IDE
XVA_IMAGE = $(IMAGES)/$(APPLIANCE).xva
LST_FILE = $(IMAGES)/$(APPLIANCE)-packages.lst
CHECKSUMS = $(IMAGES)/SHA256SUMS
@@ -284,7 +285,11 @@
$(VMDK_IMAGE): $(RAW_IMAGE)
@scripts/echo Creating `basename $(VMDK_IMAGE)`
+ifeq ($(VMDK_TYPE),SCSI)
+ qemu-img convert -f raw -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 $(RAW_IMAGE) $(VMDK_IMAGE).tmp
+else
qemu-img convert -f raw -O vmdk $(RAW_IMAGE) $(VMDK_IMAGE).tmp
+endif
mv $(VMDK_IMAGE).tmp $(VMDK_IMAGE)
vmdk: $(VMDK_IMAGE)
@@ -372,6 +377,7 @@
@echo 'EXTERNAL_KERNEL=YES - Do not build a kernel in the image'
@echo 'HEADLESS=YES - Build a headless (serial console) image.'
@echo 'ENABLE_SSHD=YES - Enable sshd to start automatically in the image'
+ @echo 'VMDK_TYPE=IDE - VMDK image type (IDE or SCSI)'
@echo
@scripts/echo 'Example'
@echo 'make APPLIANCE=mongodb HEADLESS=YES VIRTIO=YES stage4 qcow clean'

View File

@ -4,20 +4,21 @@
EAPI=5
inherit eutils linux-info toolchain-funcs
inherit eutils linux-info toolchain-funcs mercurial
MY_REV="82ab42046c48" # checkout revision
MY_REV="f718935" # checkout revision
MY_USR="marduk" # user name
MY_P="${MY_USR}-${PN}-${MY_REV}"
DESCRIPTION="Programatically (re)create Gentoo Virtual Appliances"
HOMEPAGE="https://bitbucket.org/marduk/virtual-appliance/wiki/Home"
SRC_URI="https://bitbucket.org/${MY_USR}/${PN}/get/${PV}.tar.bz2 -> ${P}.tar.bz2"
EHG_REPO_URI="https://bitbucket.org/${MY_USR}/${PN}"
EHG_REVISION=${MY_REV}
LICENSE="unknown"
SLOT="0"
KEYWORDS="amd64 x86"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="app-emulation/qemu
@ -32,11 +33,11 @@ pkg_setup() {
}
src_prepare() {
rm .hg_archival.txt
rm .hgignore
rm .hgtags
epatch ${FILESDIR}/varconfpath-${PV}.diff
epatch ${FILESDIR}/addparams-${PV}.diff
rm -rf .hg
epatch ${FILESDIR}/locale-de.diff
epatch ${FILESDIR}/vmdk-scsi.diff
}
src_compile() {
@ -44,10 +45,10 @@ src_compile() {
}
src_install() {
insinto /opt/${PN}
dodir /opt/${PN}/appliances
mv appliances appliances-examples
cp -r . ${D}/opt/${PN}
echo "CONFIG_PROTECT=\"/opt/${PN}/configs\"" > "${T}"/99${PN}
doenvd "${T}"/99${PN}
}