Vagrant in Fedora
by Alex Drahon
Hi all,
I wanted to give an update on the status of Vagrant in Fedora 20, I just realised it's my first post to the list so I'll take this opportunity to introduce myself. I'm Alex, I work at Red Hat as a Solution Architect (ie. nothing engineering related), I wrote the vagrant-kvm plugin on my spare time to make it work on my Fedora laptop, though there's now a (much more qualified) second maintainer who is also providing support for Ubuntu through a PPA. Matthew asked me if I wanted to work on packaging Vagrant and the KVM plugin for Fedora 20, and I foolishly accepted ;)
It's quite exhilarating having the opportunity to contribute to Fedora, and at the same time I feel totally lost. I don't mean this as a criticism, it's just this "first week at school" feeling, it will take me some time to get an idea of how things work. That said, here's the Vagrant situation:
1. I have a vagrant RPM that installs and works as expected, there's some minimal patching involved which has to do with the fact that Vagrant expect to be running in it's own Ruby 1.9.3 environment in /opt
2. There was also some patching involved to make the plugin system work, although I haven't tested plugins extensively (some stuff breaks like rubygems loading path) and providing common plugins as RPMs looks like the better way in Fedora.
3. I had to build my own rubygems-childprocess (current Fedora package is very old) and rubygems-log4r (not provided in Fedora) RPMs, but I don't know how I should submit them (package review ticket?). There's a existing ticket for log4r https://bugzilla.redhat.com/show_bug.cgi?id=905240 , I added it as a dependency to the Vagrant ticket.
4. I've packaged vagrant-kvm as a RPM and it installs, but I'm running into serious issues with Policykit. I don't think I'll be able to solve that without help, I'm not even sure what's the right way to do it.
So, as a summary:
- yum install vagrant should work, at which point you need to install VirtualBox and it will run as expected
- vagrant-kvm installs but I don't know how to add the right polkit rules (I need help)
Looks pretty good, right?
Alex
9 years, 11 months
Disabling firewalld on AWS?
by Sam Kottler
Greetings,
Given the deny-by-default nature of security groups I think it makes sense to disable firewalld in the AMI's. I haven't seen any other AMI's that have a firewall enabled by default and we probably shouldn't break that pattern IMO.
Thoughts?
-Sam
10 years, 1 month
container/container-medium-19.ks container/container-medium-20.ks container/container-small-19.ks container/container-small-20.ks
by Matthew Miller
container/container-medium-19.ks | 2 ++
container/container-medium-20.ks | 2 ++
container/container-small-19.ks | 2 ++
container/container-small-20.ks | 2 ++
4 files changed, 8 insertions(+)
New commits:
commit 3a5da269bf89e09abbb07dc38ab93bce23dc81ee
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Thu Sep 26 09:29:17 2013 -0400
/dev/console shouldn't be the real console in the container.
diff --git a/container/container-medium-19.ks b/container/container-medium-19.ks
index 313ac58..ebdedff 100644
--- a/container/container-medium-19.ks
+++ b/container/container-medium-19.ks
@@ -70,6 +70,8 @@ ln -s /proc/kcore /dev/core
mknod -m 600 /dev/console c 5 1
mknod -m 660 /dev/loop0 b 7 0
mknod -m 660 /dev/loop1 b 7 1
+rm -rf /dev/console
+ln -s /dev/tty1 /dev/console
echo -n "Network fixes"
# initscripts don't like this file to be missing.
diff --git a/container/container-medium-20.ks b/container/container-medium-20.ks
index 03988e3..b9a9cbe 100644
--- a/container/container-medium-20.ks
+++ b/container/container-medium-20.ks
@@ -70,6 +70,8 @@ ln -s /proc/kcore /dev/core
mknod -m 600 /dev/console c 5 1
mknod -m 660 /dev/loop0 b 7 0
mknod -m 660 /dev/loop1 b 7 1
+rm -rf /dev/console
+ln -s /dev/tty1 /dev/console
echo -n "Network fixes"
# initscripts don't like this file to be missing.
diff --git a/container/container-small-19.ks b/container/container-small-19.ks
index 4e19ded..3fcd63d 100644
--- a/container/container-small-19.ks
+++ b/container/container-small-19.ks
@@ -64,6 +64,8 @@ ln -s /proc/kcore /dev/core
mknod -m 600 /dev/console c 5 1
mknod -m 660 /dev/loop0 b 7 0
mknod -m 660 /dev/loop1 b 7 1
+rm -rf /dev/console
+ln -s /dev/tty1 /dev/console
echo -n "Network fixes"
# initscripts don't like this file to be missing.
diff --git a/container/container-small-20.ks b/container/container-small-20.ks
index 9266a0e..bc44013 100644
--- a/container/container-small-20.ks
+++ b/container/container-small-20.ks
@@ -64,6 +64,8 @@ ln -s /proc/kcore /dev/core
mknod -m 600 /dev/console c 5 1
mknod -m 660 /dev/loop0 b 7 0
mknod -m 660 /dev/loop1 b 7 1
+rm -rf /dev/console
+ln -s /dev/tty1 /dev/console
echo -n "Network fixes"
# initscripts don't like this file to be missing.
10 years, 2 months
generic/fedora-20-cloud.ks
by Matthew Miller
generic/fedora-20-cloud.ks | 9 ---------
1 file changed, 9 deletions(-)
New commits:
commit 37b3065b9ee1a42c8c956cc6c6d98a8737743613
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Wed Sep 25 08:37:59 2013 -0400
cloud-init kludges removed as they're fixed in the package now
diff --git a/generic/fedora-20-cloud.ks b/generic/fedora-20-cloud.ks
index cda0edf..e58941b 100644
--- a/generic/fedora-20-cloud.ks
+++ b/generic/fedora-20-cloud.ks
@@ -221,11 +221,6 @@ fi
# make sure firstboot doesn't start
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
-# workaround https://bugzilla.redhat.com/show_bug.cgi?id=966888
-if ! grep -q growpart /etc/cloud/cloud.cfg; then
- sed -i 's/ - resizefs/ - growpart\n - resizefs/' /etc/cloud/cloud.cfg
-fi
-
# Uncomment this if you want to use cloud init but suppress the creation
# of an "ec2-user" account. This will, in the absence of further config,
# cause the ssh key from a metadata source to be put in the root account.
@@ -234,10 +229,6 @@ fi
#disable_root: 0
#EOF
-# This is a temporary fix to change the default user to "fedora"; this
-# change will be in an upcoming cloud-init update
-sed -i 's/ec2-user/fedora/;s/EC2 user/Fedora Cloud User/' /etc/cloud/cloud.cfg
-
echo "Removing random-seed so it's not the same in every image."
rm -f /var/lib/random-seed
10 years, 2 months
2 commits - container/buildcontainers.sh
by Matthew Miller
container/buildcontainers.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 93a5ed02f80507b2e730d4dfb66e219d7d1c64e2
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Tue Sep 24 20:17:26 2013 -0400
this would work a lot better if I actually included the "docker" command
diff --git a/container/buildcontainers.sh b/container/buildcontainers.sh
index 98f15a3..90e3d49 100755
--- a/container/buildcontainers.sh
+++ b/container/buildcontainers.sh
@@ -5,6 +5,6 @@ for ver in 19 20; do
-o /tmp/f$ver$size --name "fedora-$ver-$size" --release $ver \
--format=qcow2 &&
virt-tar-out -a /tmp/f$ver$size/fedora-$ver-$size/fedora-$ver-$size-sda.qcow2 / - |
- import - fedora$ver-$size
+ docker import - fedora$ver-$size
done
done
commit a16b4d58587733901e56601a2e9519cfa5d234da
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Tue Sep 24 20:10:24 2013 -0400
bash -x for my kludgy script
diff --git a/container/buildcontainers.sh b/container/buildcontainers.sh
index 7321026..98f15a3 100755
--- a/container/buildcontainers.sh
+++ b/container/buildcontainers.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
for size in small medium; do
for ver in 19 20; do
appliance-creator -c container-$size-$ver.ks -d -v -t /tmp \
10 years, 2 months
container/buildcontainers.sh
by Matthew Miller
container/buildcontainers.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 2248a579a61b7896c985d7fd8f9139f771d7eb19
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Tue Sep 24 19:56:53 2013 -0400
here's an excitingly hacky build script. you shouldn't really use this.
i just dont want to lose it if i lose my laptop.
diff --git a/container/buildcontainers.sh b/container/buildcontainers.sh
new file mode 100755
index 0000000..7321026
--- /dev/null
+++ b/container/buildcontainers.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+for size in small medium; do
+for ver in 19 20; do
+ appliance-creator -c container-$size-$ver.ks -d -v -t /tmp \
+ -o /tmp/f$ver$size --name "fedora-$ver-$size" --release $ver \
+ --format=qcow2 &&
+ virt-tar-out -a /tmp/f$ver$size/fedora-$ver-$size/fedora-$ver-$size-sda.qcow2 / - |
+ import - fedora$ver-$size
+done
+done
10 years, 2 months
6 commits - container/container-medium-19.ks container/container-medium-20.ks container/container-minimal-19.ks container/container-minimal-20.ks container/container-small-19.ks container/container-small-20.ks
by Matthew Miller
container/container-medium-19.ks | 4 -
container/container-medium-20.ks | 4 -
container/container-minimal-19.ks | 138 -----------------------------------
container/container-minimal-20.ks | 138 -----------------------------------
container/container-small-19.ks | 148 ++++++++++++++++++++++++++++++++++++++
container/container-small-20.ks | 148 ++++++++++++++++++++++++++++++++++++++
6 files changed, 298 insertions(+), 282 deletions(-)
New commits:
commit 4d6e862b034d0b400eb23ede28efdde8f18cbc20
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Tue Sep 24 19:55:22 2013 -0400
mv minimal to small, because minimal is KIND OF A LIE
diff --git a/container/container-minimal-19.ks b/container/container-minimal-19.ks
deleted file mode 100644
index 4e19ded..0000000
--- a/container/container-minimal-19.ks
+++ /dev/null
@@ -1,148 +0,0 @@
-# This is a kickstart for making a non-bootable container environment.
-#
-# Convert the result to a tarfile with
-#
-# virt-tar-out -a fedora.qcow2 / - | bzip2 --best > fedora.tar.bz2
-#
-#
-# This kickstart file is designed to be used with appliance-creator and
-# may need slight modification for use with actual anaconda or other tools.
-# We intend to target anaconda-in-a-vm style image building for F20, but
-# not necessarily for containers -- that's yet to be worked out.
-
-lang en_US.UTF-8
-keyboard us
-timezone --utc Etc/UTC
-
-auth --useshadow --enablemd5
-selinux --enforcing
-rootpw --lock --iscrypted locked
-
-zerombr
-clearpart --all
-part / --size 1024 --fstype ext4
-
-# Repositories
-repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-19&arch=$basearch
-repo --name=fedora-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f19&arch=$basearch
-
-reboot
-
-# Package list.
-%packages --excludedocs
-
-bash
-coreutils
-fedora-release
-filesystem
-findutils
-grep
-iproute
-sed
-setup
-yum
-
-# removed below
-passwd
-# https://bugzilla.redhat.com/show_bug.cgi?id=1004976
-firewalld
-
-%end
-
-
-
-%post --erroronfail
-
-# setup systemd to boot to the right runlevel
-echo -n "Setting default runlevel to multiuser text mode"
-rm -f /etc/systemd/system/default.target
-ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
-echo .
-
-# create devices which appliance-creator does not
-ln -s /proc/kcore /dev/core
-mknod -m 600 /dev/console c 5 1
-mknod -m 660 /dev/loop0 b 7 0
-mknod -m 660 /dev/loop1 b 7 1
-
-echo -n "Network fixes"
-# initscripts don't like this file to be missing.
-cat > /etc/sysconfig/network << EOF
-NETWORKING=yes
-NOZEROCONF=yes
-EOF
-
-# For cloud images, 'eth0' _is_ the predictable device name, since
-# we don't want to be tied to specific virtual (!) hardware
-rm -f /etc/udev/rules.d/70*
-ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
-
-# simple eth0 config, again not hard-coded to the build hardware
-cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
-DEVICE="eth0"
-BOOTPROTO="dhcp"
-ONBOOT="yes"
-TYPE="Ethernet"
-EOF
-
-# generic localhost names
-cat > /etc/hosts << EOF
-127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
-::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
-
-EOF
-echo .
-
-
-# Because memory is scarce resource in most cloud/virt environments,
-# and because this impedes forensics, we are differing from the Fedora
-# default of having /tmp on tmpfs.
-echo "Disabling tmpfs for /tmp."
-systemctl mask tmp.mount
-
-echo "Removing random-seed so it's not the same in every image."
-rm -f /var/lib/random-seed
-
-
-echo "Compressing cracklib."
-gzip -9 /usr/share/cracklib/pw_dict.pwd
-
-echo "Minimizing locale-archive."
-localedef --list-archive | grep -v en_US | xargs localedef --delete-from-archive
-mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
-/usr/sbin/build-locale-archive
-# this is really kludgy and will be fixed with a better way of building
-# these containers
-mv /usr/share/locale/en /usr/share/locale/en_US /tmp
-rm -rf /usr/share/locale/*
-mv /tmp/en /tmp/en_US /usr/share/locale/
-mv /usr/share/i18n/locales/en_US /tmp
-rm -rf /usr/share/i18n/locales/*
-mv /tmp/en_US /usr/share/i18n/locales/
-echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
-
-echo "Removing extra packages."
-rm -vf /etc/yum/protected.d/*
-yum -C -y remove passwd --setopt="clean_requirements_on_remove=1"
-yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
-
-echo "Removing boot, since we don't need that."
-rm -rf /boot/*
-
-echo "Cleaning old yum repodata."
-yum clean all
-rm -rf /var/lib/yum/yumdb/*
-truncate -c -s 0 /var/log/yum.log
-
-echo "Fixing SELinux contexts."
-/usr/sbin/fixfiles -R -a restore
-
-
-echo "Zeroing out empty space."
-# This forces the filesystem to reclaim space from deleted files
-dd bs=1M if=/dev/zero of=/var/tmp/zeros || :
-rm -f /var/tmp/zeros
-echo "(Don't worry -- that out-of-space error was expected.)"
-
-%end
-
diff --git a/container/container-minimal-20.ks b/container/container-minimal-20.ks
deleted file mode 100644
index 9266a0e..0000000
--- a/container/container-minimal-20.ks
+++ /dev/null
@@ -1,148 +0,0 @@
-# This is a kickstart for making a non-bootable container environment.
-#
-# Convert the result to a tarfile with
-#
-# virt-tar-out -a fedora.qcow2 / - | bzip2 --best > fedora.tar.bz2
-#
-#
-# This kickstart file is designed to be used with appliance-creator and
-# may need slight modification for use with actual anaconda or other tools.
-# We intend to target anaconda-in-a-vm style image building for F20, but
-# not necessarily for containers -- that's yet to be worked out.
-
-lang en_US.UTF-8
-keyboard us
-timezone --utc Etc/UTC
-
-auth --useshadow --enablemd5
-selinux --enforcing
-rootpw --lock --iscrypted locked
-
-zerombr
-clearpart --all
-part / --size 1024 --fstype ext4
-
-# Repositories
-repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-20&arch=$basearch
-repo --name=fedora-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f20&arch=$basearch
-
-reboot
-
-# Package list.
-%packages --excludedocs
-
-bash
-coreutils
-fedora-release
-filesystem
-findutils
-grep
-iproute
-sed
-setup
-yum
-
-# removed below
-passwd
-# https://bugzilla.redhat.com/show_bug.cgi?id=1004976
-firewalld
-
-%end
-
-
-
-%post --erroronfail
-
-# setup systemd to boot to the right runlevel
-echo -n "Setting default runlevel to multiuser text mode"
-rm -f /etc/systemd/system/default.target
-ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
-echo .
-
-# create devices which appliance-creator does not
-ln -s /proc/kcore /dev/core
-mknod -m 600 /dev/console c 5 1
-mknod -m 660 /dev/loop0 b 7 0
-mknod -m 660 /dev/loop1 b 7 1
-
-echo -n "Network fixes"
-# initscripts don't like this file to be missing.
-cat > /etc/sysconfig/network << EOF
-NETWORKING=yes
-NOZEROCONF=yes
-EOF
-
-# For cloud images, 'eth0' _is_ the predictable device name, since
-# we don't want to be tied to specific virtual (!) hardware
-rm -f /etc/udev/rules.d/70*
-ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
-
-# simple eth0 config, again not hard-coded to the build hardware
-cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
-DEVICE="eth0"
-BOOTPROTO="dhcp"
-ONBOOT="yes"
-TYPE="Ethernet"
-EOF
-
-# generic localhost names
-cat > /etc/hosts << EOF
-127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
-::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
-
-EOF
-echo .
-
-
-# Because memory is scarce resource in most cloud/virt environments,
-# and because this impedes forensics, we are differing from the Fedora
-# default of having /tmp on tmpfs.
-echo "Disabling tmpfs for /tmp."
-systemctl mask tmp.mount
-
-echo "Removing random-seed so it's not the same in every image."
-rm -f /var/lib/random-seed
-
-
-echo "Compressing cracklib."
-gzip -9 /usr/share/cracklib/pw_dict.pwd
-
-echo "Minimizing locale-archive."
-localedef --list-archive | grep -v en_US | xargs localedef --delete-from-archive
-mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
-/usr/sbin/build-locale-archive
-# this is really kludgy and will be fixed with a better way of building
-# these containers
-mv /usr/share/locale/en /usr/share/locale/en_US /tmp
-rm -rf /usr/share/locale/*
-mv /tmp/en /tmp/en_US /usr/share/locale/
-mv /usr/share/i18n/locales/en_US /tmp
-rm -rf /usr/share/i18n/locales/*
-mv /tmp/en_US /usr/share/i18n/locales/
-echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
-
-echo "Removing extra packages."
-rm -vf /etc/yum/protected.d/*
-yum -C -y remove passwd --setopt="clean_requirements_on_remove=1"
-yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
-
-echo "Removing boot, since we don't need that."
-rm -rf /boot/*
-
-echo "Cleaning old yum repodata."
-yum clean all
-rm -rf /var/lib/yum/yumdb/*
-truncate -c -s 0 /var/log/yum.log
-
-echo "Fixing SELinux contexts."
-/usr/sbin/fixfiles -R -a restore
-
-
-echo "Zeroing out empty space."
-# This forces the filesystem to reclaim space from deleted files
-dd bs=1M if=/dev/zero of=/var/tmp/zeros || :
-rm -f /var/tmp/zeros
-echo "(Don't worry -- that out-of-space error was expected.)"
-
-%end
-
diff --git a/container/container-small-19.ks b/container/container-small-19.ks
new file mode 100644
index 0000000..4e19ded
--- /dev/null
+++ b/container/container-small-19.ks
@@ -0,0 +1,148 @@
+# This is a kickstart for making a non-bootable container environment.
+#
+# Convert the result to a tarfile with
+#
+# virt-tar-out -a fedora.qcow2 / - | bzip2 --best > fedora.tar.bz2
+#
+#
+# This kickstart file is designed to be used with appliance-creator and
+# may need slight modification for use with actual anaconda or other tools.
+# We intend to target anaconda-in-a-vm style image building for F20, but
+# not necessarily for containers -- that's yet to be worked out.
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc Etc/UTC
+
+auth --useshadow --enablemd5
+selinux --enforcing
+rootpw --lock --iscrypted locked
+
+zerombr
+clearpart --all
+part / --size 1024 --fstype ext4
+
+# Repositories
+repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-19&arch=$basearch
+repo --name=fedora-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f19&arch=$basearch
+
+reboot
+
+# Package list.
+%packages --excludedocs
+
+bash
+coreutils
+fedora-release
+filesystem
+findutils
+grep
+iproute
+sed
+setup
+yum
+
+# removed below
+passwd
+# https://bugzilla.redhat.com/show_bug.cgi?id=1004976
+firewalld
+
+%end
+
+
+
+%post --erroronfail
+
+# setup systemd to boot to the right runlevel
+echo -n "Setting default runlevel to multiuser text mode"
+rm -f /etc/systemd/system/default.target
+ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
+echo .
+
+# create devices which appliance-creator does not
+ln -s /proc/kcore /dev/core
+mknod -m 600 /dev/console c 5 1
+mknod -m 660 /dev/loop0 b 7 0
+mknod -m 660 /dev/loop1 b 7 1
+
+echo -n "Network fixes"
+# initscripts don't like this file to be missing.
+cat > /etc/sysconfig/network << EOF
+NETWORKING=yes
+NOZEROCONF=yes
+EOF
+
+# For cloud images, 'eth0' _is_ the predictable device name, since
+# we don't want to be tied to specific virtual (!) hardware
+rm -f /etc/udev/rules.d/70*
+ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
+
+# simple eth0 config, again not hard-coded to the build hardware
+cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
+DEVICE="eth0"
+BOOTPROTO="dhcp"
+ONBOOT="yes"
+TYPE="Ethernet"
+EOF
+
+# generic localhost names
+cat > /etc/hosts << EOF
+127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
+::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
+
+EOF
+echo .
+
+
+# Because memory is scarce resource in most cloud/virt environments,
+# and because this impedes forensics, we are differing from the Fedora
+# default of having /tmp on tmpfs.
+echo "Disabling tmpfs for /tmp."
+systemctl mask tmp.mount
+
+echo "Removing random-seed so it's not the same in every image."
+rm -f /var/lib/random-seed
+
+
+echo "Compressing cracklib."
+gzip -9 /usr/share/cracklib/pw_dict.pwd
+
+echo "Minimizing locale-archive."
+localedef --list-archive | grep -v en_US | xargs localedef --delete-from-archive
+mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
+/usr/sbin/build-locale-archive
+# this is really kludgy and will be fixed with a better way of building
+# these containers
+mv /usr/share/locale/en /usr/share/locale/en_US /tmp
+rm -rf /usr/share/locale/*
+mv /tmp/en /tmp/en_US /usr/share/locale/
+mv /usr/share/i18n/locales/en_US /tmp
+rm -rf /usr/share/i18n/locales/*
+mv /tmp/en_US /usr/share/i18n/locales/
+echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
+
+echo "Removing extra packages."
+rm -vf /etc/yum/protected.d/*
+yum -C -y remove passwd --setopt="clean_requirements_on_remove=1"
+yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
+
+echo "Removing boot, since we don't need that."
+rm -rf /boot/*
+
+echo "Cleaning old yum repodata."
+yum clean all
+rm -rf /var/lib/yum/yumdb/*
+truncate -c -s 0 /var/log/yum.log
+
+echo "Fixing SELinux contexts."
+/usr/sbin/fixfiles -R -a restore
+
+
+echo "Zeroing out empty space."
+# This forces the filesystem to reclaim space from deleted files
+dd bs=1M if=/dev/zero of=/var/tmp/zeros || :
+rm -f /var/tmp/zeros
+echo "(Don't worry -- that out-of-space error was expected.)"
+
+%end
+
diff --git a/container/container-small-20.ks b/container/container-small-20.ks
new file mode 100644
index 0000000..9266a0e
--- /dev/null
+++ b/container/container-small-20.ks
@@ -0,0 +1,148 @@
+# This is a kickstart for making a non-bootable container environment.
+#
+# Convert the result to a tarfile with
+#
+# virt-tar-out -a fedora.qcow2 / - | bzip2 --best > fedora.tar.bz2
+#
+#
+# This kickstart file is designed to be used with appliance-creator and
+# may need slight modification for use with actual anaconda or other tools.
+# We intend to target anaconda-in-a-vm style image building for F20, but
+# not necessarily for containers -- that's yet to be worked out.
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc Etc/UTC
+
+auth --useshadow --enablemd5
+selinux --enforcing
+rootpw --lock --iscrypted locked
+
+zerombr
+clearpart --all
+part / --size 1024 --fstype ext4
+
+# Repositories
+repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-20&arch=$basearch
+repo --name=fedora-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f20&arch=$basearch
+
+reboot
+
+# Package list.
+%packages --excludedocs
+
+bash
+coreutils
+fedora-release
+filesystem
+findutils
+grep
+iproute
+sed
+setup
+yum
+
+# removed below
+passwd
+# https://bugzilla.redhat.com/show_bug.cgi?id=1004976
+firewalld
+
+%end
+
+
+
+%post --erroronfail
+
+# setup systemd to boot to the right runlevel
+echo -n "Setting default runlevel to multiuser text mode"
+rm -f /etc/systemd/system/default.target
+ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
+echo .
+
+# create devices which appliance-creator does not
+ln -s /proc/kcore /dev/core
+mknod -m 600 /dev/console c 5 1
+mknod -m 660 /dev/loop0 b 7 0
+mknod -m 660 /dev/loop1 b 7 1
+
+echo -n "Network fixes"
+# initscripts don't like this file to be missing.
+cat > /etc/sysconfig/network << EOF
+NETWORKING=yes
+NOZEROCONF=yes
+EOF
+
+# For cloud images, 'eth0' _is_ the predictable device name, since
+# we don't want to be tied to specific virtual (!) hardware
+rm -f /etc/udev/rules.d/70*
+ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
+
+# simple eth0 config, again not hard-coded to the build hardware
+cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
+DEVICE="eth0"
+BOOTPROTO="dhcp"
+ONBOOT="yes"
+TYPE="Ethernet"
+EOF
+
+# generic localhost names
+cat > /etc/hosts << EOF
+127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
+::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
+
+EOF
+echo .
+
+
+# Because memory is scarce resource in most cloud/virt environments,
+# and because this impedes forensics, we are differing from the Fedora
+# default of having /tmp on tmpfs.
+echo "Disabling tmpfs for /tmp."
+systemctl mask tmp.mount
+
+echo "Removing random-seed so it's not the same in every image."
+rm -f /var/lib/random-seed
+
+
+echo "Compressing cracklib."
+gzip -9 /usr/share/cracklib/pw_dict.pwd
+
+echo "Minimizing locale-archive."
+localedef --list-archive | grep -v en_US | xargs localedef --delete-from-archive
+mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
+/usr/sbin/build-locale-archive
+# this is really kludgy and will be fixed with a better way of building
+# these containers
+mv /usr/share/locale/en /usr/share/locale/en_US /tmp
+rm -rf /usr/share/locale/*
+mv /tmp/en /tmp/en_US /usr/share/locale/
+mv /usr/share/i18n/locales/en_US /tmp
+rm -rf /usr/share/i18n/locales/*
+mv /tmp/en_US /usr/share/i18n/locales/
+echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
+
+echo "Removing extra packages."
+rm -vf /etc/yum/protected.d/*
+yum -C -y remove passwd --setopt="clean_requirements_on_remove=1"
+yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
+
+echo "Removing boot, since we don't need that."
+rm -rf /boot/*
+
+echo "Cleaning old yum repodata."
+yum clean all
+rm -rf /var/lib/yum/yumdb/*
+truncate -c -s 0 /var/log/yum.log
+
+echo "Fixing SELinux contexts."
+/usr/sbin/fixfiles -R -a restore
+
+
+echo "Zeroing out empty space."
+# This forces the filesystem to reclaim space from deleted files
+dd bs=1M if=/dev/zero of=/var/tmp/zeros || :
+rm -f /var/tmp/zeros
+echo "(Don't worry -- that out-of-space error was expected.)"
+
+%end
+
commit b214082a87c4ada3c823c1b3dbad96c90094f970
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Sun Sep 22 20:16:35 2013 -0400
don't remove findutils
diff --git a/container/container-minimal-19.ks b/container/container-minimal-19.ks
index 379bdd4..4e19ded 100644
--- a/container/container-minimal-19.ks
+++ b/container/container-minimal-19.ks
@@ -124,7 +124,6 @@ echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
echo "Removing extra packages."
rm -vf /etc/yum/protected.d/*
yum -C -y remove passwd --setopt="clean_requirements_on_remove=1"
-yum -C -y remove findutils --setopt="clean_requirements_on_remove=1"
yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
echo "Removing boot, since we don't need that."
diff --git a/container/container-minimal-20.ks b/container/container-minimal-20.ks
index bc90457..9266a0e 100644
--- a/container/container-minimal-20.ks
+++ b/container/container-minimal-20.ks
@@ -124,7 +124,6 @@ echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
echo "Removing extra packages."
rm -vf /etc/yum/protected.d/*
yum -C -y remove passwd --setopt="clean_requirements_on_remove=1"
-yum -C -y remove findutils --setopt="clean_requirements_on_remove=1"
yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
echo "Removing boot, since we don't need that."
commit 31fe6b6af9b6ab628f8ccb19bb565611eff884ee
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Sun Sep 22 20:12:20 2013 -0400
less agressive with the yum history munging
diff --git a/container/container-medium-19.ks b/container/container-medium-19.ks
index 0eefe6c..313ac58 100644
--- a/container/container-medium-19.ks
+++ b/container/container-medium-19.ks
@@ -120,9 +120,7 @@ yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
echo "Cleaning old yum repodata."
yum clean all
-rm -rf /var/lib/yum/yumdb/*
-rm -rf /var/lib/yum/history/*
-yum history new || yum history new
+yum history new
truncate -c -s 0 /var/log/yum.log
echo "Removing boot, since we don't need that."
diff --git a/container/container-medium-20.ks b/container/container-medium-20.ks
index 5c90c61..03988e3 100644
--- a/container/container-medium-20.ks
+++ b/container/container-medium-20.ks
@@ -120,9 +120,7 @@ yum -C -y remove firewalld --setopt="clean_requirements_on_remove=1"
echo "Cleaning old yum repodata."
yum clean all
-rm -rf /var/lib/yum/yumdb/*
-rm -rf /var/lib/yum/history/*
-yum history new || yum history new
+yum history new
truncate -c -s 0 /var/log/yum.log
echo "Removing boot, since we don't need that."
diff --git a/container/container-minimal-19.ks b/container/container-minimal-19.ks
index 97aa7ee..379bdd4 100644
--- a/container/container-minimal-19.ks
+++ b/container/container-minimal-19.ks
@@ -43,7 +43,6 @@ setup
yum
# removed below
-findutils
passwd
# https://bugzilla.redhat.com/show_bug.cgi?id=1004976
firewalld
diff --git a/container/container-minimal-20.ks b/container/container-minimal-20.ks
index 2a9fa1b..bc90457 100644
--- a/container/container-minimal-20.ks
+++ b/container/container-minimal-20.ks
@@ -43,7 +43,6 @@ setup
yum
# removed below
-findutils
passwd
# https://bugzilla.redhat.com/show_bug.cgi?id=1004976
firewalld
commit 5765cb05d2e96182ab64c9b9f8982e1a0303f230
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Sun Sep 22 20:02:18 2013 -0400
find, grep, sed -- really, we need 'em
diff --git a/container/container-minimal-19.ks b/container/container-minimal-19.ks
index f0fe76d..97aa7ee 100644
--- a/container/container-minimal-19.ks
+++ b/container/container-minimal-19.ks
@@ -35,7 +35,10 @@ bash
coreutils
fedora-release
filesystem
+findutils
+grep
iproute
+sed
setup
yum
diff --git a/container/container-minimal-20.ks b/container/container-minimal-20.ks
index 6c9304f..2a9fa1b 100644
--- a/container/container-minimal-20.ks
+++ b/container/container-minimal-20.ks
@@ -35,7 +35,10 @@ bash
coreutils
fedora-release
filesystem
+findutils
+grep
iproute
+sed
setup
yum
commit 403090d2234b535f85af74bba7b549bea59b687e
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Sun Sep 22 19:28:15 2013 -0400
mixed-up rpm macros filename
diff --git a/container/container-minimal-19.ks b/container/container-minimal-19.ks
index 3ddff3f..f0fe76d 100644
--- a/container/container-minimal-19.ks
+++ b/container/container-minimal-19.ks
@@ -117,7 +117,7 @@ mv /tmp/en /tmp/en_US /usr/share/locale/
mv /usr/share/i18n/locales/en_US /tmp
rm -rf /usr/share/i18n/locales/*
mv /tmp/en_US /usr/share/i18n/locales/
-echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/rpm.imgcreate
+echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
echo "Removing extra packages."
rm -vf /etc/yum/protected.d/*
diff --git a/container/container-minimal-20.ks b/container/container-minimal-20.ks
index 06a100d..6c9304f 100644
--- a/container/container-minimal-20.ks
+++ b/container/container-minimal-20.ks
@@ -117,7 +117,7 @@ mv /tmp/en /tmp/en_US /usr/share/locale/
mv /usr/share/i18n/locales/en_US /tmp
rm -rf /usr/share/i18n/locales/*
mv /tmp/en_US /usr/share/i18n/locales/
-echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/rpm.imgcreate
+echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/macros.imgcreate
echo "Removing extra packages."
rm -vf /etc/yum/protected.d/*
commit a4d70fb6eb96d4708b977cea5c8db0a9ab79199c
Author: Matthew Miller <mattdm(a)mattdm.org>
Date: Sun Sep 22 17:44:53 2013 -0400
temporary destruction of i18n in the minimal container -- need a better way!
diff --git a/container/container-minimal-19.ks b/container/container-minimal-19.ks
index 5f15a0b..3ddff3f 100644
--- a/container/container-minimal-19.ks
+++ b/container/container-minimal-19.ks
@@ -109,6 +109,15 @@ echo "Minimizing locale-archive."
localedef --list-archive | grep -v en_US | xargs localedef --delete-from-archive
mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
/usr/sbin/build-locale-archive
+# this is really kludgy and will be fixed with a better way of building
+# these containers
+mv /usr/share/locale/en /usr/share/locale/en_US /tmp
+rm -rf /usr/share/locale/*
+mv /tmp/en /tmp/en_US /usr/share/locale/
+mv /usr/share/i18n/locales/en_US /tmp
+rm -rf /usr/share/i18n/locales/*
+mv /tmp/en_US /usr/share/i18n/locales/
+echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/rpm.imgcreate
echo "Removing extra packages."
rm -vf /etc/yum/protected.d/*
diff --git a/container/container-minimal-20.ks b/container/container-minimal-20.ks
index c052a0e..06a100d 100644
--- a/container/container-minimal-20.ks
+++ b/container/container-minimal-20.ks
@@ -109,6 +109,15 @@ echo "Minimizing locale-archive."
localedef --list-archive | grep -v en_US | xargs localedef --delete-from-archive
mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
/usr/sbin/build-locale-archive
+# this is really kludgy and will be fixed with a better way of building
+# these containers
+mv /usr/share/locale/en /usr/share/locale/en_US /tmp
+rm -rf /usr/share/locale/*
+mv /tmp/en /tmp/en_US /usr/share/locale/
+mv /usr/share/i18n/locales/en_US /tmp
+rm -rf /usr/share/i18n/locales/*
+mv /tmp/en_US /usr/share/i18n/locales/
+echo '%_install_langs C:en:en_US:en_US.UTF-8' >> /etc/rpm/rpm.imgcreate
echo "Removing extra packages."
rm -vf /etc/yum/protected.d/*
10 years, 2 months
(no subject)
by Zarema Zarema
Hi
Want to subscribe to Cloud mail list
Zarema.
10 years, 2 months