From 5f9e976598dc3434403055afc95934ace2eb2439 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Sat, 7 Mar 2015 03:30:28 +0000 Subject: [PATCH] Fixing bootable image creation steps Corrected steps so an image boots as expected with the grub boot loader. --- setup/create_bootable_image.yaml | 19 +++++++++++++------ setup/templates/device.map.j2 | 2 -- 2 files changed, 13 insertions(+), 8 deletions(-) delete mode 100644 setup/templates/device.map.j2 diff --git a/setup/create_bootable_image.yaml b/setup/create_bootable_image.yaml index 6cc57e0c3..a3054151a 100644 --- a/setup/create_bootable_image.yaml +++ b/setup/create_bootable_image.yaml @@ -23,18 +23,25 @@ file: path=/mnt/bootimg state=directory - name: "Mounting volume on /mnt/bootimg" command: mount "{{stored_value_loopback_beta.stdout}}" /mnt/bootimg -- name: "Place grub device file map" - template: src=templates/device.map.j2 dest=/mnt/bootimg/boot/grub/device.map - name: "Binding /sys into /mnt/bootimg/sys" - command: mount -t sysfs sysfs sysfs /mnt/bootimg/sys + command: mount -t sysfs sysfs /mnt/bootimg/sys - name: "Binding /proc into /mnt/bootimg/proc" command: mount -t proc proc /mnt/bootimg/proc - name: "Binding /dev into /mnt/bootimg/dev" command: mount --bind /dev /mnt/bootimg/dev -- name: "Make grub configuration" - command: chroot /mnt/bootimg/ grub-mkconfig -o /boot/grub/grub.cfg + # Attempt to identify kernel +#- name: "Identify kernel" +# shell: ls vmlinuz* |cut -f 1 -d ' ' chdir=/mnt/bootimg/boot/ +# register: kernel_filename +#- name: "Identify initrd" +# shell: ls initrd* |cut -f 1 -d ' ' chdir=/mnt/bootimg/boot/ +# register: initrd_filename +- name: "Disable Grub Prober" + shell: echo "GRUB_DISABLE_OS_PROBER=true" >>/etc/default/grub +- name: "Disable Grub Prober" + shell: echo 'GRUB_TERMIAL="serial console"' >>/etc/default/grub - name: "Run the grub-install tool" - command: grub-install --grub-mkdevicemap=/mnt/bootimg/boot/grub/grub.cfg --root-directory=/mnt/bootimg "{{stored_value_loopback_alpha.stdout}}" + command: chroot /mnt/bootimg grub-install --boot-directory=/boot --modules="biosdisk part_msdos" "{{stored_value_loopback_alpha.stdout}}" - name: "Unlink /dev/bootimg/dev" command: umount /mnt/bootimg/dev - name: "Unlink /dev/bootimg/proc" diff --git a/setup/templates/device.map.j2 b/setup/templates/device.map.j2 deleted file mode 100644 index 2d39fd9fd..000000000 --- a/setup/templates/device.map.j2 +++ /dev/null @@ -1,2 +0,0 @@ -(hd0) {{stored_value_loopback_alpha.stdout}} -(hd0,msdos1) {{stored_value_loopback_beta.stdout}}