[PATCH v2 10/12] Prepare grub for booting x86_64 HVM domU from a disk

Marek Marczykowski-Górecki posted 12 patches 1 week, 1 day ago
Only 10 patches received!
[PATCH v2 10/12] Prepare grub for booting x86_64 HVM domU from a disk
Posted by Marek Marczykowski-Górecki 1 week, 1 day ago
The stubdomain test will use it

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 scripts/alpine-rootfs.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/alpine-rootfs.sh b/scripts/alpine-rootfs.sh
index e06e72b..7d0e70d 100755
--- a/scripts/alpine-rootfs.sh
+++ b/scripts/alpine-rootfs.sh
@@ -94,5 +94,12 @@ cd /
     echo -ne "dev\0proc\0run\0sys\0"
 } | cpio -0 -R 0:0 -H newc -o | gzip > "${COPYDIR}/rootfs.cpio.gz"
 
+if [ "$UNAME" = "x86_64" ]; then
+    # Prepare boot sector for HVM disk
+    grub-mkimage -o ${COPYDIR}/grub-core.img \
+        -O i386-pc -p '(hd0,msdos1)/boot/grub2' \
+        boot part_msdos ext2 linux biosdisk configfile normal
+fi
+
 # Print the contents for the build log
 zcat "${COPYDIR}/rootfs.cpio.gz" | cpio -tv
-- 
git-series 0.9.1

Re: [PATCH v2 10/12] Prepare grub for booting x86_64 HVM domU from a disk
Posted by Stefano Stabellini 2 days, 18 hours ago
On Thu, 4 Dec 2025, Marek Marczykowski-Górecki wrote:
> The stubdomain test will use it
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
>  scripts/alpine-rootfs.sh | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/scripts/alpine-rootfs.sh b/scripts/alpine-rootfs.sh
> index e06e72b..7d0e70d 100755
> --- a/scripts/alpine-rootfs.sh
> +++ b/scripts/alpine-rootfs.sh
> @@ -94,5 +94,12 @@ cd /
>      echo -ne "dev\0proc\0run\0sys\0"
>  } | cpio -0 -R 0:0 -H newc -o | gzip > "${COPYDIR}/rootfs.cpio.gz"
>  
> +if [ "$UNAME" = "x86_64" ]; then
> +    # Prepare boot sector for HVM disk
> +    grub-mkimage -o ${COPYDIR}/grub-core.img \
> +        -O i386-pc -p '(hd0,msdos1)/boot/grub2' \
> +        boot part_msdos ext2 linux biosdisk configfile normal
> +fi

I am not opposed to this but I'll wait until I review the stubdom test
:-)


>  # Print the contents for the build log
>  zcat "${COPYDIR}/rootfs.cpio.gz" | cpio -tv
> -- 
> git-series 0.9.1
>