Compare commits

..

1 Commits

Author SHA1 Message Date
Albert Hopkins 1f4fbac60e closed 2011-02-05 00:16:24 -05:00
109 changed files with 4741 additions and 8090 deletions

16
.gitignore vendored
View File

@ -1,16 +0,0 @@
appliances/*
!appliances/base/
!appliances/default/
build
kernel
loop
packages
repos
distfiles
images
*.cfg
!appliances/default/default.cfg
latest-stage3.txt
portage-snapshot.tar.bz2
stage3-*-latest.tar.xz
stage3-*.tar.xz

7
.hgignore Normal file
View File

@ -0,0 +1,7 @@
vabuild\/.*
loop\/.*
.*\.swp$
.*\.cfg
latest-stage3\.txt
portage-latest\.tar\.bz2
stage3-.*-latest\.tar\.bz2

637
Makefile
View File

@ -1,490 +1,287 @@
APPLIANCE ?= base
VABUILDER_OUTPUT := $(CURDIR)
CHROOT := $(VABUILDER_OUTPUT)/build/$(APPLIANCE)
VA_PKGDIR = $(VABUILDER_OUTPUT)/packages
DISTDIR = $(CURDIR)/distfiles
REPO_DIR = $(CURDIR)/repos
REPO_NAMES =
KERNEL_DIR = $(CURDIR)/kernel
PORTAGE_DIR = $(REPO_DIR)/gentoo
CHROOT=./vabuild
APPLIANCE = base
HOSTNAME = $(APPLIANCE)
IMAGES = $(VABUILDER_OUTPUT)/images
RAW_IMAGE = $(IMAGES)/$(APPLIANCE).img
QCOW_IMAGE = $(IMAGES)/$(APPLIANCE).qcow
VMDK_IMAGE = $(IMAGES)/$(APPLIANCE).vmdk
VMDK_TYPE = IDE
OVA_IMAGE = $(IMAGES)/$(APPLIANCE).ova
OVA_NUM_CPUS = 1
OVA_MEM_SIZE = 1024
XVA_IMAGE = $(IMAGES)/$(APPLIANCE).xva
LST_FILE = $(IMAGES)/$(APPLIANCE)-packages.lst
CHECKSUMS = $(IMAGES)/SHA256SUMS
STAGE3 = $(CHROOT)/var/tmp/stage3
COMPILE_OPTIONS = $(CHROOT)/var/tmp/compile_options
SOFTWARE = $(CHROOT)/var/tmp/software
KERNEL_SRC = $(CHROOT)/var/tmp/kernel_src
KERNEL = $(CHROOT)/var/tmp/kernel
GRUB = $(CHROOT)/var/tmp/grub
PREPROOT = $(CHROOT)/var/tmp/preproot
SYSTOOLS = $(CHROOT)/var/tmp/systools
STAGE4_TARBALL = $(VABUILDER_OUTPUT)/images/$(APPLIANCE).tar.xz
RAW_IMAGE = $(HOSTNAME).img
QCOW_IMAGE = $(HOSTNAME).qcow
VMDK_IMAGE = $(HOSTNAME).vmdk
KERNEL_CONFIG = kernel.config
VIRTIO = NO
TIMEZONE = UTC
DISK_SIZE = 6.0G
SWAP_SIZE = 30
SWAP_FILE = $(CHROOT)/.swap
VA_ARCH = amd64
KERNEL_CONFIG = configs/kernel.config.$(VA_ARCH)
KERNEL_PATH = $(CHROOT)/usr/src/kernel-path
MAKEOPTS = -j5 -l5.64
ARCH = amd64
MAKEOPTS = -j4
PRUNE_CRITICAL = NO
REMOVE_PORTAGE_TREE = YES
ENABLE_SSHD = NO
CHANGE_PASSWORD = YES
HEADLESS = NO
EXTERNAL_KERNEL = NO
PKGLIST = 0
DASH = NO
LOCALE ?= en_US.utf8
ACCEPT_KEYWORDS = amd64
M4 = m4
EMERGE = emerge --jobs=$(shell nproc --all)
EMERGE = /usr/bin/emerge
M4_DEFS = -D HOSTNAME=$(HOSTNAME)
M4C = $(M4) $(M4_DEFS)
NBD_DEV = /dev/nbd0
USEPKG = --usepkg --binpkg-respect-use=y
RSYNC_MIRROR = rsync://rsync.gtlib.gatech.edu/gentoo/
KERNEL_PKG = gentoo-sources
WORLD = appliances/$(APPLIANCE)/world
WORLD_DEFAULT = appliances/default/world
EXTRA_WORLD =
RSYNC_MIRROR = rsync://mirrors.rit.edu/gentoo/
KERNEL = gentoo-sources
PACKAGE_FILES = $(APPLIANCE)/package.*
WORLD = $(APPLIANCE)/world
CRITICAL = $(APPLIANCE)/critical
# /etc/portage targets
base_etc_portage := $(wildcard configs/portage/*)
etc_portage := $(patsubst configs/portage/%,$(CHROOT)/etc/portage/%,$(base_etc_portage))
default_package_files := $(wildcard appliances/default/package.*)
appliance_package_files := $(wildcard appliances/$(APPLIANCE)/package.*)
portage_default_package_files = $(patsubst appliances/default/package.%,$(CHROOT)/etc/portage/package.%/01default,$(default_package_files))
portage_package_files = $(patsubst appliances/$(APPLIANCE)/package.%,$(CHROOT)/etc/portage/package.%/02$(APPLIANCE),$(appliance_package_files))
default_make_conf = $(wildcard appliances/default/make.conf)
appliance_make_conf = $(wildcard appliances/$(APPLIANCE)/make.conf)
portage_make_conf_local = $(CHROOT)/etc/portage/make.conf.local
appliance_profile := default/linux/amd64/23.0/systemd
# Allow appliance to override variables
-include appliances/default/default.cfg
-include appliances/$(APPLIANCE)/$(APPLIANCE).cfg
# Allow user to override variables
-include $(profile).cfg
ifneq ($(profile),)
container = $(profile)-$(APPLIANCE)-build
ifneq ($(PKGDIR),)
MOUNT_PKGDIR = mkdir -p $(CHROOT)/var/portage/packages; \
mount -o bind "$(PKGDIR)" $(CHROOT)/var/portage/packages
UMOUNT_PKGDIR = umount $(CHROOT)/var/portage/packages
ADD_PKGDIR = echo PKGDIR="/var/portage/packages" >> $(CHROOT)/etc/make.conf
endif
ifeq ($(PRUNE_CRITICAL),YES)
COPY_LOOP = rsync -ax --exclude-from=rsync-excludes \
--exclude-from=rsync-excludes-critical gentoo/ loop/
UNMERGE_CRITICAL = chroot $(CHROOT) $(EMERGE) -C `cat $(CRITICAL)`
else
container = $(APPLIANCE)-build
COPY_LOOP = rsync -ax --exclude-from=rsync-excludes gentoo/ loop/
endif
PATH := $(CURDIR)/scripts:$(PATH)
export PATH CHROOT container PORTAGE_DIR REPO_DIR REPO_NAMES VA_PKGDIR DISTDIR VA_ARCH
inroot := systemd-nspawn --quiet \
--directory=$(CHROOT) \
--machine=$(container) \
--capability=CAP_NET_ADMIN \
--bind=$(PORTAGE_DIR):/var/db/repos/gentoo \
$(foreach repo,$(REPO_NAMES),--bind=$(REPO_DIR)/$(repo):/var/db/repos/$(repo) ) \
--bind=$(VA_PKGDIR):/var/cache/binpkgs \
--bind=$(DISTDIR):/var/cache/distfiles
ifeq ($(VA_ARCH),x86)
inroot := linux32 $(inroot)
endif
stage4-exists := $(wildcard $(STAGE4_TARBALL))
COPY_ARGS = --exclude-from=configs/rsync-excludes
ifeq ($(CHANGE_PASSWORD),YES)
ifdef ROOT_PASSWORD
change_password = RUN usermod --password '$(ROOT_PASSWORD)' root
change_password = chroot $(CHROOT) usermod -p '$(ROOT_PASSWORD)' root
else
change_password = RUN passwd --delete root
change_password = chroot $(CHROOT) passwd -d root; chroot $(CHROOT) passwd -e root
endif
endif
gcc_config = $(inroot) gcc-config 1
ifneq ($(shell grep 'CONFIG_MODULES=y' $(KERNEL_CONFIG)), )
KERNEL_MODULES_PREPARE = modules_prepare
ifeq ($(REMOVE_PORTAGE_TREE),YES)
COPY_LOOP += --exclude=usr/portage
endif
export APPLIANCE ACCEPT_KEYWORDS CHROOT EMERGE HEADLESS M4 M4C inroot gcc_config
export HOSTNAME MAKEOPTS TIMEZONE USEPKG WORLD
export USEPKG RSYNC_MIRROR
export EXTERNAL_KERNEL KERNEL_PKG KERNEL_PATH KERNEL_CONFIG
ifeq ($(VIRTIO),YES)
VIRTIO_FSTAB = sed -i 's/sda/vda/' $(CHROOT)/etc/fstab
VIRTIO_GRUB = sed -i 's/sda/vda/' $(CHROOT)/boot/grub/grub.conf
endif
all: stage4
ifeq ($(HEADLESS),YES)
HEADLESS_INITTAB = sed -ri 's/^(c[0-9]:)/\#\1/' $(CHROOT)/etc/inittab
HEADLESS_GRUB = sed -i -f grub-headless.sed $(CHROOT)/boot/grub/grub.conf
endif
image: $(RAW_IMAGE)
ifeq ($(ENABLE_SSHD),YES)
enable_sshd = chroot $(CHROOT) rc-update add sshd default
endif
sync_portage: $(PORTAGE_DIR)
@print Grabbing latest portage
git -C $(PORTAGE_DIR) pull
touch $(PORTAGE_DIR)
gcc_config = chroot $(CHROOT) gcc-config 1
$(PORTAGE_DIR):
@print Grabbing the portage tree
git clone --depth=1 https://github.com/gentoo/gentoo.git $(PORTAGE_DIR)
export APPLIANCE ACCEPT_KEYWORDS CHROOT EMERGE HEADLESS M4 M4C
export HOSTNAME MAKEOPTS PRUNE_CRITICAL TIMEZONE USEPKG WORLD OVERLAY
$(CHROOT)/etc/portage/%: configs/portage/%
COPY --recursive $< /etc/portage/
unexport PKGDIR ARCH NBD_DEV
fstab:
@print Create new /etc/fstab
env echo -e "# <fs>\t\t<mountpoint>\t<type>\t<opts>\t<dump/pass>" > $(CHROOT)/etc/fstab
env echo -e "LABEL=ROOT\t/\t\text4\tnoatime\t1 1" >> $(CHROOT)/etc/fstab
env echo -e "/.swap\t\tnone\t\tswap\tsw\t0 0" >> $(CHROOT)/etc/fstab
env echo -e "#LABEL=SWAP\tnone\t\tswap\tsw\t0 0" >> $(CHROOT)/etc/fstab
all: image
$(PREPROOT): $(STAGE3) $(PORTAGE_DIR) $(foreach repo,$(REPO_NAMES),$(REPO_DIR)/$(repo)) fstab $(etc_portage) $(portage_default_package_files) $(portage_package_files)
mkdir -p $(VA_PKGDIR) $(DISTDIR)
@print Creating swap file: `basename $(SWAP_FILE)`
$(RAW_IMAGE):
qemu-img create -f raw $(RAW_IMAGE) $(DISK_SIZE)
partitions: $(RAW_IMAGE)
parted -s $(RAW_IMAGE) mklabel msdos
parted -s $(RAW_IMAGE) mkpart primary ext2 0 $(DISK_SIZE)
parted -s $(RAW_IMAGE) set 1 boot on
qemu-nbd -c $(NBD_DEV) $(RAW_IMAGE)
sleep 3
mkfs.ext2 -O sparse_super -L "$(APPLIANCE)"_root $(NBD_DEV)p1
touch partitions
mounts: stage3
mkdir -p $(CHROOT)
if [ ! -e mounts ] ; then \
mount -t proc none $(CHROOT)/proc; \
mount -o bind /dev $(CHROOT)/dev; \
mount -o bind /var/tmp $(CHROOT)/var/tmp; \
fi
touch mounts
sync_portage:
rsync --no-motd -L $(RSYNC_MIRROR)/snapshots/portage-latest.tar.bz2 portage-latest.tar.bz2
touch sync_portage
portage: sync_portage stage3
tar xjf portage-latest.tar.bz2 -C $(CHROOT)/usr
$(MOUNT_PKGDIR)
touch portage
preproot: stage3 mounts portage
cp -L /etc/resolv.conf $(CHROOT)/etc/
# bug in portage... annoying
chroot $(CHROOT) eselect python set python2.6
touch preproot
stage3:
mkdir -p $(CHROOT)
rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/latest-stage3.txt .
rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/`tail -n 1 latest-stage3.txt` stage3-$(ARCH)-latest.tar.bz2
tar xjpf stage3-$(ARCH)-latest.tar.bz2 -C $(CHROOT)
touch stage3
compile_options: portage make.conf locale.gen $(PACKAGE_FILES)
cp make.conf $(CHROOT)/etc/make.conf
$(ADD_PKGDIR)
echo ACCEPT_KEYWORDS=$(ACCEPT_KEYWORDS) >> $(CHROOT)/etc/make.conf
cp locale.gen $(CHROOT)/etc/locale.gen
chroot $(CHROOT) locale-gen
mkdir -p $(CHROOT)/etc/portage
for f in $(PACKAGE_FILES) ; do \
cp $$f $(CHROOT)/etc/portage/ ; \
done
touch compile_options
base_system: mounts compile_options
touch base_system
kernel: base_system $(KERNEL_CONFIG)
chroot $(CHROOT) cp /usr/share/zoneinfo/$(TIMEZONE) /etc/localtime
ifneq ($(EXTERNAL_KERNEL),YES)
chroot $(CHROOT) $(EMERGE) -n $(USEPKG) sys-kernel/$(KERNEL)
cp $(KERNEL_CONFIG) $(CHROOT)/usr/src/linux/.config
$(gcc_config)
chroot $(CHROOT) make $(MAKEOPTS) -C /usr/src/linux oldconfig
chroot $(CHROOT) make $(MAKEOPTS) -C /usr/src/linux
chroot $(CHROOT) make $(MAKEOPTS) -C /usr/src/linux modules_install
chroot $(CHROOT) make $(MAKEOPTS) -C /usr/src/linux install
cd $(CHROOT)/boot ; \
k=`/bin/ls -1 --sort=time vmlinuz-*|head -n 1` ; \
ln -nsf $$k vmlinuz
endif
touch kernel
$(SWAP_FILE): preproot
dd if=/dev/zero of=$(SWAP_FILE) bs=1M count=$(SWAP_SIZE)
/sbin/mkswap $(SWAP_FILE)
rm -f $(CHROOT)/etc/resolv.conf
COPY -L /etc/resolv.conf /etc/resolv.conf
touch $(PREPROOT)
stage3-$(VA_ARCH).tar.xz:
@print You do not have a stage3 tarball. Consider \"make sync_stage3\"
@exit 1
$(CHROOT)/etc/fstab: fstab preproot
cp fstab $(CHROOT)/etc/fstab
sync_stage3:
fetch-stage3 --systemd --outfile=stage3-$(VA_ARCH).tar.xz $(VA_ARCH)
$(CHROOT)/etc/conf.d/hostname: preproot
echo HOSTNAME=$(HOSTNAME) > $(CHROOT)/etc/conf.d/hostname
$(CHROOT)/etc/conf.d/clock: preproot
sed -i 's/^#TIMEZONE=.*/TIMEZONE="$(TIMEZONE)"/' $(CHROOT)/etc/conf.d/clock
$(STAGE3): stage3-$(VA_ARCH).tar.xz configs/stage3-tarball-excludes
mkdir -p $(CHROOT)
ifdef stage4-exists
@print Using stage4 tarball: `basename $(STAGE4_TARBALL)`
tar xpf "$(STAGE4_TARBALL)" -C $(CHROOT)
else
@print Using stage3 tarball
tar xpf stage3-$(VA_ARCH).tar.xz -C $(CHROOT) --exclude-from=configs/stage3-tarball-excludes
endif
rm -f $(CHROOT)/etc/localtime
touch $(STAGE3)
sysconfig: preproot $(SWAP_FILE) $(CHROOT)/etc/fstab $(CHROOT)/etc/conf.d/hostname $(CHROOT)/etc/conf.d/clock
@echo $(VIRTIO)
$(VIRTIO_FSTAB)
sed -i 's/^#s0:/s0:/' $(CHROOT)/etc/inittab
$(HEADLESS_INITTAB)
echo 'config_eth0=( "dhcp" )' > $(CHROOT)/etc/conf.d/net
echo 'dhcp_eth0="release"' >> $(CHROOT)/etc/conf.d/net
chroot $(CHROOT) ln -nsf net.lo /etc/init.d/net.eth0
chroot $(CHROOT) rc-update add net.eth0 default
chroot $(CHROOT) rc-update del consolefont boot
touch sysconfig
systools: sysconfig compile_options
chroot $(CHROOT) $(EMERGE) -n $(USEPKG) app-admin/syslog-ng
chroot $(CHROOT) rc-update add syslog-ng default
chroot $(CHROOT) $(EMERGE) -n $(USEPKG) sys-power/acpid
chroot $(CHROOT) rc-update add acpid default
chroot $(CHROOT) $(EMERGE) -n $(USEPKG) net-misc/dhcpcd
touch systools
sync_repos: $(foreach repo,$(REPO_NAMES),$(REPO_DIR)/$(repo))
@print Updating the repositories
$(foreach repo,$(REPO_NAMES),git -C $(REPO_DIR)/$(repo) pull;touch $(REPO_DIR)/$(repo);)
$(foreach repo,$(REPO_NAMES),$(REPO_DIR)/$(repo)):
@print Grabbing a repository
git clone --depth=1 $(REPO_URI_$(subst $(REPO_DIR)/,,$@)) $@
$(CHROOT)/etc/portage/repos.conf: $(foreach repo,$(REPO_NAMES),$(REPO_DIR)/$(repo))
$(foreach repo,$(REPO_NAMES),\
echo "[$(repo)]" >>$@;\
echo "location = /var/db/repos/$(repo)" >>$@;\
echo "auto-sync = no" >>$@;\
echo "" >>$@;\
)
touch $@
$(CHROOT)/etc/portage/package.%/01default: appliances/default/package.% $(STAGE3)
mkdir -p `dirname $@`
cp $< $@
$(CHROOT)/etc/portage/package.%/02$(APPLIANCE): appliances/$(APPLIANCE)/package.% $(STAGE3)
mkdir -p `dirname $@`
cp $< $@
$(portage_make_conf_local): $(default_make_conf) $(appliance_make_conf)
if [ -f "$(default_make_conf)" ] ; \
then COPY $(default_make_conf) /etc/portage/make.conf.local; \
fi
if [ -f "$(appliance_make_conf)" ] ; \
then cat $(appliance_make_conf) >> $(portage_make_conf_local); \
fi
touch $@
$(CHROOT)/var/tmp/profile: $(STAGE3)
RUN eselect profile set $(appliance_profile)
touch $@
$(KERNEL_PATH): $(STAGE3) $(KERNEL_CONFIG)
grub: systools grub.conf kernel
ifneq ($(EXTERNAL_KERNEL),YES)
$(eval kernel_ebuild = $(shell basename `RUN portageq best_visible / $(KERNEL_PKG)`))
$(eval kernel_name = $(shell echo $(kernel_ebuild) | sed -e 's/\(..*\)-sources-\(..*\)/linux-\2-\1/' -e 's/\(..*\)-\(r[0-9]*\)-\(..*\)/\1-\3-\2/'))
$(eval kernel_config_checksum = $(shell sha1sum $(KERNEL_CONFIG) | cut -c -40))
echo -n "$(KERNEL_DIR)/$(kernel_name)/$(kernel_config_checksum)" > $@
else
echo "NONE" > $@
chroot $(CHROOT) $(EMERGE) -nN $(USEPKG) sys-boot/grub
cp grub.conf $(CHROOT)/boot/grub/grub.conf
$(VIRTIO_GRUB)
$(HEADLESS_GRUB)
endif
touch grub
$(KERNEL_SRC): $(KERNEL_PATH)
ifneq ($(EXTERNAL_KERNEL),YES)
if [ ! -f $(shell cat $(KERNEL_PATH))/Makefile ] ; then \
RUN $(EMERGE) --oneshot --noreplace $(USEPKG) sys-kernel/$(KERNEL_PKG); \
cp -a $(CHROOT)/usr/src/linux-*/* $(shell cat $(KERNEL_PATH)); \
RUN $(EMERGE) -C sys-kernel/$(KERNEL_PKG); \
cp $(KERNEL_CONFIG) $(shell cat $(KERNEL_PATH))/.config; \
RUN make -C /usr/src/linux MAKEOPTS=$(MAKEOPTS) oldconfig $(KERNEL_MODULES_PREPARE); \
fi
endif
touch $(KERNEL_SRC)
$(COMPILE_OPTIONS): $(STAGE3) $(PORTAGE_DIR) configs/make.conf.$(VA_ARCH) configs/locale.gen $(portage_default_package_files) $(portage_package_files) $(portage_make_conf_local) $(CHROOT)/var/tmp/profile $(CHROOT)/etc/portage/repos.conf $(KERNEL_SRC)
COPY configs/make.conf.$(VA_ARCH) /etc/portage/make.conf
COPY configs/locale.gen /etc/locale.gen
RUN locale-gen
touch $(COMPILE_OPTIONS)
$(KERNEL): $(COMPILE_OPTIONS) $(KERNEL_CONFIG) scripts/build-kernel
ifneq ($(EXTERNAL_KERNEL),YES)
@print Configuring kernel
COPY $(KERNEL_CONFIG) /root/kernel.config
COPY scripts/build-kernel /root/build-kernel
RUN --setenv=KERNEL=$(KERNEL_PKG) \
--setenv=EMERGE="$(EMERGE)" \
--setenv=USEPKG="$(USEPKG)" \
--setenv=MAKEOPTS="$(MAKEOPTS)" \
/root/build-kernel
rm -f $(CHROOT)/root/build-kernel
endif
touch $(KERNEL)
$(SYSTOOLS): $(PREPROOT) $(COMPILE_OPTIONS)
@print Installing standard system tools
systemd-firstboot \
--root=$(CHROOT) \
--setup-machine-id \
--timezone=$(TIMEZONE) \
--hostname=$(HOSTNAME) \
--root-password=
RUN eselect locale set $(LOCALE)
ifeq ($(DASH),YES)
if ! test -e "$(STAGE4_TARBALL)"; \
then RUN $(EMERGE) --noreplace $(USEPKG) app-shells/dash; \
echo /bin/dash >> $(CHROOT)/etc/shells; \
RUN chsh -s /bin/sh root; \
fi
RUN ln -sf dash /bin/sh
endif
touch $(SYSTOOLS)
$(GRUB): $(PREPROOT) configs/grub.cfg $(KERNEL) scripts/grub-headless.sed
ifneq ($(EXTERNAL_KERNEL),YES)
@print Installing Grub
RUN $(EMERGE) -nN $(USEPKG) sys-boot/grub
mkdir -p $(CHROOT)/boot/grub
COPY configs/grub.cfg /boot/grub/grub.cfg
ifeq ($(VIRTIO),YES)
sed -i 's/sda/vda/' $(CHROOT)/boot/grub/grub.cfg
endif
ifeq ($(HEADLESS),YES)
sed -i -f scripts/grub-headless.sed $(CHROOT)/boot/grub/grub.cfg
endif
endif
ln -nsf /run/systemd/resolve/resolv.conf $(CHROOT)/etc/resolv.conf
touch $(GRUB)
software: $(SOFTWARE)
$(SOFTWARE): $(SYSTOOLS) configs/eth.network configs/issue $(COMPILE_OPTIONS) $(WORLD)
@print Building $(APPLIANCE)-specific software
if test -f appliances/default/Makefile; \
then $(MAKE) -C appliances/default preinstall; \
fi
$(MAKE) -C appliances/$(APPLIANCE) preinstall
software: systools issue etc-update.conf $(CRITICAL) $(WORLD)
$(MAKE) -C $(APPLIANCE) preinstall
cp etc-update.conf $(CHROOT)/etc/
if test -f $(WORLD_DEFAULT); \
then cat $(WORLD_DEFAULT) >> $(CHROOT)/var/lib/portage/world; \
fi
cat $(WORLD) >> $(CHROOT)/var/lib/portage/world
RUN $(EMERGE) $(USEPKG) --update --newuse --deep @system
# some packages, like, tar need xz-utils to unpack, but it not part of
# the stage3 so may not be installed yet
chroot $(CHROOT) $(EMERGE) -1n $(USEPKG) app-arch/xz-utils
@print Running @preserved-rebuild
RUN $(EMERGE) --usepkg=n @preserved-rebuild
chroot $(CHROOT) $(EMERGE) $(USEPKG) --update --newuse --deep `cat $(WORLD)`
$(gcc_config)
COPY configs/issue /etc/issue
RUN $(EMERGE) $(USEPKG) --update --newuse --deep @world $(grub_package)
RUN $(EMERGE) --depclean --with-bdeps=n
RUN --setenv EDITOR=/usr/bin/nano etc-update
COPY configs/eth.network /etc/systemd/network/eth.network
RUN systemctl enable systemd-networkd.service
RUN systemctl enable systemd-resolved.service
ifeq ($(ENABLE_SSHD),YES)
RUN systemctl enable sshd.service
endif
ifeq ($(DASH),YES)
RUN $(EMERGE) --depclean app-shells/bash
endif
if test -f appliances/default/Makefile; \
then $(MAKE) -C appliances/default postinstall; \
fi
$(MAKE) -C appliances/$(APPLIANCE) postinstall
ifneq ($(PKGLIST),0)
echo \# > $(LST_FILE)
echo \# Gentoo Virtual Appliance \"$(APPLIANCE)\" package list >> $(LST_FILE)
echo \# Generated `date -u` >> $(LST_FILE)
echo \# >> $(LST_FILE)
(cd "$(CHROOT)"/var/db/pkg ; /bin/ls -1d */* | grep -v '^virtual/') >> $(LST_FILE)
endif
touch $(SOFTWARE)
# Need gentoolkit to run revdep-rebuild
chroot $(CHROOT) $(EMERGE) -1n $(USEPKG) app-portage/gentoolkit
chroot $(CHROOT) revdep-rebuild -i
cp issue $(CHROOT)/etc/issue
$(gcc_config)
chroot $(CHROOT) $(EMERGE) $(USEPKG) --update --newuse --deep world
chroot $(CHROOT) $(EMERGE) --depclean --with-bdeps=n
$(gcc_config)
chroot $(CHROOT) etc-update
$(MAKE) -C $(APPLIANCE) postinstall
$(enable_sshd)
$(change_password)
$(UNMERGE_CRITICAL)
touch software
device-map: $(RAW_IMAGE)
echo '(hd0) ' $(RAW_IMAGE) > device-map
$(RAW_IMAGE): $(STAGE4_TARBALL) scripts/grub.shell scripts/motd.sh
@print Installing files to `basename $(RAW_IMAGE)`
qemu-img create -f raw $(RAW_IMAGE).tmp $(DISK_SIZE)
parted -s $(RAW_IMAGE).tmp mklabel msdos
parted -s $(RAW_IMAGE).tmp mkpart primary 1 $(DISK_SIZE)
parted -s $(RAW_IMAGE).tmp set 1 boot on
sync
losetup --show --find --partscan $(RAW_IMAGE).tmp > partitions
mkfs.ext4 -O sparse_super,^has_journal -L ROOT -m 0 `cat partitions`p1
mkdir $(CHROOT)
mount -o noatime `cat partitions`p1 $(CHROOT)
tar -xf $(STAGE4_TARBALL) --numeric-owner $(COPY_ARGS) -C $(CHROOT)
motd.sh $(EXTERNAL_KERNEL) $(VIRTIO) $(DISK_SIZE) $(SWAP_SIZE) $(DASH) $(VA_ARCH) > $(CHROOT)/etc/motd
image: $(RAW_IMAGE) grub partitions device-map grub.shell systools software
mkdir -p loop
mount -o noatime $(NBD_DEV)p1 loop
mkdir -p gentoo
mount -o bind $(CHROOT) gentoo
$(COPY_LOOP)
ifneq ($(EXTERNAL_KERNEL),YES)
echo '(hd0) ' `cat partitions` > $(CHROOT)/device-map
cp partitions $(CHROOT)/partitions
RUN /usr/sbin/grub-install --no-floppy --grub-mkdevicemap=device-map --directory=/usr/lib/grub/i386-pc --boot-directory=/boot `cat partitions`
rm $(CHROOT)/device-map $(CHROOT)/partitions
loop/sbin/grub --device-map=device-map --no-floppy --batch < grub.shell
endif
umount $(CHROOT)
rmdir $(CHROOT)
sync
losetup --detach `cat partitions`
rm -f partitions device-map
mv $(RAW_IMAGE).tmp $(RAW_IMAGE)
umount gentoo
rmdir gentoo
umount loop
sleep 3
rmdir loop
qemu-nbd -d $(NBD_DEV)
touch image
$(QCOW_IMAGE): $(RAW_IMAGE)
@print Creating `basename $(QCOW_IMAGE)`
qemu-img convert -f raw -O qcow2 -c $(RAW_IMAGE) $(QCOW_IMAGE).tmp
mv $(QCOW_IMAGE).tmp $(QCOW_IMAGE)
$(QCOW_IMAGE): $(RAW_IMAGE) image
qemu-img convert -f raw -O qcow2 -c $(RAW_IMAGE) $(QCOW_IMAGE)
qcow: $(QCOW_IMAGE)
$(XVA_IMAGE): $(RAW_IMAGE)
@print Creating `basename $(XVA_IMAGE)`
xva.py --disk=$(RAW_IMAGE) --is-hvm --memory=256 --vcpus=1 --name=$(APPLIANCE) \
--filename=$(XVA_IMAGE).tmp
mv $(XVA_IMAGE).tmp $(XVA_IMAGE)
xva: $(XVA_IMAGE)
$(VMDK_IMAGE): $(RAW_IMAGE)
@print Creating `basename $(VMDK_IMAGE)`
ifeq ($(VMDK_TYPE),SCSI)
qemu-img convert -f raw -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,hwversion=7 $(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_IMAGE): $(RAW_IMAGE) image
qemu-img convert -f raw -O vmdk $(RAW_IMAGE) $(VMDK_IMAGE)
vmdk: $(VMDK_IMAGE)
NUM_CPUS := $(OVA_NUM_CPUS)
MEM_SIZE := $(OVA_MEM_SIZE)
export NUM_CPUS MEM_SIZE
umount:
$(UMOUNT_PKGDIR)
umount $(CHROOT)/var/tmp
umount $(CHROOT)/dev
umount $(CHROOT)/proc
touch umount
$(OVA_IMAGE): $(VMDK_IMAGE)
@print Creating `basename $(OVA_IMAGE)`
cd $(IMAGES) && mkova.sh $(APPLIANCE) /usr/share/open-vmdk/template-hw7.ovf $(VMDK_IMAGE)
remove_checkpoints:
rm -f mounts compile_options base_system portage sync_portage
rm -f parted kernel grub stage3 software preproot sysconfig systools image partitions device-map
ova: $(OVA_IMAGE)
$(STAGE4_TARBALL): $(PORTAGE_DIR) stage3-$(VA_ARCH).tar.xz appliances/$(APPLIANCE) configs/rsync-excludes
$(MAKE) $(STAGE3)
$(MAKE) $(PREPROOT)
$(MAKE) $(SOFTWARE)
$(MAKE) $(KERNEL)
$(MAKE) $(GRUB)
@print Creating stage4 tarball: `basename $(STAGE4_TARBALL)`
$(change_password)
mkdir -p $(IMAGES)
tar -acf "$(STAGE4_TARBALL).tmp.xz" --numeric-owner $(COPY_ARGS) -C $(CHROOT) --one-file-system .
mv "$(STAGE4_TARBALL).tmp.xz" "$(STAGE4_TARBALL)"
$(MAKE) clean
stage4: $(STAGE4_TARBALL)
eclean: $(COMPILE_OPTIONS)
RUN $(EMERGE) $(USEPKG) --oneshot --noreplace app-portage/gentoolkit
RUN eclean-pkg
RUN eclean-dist
RUN $(EMERGE) --depclean app-portage/gentoolkit
$(MAKE) clean
clean:
rm -f partitions device-map $(IMAGES)/*.tmp
rm -rf --one-file-system -- $(CHROOT)
clean: umount remove_checkpoints
rm -f umount
rm -rf loop gentoo
rm -rf gentoo
rm -rf $(CHROOT)
realclean: clean
${RM} $(RAW_IMAGE) $(QCOW_IMAGE) $(VMDK_IMAGE)
distclean:
rm -f -- *.qcow *.img *.vmdk
rm -f stage3-*.tar.xz
rm -f portage-snapshot.tar.bz2
rm -f *.qcow *.img *.vmdk
rm -f latest-stage3.txt stage3-*-latest.tar.bz2
rm -f portage-latest.tar.bz2
appliance-list:
@print 'Available appliances:'
@/bin/ls -1 appliances
checksums:
@print Calculating checksums
$(RM) $(CHECKSUMS)
cd $(IMAGES) && sha256sum --binary * > $(CHECKSUMS).tmp
mv $(CHECKSUMS).tmp $(CHECKSUMS)
shell: $(PREPROOT)
@print 'Entering interactive shell for the $(APPLIANCE) build.'
@print 'Type "exit" or "^D" to leave'
@print
@RUN
@rm -f $(CHROOT)/root/.bash_history
help:
@print 'Help targets (this is not a comprehensive list)'
@echo
@echo 'sync_portage - Download the latest portage snapshot'
@echo 'sync_stage3 - Download the latest stage3 tarball'
@echo 'sync_repos - Download/update the repositories (portage overlays)'
@echo 'stage4 - Build a stage4 tarball'
@echo 'clean - Unmount chroot and clean directory'
@echo 'eclean - Clean outdated packages and distfiles'
@echo 'realclean - Clean and remove image files'
@echo 'shell - Enter a shell in the build environment'
@print 'Images'
@echo 'image - Build a raw VM image from stage4'
@echo 'qcow - Build a qcow VM image from a raw image'
@echo 'vmdk - Build a vmdk image from a raw image'
@echo 'ova - Build a ova image from a vmdk image'
@echo 'xva - Build an xva image from a raw image'
@echo 'appliance-list - List built-in appliances'
@echo 'help - Show this help'
@echo 'Variables'
@echo 'APPLIANCE= - The appliance to build'
@echo 'HOSTNAME= - Hostname to give appliance'
@echo 'TIMEZONE= - Timezone to set for the appliance'
@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 'VA_ARCH= - Architecture to build for (x86 or amd64)'
@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 'ENABLE_SSHD=YES - Enable sshd to start automatically in the image'
@echo 'VMDK_TYPE=IDE - VMDK image type (IDE or SCSI)'
@echo
@print 'Example to build the base appliance'
@echo 'make APPLIANCE=base HEADLESS=YES VIRTIO=YES stage4 qcow clean'
.PHONY: qcow vmdk ova clean realclean distclean stage4 image stage4 help appliance-list eclean sync_portage sync_stage3 checksums fstab
.PHONY: qcow vmdk clean realclean distclean remove_checkpoints

View File

@ -1,59 +0,0 @@
HARDENED = $(CHROOT)/var/tmp/hardened
PAM_SSH_AGENT_AUTH = $(CHROOT)/var/tmp/pam_ssh_agent_auth
ADMINUSER = $(CHROOT)/var/tmp/adminuser
timesyncd_conf = $(CHROOT)/etc/systemd/timesyncd.conf
01firstboot = $(CHROOT)/usr/local/bin/01firstboot.start
network_example = $(CHROOT)/00-eth0.network.example
tmux_conf = $(CHROOT)//root/.tmux.conf
$(HARDENED):
mkdir -p $(CHROOT)/etc/portage/profile
echo "-hardened" >> $(CHROOT)/etc/portage/profile/use.mask
RUN $(EMERGE) $(USEPKG) --oneshot gcc
RUN $(EMERGE) $(USEPKG) --oneshot binutils virtual/libc
RUN $(EMERGE) --depclean --with-bdeps=n
-$(gcc_config)
RUN /usr/bin/gcc --version
RUN $(EMERGE) $(USEPKG) --emptytree @world
RUN $(EMERGE) --depclean --with-bdeps=n
RUN bash -c 'yes YES | etc-update --automode -9'
ifneq ($(EXTERNAL_KERNEL),YES)
if ! grep -q "$(shell RUN /usr/bin/gcc --version | grep gcc)" "$(KERNEL_PATH))/.config"; then \
RUN $(EMERGE) $(USEPKG) --onlydeps --oneshot --noreplace sys-kernel/$(KERNEL_PKG); \
RUN make -C /usr/src/linux MAKEOPTS=$(MAKEOPTS) clean oldconfig $(KERNEL_MODULES_PREPARE); \
fi
endif
touch $(HARDENED)
$(timesyncd_conf): default/timesyncd.conf
cp $< $@
$(01firstboot): default/01firstboot.start default/bashrc.firstboot
mkdir -p $(CHROOT)/usr/local/bin
cp $< $@
cat default/bashrc.firstboot >> $(CHROOT)/home/admin/.bashrc
touch $(CHROOT)/01firstboot
$(network_example): default/00-eth0.network
cp $< $@
$(tmux_conf): default/tmux.conf
RUN systemctl enable tmux@root.service
cp $< $@
$(PAM_SSH_AGENT_AUTH):
sed -i 's/# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' $(CHROOT)/etc/sudoers
sed -i 's#^auth.*$$#auth sufficient pam_ssh_agent_auth.so file=~/.ssh/authorized_keys\nauth required pam_env.so readenv=1 user_readenv=0\nsession required pam_env.so readenv=1 user_readenv=0\nauth substack system-auth#' $(CHROOT)/etc/pam.d/sudo
sed -i 's#^auth.*$$#auth sufficient pam_ssh_agent_auth.so file=~/.ssh/authorized_keys\nauth required pam_env.so readenv=1 user_readenv=0\nsession required pam_env.so readenv=1 user_readenv=0\nauth substack system-auth#' $(CHROOT)/etc/pam.d/sudo-i
mkdir -p $(CHROOT)/etc/sudoers.d
echo "Defaults env_keep += SSH_AUTH_SOCK" > $(CHROOT)/etc/sudoers.d/ssh_auth_sock
touch $(PAM_SSH_AGENT_AUTH)
$(ADMINUSER):
-RUN useradd -m -G users,wheel -s /bin/bash --comment="virtual appliance admin" --uid 2000 admin
RUN passwd -d admin; $(inroot) passwd -e admin
touch $(ADMINUSER)
preinstall: $(HARDENED)
postinstall: $(PAM_SSH_AGENT_AUTH) $(ADMINUSER) $(timesyncd_conf) $(01firstboot) $(network_example) $(tmux_conf)

View File

@ -1,6 +0,0 @@
Initial configuration
=====================
- For dynamic data (configuration, databases) there must be a data partition formatted with ext4 with the label "DATA". This is mounted to /DATA.
- Configure fixed IP address and /etc/hosts.
- under VMware activate open-vm-tools if necessary

View File

@ -1,7 +0,0 @@
DISK_SIZE = 8.0G
##KERNEL_CONFIG = appliances/default/kernel.config
ENABLE_SSHD = YES
TIMEZONE=Europe/Berlin
LOCALE=de_DE.utf8
REPO_NAMES += unitas-misc
REPO_URI_unitas-misc = https://git.unitas-network.de/Gentoo/unitas-misc.git

View File

@ -1,21 +0,0 @@
# Example of fixed IP address configuration:
#
# Customize and move as 00-eth0.network to /etc/systemd/network
# (refer to "man systemd.network", "man systemd-resolved")
#
# DON'T FORGET: add appropriate entries in /etc/hosts
# <IPv4> <fqdn> <hostname>
# <IPv6> <fqdn> <hostname>
[Match]
Name=eth0
[Network]
Description=first network port
Address=192.168.1.2/24
Address=fdb5:78b:64cc:0:f8c0::2/64
Gateway=192.168.1.1
Gateway=fdb5:78b:64cc:0:f8c0::1
DNS=192.168.1.3
DNS=fdb5:78b:64cc:0:f8c0::3
Domains=exampledomain.de

View File

@ -1,209 +0,0 @@
#!/bin/bash
#
# This script is called the first time the appliance is started
# after the installation or update.
#
########################
# variables
########################
LABEL="DATA"
APPLCTRL="/$LABEL/.APPLIANCE"
LISTCOPY="$APPLCTRL/populate-data/COPY"
LISTLINK="$APPLCTRL/populate-data/LINK"
########################
# functions
########################
copy_data () {
if [ -e "/$1.orig" ]; then
echo "skip /$1 (/$1.orig exists)"
return 0
fi
if [ -e "/$1" ]; then
# destination exists, copy it to *.orig
cp -af "/$1" "/$1.orig"
else
# destination doesn't exists, create empty *.orig
if [ -d "/$LABEL/$1" ]; then
mkdir -p "/$1.orig"
else
mkdir -p $(dirname /$1)
touch "/$1.orig"
fi
fi
echo "copy /$LABEL/$1"
if [ -d "/$LABEL/$1" ] && [ -d "/$1" ]; then
# Source is a directory and the destination directory exists
cp -af "/$LABEL/$1/." "/$1"
else
mkdir -p $(dirname /$1)
cp -af "/$LABEL/$1" "/$1"
fi
}
link_data () {
if [ -e "/$1.orig" ]; then
echo "skip /$1 (/$1.orig exists)"
return 0
fi
if [ -e "/$1" ]; then
# destination exists, move it to *.orig
mv "/$1" "/$1.orig"
else
# destination doesn't exists, create empty *.orig
if [ -d "/$LABEL/$1" ]; then
mkdir -p "/$1.orig"
else
mkdir -p $(dirname /$1)
touch "/$1.orig"
fi
fi
echo "link /$LABEL/$1"
ln -nsf "/$LABEL/$1" "/$1"
}
populate_data () {
# All files and directories listed in LISTCOPY will be copied from
# /DATA to the system (directories recursively). The files and
# directories listed in LISTLINK will be linked into the system.
#
# Copy
if [ -f "$LISTCOPY" ]; then
while IFS="" read -r src || [ -n "$src" ]
do
[[ -z "$src" ]] && continue
[[ "$src" =~ ^#.*$ ]] && continue
src=${src#/}
[[ "$src" =~ ^home/ ]] && continue
[[ ! -e "/$LABEL/$src" ]] && continue
copy_data "$src"
done < "$LISTCOPY"
fi
# Link
if [ -f "$LISTLINK" ]; then
while IFS="" read -r src || [ -n "$src" ]
do
[[ -z "$src" ]] && continue
[[ "$src" =~ ^#.*$ ]] && continue
src=${src#/}
[[ "$src" =~ ^home/ ]] && continue
[[ ! -e "/$LABEL/$src" ]] && continue
link_data "$src"
done < "$LISTLINK"
fi
}
########################
# base settings
########################
set -e
[ -e /01firstboot ] || exit 0
echo 'Setting keymap...'
localectl --no-convert set-keymap de-latin1-nodeadkeys
echo 'Activate NTP service...'
timedatectl set-ntp true
echo 'set machine id...'
systemd-machine-id-setup
########################
# Data partition
########################
echo 'Mount data partition...'
mkdir -p /$LABEL
if [ ! -L "/dev/disk/by-label/$LABEL" ]; then
echo 'ERROR: Data partition not found!'
echo "Please create a data partition with ext4 filesystem and label \"$LABEL\":"
echo "# cfdisk /dev/<disk> (use GPT label, create linux partition)"
echo "# mkfs.ext4 -L $LABEL /dev/<partition>"
exit 1
fi
if ! grep -Fq "LABEL=$LABEL" /etc/fstab; then
echo -e "LABEL=$LABEL\t/$LABEL\t\text4\tnoatime\t0 1" >> /etc/fstab
fi
mount -a
if ! mount | grep /$LABEL > /dev/null; then
echo "ERROR: Could not mount data partition!"
exit 1
fi
########################
# Swap partition
########################
if [ -L "/dev/disk/by-label/SWAP" ]; then
echo 'Swap partition found, mounting...'
swapoff -a
grep -Fv swap /etc/fstab > /etc/fstab.tmp && mv /etc/fstab.tmp /etc/fstab
echo -e "LABEL=SWAP\tnone\t\tswap\tsw\t0 0" >> /etc/fstab
swapon -a
rm -f /.swap
fi
echo 'Mount data partition...'
########################
# homedirs, users
########################
if [ -d "/$LABEL/home" ]; then
cd "/$LABEL/home"
for user in *; do
if [ -d "$user" ]; then
if ! id -u "$user" >/dev/null 2>&1; then
useradd -m -G users,wheel -s /bin/bash --uid $(stat -c '%u' $user) --user-group $user
fi
rm -rf "/home/$user"
ln -nsf "/$LABEL/home/$user" "/home/$user"
fi
done
fi
########################
# DATA
########################
populate_data
if [ ! -d "/$LABEL/etc/ssh" ]; then
cp -af /etc/ssh /etc/ssh.orig
mkdir -p "/$LABEL/etc"
mv /etc/ssh "/$LABEL/etc/"
ln -nsf "/$LABEL/etc/ssh" /etc/ssh
fi
if [ ! -f "/$LABEL/etc/hosts" ]; then
cp -af /etc/hosts /etc/hosts.orig
mkdir -p "/$LABEL/etc"
mv -f /etc/hosts "/$LABEL/etc/hosts"
ln -nsf "/$LABEL/etc/hosts" /etc/hosts
fi
if [ ! -f "/$LABEL/etc/fstab" ]; then
cp -af /etc/fstab "/$LABEL/etc/fstab"
fi
if [ ! -f "/$LABEL/etc/hostname" ]; then
cp -af /etc/hostname "/$LABEL/etc/hostname"
fi
if [ ! -f "$LISTCOPY" ]; then
mkdir -p $(dirname $LISTCOPY)
echo "# all files and directories listed here are copied from /DATA to the system," >> $LISTCOPY
echo "# directories recursively (one file / directory per line)" >> $LISTCOPY
echo "/etc/fstab" >> $LISTCOPY
echo "/etc/hostname" >> $LISTCOPY
fi
if [ ! -f "$LISTLINK" ]; then
mkdir -p $(dirname $LISTLINK)
echo "# all files and directories listed here are linked from /DATA to the system," >> $LISTLINK
echo "# directories recursively (one file / directory per line)" >> $LISTLINK
echo "/etc/hosts" >> $LISTLINK
echo "/etc/ssh" >> $LISTLINK
fi
rm /01firstboot

View File

@ -1,38 +0,0 @@
if [ -e /01firstboot ]; then
echo
echo "##########################################################################"
echo "The new or updated appliance still needs to be initialized."
echo "If errors occur, their cause must be fixed. Afterwards the initialization"
echo "can be restarted by running \"sudo /usr/local/bin/01firstboot.start\"."
echo "##########################################################################"
echo
read -n 1 -s -r -p "Press any key to start initialization..."
echo
sudo /usr/local/bin/01firstboot.start
echo
echo "##########################################################################"
echo "After successful initialization, the appliance should be restarted."
echo
read -n 1 -s -r -p "Press any key to continue..."
echo
fi
if [ -e /02firstboot ] && [ ! -e /01firstboot ]; then
echo
echo "##########################################################################"
echo "After basic initialization, the special services of the appliance still"
echo "have to be configured. Any errors that may occur must be corrected, after"
echo "which the configuration can be restarted by executing"
echo "\"sudo /usr/local/bin/02firstboot.start\"."
echo "##########################################################################"
echo
read -n 1 -s -r -p "Press any key to start configuration..."
echo
sudo /usr/local/bin/02firstboot.start
echo
echo "##########################################################################"
echo "After successful configuration, the appliance should be restarted."
echo
read -n 1 -s -r -p "Press any key to continue..."
echo
fi

View File

@ -1,5 +0,0 @@
# See timesyncd.conf(5) for details.
[Time]
NTP=0.de.pool.ntp.org 1.de.pool.ntp.org 2.de.pool.ntp.org 3.de.pool.ntp.org
FallbackNTP=0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org

View File

@ -1,3 +0,0 @@
set -g mouse on
set-option -g set-titles on
set-option -g set-titles-string "#S / #T"

View File

@ -1,10 +0,0 @@
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
USE="hardened justify pie ssp urandom xattr -fortran -pch -pic -prelink -profile -tcc"
MAKEOPTS="-j5"
ACCEPT_LICENSE="*"
# Python-Version festpinnen (s. auch package.mask)
USE_PYTHON="3.12"
PYTHON_TARGETS="python3_12"
PYTHON_SINGLE_TARGET="python3_12"

View File

@ -1,3 +0,0 @@
# Base system
app-emulation/open-vm-tools
sys-auth/pam_ssh_agent_auth

View File

@ -1,2 +0,0 @@
# Python: nur Version 3.12 verwenden (s. auch make.conf: PYTHON-Variable)
>=dev-lang/python-3.13

View File

@ -1,26 +0,0 @@
# Base system
app-admin/sudo -sendmail
app-editors/nano ncurses
app-emulation/open-vm-tools pic -fuse -modules -resolutionkms
app-misc/mc -slang
dev-lang/python ssl threads xml
dev-libs/libpcre cxx jit
dev-libs/libpcre2 jit
dev-util/pkgconfig internal-glib
dev-vcs/git -gpg -iconv -pcre -pcre-jit -perl -python -threads -webdav
net-misc/openssh ssl
net-misc/wget ssl
sys-apps/hwids udev
sys-apps/kmod tools
sys-apps/net-tools hostname
sys-apps/portage ipc
sys-auth/pambase nullok sha512
sys-devel/gcc cxx nptl
sys-kernel/gentoo-sources symlink
# Monitoring
net-analyzer/zabbix agent
# temp., sonst circular dependencies error
sys-devel/m4 -nls
sys-apps/help2man -nls

View File

@ -1,12 +0,0 @@
app-admin/logrotate
app-admin/sudo
app-arch/p7zip
app-emulation/open-vm-tools
app-emulation/qemu-guest-agent
app-misc/mc
app-misc/tmuxservice
dev-vcs/git
net-analyzer/zabbix
sys-auth/pam_ssh_agent_auth
sys-fs/mdadm
sys-power/acpid

View File

@ -1,3 +1,6 @@
preinstall:
postinstall:
clean:

37
base/critical Normal file
View File

@ -0,0 +1,37 @@
app-editors/nano
net-misc/openssh
net-misc/rsync
net-misc/wget
sys-kernel/gentoo-sources
sys-kernel/linux-headers
sys-devel/gcc
sys-devel/automake
sys-devel/bison
sys-devel/make
sys-devel/flex
sys-devel/automake-wrapper
sys-devel/autoconf-wrapper
sys-devel/autoconf
sys-devel/m4
sys-devel/gcc-config
sys-devel/libtool
sys-devel/binutils
sys-devel/binutils-config
sys-devel/patch
sys-devel/gnuconfig
app-admin/python-updater
app-admin/perl-cleaner
sys-apps/man-pages
sys-apps/man
sys-apps/file
sys-apps/less
sys-apps/texinfo
sys-apps/busybox
sys-apps/debianutils
sys-apps/man-pages-posix
sys-apps/sandbox
sys-apps/which
dev-lang/perl
sys-devel/libperl
sys-apps/portage
dev-lang/python

3
base/package.use Normal file
View File

@ -0,0 +1,3 @@
app-editors/nano ncurses
dev-lang/python ssl threads xml
sys-kernel/gentoo-sources symlink

1
base/world Normal file
View File

@ -0,0 +1 @@
net-misc/dhcpcd

View File

@ -1,5 +0,0 @@
[Match]
Name=*
[Network]
DHCP=yes

View File

@ -1,10 +0,0 @@
insmod part_msdos
set timeout=2
set default=0
set fallback=1
set graphics=0
menuentry "Gentoo Linux" {
set root=(hd0,1)
linux /boot/vmlinuz root=/dev/sda1 rootfstype=ext4 net.ifnames=0 init=/usr/lib/systemd/systemd quiet
}

View File

@ -1,4 +0,0 @@

 Gentoo Virtual Appliance
 

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +0,0 @@
CFLAGS="-Os -Qn -s"
CXXFLAGS="-Os -Qn -s"
CHOST="x86_64-pc-linux-gnu"
MAKEOPTS="-j2"
USE="-* bindist ipv6 nptl openssl pam split-usr systemd udev unicode"
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 binpkg-multi-instance -cgroup"
CURL_SSL="openssl"
INSTALL_MASK="/etc/default/grub /etc/locale.gen /etc/fstab /etc/issue /usr/share/doc"
source make.conf.local

View File

@ -1,17 +0,0 @@
CFLAGS="-Os -Qn -s"
CXXFLAGS="-Os -Qn -s"
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j2"
USE="-* bindist ipv6 nptl openssl pam split-usr systemd unicode"
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 binpkg-multi-instance -cgroup"
CURL_SSL="openssl"
ABI_X86="32"
INSTALL_MASK="/etc/default/grub /etc/locale.gen /etc/fstab /etc/issue /usr/share/doc"
source make.conf.local

View File

@ -1,5 +0,0 @@
dev-lang/python ssl xml
dev-util/pkgconfig internal-glib
sys-apps/kmod tools
sys-apps/systemd sysv-utils
sys-process/procps kill

75
etc-update.conf Normal file
View File

@ -0,0 +1,75 @@
# /etc/etc-update.conf: config file for `etc-update` utility
# edit the lines below to your liking
# mode - 0 for text, 1 for menu (support incomplete)
# note that you need dev-util/dialog installed
mode="0"
# Whether trivial/comment changes should be automerged
eu_automerge="yes"
# arguments used whenever rm is called
rm_opts=""
# arguments used whenever mv is called
mv_opts=""
# arguments used whenever cp is called
cp_opts=""
# pager for use with diff commands
#pager=""
# For emacs-users (see NOTE_2)
# diff_command="eval emacs -nw --eval=\'\(ediff\ \"%file1\"\ \"%file2\"\)\'"
#using_editor=1
# vim-users: you CAN use vimdiff for diff_command. (see NOTE_1 and NOTE_2)
#diff_command="vim -d %file1 %file2"
#using_editor=1
diff_command="diff -uN %file1 %file2"
using_editor=0
# vim-users: don't use vimdiff for merging (see NOTE_1)
merge_command="sdiff -s -o %merged %orig %new"
# EXPLANATION
#
# pager:
#
# Examples of pager usage:
# pager="" # don't use a pager
# pager="less -E" # less
# pager="more" # more
#
#
# diff_command:
#
# Arguments:
# %file1 [REQUIRED]
# %file2 [REQUIRED]
#
# Examples of diff_command:
# diff_command="diff -uN %file1 %file2" # diff
# diff_command="vim -d %file1 %file2" # vimdiff
#
#
# merge_command:
#
# Arguments:
# %orig [REQUIRED]
# %new [REQUIRED]
# %merged [REQUIRED]
#
# Examples of merge_command:
# merge_command="sdiff -s -o %merged %old %new" # sdiff
#
# NOTE_1: Editors such as vim/vimdiff are not usable for the merge_command
# because it is not known what filenames the produced files have (the user can
# choose while using those programs)
# NOTE_2: Make sure using_editor is set to "1" when using an editor as
# diff_command!

4
fstab Normal file
View File

@ -0,0 +1,4 @@
# <fs> <mountpoint> <type> <opts> <dump/pass>
/dev/sda1 / ext2 noatime 1 1
/.swap none swap sw 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0

28
gnome/Makefile Normal file
View File

@ -0,0 +1,28 @@
ifneq ($(OVERLAY),YES)
DO_OVERLAY = \#
endif
# totem gst-inspect requires a machine id (generated by dbus). we
# don't have one yet because we are in a virgin chroot. fake one
preinstall:
mkdir -p "$(CHROOT)/var/lib/dbus"
echo 1234567890abcdef1234567890abcdef > \
"$(CHROOT)"/var/lib/dbus/machine-id
chroot "$(CHROOT)" $(EMERGE) $(USEPKG) -1n dev-util/pkgconfig
$(DO_OVERLAY) chroot $(CHROOT) $(EMERGE) $(USEPKG) -1n app-portage/layman
$(DO_OVERLAY) chroot $(CHROOT) $(EMERGE) $(USEPKG) -1n dev-vcs/git
$(DO_OVERLAY) chroot $(CHROOT) /usr/bin/layman --sync ALL
$(DO_OVERLAY) chroot $(CHROOT) /usr/bin/layman --add gnome
$(DO_OVERLAY) echo "source /var/lib/layman/make.conf" >> $(CHROOT)/etc/make.conf
$(DO_OVERLAY) echo USE='"$$USE clutter"' >> $(CHROOT)/etc/make.conf
postinstall: custom.conf
$(RM) "$(CHROOT)"/var/lib/dbus/machine-id
cp custom.conf "$(CHROOT)"/etc/X11/gdm/custom.conf
#chroot "$(CHROOT)" rc-update add hald default
chroot "$(CHROOT)" rc-update add dbus default
echo 'gdm &>/dev/null' >> "$(CHROOT)"/etc/conf.d/local.start
clean:

35
gnome/critical Normal file
View File

@ -0,0 +1,35 @@
app-editors/nano
net-misc/openssh
net-misc/rsync
net-misc/wget
sys-kernel/gentoo-sources
sys-kernel/linux-headers
sys-devel/gcc
sys-devel/automake
sys-devel/bison
sys-devel/make
sys-devel/flex
sys-devel/automake-wrapper
sys-devel/autoconf-wrapper
sys-devel/autoconf
sys-devel/m4
sys-devel/gcc-config
sys-devel/binutils
sys-devel/binutils-config
sys-devel/patch
sys-devel/gnuconfig
app-admin/python-updater
app-admin/perl-cleaner
sys-apps/man-pages
sys-apps/man
sys-apps/file
sys-apps/less
sys-apps/texinfo
sys-apps/busybox
sys-apps/debianutils
sys-apps/man-pages-posix
sys-apps/sandbox
sys-apps/which
dev-lang/perl
sys-devel/libperl
sys-apps/portage

82
gnome/custom.conf Normal file
View File

@ -0,0 +1,82 @@
# GDM Custom Configuration file.
#
# This file is the appropriate place for specifying your customizations to the
# GDM configuration. If you run gdmsetup, it will automatically edit this
# file for you and will cause the daemon and any running GDM GUI programs to
# automatically update with the new configuration. Not all configuration
# options are supported by gdmsetup, so to modify some values it may be
# necessary to modify this file directly by hand.
#
# This file overrides the default configuration settings. These settings
# are stored in the GDM System Defaults configuration file, which is found
# at the following location.
#
# /usr/share/gdm/defaults.conf.
#
# This file contains comments about the meaning of each configuration option,
# so is also a useful reference. Also refer to the documentation links at
# the end of this comment for further information. In short, to hand-edit
# this file, simply add or modify the key=value combination in the
# appropriate section in the template below this comment section.
#
# For example, if you want to specify a different value for the Enable key
# in the "[debug]" section of your GDM System Defaults configuration file,
# then add "Enable=true" in the "[debug]" section of this file. If the
# key already exists in this file, then simply modify it.
#
# Older versions of GDM used the "gdm.conf" file for configuration. If your
# system has an old gdm.conf file on the system, it will be used instead of
# this file - so changes made to this file will not take effect. Consider
# migrating your configuration to this file and removing the gdm.conf file.
#
# If you hand edit a GDM configuration file, you can run the following
# command and the GDM daemon will immediately reflect the change. Any
# running GDM GUI programs will also be notified to update with the new
# configuration.
#
# gdmflexiserver --command="UPDATE_CONFIG <configuration key>"
#
# e.g, the "Enable" key in the "[debug]" section would be "debug/Enable".
#
# You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and
# re-read the new configuration settings. You can also restart GDM by sending
# a HUP or USR1 signal to the daemon. HUP behaves like gdm-restart and causes
# any user session started by GDM to exit immediately while USR1 behaves like
# gdm-safe-restart and will wait until all users log out before restarting GDM.
#
# For full reference documentation see the gnome help browser under
# GNOME|System category. You can also find the docs in HTML form on
# http://www.gnome.org/projects/gdm/
#
# NOTE: Lines that begin with "#" are considered comments.
#
# Have fun!
[daemon]
[security]
[xdmcp]
Enable=True
[gui]
[greeter]
[chooser]
[debug]
# Note that to disable servers defined in the GDM System Defaults
# configuration file (such as 0=Standard, you must put a line in this file
# that says 0=inactive, as described in the Configuration section of the GDM
# documentation.
#
[servers]
0=inactive
# Also note, that if you redefine a [server-foo] section, then GDM will
# use the definition in this file, not the GDM System Defaults configuration
# file. It is currently not possible to disable a [server-foo] section
# defined in the GDM System Defaults configuration file.
#

30
gnome/package.use Normal file
View File

@ -0,0 +1,30 @@
app-editors/nano ncurses
dev-lang/python ssl sqlite threads xml
sys-kernel/gentoo-sources symlink
# for gnome
app-text/enchant hunspell
app-text/poppler cairo
dev-libs/libxml2 python
gnome-base/gnome-menus python
gnome-base/gvfs gdu
media-libs/libcanberra gtk
media-libs/swfdec gtk
net-libs/libsoup gnome ssl
net-misc/curl ssl
sys-apps/dbus X
sys-apps/parted device-mapper
sys-block/parted device-mapper
sys-auth/consolekit policykit
sys-fs/udev extras
x11-libs/cairo svg X
x11-libs/gtk+ jpeg
x11-libs/pango X
mail-client/evolution ssl
gnome-extra/evolution-data-server ssl
>=gnome-extra/evolution-data-server-2.30 weather
#net-libs/xulrunner cups
#net-print/cups gnutls
#app-text/poppler utils
#app-text/ghostscript-gpl cups

4
gnome/world Normal file
View File

@ -0,0 +1,4 @@
gnome-base/gnome
media-fonts/dejavu
media-fonts/freefont-ttf
x11-apps/xauth

3
grub-headless.sed Normal file
View File

@ -0,0 +1,3 @@
1iserial --speed=9600 --unit=0 --word=8 --parity=no --stop=1\
1iterminal --timeout=2 serial console\
s/^\(kernel .*\)$/\1 console=ttyS0/

7
grub.conf Normal file
View File

@ -0,0 +1,7 @@
default 0
timeout 5
title Gentoo Linux
root (hd0,0)
kernel /boot/vmlinuz root=/dev/sda1 quiet

12
hemp-node/Makefile Normal file
View File

@ -0,0 +1,12 @@
preinstall:
postinstall:
chroot "$(CHROOT)" emerge -C '>=dev-lang/python-3.0' gentoo-sources
# we want sshd running
chroot "$(CHROOT)" rc-update add sshd default
# and root account enabled, so we can ssh in
chroot "$(CHROOT)" chage -E -1 root
clean:

3
hemp-node/README Normal file
View File

@ -0,0 +1,3 @@
You should pass "APPLIANCE=hemp-node CHANGE_PASSWORD=NO REMOVE_PORTAGE=NO"
to the toplevel Makefile for this to be useable

37
hemp-node/critical Normal file
View File

@ -0,0 +1,37 @@
app-editors/nano
net-misc/openssh
net-misc/rsync
net-misc/wget
sys-kernel/gentoo-sources
sys-kernel/linux-headers
sys-devel/gcc
sys-devel/automake
sys-devel/bison
sys-devel/make
sys-devel/flex
sys-devel/automake-wrapper
sys-devel/autoconf-wrapper
sys-devel/autoconf
sys-devel/m4
sys-devel/gcc-config
sys-devel/libtool
sys-devel/binutils
sys-devel/binutils-config
sys-devel/patch
sys-devel/gnuconfig
app-admin/python-updater
app-admin/perl-cleaner
sys-apps/man-pages
sys-apps/man
sys-apps/file
sys-apps/less
sys-apps/texinfo
sys-apps/busybox
sys-apps/debianutils
sys-apps/man-pages-posix
sys-apps/sandbox
sys-apps/which
dev-lang/perl
sys-devel/libperl
sys-apps/portage
dev-lang/python

3
hemp-node/package.use Normal file
View File

@ -0,0 +1,3 @@
app-editors/nano ncurses
dev-lang/python ssl threads xml
sys-kernel/gentoo-sources symlink

1
hemp-node/world Normal file
View File

@ -0,0 +1 @@
net-misc/dhcpcd

6
issue Normal file
View File

@ -0,0 +1,6 @@

------------------------------------------------------------------------------
Gentoo Virtual Machine
------------------------------------------------------------------------------

22
kde/Makefile Normal file
View File

@ -0,0 +1,22 @@
preinstall:
echo 'USE="$$USE qt3support xcomposite opengl"' >> "$(CHROOT)"/etc/make.conf;
postinstall: kdmrc Xaccess local knotifyrc
cp kdmrc Xaccess "$(CHROOT)"/usr/share/config/kdm
mkdir -p "$(CHROOT)"/etc/skel/.kde4/share/config
cp knotifyrc "$(CHROOT)"/etc/skel/.kde4/share/config/knotifyrc
chroot "$(CHROOT)" rc-update add dbus default
if [ -e "$(CHROOT)"/etc/conf.d/xdm ]; then \
sed -i 's/^DISPLAYMANAGER=.*/DISPLAYMANAGER="kdm"/' \
"$(CHROOT)"/etc/conf.d/xdm; \
chroot "$(CHROOT)" rc-update add xdm default; \
elif [ -f "$(CHROOT)/etc/conf.d/local" ]; then \
cp local "$(CHROOT)/etc/conf.d/local"; \
else \
echo "/usr/bin/kdm -daemon" >> "$(CHROOT)"/etc/conf.d/local.start; \
fi
clean:

67
kde/Xaccess Normal file
View File

@ -0,0 +1,67 @@
# Xaccess - Access control file for XDMCP connections
#
# To control Direct and Broadcast access:
#
# pattern
#
# To control Indirect queries:
#
# pattern list of hostnames and/or macros ...
#
# To use the chooser:
#
# pattern CHOOSER BROADCAST
#
# or
#
# pattern CHOOSER list of hostnames and/or macros ...
#
# To define macros:
#
# %name list of hosts ...
#
# The first form tells xdm which displays to respond to itself.
# The second form tells xdm to forward indirect queries from hosts matching
# the specified pattern to the indicated list of hosts.
# The third form tells xdm to handle indirect queries using the chooser;
# the chooser is directed to send its own queries out via the broadcast
# address and display the results on the terminal.
# The fourth form is similar to the third, except instead of using the
# broadcast address, it sends DirectQuerys to each of the hosts in the list
#
# In all cases, xdm uses the first entry which matches the terminal;
# for IndirectQuery messages only entries with right hand sides can
# match, for Direct and Broadcast Query messages, only entries without
# right hand sides can match.
#
* #any host can get a login window
#
# To hardwire a specific terminal to a specific host, you can
# leave the terminal sending indirect queries to this host, and
# use an entry of the form:
#
#terminal-a host-a
#
# The nicest way to run the chooser is to just ask it to broadcast
# requests to the network - that way new hosts show up automatically.
# Sometimes, however, the chooser cannot figure out how to broadcast,
# so this may not work in all environments.
#
* CHOOSER BROADCAST #any indirect host can get a chooser
#
# If you would prefer to configure the set of hosts each terminal sees,
# then just uncomment these lines (and comment the CHOOSER line above)
# and edit the %hostlist line as appropriate
#
#%hostlist host-a host-b
* CHOOSER %hostlist #
*

36
kde/critical Normal file
View File

@ -0,0 +1,36 @@
app-editors/nano
net-misc/openssh
net-misc/rsync
net-misc/wget
sys-kernel/gentoo-sources
sys-kernel/linux-headers
sys-devel/gcc
sys-devel/automake
sys-devel/bison
sys-devel/make
sys-devel/flex
sys-devel/automake-wrapper
sys-devel/autoconf-wrapper
sys-devel/autoconf
sys-devel/m4
sys-devel/gcc-config
sys-devel/libtool
sys-devel/binutils
sys-devel/binutils-config
sys-devel/patch
sys-devel/gnuconfig
app-admin/python-updater
app-admin/perl-cleaner
sys-apps/man-pages
sys-apps/man
sys-apps/file
sys-apps/less
sys-apps/texinfo
sys-apps/busybox
sys-apps/debianutils
sys-apps/man-pages-posix
sys-apps/sandbox
sys-apps/which
dev-lang/perl
sys-devel/libperl
sys-apps/portage

588
kde/kdmrc Normal file
View File

@ -0,0 +1,588 @@
# KDM master configuration file
#
# Definition: the greeter is the login dialog, i.e., the part of KDM
# which the user sees.
#
# You can configure every X-display individually.
# Every display has a display name, which consists of a host name
# (which is empty for local displays specified in {Static|Reserve}Servers),
# a colon, and a display number. Additionally, a display belongs to a
# display class (which can be ignored in most cases; the control center
# does not support this feature at all).
# Sections with display-specific settings have the formal syntax
# "[X-" host [":" number [ "_" class ]] "-" sub-section "]"
# You can use the "*" wildcard for host, number, and class. You may omit
# trailing components; they are assumed to be "*" then.
# The host part may be a domain specification like ".inf.tu-dresden.de".
# It may also be "+", which means non-empty, i.e. remote displays only.
# From which section a setting is actually taken is determined by these
# rules:
# - an exact match takes precedence over a partial match (for the host part),
# which in turn takes precedence over a wildcard ("+" taking precedence
# over "*")
# - precedence decreases from left to right for equally exact matches
# Example: display name "myhost:0", class "dpy".
# [X-myhost:0_dpy] precedes
# [X-myhost:0_*] (same as [X-myhost:0]) precedes
# [X-myhost:*_dpy] precedes
# [X-myhost:*_*] (same as [X-myhost]) precedes
# [X-+:0_dpy] precedes
# [X-*:0_dpy] precedes
# [X-*:0_*] (same as [X-*:0]) precedes
# [X-*:*_*] (same as [X-*])
# These sections do NOT match this display:
# [X-hishost], [X-myhost:0_dec], [X-*:1], [X-:*]
# If a setting is not found in any matching section, the default is used.
#
# Every comment applies to the following section or key. Note that all
# comments will be lost if you change this file with the kcontrol frontend.
# The defaults refer to KDM's built-in values, not anything set in this file.
#
# Special characters need to be backslash-escaped (leading and trailing
# spaces (\s), tab (\t), linefeed (\n), carriage return (\r) and the
# backslash itself (\\)).
# In lists, fields are separated with commas without whitespace in between.
# Some command strings are subject to simplified sh-style word splitting:
# single quotes (') and double quotes (") have the usual meaning; the backslash
# quotes everything (not only special characters). Note that the backslashes
# need to be doubled because of the two levels of quoting.
[General]
# This option exists solely for the purpose of a clean automatic upgrade.
# Do not even think about changing it!
ConfigVersion=2.4
# List of permanent displays. Displays with a hostname are foreign. A display
# class may be specified separated by an underscore.
# Default is ":0"
StaticServers=
# List of on-demand displays. See StaticServers for syntax.
# Default is ""
ReserveServers=
# VTs to allocate to X-servers. A negative number means that the VT will be
# used only if it is free. If all VTs in this list are used up, the next free
# one greater than the last one in this list will be allocated.
# Default is ""
ServerVTs=-7
# TTYs (without /dev/) to monitor for activity while in console mode.
# Default is ""
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6
# Where KDM should store its PID (do not store if empty).
# Default is ""
PidFile=/var/run/kdm.pid
# Whether KDM should lock the PID file to prevent having multiple KDM
# instances running at once. Do not change unless you are brave.
# Default is true
#LockPidFile=false
# Where to store authorization files.
# Default is "/var/run/xauth"
#AuthDir=/tmp
# Whether KDM should automatically re-read configuration files, if it
# finds them having changed.
# Default is true
#AutoRescan=false
# Additional environment variables KDM should pass on to all programs it runs.
# LD_LIBRARY_PATH and XCURSOR_THEME are good candidates;
# otherwise, it should not be necessary very often.
# Default is ""
#ExportList=LD_LIBRARY_PATH,ANOTHER_IMPORTANT_VAR
# A character device KDM should read entropy from.
# Empty means use the system's preferred entropy device.
# Default is ""
#RandomDevice=/dev/altrandom
# Where the command sockets should be created; make it empty to disable
# them.
# Default is "/var/run/xdmctl"
#FifoDir=/tmp
# The group to which the global command socket should belong;
# can be either a name or a numerical ID.
# Default is 0
#FifoGroup=xdmctl
# The directory in which KDM should store persistent working data.
# Default is "/var/lib/kdm"
##DataDir=
DataDir=/var/lib/kdm-4.4
# The directory in which KDM should store users' .dmrc files. This is only
# needed if the home directories are not readable before actually logging in
# (like with AFS).
# Default is ""
#DmrcDir=/nfs-shared/var/dmrcs
[Xdmcp]
# Whether KDM should listen to incoming XDMCP requests.
# Default is true
Enable=true
# The UDP port on which KDM should listen for XDMCP requests. Do not change.
# Default is 177
Port=177
# File with the private keys of X-terminals. Required for XDM authentication.
# Default is ""
#KeyFile=/usr/share/config/kdm/kdmkeys
# XDMCP access control file in the usual XDM-Xaccess format.
# Default is "/usr/share/config/kdm/Xaccess"
#Xaccess=
# Number of seconds to wait for display to respond after the user has
# selected a host from the chooser.
# Default is 15
#ChoiceTimeout=10
# Strip domain name from remote display names if it is equal to the local
# domain.
# Default is true
#RemoveDomainname=false
# Use the numeric IP address of the incoming connection on multihomed hosts
# instead of the host name.
# Default is false
#SourceAddress=true
# The program which is invoked to dynamically generate replies to XDMCP
# DirectQuery or BroadcastQuery requests.
# If empty, no program is invoked and "Willing to manage" is sent.
# Default is ""
Willing=/usr/share/config/kdm/Xwilling
[Shutdown]
# The command (subject to word splitting) to run to halt the system.
# Default is "/sbin/halt"
#HaltCmd=
# The command (subject to word splitting) to run to reboot the system.
# Default is "/sbin/reboot"
#RebootCmd=
# Whether it is allowed to shut down the system via the global command socket.
# Default is false
#AllowFifo=true
# Whether it is allowed to abort active sessions when shutting down the
# system via the global command socket.
# Default is true
#AllowFifoNow=false
# The boot manager KDM should use for offering boot options in the
# shutdown dialog.
# "None" - no boot manager
# "Grub" - Grub boot manager
# "Lilo" - Lilo boot manager (Linux on i386 & x86-64 only)
# Default is None
#BootManager=Grub
# Rough estimations about how many seconds KDM will spend at most on
# - opening a connection to the X-server (OpenTime) if the attempt
# - times out: OpenTimeout
# - is refused: OpenRepeat * OpenDelay
# - starting a local X-server (ServerTime):
# ServerAttempts * (ServerTimeout + OpenDelay)
# - starting a display:
# - local display: ServerTime + OpenTime
# - foreign display: StartAttempts * OpenTime
# - XDMCP display: OpenTime (repeated indefinitely by client)
# Core config for all displays
[X-*-Core]
# How long to wait before retrying to connect a display.
# Default is 15
#OpenDelay=15
# How long to wait before timing out a display connection attempt.
# Default is 120
#OpenTimeout=120
# How many connection attempts to make during a start attempt. Note that
# a timeout aborts the entire start attempt.
# Default is 5
#OpenRepeat=5
# Try at most that many times to start a display. If this fails, the display
# is disabled.
# Default is 4
#StartAttempts=4
# Ping remote display every that many minutes.
# Default is 5
#PingInterval=5
# Wait for a Pong that many minutes.
# Default is 5
#PingTimeout=5
# The name of this X-server's Xauth file.
# If empty, a random name in the AuthDir directory will be used.
# Default is ""
#AuthFile=
# Specify a file with X-resources for the greeter, chooser and background.
# The KDE frontend does not use this file, so you do not need it unless you
# use another background generator than krootimage.
# Default is ""
#Resources=
# The xrdb program to use to read the above specified recources.
# Subject to word splitting.
# Default is "/usr/bin/xrdb"
#Xrdb=
# A program to run before the greeter is shown. Can be used to start an
# xconsole or an alternative background generator. Subject to word splitting.
# Default is ""
Setup=/usr/share/config/kdm/Xsetup
# A program to run before a user session starts. Subject to word splitting.
# Default is ""
Startup=/usr/share/config/kdm/Xstartup
# A program to run after a user session exits. Subject to word splitting.
# Default is ""
Reset=/usr/share/config/kdm/Xreset
# The program which is run as the user which logs in. It is supposed to
# interpret the session argument (see SessionsDirs) and start an appropriate
# session according to it. Subject to word splitting.
# Default is "/usr/bin/xterm -ls -T"
Session=/usr/share/config/kdm/Xsession
# The program to run if Session fails.
# Default is "/usr/bin/xterm"
#FailsafeClient=
# The PATH for the Session program.
# Default is "/usr/local/bin:/usr/bin:/bin:/usr/games"
#UserPath=
# The PATH for Setup, Startup and Reset, etc.
# Default is "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
#SystemPath=
# The default system shell.
# Default is "/bin/sh"
#SystemShell=/bin/bash
# Where to put the user's X-server authorization file if ~/.Xauthority
# cannot be created.
# Default is "/tmp"
#UserAuthDir=
# If true, UserAuthDir will be used unconditionally.
# Default is false
#ForceUserAuthDir=true
# Whether to automatically restart sessions after X-server crashes.
# Note that enabling this makes circumventing screen lockers other than
# KDE's built-in one possible!
# Default is false
#AutoReLogin=true
# Allow root logins?
# Default is true
AllowRootLogin=false
# Allow to log in, when user has set an empty password?
# Default is true
AllowNullPasswd=false
# Who is allowed to shut down the system. This applies both to the
# greeter and to the command sockets.
# "None" - no "Shutdown..." menu entry is shown at all
# "Root" - the root password must be entered to shut down
# "All" - everybody can shut down the machine
# Default is All
AllowShutdown=Root
# Who is allowed to abort active sessions when shutting down.
# "None" - no forced shutdown is allowed at all
# "Root" - the root password must be entered to shut down forcibly
# "All" - everybody can shut down the machine forcibly
# Default is All
#AllowSdForceNow=Root
# The default choice for the shutdown condition/timing.
# "Schedule" - shut down after all active sessions exit (possibly at once)
# "TryNow" - shut down, if no active sessions are open; otherwise, do nothing
# "ForceNow" - shut down unconditionally
# Default is Schedule
#DefaultSdMode=ForceNow
# How to offer shutdown scheduling options:
# "Never" - not at all
# "Optional" - as a button in the simple shutdown dialogs
# "Always" - instead of the simple shutdown dialogs
# Default is Never
#ScheduledSd=Optional
# The directories containing session type definitions in .desktop format,
# ordered by falling priority.
# Default is "/usr/share/apps/kdm/sessions"
#SessionsDirs=/usr/share/config/kdm/sessions,/usr/share/apps/kdm/sessions
SessionsDirs=/usr/share/xsessions
# The file (relative to $HOME) to redirect the session output to. The
# following character pairs are replaced:
# - %d -> current display
# - %u -> current user
# - %r -> empty at first. See below.
# - %% -> a single %
# When the constructed filename cannot be used safely and the specification
# contains %<stuff>r, other names will be tried - this time expanding %<stuff>r
# to <stuff> followed by a random number.
# Default is ".xsession-errors"
ClientLogFile=.xsession-errors-%d
# Fallback when ClientLogFile cannot be used. The same expansions are
# supported. DO NOT use relative paths here.
# Default is "/tmp/xerr-%u-%d%-r"
#ClientLogFallback=/var/log/xsession-errors/%u-%d%-r
# Whether KDM's built-in utmp/wtmp/lastlog registration should be used.
# Default is true
#UseSessReg=false
# Greeter config for all displays
[X-*-Greeter]
# Specify the widget style for the greeter. Empty means to use the
# built-in default which currently is "Oxygen-air".
# Default is ""
#GUIStyle=Plastique
# Specify the widget color scheme for the greeter. Empty means to use the
# built-in default which currently is "Oxygen-air".
# Default is ""
#ColorScheme=MidnightMeadow
# What should be shown in the greeter's logo are:
# "None" - nothing
# "Logo" - the image specified by LogoPixmap
# "Clock" - a neat analog clock
# Default is Clock
LogoArea=Logo
# The image to show when LogoArea=Logo.
# Default is ""
LogoPixmap=/usr/share/apps/kdm/pics/kdelogo.png
# The relative coordinates (X,Y in percent) of the center of the greeter.
# Default is "50,50"
#GreeterPos=30,40
# The screen the greeter should be displayed on in multi-headed and Xinerama
# setups. The numbering starts with 0. For Xinerama, it corresponds to the
# listing order in the active ServerLayout section of XF86Config; -1 means
# to use the upper-left screen, -2 means to use the upper-right screen.
# Default is 0
#GreeterScreen=-1
# The headline in the greeter. The following character pairs are replaced:
# - %d -> current display
# - %h -> host name, possibly with domain name
# - %n -> node name, most probably the host name without domain name
# - %s -> the operating system
# - %r -> the operating system's version
# - %m -> the machine (hardware) type
# - %% -> a single %
# Default is "Welcome to %s at %n"
#GreetString=K Desktop Environment (%n)
# Whether the fonts used in the greeter should be antialiased.
# Default is false
#AntiAliasing=true
# The font for the greeter headline.
# Default is "Serif,20,bold"
#GreetFont=Serif,20,5,0,50,0
# The normal font used in the greeter.
# Default is "Sans Serif,10"
#StdFont=Sans Serif,10,5,0,50,0
# The font used for the "Login Failed" message.
# Default is "Sans Serif,10,bold"
#FailFont=Sans Serif,10,5,0,75,0
# What to do with the Num Lock modifier for the time the greeter is running:
# "Off" - turn off
# "On" - turn on
# "Keep" - do not change the state
# Default is Keep
#NumLock=Off
# Language and locale to use in the greeter, encoded like $LANGUAGE.
# If empty, the settings from the environment are used.
# Default is ""
#Language=de_DE
# Enable autocompletion in the username line edit.
# Default is false
#UserCompletion=true
# Enable user list (names along with images) in the greeter.
# Default is true
#UserList=false
# User selection for UserCompletion and UserList:
# "NotHidden" - all users except those listed in HiddenUsers
# "Selected" - only the users listed in SelectedUsers
# Default is NotHidden
#ShowUsers=Selected
# For ShowUsers=Selected. @<group> means all users in that group.
# Default is ""
#SelectedUsers=root,johndoe
# For ShowUsers=NotHidden. @<group> means all users in that group.
# Default is ""
#HiddenUsers=root
# Special case of HiddenUsers: users with a non-zero UID less than this number
# will not be shown as well.
# Default is 0
MinShowUID=1000
# Complement to MinShowUID: users with a UID greater than this number will
# not be shown as well.
# Default is 65535
MaxShowUID=65000
# If false, the users are listed in the order they appear in /etc/passwd.
# If true, they are sorted alphabetically.
# Default is true
#SortUsers=false
# Specify, where the users' pictures should be taken from.
# "AdminOnly" - from <FaceDir>/$USER.face[.icon]
# "PreferAdmin" - prefer <FaceDir>, fallback on $HOME
# "PreferUser" - ... and the other way round
# "UserOnly" - from the user's $HOME/.face[.icon]
# Default is AdminOnly
#FaceSource=PreferUser
# The directory containing the user images if FaceSource is not UserOnly.
# Default is "/usr/share/apps/kdm/faces"
##FaceDir=/usr/share/faces
FaceDir=/var/lib/kdm-4.4/faces
# Specify, if/which user should be preselected for log in.
# "None" - do not preselect any user
# "Previous" - the user which successfully logged in last time
# "Default" - the user specified in the DefaultUser option
# Default is None
#PreselectUser=Previous
# If this is true, the password input line is focused automatically if
# a user is preselected.
# Default is false
#FocusPasswd=true
# If this is true, the entered password is echoed as bullets. Otherwise,
# no feedback is given at all.
# Default is true
#EchoPasswd=false
# If true, krootimage will be automatically started by KDM; otherwise, the
# Setup script should be used to setup the background.
# Default is true
#UseBackground=false
# The configuration file to be used by krootimage.
# Default is "/usr/share/config/kdm/backgroundrc"
#BackgroundCfg=
# Whether to grab keyboard and mouse while the greeter is visible. Grabs
# may improve security, but make on-screen keyboards, etc. unusable.
# "Never" - never grab
# "IfNoAuth" - grab if the display requires no X authorization
# "Always" - always grab
# Default is IfNoAuth
#GrabInput=Always
# Hold the X-server grabbed the whole time the greeter is visible. This
# may be more secure, but it will disable any background and other
# X-clients started from the Setup script.
# Default is false
#GrabServer=true
# How many seconds to wait for grab to succeed.
# Default is 3
#GrabTimeout=3
# Warn, if display has no X-authorization (local auth cannot be created,
# XDMCP display wants no auth, or display is foreign from StaticServers).
# Default is true
#AuthComplain=false
# Random seed for forging saved session types, etc. of unknown users.
# This value should be random but constant across the login domain.
# Default is 0
ForgingSeed=1277780988
# Specify conversation plugins for the login dialog. Each plugin can be
# specified as a base name (which expands to $kde_modulesdir/kgreet_$base)
# or as a full pathname.
# Default is "classic"
#PluginsLogin=sign
# Same as PluginsLogin, but for the shutdown dialog.
# Default is "classic"
#PluginsShutdown=modern
# A list of options of the form Key=Value. The conversation plugins can query
# these settings; it is up to them what possible keys are.
# Default is ""
#PluginOptions=SomeKey=randomvalue,Foo=bar
# Show the "Console Login" action in the greeter (if ServerTTY/ConsoleTTYs
# is configured).
# Default is true
#AllowConsole=false
# A program to run while the greeter is visible. It is supposed to preload
# as much as possible of the session that is going to be started (most
# probably).
# Default is ""
Preloader=/usr/bin/preloadkde
# Whether the greeter should be themed.
# Default is false
UseTheme=true
# The theme to use for the greeter. Can point to either a directory or an XML
# file.
# Default is ""
Theme=/usr/share/apps/kdm/themes/oxygen-air
# Core config for local displays
[X-:*-Core]
# How often to try to run the X-server. Running includes executing it and
# waiting for it to come up.
# Default is 1
#ServerAttempts=1
# How long to wait for a local X-server to come up.
# Default is 15
ServerTimeout=30
# The command line to start the X-server, without display number and VT spec.
# This string is subject to word splitting.
# Default is "/usr/bin/X"
ServerCmd=/usr/bin/X
# Additional arguments for the X-servers for local sessions.
# This string is subject to word splitting.
# Default is ""
ServerArgsLocal=-nolisten tcp
# Additional arguments for the X-servers for remote sessions.
# This string is subject to word splitting.
# Default is ""
#ServerArgsRemote=
# Restart instead of resetting the local X-server after session exit.
# Use it if the server leaks memory etc.
# Default is false
TerminateServer=true
# The signal needed to reset the local X-server.
# Default is 1 (SIGHUP)
#ResetSignal=1
# The signal needed to terminate the local X-server.
# Default is 15 (SIGTERM)
#TermSignal=15
# Create X-authorizations for local displays.
# Default is true
#Authorize=false
# Which X-authorization mechanisms should be used.
# Default is "MIT-MAGIC-COOKIE-1"
#AuthNames=
# Need to reset the X-server to make it read initial Xauth file.
# Default is false
#ResetForAuth=true
# See above
AllowNullPasswd=true
# See above
AllowShutdown=All
# Enable password-less logins on this display. USE WITH EXTREME CARE!
# Default is false
#NoPassEnable=true
# The users that do not need to provide a password to log in. NEVER list root!
# "*" means all non-root users. @<group> means all users in that group.
# Default is ""
#NoPassUsers=fred,ethel
# Greeter config for local displays
[X-:*-Greeter]
# See above
PreselectUser=Previous
# See above
FocusPasswd=true
# Specify whether the greeter of local displays should start up in host chooser
# (remote) or login (local) mode and whether it is allowed to switch to the
# other mode.
# "LocalOnly" - only local login possible
# "DefaultLocal" - start up in local mode, but allow switching to remote mode
# "DefaultRemote" - ... and the other way round
# "RemoteOnly" - only choice of remote host possible
# Default is LocalOnly
LoginMode=DefaultLocal
# A list of hosts to be automatically added to the remote login menu. The
# special name "*" means broadcast.
# Default is "*"
#ChooserHosts=*,ugly,sky,dino,kiste.local,login.crap.com
# Show the "Restart X Server"/"Close Connection" action in the greeter.
# Default is true
AllowClose=false
# Core config for 1st local display
[X-:0-Core]
# The VT the X-server should run on; auto-assign if zero, don't assign if -1.
# Better leave it zero and use ServerVTs.
# Default is 0
#ServerVT=7
# Enable automatic login. USE WITH EXTREME CARE!
# Default is false
#AutoLoginEnable=true
# If true, auto-login after logout. If false, auto-login is performed only
# when a display session starts up.
# Default is false
#AutoLoginAgain=true
# The delay in seconds before automatic login kicks in.
# Default is 0
#AutoLoginDelay=10
# The user to log in automatically. NEVER specify root!
# Default is ""
#AutoLoginUser=fred
# The password for the user to log in automatically. This is NOT required
# unless the user is logged into a NIS or Kerberos domain. If you use this
# option, you should "chmod 600 kdmrc" for obvious reasons.
# Default is ""
#AutoLoginPass=secret!
# Immediately lock the automatically started session. This works only with
# KDE sessions.
# Default is false
#AutoLoginLocked=true
# See above
ClientLogFile=.xsession-errors
# Greeter config for 1st local display
[X-:0-Greeter]
# See above
#PreselectUser=Default
# The user to preselect if PreselectUser=Default.
# Default is ""
#DefaultUser=johndoe

10
kde/knotifyrc Normal file
View File

@ -0,0 +1,10 @@
[Misc]
LastConfiguredApp=Accessibility
[Phonon::AudioOutput]
KNotify_Volume=1
[Sounds]
No sound=true
Use external player=false
Volume=100

9
kde/local Normal file
View File

@ -0,0 +1,9 @@
local_start() {
/usr/bin/kdm -daemon
return 0
}
local_stop() {
pkill kdm
return 0
}

2
kde/package.mask Normal file
View File

@ -0,0 +1,2 @@
# Build error: bug #346491
=media-libs/libgphoto2-2.4.10

22
kde/package.use Normal file
View File

@ -0,0 +1,22 @@
app-editors/nano ncurses
dev-lang/python ssl threads xml
sys-kernel/gentoo-sources symlink
# per kde
app-misc/strigi dbus qt4
app-text/poppler utils
dev-libs/libxml2 python
dev-libs/xmlrpc-c curl
media-libs/xine-lib xcb
media-sound/phonon xcb xine
net-misc/curl ssl
sys-apps/dbus X
x11-libs/cairo X svg
x11-libs/qt-core exceptions qt3support ssl
x11-libs/qt-gui accessibility dbus mng
x11-libs/qt-qt3support accessibility kde
x11-libs/qt-sql qt3support mysql
x11-libs/qt-webkit kde
# KDE 4.5
>=dev-libs/soprano-2.4.64 raptor redland

6
kde/world Normal file
View File

@ -0,0 +1,6 @@
app-admin/syslog-ng
kde-base/kde-meta
kde-base/kdebase-runtime-meta
media-fonts/dejavu
media-fonts/freefont-ttf
net-misc/dhcpcd

1249
kernel.config Normal file

File diff suppressed because it is too large Load Diff

1192
kernel.config.testing Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,6 @@
en_US ISO-8859-1
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
#ja_JP.EUC-JP EUC-JP
#ja_JP.UTF-8 UTF-8
#ja_JP EUC-JP

16
lodgeit/10_lodgeit.conf Normal file
View File

@ -0,0 +1,16 @@
Listen 80
WSGIPythonHome /home/lodgeit/lodgeitproject
<VirtualHost *>
Servername localhost
DocumentRoot /home/lodgeit/lodgeitproject/
WSGIDaemonProcess lodgeit user=lodgeit group=lodgeit processes=1 threads=5
WSGIScriptAlias / /home/lodgeit/lodgeitproject/lodgeit/lodgeit.wsgi
<Location "/">
WSGIProcessGroup lodgeit
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Location>
</VirtualHost>

28
lodgeit/Makefile Normal file
View File

@ -0,0 +1,28 @@
# set up apache modules in make.conf
POST_FILES = lodgeit.sh 10_lodgeit.conf apache2.conf genkey.py lodgeit.wsgi
POST_FILES += issue
preinstall: make.conf.extra
cat make.conf.extra >> $(CHROOT)/etc/make.conf
postinstall: $(POST_FILES)
chroot $(CHROOT) $(EMERGE) -1n $(USEPKG) dev-vcs/mercurial
chroot $(CHROOT) $(EMERGE) -1n $(USEPKG) dev-python/virtualenv
chroot $(CHROOT) getent group lodgeit || chroot $(CHROOT) groupadd lodgeit
chroot $(CHROOT) getent passwd lodgeit || \
chroot $(CHROOT) useradd -c "Lodgeit Pastebin" -m -g lodgeit lodgeit
cp lodgeit.sh $(CHROOT)/tmp
chroot $(CHROOT) su -c /tmp/lodgeit.sh lodgeit
cp 10_lodgeit.conf $(CHROOT)/etc/apache2/vhosts.d
cp apache2.conf $(CHROOT)/etc/conf.d/apache2
python genkey.py $(CHROOT)
cp lodgeit.wsgi $(CHROOT)/home/lodgeit/lodgeitproject/lodgeit
cp issue $(CHROOT)/etc/issue
chroot $(CHROOT) rc-update add apache2 default
chroot $(CHROOT) $(EMERGE) -C dev-vcs/mercurial
chroot $(CHROOT) $(EMERGE) -C dev-python/virtualenv
chroot $(CHROOT) $(EMERGE) --depclean --with-bdeps=n
clean:

3
lodgeit/README Normal file
View File

@ -0,0 +1,3 @@
Lodgeit is a pastebin service written in the Python programming language
See http://dev.pocoo.org/projects/lodgeit/

73
lodgeit/apache2.conf Normal file
View File

@ -0,0 +1,73 @@
# /etc/conf.d/apache2: config file for /etc/init.d/apache2
# When you install a module it is easy to activate or deactivate the modules
# and other features of apache using the APACHE2_OPTS line. Every module should
# install a configuration in /etc/apache2/modules.d. In that file will have an
# <IfDefine NNN> directive where NNN is the option to enable that module.
#
# Here are the options available in the default configuration:
#
# AUTH_DIGEST Enables mod_auth_digest
# AUTHNZ_LDAP Enables authentication through mod_ldap (available if USE=ldap)
# CACHE Enables mod_cache
# DAV Enables mod_dav
# ERRORDOCS Enables default error documents for many languages.
# INFO Enables mod_info, a useful module for debugging
# LANGUAGE Enables content-negotiation based on language and charset.
# LDAP Enables mod_ldap (available if USE=ldap)
# MANUAL Enables /manual/ to be the apache manual (available if USE=docs)
# MEM_CACHE Enables default configuration mod_mem_cache
# PROXY Enables mod_proxy
# SSL Enables SSL (available if USE=ssl)
# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
# USERDIR Enables /~username mapping to /home/username/public_html
#
#
# The following two options provide the default virtual host for the HTTP and
# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache
# will not listen for incomming connections on the approriate port.
#
# DEFAULT_VHOST Enables name-based virtual hosts, with the default
# virtual host being in /var/www/localhost/htdocs
# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
# when you enable SSL)
#
APACHE2_OPTS="-D INFO -D WSGI"
# Extended options for advanced uses of Apache ONLY
# You don't need to edit these unless you are doing crazy Apache stuff
# As not having them set correctly, or feeding in an incorrect configuration
# via them will result in Apache failing to start
# YOU HAVE BEEN WARNED.
# PID file
#PIDFILE=/var/run/apache2.pid
# timeout for startup/shutdown checks
#TIMEOUT=10
# ServerRoot setting
#SERVERROOT=/usr/lib64/apache2
# Configuration file location
# - If this does NOT start with a '/', then it is treated relative to
# $SERVERROOT by Apache
#CONFIGFILE=/etc/apache2/httpd.conf
# Location to log startup errors to
# They are normally dumped to your terminal.
#STARTUPERRORLOG="/var/log/apache2/startuperror.log"
# A command that outputs a formatted text version of the HTML at the URL
# of the command line. Designed for lynx, however other programs may work.
#LYNX="lynx -dump"
# The URL to your server's mod_status status page.
# Required for status and fullstatus
#STATUSURL="http://localhost/server-status"
# Method to use when reloading the server
# Valid options are 'restart' and 'graceful'
# See http://httpd.apache.org/docs/2.2/stopping.html for information on
# what they do and how they differ.
#RELOAD_TYPE="graceful"

36
lodgeit/critical Normal file
View File

@ -0,0 +1,36 @@
app-editors/nano
net-misc/openssh
net-misc/rsync
net-misc/wget
sys-kernel/gentoo-sources
sys-kernel/linux-headers
sys-devel/gcc
sys-devel/automake
sys-devel/bison
sys-devel/make
sys-devel/flex
sys-devel/automake-wrapper
sys-devel/autoconf-wrapper
sys-devel/autoconf
sys-devel/m4
sys-devel/gcc-config
sys-devel/libtool
sys-devel/binutils
sys-devel/binutils-config
sys-devel/patch
sys-devel/gnuconfig
app-admin/python-updater
app-admin/perl-cleaner
sys-apps/man-pages
sys-apps/man
sys-apps/file
sys-apps/less
sys-apps/texinfo
sys-apps/busybox
sys-apps/debianutils
sys-apps/man-pages-posix
sys-apps/sandbox
sys-apps/which
dev-lang/perl
sys-devel/libperl
sys-apps/portage

11
lodgeit/genkey.py Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/python
import os
import sys
AC_FILENAME = "%s/home/lodgeit/lodgeitproject/lodgeit/app_config.py" % sys.argv[1]
key=repr(os.urandom(30))
app_config=open(AC_FILENAME, 'w')
app_config.write('key=%s\n' % repr(key))
app_config.close()

6
lodgeit/issue Normal file
View File

@ -0,0 +1,6 @@

------------------------------------------------------------------------------
LODGEIT CONSOLE
------------------------------------------------------------------------------

17
lodgeit/lodgeit.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
set -v
cd ~/
virtualenv --no-site-packages lodgeitproject
cd lodgeitproject
source bin/activate
[ -d lodgeit ] || hg clone http://dev.pocoo.org/hg/lodgeit-main lodgeit
pip install pygments
pip install jinja2
pip install werkzeug
pip install sqlalchemy
pip install babel
pip install pil
pip install simplejson
deactivate

12
lodgeit/lodgeit.wsgi Normal file
View File

@ -0,0 +1,12 @@
import sys
from os.path import dirname
app_dir = dirname(__file__)
sys.path.insert(0, app_dir)
from lodgeit import make_app
from app_config import key
application = make_app(
dburi='sqlite:///%s/lodgeit.db' % app_dir,
secret_key=key
)

4
lodgeit/make.conf.extra Normal file
View File

@ -0,0 +1,4 @@
# Apache config for LodgeIt
APACHE2_MPMS="prefork"
APACHE2_MODULES="authz_host dir mime"

3
lodgeit/package.use Normal file
View File

@ -0,0 +1,3 @@
app-editors/nano ncurses
dev-lang/python sqlite ssl threads xml
sys-kernel/gentoo-sources symlink

5
lodgeit/world Normal file
View File

@ -0,0 +1,5 @@
app-admin/syslog-ng
net-misc/dhcpcd
sys-boot/grub
sys-kernel/gentoo-sources
www-apache/mod_wsgi

12
make.conf Normal file
View File

@ -0,0 +1,12 @@
CFLAGS="-Os -pipe"
CXXFLAGS="-Os -pipe"
CHOST="x86_64-pc-linux-gnu"
MAKEOPTS="-j2"
USE="-* nptl pam unicode"
ALSA_PCM_PLUGINS="*"
CLEAN_DELAY="0"
EMERGE_WARNING_DELAY="0"
AUTO_CLEAN="yes"
EPAUSE_IGNORE="1"
EMERGE_DEFAULT_OPTS="--jobs=2"
FEATURES="noinfo -test nodoc noman unmerge-orphans buildpkg parallel-fetch"

View File

@ -1,5 +1,4 @@
usr/src/linux-*
tmp/*
var/tmp/*
usr/portage/*

4
rsync-excludes-critical Normal file
View File

@ -0,0 +1,4 @@
usr/lib/python*/test
usr/share/gtk-doc
var/db/pkg
usr/lib/perl*

View File

@ -1,23 +0,0 @@
#!/usr/bin/env python3
"""Copy files from source to target in the chroot"""
import os
import subprocess
import sys
def main():
chroot = os.environ["CHROOT"]
target = sys.argv[-1]
chroot_target = os.path.join(chroot, target.lstrip("/"))
chroot_target_dir = os.path.dirname(chroot_target)
if not os.path.exists(chroot_target_dir):
os.makedirs(chroot_target_dir)
command = ["cp"] + sys.argv[1:-1] + [chroot_target]
sys.exit(subprocess.call(command))
if __name__ == "__main__":
main()

View File

@ -1,54 +0,0 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
def main():
environ = os.environ
repobind = []
repodir = environ['REPO_DIR']
repos = str.split(environ['REPO_NAMES'])
for repo in repos:
repobind.append(f"--bind={repodir}/{repo}:/var/db/repos/{repo}")
kernelbind = []
kernelpathfile=environ['KERNEL_PATH']
try:
with open(kernelpathfile, 'rb') as f:
kernelpath = f.read().decode("utf-8")
except OSError:
kernelpath = "NONE"
if kernelpath != "NONE":
if not os.path.exists(kernelpath):
os.makedirs(kernelpath)
##kernelbind.append(f"--bind={kernelpath}:/usr/src/{os.path.basename(os.path.dirname(kernelpath))}")
kernelbind.append(f"--bind={kernelpath}:/usr/src/linux")
loopbind = []
if os.path.exists('partitions'):
with open('partitions') as f:
loopdevice = f.readline().strip('\n')
loopbind.append(f"--bind={loopdevice}")
loopbind.append(f"--bind={loopdevice}p1")
command = [
"systemd-nspawn",
"--quiet",
f"--directory={environ['CHROOT']}",
f"--machine={environ['container']}",
f"--capability=CAP_NET_ADMIN,CAP_SYS_RAWIO",
f"--bind={environ['PORTAGE_DIR']}:/var/db/repos/gentoo",
f"--bind={environ['VA_PKGDIR']}:/var/cache/binpkgs",
f"--bind={environ['DISTDIR']}:/var/cache/distfiles",
] + repobind + kernelbind + loopbind + sys.argv[1:]
if os.environ.get("VA_ARCH") == "linux32":
command = ["linux32"] + command
sys.exit(subprocess.call(command))
if __name__ == "__main__":
main()

View File

@ -1,132 +0,0 @@
#!/usr/bin/env python3
"""Build the latest kernel but only if need be"""
import os
import shutil
import subprocess
EMERGE = os.environ["EMERGE"].split()
USEPKG = os.environ["USEPKG"].split()
def get_latest_available_kernel():
kernel = os.environ["KERNEL"]
package_name = "sys-kernel/{}".format(kernel)
popen = subprocess.Popen(
["portageq", "best_visible", "/", package_name], stdout=subprocess.PIPE
)
cpv = popen.stdout.read().decode().strip()
return cpv.rpartition("-")[2]
def get_current_kernel():
"""what kernel does /boot/vmlinuz point to"""
vmlinuz = "/boot/vmlinuz"
if not os.path.islink(vmlinuz):
return None
filename = os.path.basename(os.path.realpath(vmlinuz))
assert filename.startswith("vmlinuz")
part_after_vmlinuz = filename[8:]
# may have "-gentoo" or whatever in the name
version = part_after_vmlinuz.rpartition("-")[0]
return version
def install_kernel_package_deps():
kernel = os.environ["KERNEL"]
package_name = "sys-kernel/{}".format(kernel)
cmd = EMERGE + USEPKG + ["--onlydeps", "--oneshot", "--noreplace", package_name]
subprocess.check_call(cmd)
def copy_kernel_config():
filename = "/root/kernel.config"
shutil.copy(filename, "/usr/src/linux/.config")
def build_kernel():
makeopts = os.environ.get("MAKEOPTS", "")
subprocess.check_call(
["make", "-C", "/usr/src/linux", "MAKEOPTS=" + makeopts, "oldconfig"]
)
subprocess.check_call(["make", "-C", "/usr/src/linux", "MAKEOPTS=" + makeopts])
def remove_old_kernels():
kernel_files = ["vmlinuz-", "System.map-", "config-"]
for filename in os.listdir("/boot"):
for kernel_file in kernel_files:
if filename.startswith(kernel_file):
path = os.path.join("/boot", filename)
os.unlink(path)
if os.path.exists("/boot/vmlinuz"):
os.unlink("/boot/vmlinuz")
##shutil.rmtree("/lib/modules", ignore_errors=True)
def install_kernel():
makeopts = os.environ.get("MAKEOPTS", "")
modules_install = False
for line in open("/usr/src/linux/.config"):
if "CONFIG_MODULES=y" in line:
modules_install = True
break
if modules_install:
subprocess.check_call([
'make', '-C', '/usr/src/linux', 'MAKEOPTS=' + makeopts, 'install',
'modules_install'
])
else:
subprocess.check_call([
'make', '-C', '/usr/src/linux', 'MAKEOPTS=' + makeopts, 'install'
])
# create the symlink. /sbin/installkernel claims this is not used on
# "modern" distributions and doesn't create it (unless it already
# exists). I still do this however.
for filename in os.listdir("/boot"):
if filename.startswith("vmlinuz-"):
if os.path.lexists("/boot/vmlinuz"):
os.unlink("/boot/vmlinuz")
os.symlink(filename, "/boot/vmlinuz")
break
def uninstall_kernel_package_deps():
subprocess.check_call(EMERGE + USEPKG + ["--depclean", "--with-bdeps=n"])
def backup_kernel_config():
shutil.copy("/usr/src/linux/.config", "/root/kernel.config")
def main():
latest_kernel = get_latest_available_kernel()
current_kernel = get_current_kernel()
if current_kernel == latest_kernel:
return
install_kernel_package_deps()
##copy_kernel_config()
build_kernel()
remove_old_kernels()
install_kernel()
backup_kernel_config()
uninstall_kernel_package_deps()
main()

View File

@ -1,137 +0,0 @@
#!/usr/bin/env python3
"""fetch a stage3 from Gentoo's mirror"""
import argparse
import urllib.request
import os
import re
import sys
import gnupg
from collections import namedtuple
MIRROR = 'http://gentoo.osuosl.org/'
Stage3 = namedtuple('Stage3', 'url cpu specialty minimal nomultilib systemd mergedusr size')
MINIMAL = re.compile(r'[\+-]minimal-')
NOMULTILIB = re.compile(r'[\+-]nomultilib-')
SYSTEMD = re.compile(r'[\+-]systemd-')
MERGEDUSR = re.compile(r'[\+-]mergedusr-')
def parse_args():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--cpu', type=str, default=None)
parser.add_argument('--specialty', type=str, default=None)
parser.add_argument('--no-multilib', action='store_true', default=False)
parser.add_argument('--systemd', action='store_true', default=False)
parser.add_argument('--minimal', action='store_true', default=False)
parser.add_argument('--mergedusr', action='store_true', default=False)
parser.add_argument('--outfile', type=str, default=None)
parser.add_argument('arch', type=str)
return parser.parse_args()
def get_manifest(arch, mirror=MIRROR):
manifest = []
url = mirror + '/releases/{0}/autobuilds/latest-stage3.txt'.format(arch)
base_url = mirror + '/releases/{0}/autobuilds/'.format(arch)
gpg = gnupg.GPG(gnupghome="/home/user/.gnupg")
with urllib.request.urlopen(url) as fp:
text = gpg.verify_file(fp, extra_args=['-o', '-']).data
##text = fp.read()
text = text.decode('ascii')
for line in text.split('\n'):
line = line.strip()
if not line or line[0] == '#':
continue
filename, size = line.split()
size = int(size)
dirname, rest = filename.split('/', 1)
if '/' in rest:
specialty, rest = rest.split('/', 1)
else:
specialty = None
cpu = rest.split('-', 2)[1]
nomultilib = 'nomultilib-' in rest
nomultilib = bool(NOMULTILIB.search(rest))
systemd = 'systemd-' in rest
systemd = bool(SYSTEMD.search(rest))
mergedusr = 'mergedusr-' in rest
mergedusr = bool(MERGEDUSR.search(rest))
minimal = bool(MINIMAL.search(rest))
stage3 = Stage3(
cpu=cpu,
mergedusr=mergedusr,
minimal=minimal,
nomultilib=nomultilib,
systemd=systemd,
size=size,
specialty=specialty,
url=base_url + filename,
)
manifest.append(stage3)
return manifest
def fetch(url, outfile):
"""fetch url and write it to outfile"""
with urllib.request.urlopen(url) as infile, open(outfile, 'wb') as outfile:
while True:
data = infile.read(512)
if not data:
break
outfile.write(data)
def main():
args = parse_args()
manifest = get_manifest(args.arch)
manifest.reverse()
stage3 = None
for item in manifest:
if not args.cpu and item.cpu != args.arch:
continue
if args.cpu and item.cpu != args.cpu:
continue
if not all([
args.minimal == item.minimal,
args.mergedusr == item.mergedusr,
args.no_multilib == item.nomultilib,
args.systemd == item.systemd,
args.specialty == item.specialty,
]):
continue
stage3 = item
break
if not stage3:
msg = 'No stage3 found matching your criteria\n'
sys.stderr.write(msg)
sys.exit(404)
filename = os.path.basename(stage3.url)
if args.outfile:
outfile = args.outfile
else:
outfile = filename
print(filename)
fetch(stage3.url, outfile)
stat = os.stat(outfile)
assert stat.st_size == stage3.size, 'File size does not match manifest'
main()

View File

@ -1,4 +0,0 @@
1iserial --speed=9600 --unit=0 --word=8 --parity=no --stop=1\
1iterminal_input serial\
1iterminal_output serial\
s/^\([ \t]*linux .*\)$/\1 console=tty0 console=ttyS0,38400n8/

View File

@ -1,41 +0,0 @@
#!/bin/sh
# Script for creating the motd on a virtual appliance image
EXTERNAL_KERNEL=$1
VIRTIO=$2
DISK_SIZE=$3
SWAP_SIZE=$4
DASH=$5
ARCH=$6
TZ=$TIMEZONE ; export TZ
cat << EOF
Welcome to ${HOSTNAME}!
This system created by Gentoo Virtual Appliance:
https://bitbucket.org/marduk/virtual-appliance/
The system image was built on `date +"%Y-%m-%d %H:%M %Z"` based on the "${APPLIANCE}"
appliance. It was built with the following features:
EOF
cat << EOF | column -c80
APPLIANCE: ${APPLIANCE}
ARCH: ${ARCH}
HOSTNAME: ${HOSTNAME}
HEADLESS: ${HEADLESS}
EXTERNAL_KERNEL: ${EXTERNAL_KERNEL}
VIRTIO: ${VIRTIO}
DISK_SIZE: ${DISK_SIZE}
SWAP_SIZE: ${SWAP_SIZE}M
DASH: ${DASH}
EOF
if [ -x "${APPLIANCE}/motd.sh" ]
then
"${APPLIANCE}/motd.sh" $@
fi
echo

View File

@ -1,21 +0,0 @@
#!/usr/bin/env python3
import sys
TTY = sys.stdout.isatty()
write = sys.stdout.write
write('\n')
if TTY:
write('\x1b[') # escape, left-bracket
write('1;31m') # bold red
write(' '.join(sys.argv[1:]))
if TTY:
write('\x1b[') # escape, left-bracket
write('0m') # reset
write('\n')

49
teamplayer/Makefile Normal file
View File

@ -0,0 +1,49 @@
HG_REPO = ../../teamplayer
TP_USER = teamplayer
TP_HOME = /opt/teamplayer
TP_DB = /var/lib/teamplayer
PGVER = 9.0
INSTALL = install
M4_DEFS += -D TP_USER=$(TP_USER) -D TP_HOME=$(TP_HOME) -D TP_DB=$(TP_DB)
M4C = $(M4) $(M4_DEFS)
post_files = bash_profile settings_local.py start-teamplayer stop-teamplayer
post_files += local.start local.stop issue lighttpd.conf
preinstall:
postinstall: $(post_files)
chroot $(CHROOT) $(EMERGE) -n $(USEPKG) =dev-db/postgresql-server-$(PGVER)*
chroot $(CHROOT) passwd -d postgres
echo 'PG_INITDB_OPTS="--locale=en_US.UTF-8"' >> $(CHROOT)/etc/conf.d/postgresql-$(PGVER)
yes | chroot $(CHROOT) $(EMERGE) --config =postgresql-server-$(PGVER)*
chroot $(CHROOT) rc-update add postgresql-$(PGVER) default
chroot $(CHROOT) getent passwd $(TP_USER) || \
chroot $(CHROOT) useradd -c "Teamplayer Server" -G postgres -U -d $(TP_HOME) $(TP_USER)
rm -rf $(CHROOT)/$(TP_HOME)
hg clone --pull $(HG_REPO) $(CHROOT)/$(TP_HOME)
cp bash_profile $(CHROOT)$(TP_HOME)/.bash_profile
chroot $(CHROOT) mkdir -p /etc/teamplayer
$(M4C) settings_local.py > $(CHROOT)/etc/teamplayer/settings_local.py
mkdir -p $(CHROOT)$(TP_HOME)/bin
$(M4C) start-teamplayer > $(CHROOT)$(TP_HOME)/bin/start-teamplayer
chmod +x $(CHROOT)$(TP_HOME)/bin/start-teamplayer
$(M4C) stop-teamplayer > $(CHROOT)$(TP_HOME)/bin/stop-teamplayer
chmod +x $(CHROOT)$(TP_HOME)/bin/stop-teamplayer
chroot $(CHROOT) $(INSTALL) -d -o $(TP_USER) -g $(TP_USER) $(TP_DB)
chroot $(CHROOT) $(INSTALL) -d -o $(TP_USER) -g $(TP_USER) $(TP_DB)/songs
chroot $(CHROOT) rm -rf $(TP_HOME)/web/media/songs
chroot $(CHROOT) ln -s $(TP_DB)/songs $(TP_HOME)/web/media/songs
chroot $(CHROOT) $(INSTALL) -d -o $(TP_USER) -g $(TP_USER) $(TP_DB)/mpd
chroot $(CHROOT) $(INSTALL) -d -o $(TP_USER) -g $(TP_USER) /var/log/teamplayer
$(M4C) local.start > $(CHROOT)/etc/conf.d/local.start
$(M4C) local.stop > $(CHROOT)/etc/conf.d/local.stop
cp issue $(CHROOT)/etc/issue
$(M4C) lighttpd.conf > $(CHROOT)/etc/lighttpd/lighttpd.conf
chroot $(CHROOT) gpasswd -a lighttpd teamplayer
chroot $(CHROOT) rc-update add lighttpd default
chroot $(CHROOT) rc-update add ntpd default
clean:

1
teamplayer/bash_profile Normal file
View File

@ -0,0 +1 @@
PATH="$HOME/bin:$PATH"

36
teamplayer/critical Normal file
View File

@ -0,0 +1,36 @@
app-editors/nano
net-misc/openssh
net-misc/rsync
net-misc/wget
sys-kernel/gentoo-sources
sys-kernel/linux-headers
sys-devel/gcc
sys-devel/automake
sys-devel/bison
sys-devel/make
sys-devel/flex
sys-devel/automake-wrapper
sys-devel/autoconf-wrapper
sys-devel/autoconf
sys-devel/m4
sys-devel/gcc-config
sys-devel/libtool
sys-devel/binutils
sys-devel/binutils-config
sys-devel/patch
sys-devel/gnuconfig
app-admin/python-updater
app-admin/perl-cleaner
sys-apps/man-pages
sys-apps/man
sys-apps/file
sys-apps/less
sys-apps/texinfo
sys-apps/busybox
sys-apps/debianutils
sys-apps/man-pages-posix
sys-apps/sandbox
sys-apps/which
dev-lang/perl
sys-devel/libperl
sys-apps/portage

5
teamplayer/issue Normal file
View File

@ -0,0 +1,5 @@
------------------------------------------------------------------------------
TEAMPLAYER CONSOLE
------------------------------------------------------------------------------

80
teamplayer/lighttpd.conf Normal file
View File

@ -0,0 +1,80 @@
var.basedir = "/var/www/localhost"
var.logdir = "/var/log/lighttpd"
var.statedir = "/var/lib/lighttpd"
server.modules = (
"mod_rewrite",
# "mod_redirect",
"mod_alias",
"mod_access",
"mod_fastcgi",
# "mod_cml",
# "mod_trigger_b4_dl",
# "mod_auth",
# "mod_status",
# "mod_setenv",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
# "mod_webdav",
"mod_accesslog"
)
include "mime-types.conf"
# {{{ server settings
server.username = "lighttpd"
server.groupname = "lighttpd"
server.document-root = var.basedir + "/htdocs"
server.pid-file = "/var/run/lighttpd.pid"
server.errorlog = var.logdir + "/error.log"
# log errors to syslog instead
# server.errorlog-use-syslog = "enable"
server.indexfiles = ("index.php", "index.html",
"index.htm", "default.htm")
# server.tag = "lighttpd"
server.follow-symlink = "enable"
# {{{ mod_accesslog
accesslog.filename = var.logdir + "/access.log"
# }}}
# {{{ mod_dirlisting
# enable directory listings
dir-listing.activate = "disable"
#
url.access-deny = ("~", ".inc")
# begin TeamPlayer config
server.max-request-size = 21000
fastcgi.server = (
"/teamplayer.fcgi" => (
"main" => (
"socket" => "TP_DB/teamplayer.sock",
"check-local" => "disable",
)
),
)
alias.url = (
"/m" => "TP_HOME/web/media/",
)
url.rewrite-once = (
"^(/m.*)$" => "$1",
"^(/.*)$" => "/teamplayer.fcgi$1",
)

18
teamplayer/local.start Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
if [ ! -f /etc/firstboot ] ; then
echo "Creating TeamPlayer database ..."
createuser -U postgres -D -S -R teamplayer
createdb -U postgres teamplayer
touch /var/log/teamplayer/teamplayer.log
chown TP_USER:TP_USER /var/log/teamplayer/teamplayer.log
fi
su -c "TP_HOME/bin/start-teamplayer" TP_USER
tailf /var/log/teamplayer/teamplayer.log > /dev/tty7 &
# put some ionice on mpd
sleep 3
ionice -c2 -n0 -p$(cat TP_DB/mpd/mpd.pid)
touch /etc/firstboot

3
teamplayer/local.stop Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
su -c "TP_HOME/bin/stop-teamplayer" TP_USER

View File

@ -0,0 +1,4 @@
dev-db/postgresql-base ~amd64
dev-db/postgresql-server ~amd64
dev-python/django ~amd64
dev-python/python-mpd ~amd64

9
teamplayer/package.use Normal file
View File

@ -0,0 +1,9 @@
app-editors/nano ncurses
dev-db/sqlite extensions
dev-lang/python sqlite ssl threads xml
dev-python/django postgres
media-libs/flac ogg
media-sound/mpd audiofile ffmpeg flac id3 lame network ogg vorbis mad sqlite
media-video/ffmpeg mmx mxext mp3 network x264
sys-kernel/gentoo-sources symlink
www-servers/lighttpd fastcgi pcre

View File

@ -0,0 +1,19 @@
TIME_ZONE = 'UTC'
DJANGO_STATIC_MEDIA = False
FORCE_SCRIPT_NAME = ''
TEMPLATE_DIRS = (
'TP_HOME/web/teamplayer/templates',
)
TP_STREAM_URL = '/stream.mp3'
`TP_HOME' = 'TP_HOME'
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'teamplayer'
DATABASE_HOST = ''
DATABASE_PASSWORD = ''
DATABASE_PORT = ''
TP_MPD_HOME = 'TP_DB/mpd'
TP_REPO_URL = '/repo/'

23
teamplayer/start-teamplayer Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
# this should be run as the TP_USER user
PYTHONPATH="/etc/teamplayer:$PYTHONPATH"
export PYTHONPATH
cd ~
hg serve -p 8000 --prefix /repo/ > /var/log/teamplayer/hgserve.log 2>&1 &
cd ~/web
if [ ! -f "/etc/firstboot" ] ; then
python manage.py syncdb
fi
# start the fastcgi daemon
python manage.py runfcgi daemonize=true protocol=fcgi maxrequest=20 \
pidfile="TP_DB/fcgi.pid" socket=TP_DB/teamplayer.sock umask=002 \
> "/var/log/teamplayer/teamplayer.log" 2>&1
# spin!
python manage.py spin --verbosity=2 $@ > "/var/log/teamplayer/teamplayer.log" 2>&1 &
echo $! > "TP_DB/tps.pid"

11
teamplayer/stop-teamplayer Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
# this should be run as the TP_USER user
cd ~/web
PYTHONPATH="/etc/teamplayer:$PYTHONPATH"
export PYTHONPATH
[ -f "TP_DB/tps.pid" ] && kill $(cat "TP_DB/tps.pid")
[ -f "TP_DB/fcgi.pid" ] && kill $(cat "TP_DB/fcgi.pid")
python manage.py stop_stream >> "/var/log/teamplayer/teamplayer.log"

10
teamplayer/world Normal file
View File

@ -0,0 +1,10 @@
dev-python/django
dev-python/flup
dev-python/python-mpd
dev-vcs/mercurial
media-libs/mutagen
media-sound/mpc
media-sound/mpd
net-misc/dhcpcd
net-misc/ntp
www-servers/lighttpd

10
x/Makefile Normal file
View File

@ -0,0 +1,10 @@
xdm_files = $(wildcard xdm/*)
preinstall:
postinstall: $(xdm_files)
cp xdm/* "$(CHROOT)"/etc/X11/xdm
chroot "$(CHROOT)" rc-update add xdm default;
clean:

36
x/critical Normal file
View File

@ -0,0 +1,36 @@
app-editors/nano
net-misc/openssh
net-misc/rsync
net-misc/wget
sys-kernel/gentoo-sources
sys-kernel/linux-headers
sys-devel/gcc
sys-devel/automake
sys-devel/bison
sys-devel/make
sys-devel/flex
sys-devel/automake-wrapper
sys-devel/autoconf-wrapper
sys-devel/autoconf
sys-devel/m4
sys-devel/gcc-config
sys-devel/libtool
sys-devel/binutils
sys-devel/binutils-config
sys-devel/patch
sys-devel/gnuconfig
app-admin/python-updater
app-admin/perl-cleaner
sys-apps/man-pages
sys-apps/man
sys-apps/file
sys-apps/less
sys-apps/texinfo
sys-apps/busybox
sys-apps/debianutils
sys-apps/man-pages-posix
sys-apps/sandbox
sys-apps/which
dev-lang/perl
sys-devel/libperl
sys-apps/portage

3
x/package.use Normal file
View File

@ -0,0 +1,3 @@
dev-lang/python xml
dev-libs/libxml2 python
x11-base/xorg-server xorg

8
x/world Normal file
View File

@ -0,0 +1,8 @@
net-misc/dhcpcd
x11-apps/xcalc
x11-apps/xdm
x11-apps/xedit
x11-apps/xeyes
x11-apps/xload
x11-apps/xlogo
x11-base/xorg-x11

101
x/xdm/Xaccess Normal file
View File

@ -0,0 +1,101 @@
# $XdotOrg: Xaccess,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
# $Xorg: Xaccess,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
# $XFree86: xc/programs/xdm/config/Xaccess,v 1.4 2003/07/09 15:27:40 tsi Exp $
#
# Access control file for XDMCP connections
#
# To control Direct and Broadcast access:
#
# pattern
#
# To control Indirect queries:
#
# pattern list of hostnames and/or macros ...
#
# To use the chooser:
#
# pattern CHOOSER BROADCAST
#
# or
#
# pattern CHOOSER list of hostnames and/or macros ...
#
# To define macros:
#
# %name list of hosts ...
#
# To control which addresses xdm listens for requests on:
#
# LISTEN address [list of multicast groups ... ]
#
# The first form tells xdm which displays to respond to itself.
# The second form tells xdm to forward indirect queries from hosts matching
# the specified pattern to the indicated list of hosts.
# The third form tells xdm to handle indirect queries using the chooser;
# the chooser is directed to send its own queries out via the broadcast
# address and display the results on the terminal.
# The fourth form is similar to the third, except instead of using the
# broadcast address, it sends DirectQuerys to each of the hosts in the list
# The fifth form tells xdm which addresses to listen for incoming connections
# on. If present, xdm will only listen for connections on the specified
# interfaces and/or multicast groups.
#
# In all cases, xdm uses the first entry which matches the terminal;
# for IndirectQuery messages only entries with right hand sides can
# match, for Direct and Broadcast Query messages, only entries without
# right hand sides can match.
#
* #any host can get a login window
#
# To hardwire a specific terminal to a specific host, you can
# leave the terminal sending indirect queries to this host, and
# use an entry of the form:
#
#terminal-a host-a
#
# The nicest way to run the chooser is to just ask it to broadcast
# requests to the network - that way new hosts show up automatically.
# Sometimes, however, the chooser can't figure out how to broadcast,
# so this may not work in all environments.
#
#* CHOOSER BROADCAST #any indirect host can get a chooser
#
# If you'd prefer to configure the set of hosts each terminal sees,
# then just uncomment these lines (and comment the CHOOSER line above)
# and edit the %hostlist line as appropriate
#
#%hostlist host-a host-b
#* CHOOSER %hostlist #
#
# If you have a machine with multiple network interfaces or IP addresses
# you can control which interfaces accept XDMCP packets by listing a LISTEN
# line for each interface you want to listen on. You can additionally list
# one or more multicast groups after each address to listen on those groups
# on that address.
#
# If no LISTEN is specified, the default is the same as "LISTEN *" - listen on
# all unicast interfaces, but not for multicast packets. If any LISTEN lines
# are specified, then only the listed interfaces will be listened on.
#
# IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned
# multicast addresses for XDMCP, where X in the prefix may be replaced
# by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local,
# 5 for Site-Local, and so on. The default is equivalent to the example shown
# here using the Link-Local version to most closely match the old IPv4 subnet
# broadcast behavior.
#
# LISTEN * ff02:0:0:0:0:0:0:12b
# This example shows listening for multicast on all scopes up to site-local
#
# LISTEN * ff01:0:0:0:0:0:0:12b ff02:0:0:0:0:0:0:12b ff03:0:0:0:0:0:0:12b ff04:0:0:0:0:0:0:12b ff05:0:0:0:0:0:0:12b

13
x/xdm/Xservers Normal file
View File

@ -0,0 +1,13 @@
# $Xorg: Xserv.ws.cpp,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
#
# Xservers file, workstation prototype
#
# This file should contain an entry to start the server on the
# local display; if you have more than one display (not screen),
# you can add entries to the list (one per line). If you also
# have some X terminals connected which do not support XDMCP,
# you can add them here as well. Each X terminal line should
# look like:
# XTerminalName:0 foreign
#
#:0 local /usr/bin/X :0 vt7

Some files were not shown because too many files have changed in this diff Show More