{"id":685,"date":"2018-08-17T22:44:08","date_gmt":"2018-08-17T22:44:08","guid":{"rendered":"http:\/\/blogs.gentoo.org\/lu_zero\/?p=685"},"modified":"2018-08-20T10:28:38","modified_gmt":"2018-08-20T10:28:38","slug":"gentoo-on-integricloud","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/lu_zero\/2018\/08\/17\/gentoo-on-integricloud\/","title":{"rendered":"Gentoo on Integricloud"},"content":{"rendered":"<p><a href=\"https:\/\/integricloud.com\">Integricloud<\/a> gave me access to their infrastructure to track some issues on <strong>ppc64<\/strong> and <strong>ppc64le<\/strong>.<\/p>\n<p>Since some of the issues are related to the compilers, I obviously installed Gentoo on it and in the process I started to fix some issues with catalyst to get a working install media, but that&#8217;s for another blogpost.<\/p>\n<p>Today I&#8217;m just giving a walk-through on how to get a ppc64le (and ppc64 soon) VM up and running.<\/p>\n<h2>Preparation<\/h2>\n<p>Read <a href=\"https:\/\/secure.integricloud.com\/content\/kb\/1.html\">this<\/a> and get your install media available to your instance.<\/p>\n<h2>Install Media<\/h2>\n<p>I&#8217;m using the Gentoo <a href=\"https:\/\/dev.gentoo.org\/~lu_zero\/install-powerpc-minimal-20180815.iso\">installcd<\/a> I&#8217;m currently refining.<\/p>\n<h2>Booting<\/h2>\n<p>You have to append <code>console=hvc0<\/code> to your boot command, the boot process might figure it out for you on newer install medias (I still have to send patches to update <a href=\"https:\/\/cgit.gentoo.org\/proj\/livecd-tools.git\/\">livecd-tools<\/a>)<\/p>\n<h2>Network configuration<\/h2>\n<p>You have to manually setup the network.<br \/>\nYou can use <code>ifconfig<\/code> and <code>route<\/code> or <code>ip<\/code> as you like, refer to your instance setup for the parameters.<\/p>\n<pre><code>ifconfig enp0s0 ${ip}\/16\nroute add -net default gw ${gw}\necho \"nameserver 8.8.8.8\" &gt; \/etc\/resolv.conf\n<\/code><\/pre>\n<pre><code>ip a add ${ip}\/16 dev enp0s0\nip l set enp0s0 up\nip r add default via ${gw}\necho \"nameserver 8.8.8.8\" &gt; \/etc\/resolv.conf\n<\/code><\/pre>\n<h2>Disk Setup<\/h2>\n<p>OpenFirmware seems to like gpt much better:<\/p>\n<pre><code>parted \/dev\/sda mklabel gpt\n<\/code><\/pre>\n<p>You may use <code>fdisk<\/code> to create:<br \/>\n&#8211; a PowerPC PrEP boot partition of 8M<br \/>\n&#8211; root partition with the remaining space<\/p>\n<pre><code>Device     Start      End  Sectors Size Type\n\/dev\/sda1   2048    18431    16384   8M PowerPC PReP boot\n\/dev\/sda2  18432 33554654 33536223  16G Linux filesystem\n<\/code><\/pre>\n<p>I&#8217;m using <code>btrfs<\/code> and zstd-compress <code>\/usr\/portage<\/code> and <code>\/usr\/src\/<\/code>.<\/p>\n<pre><code>mkfs.btrfs \/dev\/sda2\n<\/code><\/pre>\n<h2>Initial setup<\/h2>\n<p>It is pretty much the usual.<\/p>\n<pre><code>mount \/dev\/sda2 \/mnt\/gentoo\ncd \/mnt\/gentoo\nwget https:\/\/dev.gentoo.org\/~mattst88\/ppc-stages\/stage3-ppc64le-20180810.tar.xz\ntar -xpf stage3-ppc64le-20180810.tar.xz\nmount -o bind \/dev dev\nmount -t devpts devpts dev\/pts\nmount -t proc proc proc\nmount -t sysfs sys sys\ncp \/etc\/resolv.conf etc\nchroot .\n<\/code><\/pre>\n<p>You just have to emerge <code>grub<\/code> and <code>gentoo-sources<\/code>, I diverge from the defconfig by making <code>btrfs<\/code> builtin.<\/p>\n<p>My <code>\/etc\/portage\/make.conf<\/code>:<\/p>\n<pre><code>CFLAGS=\"-O3 -mcpu=power9 -pipe\"\n# WARNING: Changing your CHOST is not something that should be done lightly.\n# Please consult https:\/\/wiki.gentoo.org\/wiki\/Changing_the_CHOST_variable beforee\n changing.\nCHOST=\"powerpc64le-unknown-linux-gnu\"\n\n# NOTE: This stage was built with the bindist Use flag enabled\nPORTDIR=\"\/usr\/portage\"\nDISTDIR=\"\/usr\/portage\/distfiles\"\nPKGDIR=\"\/usr\/portage\/packages\"\n\nUSE=\"ibm altivec vsx\"\n\n# This sets the language of build output to English.\n# Please keep this setting intact when reporting bugs.\nLC_MESSAGES=C\nACCEPT_KEYWORDS=~ppc64\n\nMAKEOPTS=\"-j4 -l6\"\nEMERGE_DEFAULT_OPTS=\"--jobs 10 --load-average 6 \"\n<\/code><\/pre>\n<p>My minimal set of packages I need before booting:<\/p>\n<pre><code>emerge grub gentoo-sources vim btrfs-progs openssh\n<\/code><\/pre>\n<blockquote><p>\n  <strong>NOTE:<\/strong> You want to emerge again <code>openssh<\/code> and make sure <code>bindist<\/code> is not in your <code>USE<\/code>.\n<\/p><\/blockquote>\n<h3>Kernel &amp; Bootloader<\/h3>\n<pre><code>cd \/usr\/src\/linux\nmake defconfig\nmake menuconfig # I want btrfs builtin so I can avoid a initrd\nmake -j 10 all &amp;&amp; make install &amp;&amp; make modules_install\ngrub-install \/dev\/sda1\ngrub-mkconfig -o \/boot\/grub\/grub.cfg\n<\/code><\/pre>\n<blockquote><p>\n  <strong>NOTE:<\/strong> make sure you pass <code>\/dev\/sda1<\/code> otherwise grub will happily assume <strong>OpenFirmware<\/strong> knows about <code>btrfs<\/code> and just point it to your directory.<br \/>\n  That&#8217;s not the case unfortunately.\n<\/p><\/blockquote>\n<h3>Networking<\/h3>\n<p>I&#8217;m using <a href=\"https:\/\/wiki.gentoo.org\/wiki\/Netifrc\">netifrc<\/a> and I&#8217;m using the eth0-naming-convention.<\/p>\n<pre><code>touch \/etc\/udev\/rules.d\/80-net-name-slot.rules\nln -sf \/etc\/init.d\/net.{lo,eth0}\necho -e \"config_eth0=\\\"${ip}\/16\\\"\\nroutes_eth0=\"default via ${gw}\\\"\\ndns_servers_eth0=\\\"8.8.8.8\\\"\" &gt; \/etc\/conf.d\/net\n<\/code><\/pre>\n<h3>Password and SSH<\/h3>\n<p>Even if the <code>mticlient<\/code> is quite nice, you would rather use <code>ssh<\/code> as much as you could.<\/p>\n<pre><code>passwd \nrc-update add sshd default\n<\/code><\/pre>\n<h3>Finishing touches<\/h3>\n<p>Right now <code>sysvinit<\/code> does not add the <code>hvc0<\/code> console as it should due to a profile quirk, for now check <code>\/etc\/inittab<\/code> and in case add:<\/p>\n<pre><code>echo 'hvc0:2345:respawn:\/sbin\/agetty -L 9600 hvc0' &gt;&gt; \/etc\/inittab\n<\/code><\/pre>\n<p>Add your user and add your ssh key and you are ready to use your new system!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Integricloud gave me access to their infrastructure to track some issues on ppc64 and ppc64le. Since some of the issues are related to the compilers, I obviously installed Gentoo on it and in the process I started to fix some issues with catalyst to get a working install media, but that&#8217;s for another blogpost. Today &hellip; <a href=\"https:\/\/blogs.gentoo.org\/lu_zero\/2018\/08\/17\/gentoo-on-integricloud\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Gentoo on Integricloud<\/span><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3,5],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1aGWH-b3","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/685"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/comments?post=685"}],"version-history":[{"count":12,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/685\/revisions"}],"predecessor-version":[{"id":697,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/685\/revisions\/697"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/media?parent=685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/categories?post=685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/tags?post=685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}