Skip to content

Instantly share code, notes, and snippets.

@glensc glensc/README.md
Last active Aug 29, 2015

Embed
What would you like to do?
MATE Desktop in PLD Linux

MATE Desktop in PLD Linux

To build this VM and create vagrant-mate base box:

First clone this repository:

git clone https://gist.github.com/glensc/9948541 vagrant-mate
cd vagrant-mate

Build and export VM:

vagrant destroy -f
vagrant up
vagrant package --output vagrant-mate.box
#!/bin/sh
set -xe
BOX_NAME=vagrant-mate
vagrant destroy -f
vagrant up
rm -f $BOX_NAME.box
vagrant package --vagrantfile Vagrantfile.skel --output $BOX_NAME.box
ls -l $BOX_NAME.box
ls -lh $BOX_NAME.box
tar tvf $BOX_NAME.box
vagrant box remove $BOX_NAME || :
vagrant box add $BOX_NAME $BOX_NAME.box
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# Vagrantfile to create MATE Desktop on PLD Linux
#
# https://gist.github.com/glensc/9948541
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'pld32'
config.vm.box_url = "ftp://ftp.pld-linux.org/people/glen/vm/#{config.vm.box}.box"
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', '512']
end
ignore = %w[vserver-packages]
ignore << %w[xorg-driver-video-fglrx-libs xorg-driver-video-nvidia-legacy-304xx-libs xorg-driver-video-nvidia-legacy3-libs xorg-driver-video-nvidia-libs]
ignore << %w[systemd]
ignore << %w[garcon gnome-menus kde4-kdebase-runtime lxmenu-data]
ignore << %w[kmymoney2]
# make rebuilds faster to preserve cache outside vm
Dir.mkdir('cache') unless Dir.exists?('cache')
config.vm.synced_folder 'cache', '/var/cache/poldek', owner: 'vagrant', group: 'vagrant'
# http://docs.vagrantup.com/v2/provisioning/shell.html
config.vm.provision :shell, :inline => "
set -ex;
# setup rpm
sed -i -re '/%(_repackage_all_erasures|_excludedocs)/ s/^#//' /etc/rpm/macros
# preserve cache
sed -i -re 's/^#(keep downloads) = .*/\\1 = yes/' /etc/poldek/poldek.conf
# disable equivalents
sed -i -e '/^ignore/ s/.*/ignore = #{ignore.join(" ")}/' /etc/poldek/poldek.conf
# sync indexes
poldek --up
# prepare for growfs
if [ ! -x /usr/sbin/xfs_growfs ]; then
poldek -u xfsprogs; ldconfig;
lvextend --size=3G /dev/sys/rootfs
xfs_growfs /
fi
# install stuff
poldek -Q \
-u metapackage-mate --noask \
mate-themes \
mate-terminal \
dbus-x11 ConsoleKit-x11 \
fonts-Type1-urw \
xorg-driver-input-evdev \
xorg-driver-video-vboxvideo \
xorg-app-xrandr \
lightdm-init lightdm-gtk-greeter \
bash-completion gawk \
glibc-localedb-all \
VirtualBox-guest-x11 \
wget
# add carme repo
test -e /etc/poldek/repos.d/carme.conf || wget carme.pld-linux.org/~glen/th/i686/carme.conf -O /etc/poldek/repos.d/carme.conf
service messagebus start
service lightdm start
# adjust default runlevel
sed -i -e '/^id:3:initdefault:/ s/3/5/' /etc/inittab
# setup autologin
sed -i -e 's/^#autologin-user=.*/autologin-user=vagrant/' /etc/lightdm/lightdm.conf
# set default locale to be utf8 compatible
sed -i -e 's/^#LANG=en_US.UTF-8/LANG=en_US.UTF-8/' /etc/sysconfig/i18n
# setup perms, ck should do it really
chown vagrant /dev/vboxuser
# setup password to be able to login to X11
echo vagrant | passwd vagrant --stdin
# zero disk
dd if=/dev/zero of=/ZEROFILL bs=1M || :
rm -f /ZEROFILL
"
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
# this box is built from https://gist.github.com/glensc/9948541
Vagrant.configure(2) do |config|
config.vm.provider :virtualbox do |vb|
vb.gui = true if File.new('/dev/stderr').isatty
vb.customize ['modifyvm', :id, '--memory', '512']
end
# make rebuilds faster to preserve cache outside vm
Dir.mkdir('cache') unless Dir.exists?('cache')
config.vm.synced_folder 'cache', '/var/cache/poldek', owner: 'vagrant', group: 'vagrant'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.