Commit be75d3c3 authored by Dmitriy Terekhin's avatar Dmitriy Terekhin Committed by Michael Shigorin

need /.host/qemu* in the chroot if qemu is used

The original commit broke system tar2fs use by accidentally moving TOPDIR definition into a separate shell execution; thanks iv@ for spotting and fixing it promptly. Co-authored-by: 's avatarIvan A. Melnikov" <iv@altlinux.org>
parent 803bdabb
...@@ -218,6 +218,16 @@ if [ -n "$BOOTPART" ]; then ...@@ -218,6 +218,16 @@ if [ -n "$BOOTPART" ]; then
echo "$BOOTDEV /boot $BOOTFSTYPE defaults 1 2" >> "$ROOTFS/etc/fstab" echo "$BOOTDEV /boot $BOOTFSTYPE defaults 1 2" >> "$ROOTFS/etc/fstab"
fi fi
# Query ARCH in chroot and redefine arch-dependent variable
ARCH="$(chroot "$ROOTFS" rpm --eval '%_host_cpu')"
if [[ $ARCH = *86* ]]
then # NB: different storage modules might be needed for non-kvm
INITRD_MODULES="sd_mod ata_piix ahci virtio-scsi virtio-blk"
else
INITRD_MODULES=
fi
echo "MODULES_PRELOAD += $INITRD_MODULES $ROOTFSTYPE" >> "$ROOTFS/etc/initrd.mk" echo "MODULES_PRELOAD += $INITRD_MODULES $ROOTFSTYPE" >> "$ROOTFS/etc/initrd.mk"
case "$ARCH" in case "$ARCH" in
...@@ -315,3 +325,6 @@ fi ...@@ -315,3 +325,6 @@ fi
if [ -n "$SUDO_USER" ]; then if [ -n "$SUDO_USER" ]; then
chown "$SUDO_USER:$(id -g "$SUDO_USER")" "$IMG" "$ROOTFS" "$WORKDIR" ||: chown "$SUDO_USER:$(id -g "$SUDO_USER")" "$IMG" "$ROOTFS" "$WORKDIR" ||:
fi fi
# maybe qemu interpreter was copied to chroot;
# this is no longer necessary, remove
rm -rf "$ROOTFS"/.host ||:
...@@ -23,7 +23,11 @@ check-sudo: ...@@ -23,7 +23,11 @@ check-sudo:
fi fi
prepare-image: check-sudo prepare-image: check-sudo
@if [ -x /usr/share/mkimage-profiles/bin/tar2fs ]; then \ @# need to copy $(BUILDDIR)/.work/chroot/.host/qemu* into chroot
@#if qemu is used
@(cd "$(BUILDDIR)/.work/chroot/"; \
tar -rf "$(VM_TARBALL)" ./.host/qemu*) ||:; \
if [ -x /usr/share/mkimage-profiles/bin/tar2fs ]; then \
TOPDIR=/usr/share/mkimage-profiles; \ TOPDIR=/usr/share/mkimage-profiles; \
fi; \ fi; \
if ! sudo $$TOPDIR/bin/tar2fs \ if ! sudo $$TOPDIR/bin/tar2fs \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment