Installing Gentoo: Difference between revisions
Jump to navigation
Jump to search
Strugglers (talk | contribs) m (warning about this not being finished) |
Strugglers (talk | contribs) m (→Installation: links/formatting) |
||
| (7 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{warning|This guide assumes that you’re already comfortable with Linux in general and Gentoo in particular.}} | |||
==Installation== | |||
First thing is to boot in [[rescue]] mode from the [[Xen Shell]] and to create <code>/mnt/gentoo/</code>. Partition and then mount your virtual disk over this, then download your desired stage3 tarball into this location. | |||
Then, you can follow the [https://wiki.gentoo.org/wiki/Handbook:AMD64 official handbook] with those modifications: | |||
<ul> | |||
<li><code>/dev/sda</code> is <code>/dev/xvda</code></li> | |||
<ul> | |||
<li>You do not require additional partitions unless your bootloader has no native way of reading your root filesystem (for example, full disk encryption)</li> | |||
</ul> | |||
<li>The IP to configure on eth0 is ${prefix}::2/64 and the gateway is ${prefix}::1. For example, this is my configuration: | |||
<pre>config_eth0="85.119.83.7/21 2001:ba8:1f1:f0af::2/64" | |||
< | routes_eth0="default via 85.119.80.1 | ||
<li> | default via 2001:ba8:1f1:f0af::1"</pre> | ||
</li> | |||
<li> | <li>For IPv4, pick the configuration from the live system</li> | ||
<pre> | <li>In <code>/etc/portage/make.conf</code>, it's recommended to set a <code>PORTAGE_NICENESS</code> setting so installing/updating things does not impact the running services</li> | ||
<li>In <code>/etc/portage/repos.conf/gentoo.conf</code>, you can set the <code>sync-uri</code> to the [[Local software mirrors]] | |||
<pre>sync-uri = rsync://mirror.bitfolk.com/gentoo-portage</pre></li> | |||
<li>The binary [https://wiki.gentoo.org/wiki/Project:Distribution_Kernel distribution kernel] just works for Xen</li> | |||
<li>However, should you wish to compile your own kernel - for the kernel configuration, you have to enable the Xen support. Those options worked for me: | |||
<pre>rr2 ~ # grep -i xen /usr/src/linux-4.19.97-gentoo/.config | |||
CONFIG_XEN=y | CONFIG_XEN=y | ||
CONFIG_XEN_PV=y | |||
CONFIG_XEN_PV_SMP=y | |||
CONFIG_XEN_512GB=y | |||
CONFIG_XEN_SAVE_RESTORE=y | CONFIG_XEN_SAVE_RESTORE=y | ||
# CONFIG_XEN_DEBUG_FS is not set | |||
CONFIG_XEN_BLKDEV_FRONTEND=y | CONFIG_XEN_BLKDEV_FRONTEND=y | ||
# CONFIG_XEN_SCSI_FRONTEND is not set | |||
CONFIG_XEN_NETDEV_FRONTEND=y | CONFIG_XEN_NETDEV_FRONTEND=y | ||
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y | |||
CONFIG_HVC_XEN=y | CONFIG_HVC_XEN=y | ||
CONFIG_HVC_XEN_FRONTEND=y | CONFIG_HVC_XEN_FRONTEND=y | ||
# CONFIG_XEN_WDT is not set | |||
CONFIG_DRM_XEN=y | |||
CONFIG_DRM_XEN_FRONTEND=m | |||
CONFIG_XEN_FBDEV_FRONTEND=y | CONFIG_XEN_FBDEV_FRONTEND=y | ||
# Xen driver support | |||
CONFIG_XEN_BALLOON=y | CONFIG_XEN_BALLOON=y | ||
CONFIG_XEN_SCRUB_PAGES_DEFAULT=y | |||
CONFIG_XEN_DEV_EVTCHN=y | CONFIG_XEN_DEV_EVTCHN=y | ||
CONFIG_XENFS=y | CONFIG_XENFS=y | ||
| Line 38: | Line 49: | ||
CONFIG_XEN_GNTDEV=m | CONFIG_XEN_GNTDEV=m | ||
CONFIG_XEN_GRANT_DEV_ALLOC=m | CONFIG_XEN_GRANT_DEV_ALLOC=m | ||
# CONFIG_XEN_GRANT_DMA_ALLOC is not set | |||
CONFIG_SWIOTLB_XEN=y | |||
# CONFIG_XEN_PVCALLS_FRONTEND is not set | |||
CONFIG_XEN_PRIVCMD=y | CONFIG_XEN_PRIVCMD=y | ||
CONFIG_XEN_HAVE_PVMMU=y | CONFIG_XEN_HAVE_PVMMU=y | ||
</pre> | CONFIG_XEN_HAVE_VPMU=y</pre> | ||
</li> | |||
<li>In <code>/etc/inittab</code>, add <code>hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0</code> for the Xen console and set it to run on startup: | |||
<pre> | |||
# cd /etc/init.d/ | |||
< | # ln -sv agetty agetty.hvc0 | ||
< | # rc-update add agetty.hvc0 default</pre></li> | ||
<li>In <code>/etc/securetty</code>, add <code>hvc0</code></li> | |||
<li>In <code>/etc/default/grub</code>, set: | |||
<pre>GRUB_CMDLINE_LINUX="console=hvc0 xencons=tty" | |||
... | |||
</ | GRUB_TERMINAL=console</pre></li> | ||
</ul> | |||
< | |||
</ | |||
<li> | |||
< | |||
</ | |||
< | |||
< | |||
< | |||
==Misc== | |||
If you have questions, I’m on the [https://panel.bitfolk.com/fun/ IRC channel] as alarig. | |||
I used https://www.mad-hacking.net/documentation/linux/deployment/xen/pv-guest-basics.xml to know what the Xen options are for. | |||
Latest revision as of 02:57, 3 February 2021
| This guide assumes that you’re already comfortable with Linux in general and Gentoo in particular. |
Installation
First thing is to boot in rescue mode from the Xen Shell and to create /mnt/gentoo/. Partition and then mount your virtual disk over this, then download your desired stage3 tarball into this location.
Then, you can follow the official handbook with those modifications:
/dev/sdais/dev/xvda- You do not require additional partitions unless your bootloader has no native way of reading your root filesystem (for example, full disk encryption)
- The IP to configure on eth0 is ${prefix}::2/64 and the gateway is ${prefix}::1. For example, this is my configuration:
config_eth0="85.119.83.7/21 2001:ba8:1f1:f0af::2/64" routes_eth0="default via 85.119.80.1 default via 2001:ba8:1f1:f0af::1"
- For IPv4, pick the configuration from the live system
- In
/etc/portage/make.conf, it's recommended to set aPORTAGE_NICENESSsetting so installing/updating things does not impact the running services - In
/etc/portage/repos.conf/gentoo.conf, you can set thesync-urito the Local software mirrorssync-uri = rsync://mirror.bitfolk.com/gentoo-portage
- The binary distribution kernel just works for Xen
- However, should you wish to compile your own kernel - for the kernel configuration, you have to enable the Xen support. Those options worked for me:
rr2 ~ # grep -i xen /usr/src/linux-4.19.97-gentoo/.config CONFIG_XEN=y CONFIG_XEN_PV=y CONFIG_XEN_PV_SMP=y CONFIG_XEN_512GB=y CONFIG_XEN_SAVE_RESTORE=y # CONFIG_XEN_DEBUG_FS is not set CONFIG_XEN_BLKDEV_FRONTEND=y # CONFIG_XEN_SCSI_FRONTEND is not set CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y # CONFIG_XEN_WDT is not set CONFIG_DRM_XEN=y CONFIG_DRM_XEN_FRONTEND=m CONFIG_XEN_FBDEV_FRONTEND=y # Xen driver support CONFIG_XEN_BALLOON=y CONFIG_XEN_SCRUB_PAGES_DEFAULT=y CONFIG_XEN_DEV_EVTCHN=y CONFIG_XENFS=y CONFIG_XEN_COMPAT_XENFS=y CONFIG_XEN_SYS_HYPERVISOR=y CONFIG_XEN_XENBUS_FRONTEND=y CONFIG_XEN_GNTDEV=m CONFIG_XEN_GRANT_DEV_ALLOC=m # CONFIG_XEN_GRANT_DMA_ALLOC is not set CONFIG_SWIOTLB_XEN=y # CONFIG_XEN_PVCALLS_FRONTEND is not set CONFIG_XEN_PRIVCMD=y CONFIG_XEN_HAVE_PVMMU=y CONFIG_XEN_HAVE_VPMU=y
- In
/etc/inittab, addhvc0:2345:respawn:/sbin/agetty -L 9600 hvc0for the Xen console and set it to run on startup:# cd /etc/init.d/ # ln -sv agetty agetty.hvc0 # rc-update add agetty.hvc0 default
- In
/etc/securetty, addhvc0 - In
/etc/default/grub, set:GRUB_CMDLINE_LINUX="console=hvc0 xencons=tty" ... GRUB_TERMINAL=console
Misc
If you have questions, I’m on the IRC channel as alarig.
I used https://www.mad-hacking.net/documentation/linux/deployment/xen/pv-guest-basics.xml to know what the Xen options are for.