From 56c7431467aa12f12494462277a604f8cc78e60c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 May 2015 13:53:47 +0200 Subject: [PATCH] __cdist_preos enhancements Signed-off-by: Nico Schottelius --- cdist/conf/type/__cdist_preos/manifest | 50 ++++++++++++++++++++------ 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/cdist/conf/type/__cdist_preos/manifest b/cdist/conf/type/__cdist_preos/manifest index 8bb2175f..78166b38 100755 --- a/cdist/conf/type/__cdist_preos/manifest +++ b/cdist/conf/type/__cdist_preos/manifest @@ -24,15 +24,16 @@ destination="/$__object_id" os=$(cat "$__global/explorer/os") case "$os" in - archlinux) - # any linux should work - : - ;; - *) - echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2 - echo "Please contribute an implementation for it if you can." >&2 - exit 1 - ;; + archlinux) + kernel=/boot/vmlinuz-linux + initramfs=/boot/initramfs-linux-fallback.img + required_pkg="cdrkit syslinux" + ;; + *) + echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2 + echo "Please contribute an implementation for it if you can." >&2 + exit 1 + ;; esac # Our root @@ -44,6 +45,35 @@ for rootdir in boot bin etc lib; do --mode 0755 done - require="__directory/$destination/etc" __cdistmarker \ --destination "$destination/etc/cdist-configured" + +for pkg in $required_pkg; do + __package "$pkg" --state present +done + +# Create full dependency chain, because we don't know which file depends on which package +export CDIST_ORDER_DEPENDENCY=1 + +require="__directory/$destination/boot" __file "$destination/boot/linux" \ + --source "$kernel" --mode 0644 + +require="__directory/$destination/boot" __file "$destination/boot/initramfs" \ + --source "$initramfs" --mode 0644 + +require="__directory/$destination/boot" __file "$destination/boot/syslinux.cfg" \ + + + PROMPT 1 + TIMEOUT 50 + DEFAULT arch + + LABEL arch + LINUX ../vmlinuz-linux + APPEND root=/dev/sda2 rw + INITRD ../initramfs-linux.img + + LABEL archfallback + LINUX ../vmlinuz-linux + APPEND root=/dev/sda2 rw + INITRD ../initramfs-linux-fallback.img