Changing the boards.txt file in the Aduino IDE installation - error

Changing the boards.txt to tell it that the chip has more code space does not make it so. The reason some of the ATMega328p boards have less code space than others (by a little) is that they use a bootloader that takes up more space - so if you want to get the last bit of code space out of your '328p boards, you need to burn a new bootloader to them using an ISP programmer, otherwise as soon as you try to use that extra space, the bootloader will refuse to write it.

You don't need to modify boards.txt, either. You want to burn the Uno bootloader - that one is only 512 bytes, and uploads faster; it's the best of them. Just connect your ISP programmer, tell it the board is an Uno, and do burn bootloader; therafter, tell the board it's an Uno. I bootload all my '328p-based boards as Unos.

If you want to use a board without a bootloader, then you would need to either modify boards.txt or install a custom hardware package that already has such a board definition (I think mcudude/hansibull's MiniCore has definitions for no-bootloader atmega x8 series chips)