Jump to content
XPEnology Community

How does the xpenology bootloader work?


dyce

Recommended Posts

I am trying to get virtio storage to work.

 

when does xpenology decide to boot into recovery (install OS, no disks found, etc) (this is where your root login doesnt work). can you write files to that rootfs or is it readonly?

 

I am looking at this script, is this script ran before synology would boot into recovery? https://github.com/Jman420/nanoBoot-DSM ... nuxrc.syno

Link to comment
Share on other sites

In a real Syno box there is a DOM/embedded rom that contains a minimal boot loader of the appropriate DSM level. When you install DSM to drives it partitions them and creates a system partition on each disk, installing the 'full' DSM O/S and local configurations etc

 

The XPE boot loader emulates the DOM then 'hands off' to the full DSM installed on disk.

 

I'd imagine that XPE will only 'boot to recovery' if there is no attached hdd with a good working system partition.

 

I've not played with virtio, but looking at what it does, to get it working in XPE/DSM you would either need add the 'drivers' to the XPE loader, or maybe if it could be 'packaged' to run as an add on like the open source linux VMware tools.

Link to comment
Share on other sites

In a real Syno box there is a DOM/embedded rom that contains a minimal boot loader of the appropriate DSM level. When you install DSM to drives it partitions them and creates a system partition on each disk, installing the 'full' DSM O/S and local configurations etc

 

The XPE boot loader emulates the DOM then 'hands off' to the full DSM installed on disk.

 

I'd imagine that XPE will only 'boot to recovery' if there is no attached hdd with a good working system partition.

 

I've not played with virtio, but looking at what it does, to get it working in XPE/DSM you would either need add the 'drivers' to the XPE loader, or maybe if it could be 'packaged' to run as an add on like the open source linux VMware tools.

 

I actually was able to login to the "recovery mode" (using the C code that generates a password per day) and was able to mount /dev/vda manually (using mknod). So the virtio drivers are indeed included. But of course all the synology tools are hardcoded to look for /dev/sda. I was able to hack around with the API to let it detect /dev/vda by overriding the API it calls to return that. but of course all the changes I make in the recovery do not persist and the install fails.

 

So I have come to the conclusion that either the kernel needs to be modified to mount virtio as /dev/sda rather than /dev/vda or some hacks need to be performed to allow the synology software to happily read from /dev/vda , the former would be a lot easier.

Link to comment
Share on other sites

×
×
  • Create New...