William Pitcock avatar William Pitcock committed cacb61b

More progress on redhat support.

Comments (0)

Files changed (3)


 {% block bootstrap %}
 	{"operation": "runcmd", "chroot": false, "command": ["rinse", "--distribution", "{{ distribution }}", "--directory", "$chroot", "--arch", "$debarch"]},
 	{"operation": "render_template", "template": "base/resolv.conf.tmpl", "target": "/etc/resolv.conf"},
-	{"operation": "runcmd", "chroot": true, "command": ["yum", "install", "authconfig"]},
+	{"operation": "runcmd", "chroot": true, "command": ["yum", "-y", "install", "authconfig"]},
 	{"operation": "runcmd", "chroot": true, "command": ["authconfig", "--enableshadow", "--update"]},
 	{"operation": "runcmd", "chroot": true, "command": ["chkconfig", "network", "on"]},
-	{"operation": "runcmd", "chroot": true, "command": ["yum", "install", "kernel", "openssh-server", "sudo", "rootfiles"]},
+	{"operation": "runcmd", "chroot": true, "command": ["yum", "-y", "install", "kernel", "openssh-server", "sudo", "rootfiles"]},
 	{"operation": "runcmd", "chroot": true, "command": ["chkconfig", "sshd", "on"]},
-	{"operation": "render_template", "template": "alpine/grub-menu.lst.tmpl", "target": "/boot/grub/menu.lst"},
 {% endblock %}
 {% block packages %}
 	{% for package in packages %}
-		{"operation": "runcmd", "chroot": true, "command": ["yum", "install", "{{ package }}"]},
+		{"operation": "runcmd", "chroot": true, "command": ["yum", "-y", "install", "{{ package }}"]},
 	{% endfor %}
 {% endblock %}
 {% block configure %}
 	{{ super() }}
 {% endblock %}
+{% block xentweaks %}
+	{{ super() }}
+	{"operation": "render_template", "template": "redhat/grub-menu.lst.tmpl", "target": "/boot/grub/menu.lst"},
+	{"operation": "runcmd", "chroot": true, "command": ["ln", "-sf", "/boot/grub/menu.lst", "/etc/grub.conf"]},
+	{"operation": "render_template", "template": "redhat/xen-grubby-stub.tmpl", "target": "/sbin/xen-grubby-stub"},
+	{"operation": "runcmd", "chroot": true, "command": ["sh", "/sbin/xen-grubby-stub"]},
+	{"operation": "runcmd", "chroot": true, "command": ["rm", "/sbin/xen-grubby-stub"]},
+{% endblock %}
 {% block cleanup %}
 {% endblock %}


+# Generated by ApplianceKit.
+root (hd0)


+# File: xen-grubby-stub
+# Purpose: Build a grub configuration using grubby (and a stub file) in pre-image phase.
+# Copyright (c) 2012, 2013 TortoiseLabs LLC
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+# This software is provided 'as is' and without any warranty, express or
+# implied. In no event shall the authors be liable for any damages arising
+# from the use of this software.
+# Strict error handling.
+set +e
+OS_REL=`cat /etc/redhat-release`
+echo "OS release: $OS_REL"
+for kernel in `ls /boot/vmlinuz-*`; do
+	bn=`basename $kernel`
+	ver=`echo $bn | cut -d- -f2-`
+	echo "Found kernel version: $ver"
+	/sbin/grubby --add-kernel=/boot/vmlinuz-$ver --initrd=/boot/initramfs-$ver.img \
+		--title="$OS_REL ($ver)" --args="root=/dev/xvda1 ro" --make-default
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.