How to install OpenWrt as a new os in the grub menu?

My pc had already installed two os ,the grub menu shows two os from every boot.

How can i install the openwrt as my third os and shown in the grub menu ?

I download x84 openwrt version and dd it ,boot to install,after rebooting ,i find that the grub gui is still the previous one , openwrt have not written into disk!I can't find it !

Isn't new openwrt installed, or isn't grub updated ?

does the openwrt entry in grub boot the old version ?

if you dd:ed, it definately written to disk, but grub might need updating.
you have to adapt grub2.conf, as a temp workaround you can press e while
selecting openwrt, to change the openwrt string/entry.

OpenWrt's GRUB2 doesn't bother with multiboot AFAIK, after all that's up to the user. You can follow stock GRUB2 procedure and use update-grub to update your existing GRUB2 installation and 'teach' it about your new OS.

You can always add it manually as well, but if your USB stick is plugged in, update-grub should just pick it up.

I download the img.ze file from
https://downloads.openwrt.org/releases/19.07.7/targets/x86/64/openwrt-19.07.7-x86-64-rootfs-ext4.img.gz

Extract it and dd it into /dev/sdb1.

sudo dd if=openwrt-19.07.7-x86-64-rootfs-ext4.img of=/dev/sdb1

Reboot ,enter into bios setting

Select the ip4 realtek pcie gbe family controller,

How can i do now?

Wait until it fails ?

What does PXE boot have to do with openwrt ?

It jump into window boot managerment,and enter into my win10!
I am sure that i have copied openwrt img file into /dev/sdb1,how to call activate it?

what happened to grub ?

you need it to be able to switch between OSes.

1 Like

How can i edit the grub.cfg file to call openwrt in the /dev/sdb1?
I show part of content in /boot/grub/grub.cfg:

	menuentry 'Debian GNU/Linux, with Linux 4.19.0-16-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-16-amd64-advanced-657b1f2f-671f-4c77-9832-e62fcf06d72d' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  657b1f2f-671f-4c77-9832-e62fcf06d72d
		else
		  search --no-floppy --fs-uuid --set=root 657b1f2f-671f-4c77-9832-e62fcf06d72d
		fi
		echo	'Loading Linux 4.19.0-16-amd64 ...'
		linux	/boot/vmlinuz-4.19.0-16-amd64 root=UUID=657b1f2f-671f-4c77-9832-e62fcf06d72d ro iommu=pt quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-4.19.0-16-amd64
	}

It call my debian with above grub script.
How to write some lines for grub to call openwrt?

menuentry "OpenWRT" {
	linux /boot/vmlinuz root=PARTUUID=b3ade79d-02 rootfstype=ext4 rootwait console=tty0 console=ttyS0,115200n8 noinitrd
}
menuentry "OpenWRT (failsafe)" {
	linux /boot/vmlinuz failsafe=true root=PARTUUID=b3ade79d-02 rootfstype=ext4 rootwait console=tty0 console=ttyS0,115200n8 noinitrd
}

the root= value will probably be incorrect, you'll need to adjust it.
And you'll need to redirect the boot to sdb, since it's where you put OpenWRT.

1 Like

Add openwrt into grub menu,reboot to enter into openwrt ,still stuck by something ,
the last line says:
clocksource:Switched to clocksource tsc

assuming it actually booted openwrt, and not debian,

try pressing enter to get a prompt.

1 Like

Solved, it is partuuid not uuid.

good work :slight_smile:

the example actually said partuuid :wink:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.