summaryrefslogtreecommitdiffstats
path: root/packager
diff options
context:
space:
mode:
authorJonathan Bauer2016-04-04 17:32:05 +0200
committerJonathan Bauer2016-04-04 17:32:05 +0200
commit7bad45cf0c03475c67196229ae7711021bf69486 (patch)
treebf1547606555ae8ef00d832a8befbac3c0018d32 /packager
parentFix. (diff)
downloadsystemd-init-7bad45cf0c03475c67196229ae7711021bf69486.tar.gz
systemd-init-7bad45cf0c03475c67196229ae7711021bf69486.tar.xz
systemd-init-7bad45cf0c03475c67196229ae7711021bf69486.zip
[packager] some improvements for stage4 stuff [wip]
Diffstat (limited to 'packager')
-rw-r--r--packager/.gitignore1
-rw-r--r--packager/blacklists/essential/linux-base2
-rw-r--r--packager/blacklists/essential/linux-extended4
-rw-r--r--packager/openslx.config2
-rw-r--r--packager/openslx.functions20
5 files changed, 19 insertions, 10 deletions
diff --git a/packager/.gitignore b/packager/.gitignore
new file mode 100644
index 00000000..b205ba3d
--- /dev/null
+++ b/packager/.gitignore
@@ -0,0 +1 @@
+builds/*
diff --git a/packager/blacklists/essential/linux-base b/packager/blacklists/essential/linux-base
index 54e9c294..2c3ec439 100644
--- a/packager/blacklists/essential/linux-base
+++ b/packager/blacklists/essential/linux-base
@@ -1,4 +1,3 @@
-- /boot/*
- /cdrom/*
- /dev/*
- /adm/*
@@ -68,6 +67,7 @@
#- /var/spool/**
+ /var/spool/torque/*
- /var/tmp/*
++ /var/tmp/*guestfs*
- /var/lib/nova/instances/*
- /var/lib/libvirt
diff --git a/packager/blacklists/essential/linux-extended b/packager/blacklists/essential/linux-extended
index 3d81000a..90dcdca7 100644
--- a/packager/blacklists/essential/linux-extended
+++ b/packager/blacklists/essential/linux-extended
@@ -1,5 +1,5 @@
- /home/*
- /root/*
-+ /root/.bash*
-+ /root/.ssh
+#+ /root/.bash*
+#+ /root/.ssh
- /etc/cups
diff --git a/packager/openslx.config b/packager/openslx.config
index 00fc5501..a02a608b 100644
--- a/packager/openslx.config
+++ b/packager/openslx.config
@@ -2,7 +2,7 @@
DEFAULT_RSYNC_OPTS="-e ssh -c arcfour -oStrictHostKeyChecking=no"
# default size for the qcow2-container (the one containing diffs)
-DEFAULT_QCOW_SIZE="10G"
+DEFAULT_QCOW_SIZE="25G"
# default filesystem type for the qcow2-container
DEFAULT_QCOW_FS="ext4"
diff --git a/packager/openslx.functions b/packager/openslx.functions
index 7fe74e0a..3b5c4394 100644
--- a/packager/openslx.functions
+++ b/packager/openslx.functions
@@ -353,6 +353,9 @@ clone_stage4() {
# run rsync with the exclude/include lists created earlier
cat "$INCLUDE" "$EXCLUDE" | \
rsync --verbose \
+ --acls \
+ --hard-links \
+ --xattrs \
--archive \
--delete \
--delete-excluded \
@@ -424,7 +427,7 @@ pack_qcow2() {
# which size for the qcow2 container?
if [ -z "$DEFAULT_QCOW_SIZE" ]; then
- local QCOW_SIZE="10G"
+ local QCOW_SIZE="25G"
else
local QCOW_SIZE="$DEFAULT_QCOW_SIZE"
fi
@@ -446,6 +449,10 @@ pack_qcow2() {
perror "qemu-nbd failed with: $?"
pinfo "Done."
+ # expose as a loop device
+ local NBD_LOOPED_DEV="$(losetup --find)"
+ losetup "${NBD_LOOPED_DEV}" "${NBD_DEV}"
+
# which filesystem for the qcow2 container?
if [ -z "$DEFAULT_QCOW_FS" ]; then
local QCOW_FS="ext4"
@@ -457,32 +464,33 @@ pack_qcow2() {
fi
pinfo "Creating '${QCOW_FS}' filesystem on '${CONTAINER_PATH}'..."
_STATE='QCOW_FSING'
- mkfs."${QCOW_FS}" "${NBD_DEV}" || perror "mkfs failed with: $?"
+ mkfs."${QCOW_FS}" "${NBD_LOOPED_DEV}" || perror "mkfs failed with: $?"
pinfo "Done."
# prepare NBD mount directory and check state to be safe
local NBD_MNT="$(mktemp -d)"
[ ! -d "${NBD_MNT}" ] && \
- perror "Making temporary dir for mounting '$NBD_DEV' failed."
+ perror "Making temporary dir for mounting '${NBD_DEV}' failed."
is_dir_empty ${NBD_MNT} || \
- perror "'${NBD_MNT}' not empty. Refusing to mount ${NBD_DEV} to it."
+ perror "'${NBD_MNT}' not empty. Refusing to mount '${NBD_DEV}' to it."
pinfo "Mounting '${NBD_DEV}' to '${NBD_MNT}'..."
_STATE='QCOW_MOUNTING'
- mount "${NBD_DEV}" "${NBD_MNT}" || perror "Mount failed with: $?"
+ mount "${NBD_LOOPED_DEV}" "${NBD_MNT}" || perror "Mount failed with: $?"
pinfo "Done."
# copy files from the stage4 directory to the mounted qcow2-container
pinfo "Copying '${RSYNC_TARGET}' to '${NBD_MNT}'..."
_STATE='QCOW_COPYING'
- cp -ra "${RSYNC_TARGET}"/* "${NBD_MNT}" || perror "Copying failed with: $?"
+ rsync -avAHX "${RSYNC_TARGET}"/ "${NBD_MNT}"/ || perror "Copying failed with: $?"
pinfo "Done."
pinfo "Cleaning up..."
_STATE='QCOW_CLEANING'
umount "${NBD_MNT}" || pwarning "Could not unmount '${NBD_MNT}'."
rmdir "${NBD_MNT}" || pwarning "Could not remove '${NBD_MNT}'."
+ losetup -d "${NBD_LOOPED_DEV}" || pwarning "Could not disconnect '${NBD_LOOPED_DEV}'."
qemu-nbd -d "${NBD_DEV}" || pwarning "Could not disconnect '${NBD_DEV}'."
_STATE='QCOW_DONE'
pinfo "Exporting '${RSYNC_TARGET}' to '${CONTAINER_PATH}' completed."