Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer: Find persist partition when installing into another disk #4277

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

rene
Copy link
Contributor

@rene rene commented Sep 23, 2024

Description

When installing persist into another storage device, the installer script must search for the persist partition in the corresponding destination and not in the main storage device.

How to test

First, build the installer raw image (to create all needed files):

$ make installer-raw
$ make run-installer-raw # it doesn't need to run QEMU, that's only for build OVMF files

After that, create an additional disk image file for the persist and call qemu accordingly:

qemu-img create -f qcow2 ${EVE_REPO}/dist/amd64/current/target.img 32768M
qemu-img create -f qcow2 ${EVE_REPO}/dist/amd64/current/persist.img 32768M
qemu-system-x86_64 \
	-drive file=${EVE_REPO}/dist/amd64/current/installer.raw,format=raw \
	-drive file=${EVE_REPO}/dist/amd64/current/target.img,format=qcow2 \
	-drive file=${EVE_REPO}/dist/amd64/current/persist.img,format=qcow2 \
	-m 4096 -smp 4 -display none \
	-drive if=pflash,format=raw,unit=0,readonly,file=${EVE_REPO}/dist/amd64/current/installer/firmware/OVMF_CODE.fd \
	-drive if=pflash,format=raw,unit=1,file=${EVE_REPO}/dist/amd64/current/installer/firmware/OVMF_VARS.fd \
	-serial mon:stdio -global ICH9-LPC.noreboot=false -watchdog-action reset -rtc base=utc,clock=rt \
	-netdev user,id=eth0,net=192.168.1.0/24,dhcpstart=192.168.1.10,hostfwd=tcp::2222-:22 \
	-device virtio-net-pci,netdev=eth0,romfile="" \
	-netdev user,id=eth1,net=192.168.2.0/24,dhcpstart=192.168.2.10 -device virtio-net-pci,netdev=eth1,romfile="" \
	-device nec-usb-xhci,id=xhci \
	-qmp unix:${EVE_REPO}/qmp.sock,server,wait=off \
	-machine q35,accel=kvm,usb=off,dump-guest-core=off \
	-cpu host,invtsc=on,kvmclock=off -machine kernel-irqchip=split \
	-device intel-iommu,intremap=on,caching-mode=on,aw-bits=48 -smbios type=1,serial=31415926  

After boot, the GRUB options can be added manually:

eve_install_disk=sdb eve_persist_disk=sdc

@rene rene requested a review from eriknordmark as a code owner September 23, 2024 10:38
@rene rene requested a review from deitch September 23, 2024 10:39
@rene rene force-pushed the fix-install-persist branch from d23e151 to ae9a6ed Compare September 23, 2024 15:50
@rene rene added the bug Something isn't working label Sep 23, 2024
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eriknordmark
Copy link
Contributor

@rene does this need to be backported i.e., should we add the stable label?

@rene rene added the stable Should be backported to stable release(s) label Sep 24, 2024
@rene
Copy link
Contributor Author

rene commented Sep 24, 2024

@rene does this need to be backported i.e., should we add the stable label?

@eriknordmark , I've checked stable branches, yeah, we need to backport this fix... I'm working on it....

@rene
Copy link
Contributor Author

rene commented Sep 24, 2024

Last updates:

  1. Fix the mounting of persist partition (forgot to put in the PR)
  2. PR was backported to stable branches

Copy link
Member

@OhmSpectator OhmSpectator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good.
Although the installer code is hard to follow =(

Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-run tests

@OhmSpectator
Copy link
Member

@rene, could you please rebase the PR to the master? It may help fix the build

When installing persist into another storage device, the installer
script must search for the persist partition (and mount it) in the
corresponding destination and not in the main storage device. This can
be achieved by simply looking to INSTALL_PERSIST variable instead of
INSTALL_DEV.

Signed-off-by: Renê de Souza Pinto <[email protected]>
@rene
Copy link
Contributor Author

rene commented Sep 24, 2024

@rene, could you please rebase the PR to the master? It may help fix the build

done.

@OhmSpectator
Copy link
Member

🤞🤞🤞

@eriknordmark eriknordmark merged commit 7891d3d into lf-edge:master Sep 25, 2024
16 of 21 checks passed
@rene rene deleted the fix-install-persist branch October 11, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stable Should be backported to stable release(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants