Powered it on and was greeted by the startup chime and the Apple logo. Looking good so far. Progress bar steadily moving all the way till the end. Waited for more than 10 minutes, but still not loading the OS. It's most likely a really old CPU, but this is too long.
Suspecting a corrupted OS, I booted into macOS Recovery using Ctrl-R. There's a 1TB hard disk with 1.3GB used. Doesn't look like there is a proper OS on this thing though. Ran the Disk Utility to erase the disk - said "Unable to unmount disk". Chose the Install macOS option, but the 1TB hard disk does not show up as an option. First Aid reports the hard disk to be fine.
My guess is that because I'm running the recovery image from the HDD itself, Disk Utility is not able to unmount the disk. So the next step is to build a bootable USB stick, and run the erase/install from there.
Downloaded a bunch of DMGs and APPs, tried TransMac and command-line, but the USB sticks either won't be detected during boot-time, or getting a forbidden sign as soon as selected, or won't even get created by the createinstallmedia utility.
Another option is to replace the hard disk and try Internet Recovery, which bypasses the hard disk altogether. However, this requires me to open up the iMac, which doesn't look easy (if you don't have the right tools).
So I simply took the easy way out. Created a bootable installer of CloudReady (now ChromeOS Flex) and boom! Mission accomplished.