{"id":1052,"date":"2013-01-20T17:51:58","date_gmt":"2013-01-20T17:51:58","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=1052"},"modified":"2013-01-21T07:55:15","modified_gmt":"2013-01-21T07:55:15","slug":"fai-on-ubuntu-12-04","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2013\/01\/fai-on-ubuntu-12-04\/","title":{"rendered":"FAI on Ubuntu 12.04"},"content":{"rendered":"<p>These notes are a work in progress and detail my installation of FAI (Fully Automatic Installation) on Ubuntu 12.04. I had some issues before realising I needed a 64bit client to install to (had PXE working then realised my client is 32bit only). This is worth noting as it&#8217;s most likely \/VERY\/ annoying to build a FAI server for a different architecture.<\/p>\n<p>Also, be careful about doing this on an active network, as you can easily setup a rogue DHCP server which will make bad things happen.<\/p>\n<p>Install the basic FAI packages:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\napt-get install fai-quickstart\r\n<\/pre>\n<p>Add the following to \/etc\/exports:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/srv\/fai\/config (async,ro,no_subtree_check,no_root_squash)\r\n<\/pre>\n<p>Edit: \/etc\/fai\/make-fai-nfsroot.conf<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nChange: FAI_DEBOOTSTRAP=&quot;squeeze http:\/\/cdn.debian.net\/debian&quot;\r\nTo    : FAI_DEBOOTSTRAP=&quot;precise http:\/\/gb.archive.ubuntu.com\/ubuntu&quot;\r\n<\/pre>\n<p>Do the initial debbootstrap, copy the sample dhcp server config into place.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsudo fai-setup\r\n\/etc\/init.d\/nfs-kernel-server reload\r\napt-get install isc-dhcp-server syslinux-common tftpd-hpa\r\ncp \/usr\/share\/doc\/fai-doc\/examples\/etc\/dhcpd.conf \/etc\/dhcp\/dhcpd.conf\r\n<\/pre>\n<p>add hosts to \/etc\/dhcp\/dhcpd.conf similar to the example line already present:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhost demohost {hardware ethernet 0:2:a3:b5:c5:41;fixed-address demohost;}\r\n<\/pre>\n<p>or remove:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ndeny unknown-clients;\r\n<\/pre>\n<p>to allow all clients<\/p>\n<p>add a range if required under the subnet line, e.g.:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nrange 192.168.1.1 192.168.1.50;\r\n<\/pre>\n<p>edit \/etc\/default\/tftpd-hpa:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nCHANGE: TFTP_DIRECTORY=&quot;\/var\/lib\/tftpboot&quot;\r\nTO    : TFTP_DIRECTORY=&quot;\/srv\/tftp&quot;\r\n<\/pre>\n<p>and\/or add the following in \/etc\/init\/tftpd-hpa.conf :<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nenv TFTP_DIRECTORY=&quot;\/srv\/tftp&quot;\r\n<\/pre>\n<p>Install demo configuration files (this may not be required):<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ncp -a \/usr\/share\/doc\/fai-doc\/examples\/simple\/* \/srv\/fai\/config\r\n<\/pre>\n<p>Set permissions on kernel correctly:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nchmod o+r \/srv\/tftp\/fai\/vmlinuz-3.2.0-36-generic\r\n<\/pre>\n<p>Edit: \/srv\/fai\/config\/files\/boot\/grub\/menu.lst\/postinst <\/p>\n<p>Comment out as follows:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#$ROOTCMD grub-install --no-floppy $(device2grub $BOOT_DEVICE)\r\n<\/pre>\n<p>Edit, \/srv\/fai\/config\/scripts\/GRUB\/10-setup replace the entire contents as follows:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#! \/bin\/bash\r\n\r\nerror=0 ; trap &quot;error=$((error|1))&quot; ERR\r\n\r\n# Eventual source the disk_var.sh just in case \r\n# the BOOT_DEVICE\/BOOT_PARTITION\/ROOT_PARTITION \r\n# variables are overwritten\r\n&#x5B; -r \/tmp\/fai\/disk_var.sh ] &amp;&amp; . \/tmp\/fai\/disk_var.sh\r\n\r\nifclass NOMBR &amp;&amp; BOOT_DEVICE=$BOOT_PARTITION\r\n\r\n&#x5B; -z &quot;$BOOT_DEVICE&quot; ]    &amp;&amp; exit 701\r\n&#x5B; -z &quot;$BOOT_PARTITION&quot; ] &amp;&amp; exit 702\r\n\r\n# call grub-install from ubuntu\r\n$target\/usr\/sbin\/grub-install --no-floppy --root-directory=\/$target $BOOT_DEVICE\r\n\r\n# call update-grub inside ubuntu chroot with special &quot;no user questions&quot; flag\r\n$ROOTCMD \/usr\/sbin\/update-grub -y\r\n\r\nexit $error\r\n<\/pre>\n<p>Create: \/srv\/tftp\/fai\/pxelinux.cfg\/default with the following contents:<br \/>\nNote, this currently boots to fai then tries to connect to the nfs server.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n       # Default boot option to use\r\n       DEFAULT x64\r\n\r\n       # Prompt user for selection\r\n       PROMPT 0\r\n       # Menu Configuration\r\n       MENU WIDTH 80\r\n       MENU MARGIN 10\r\n       MENU PASSWORDMARGIN 3\r\n       MENU ROWS 12\r\n       MENU TABMSGROW 18\r\n       MENU CMDLINEROW 18\r\n       MENU ENDROW 24\r\n       MENU PASSWORDROW 11\r\n       MENU TIMEOUTROW 20\r\n       MENU TITLE Main Menu\r\n       # Menus\r\n       LABEL x64\r\n         MENU LABEL x64\r\n         KERNEL vmlinuz-3.2.0-36-generic\r\n         APPEND initrd=initrd.img-3.2.0-36-generic ip=dhcp root=\/dev\/nfs nfsroot=\/srv\/fai\/nfsroot boot=live FAI_FLAGS=verbose,sshd,createvt FAI_ACTION=install FAI_CONFIG_SRC=nfs:\/\/192.168.1.100\/srv\/fai\/config\r\n<\/pre>\n<p>This config installs an Ubuntu system for me, but there appear to be bootloader issues (hopefully resolved now, testing).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These notes are a work in progress and detail my installation of FAI (Fully Automatic Installation) on Ubuntu 12.04. I had some issues before realising I needed a 64bit client to install to (had PXE working then realised my client is 32bit only). This is worth noting as it&#8217;s most likely \/VERY\/ annoying to build [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1052","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-gY","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=1052"}],"version-history":[{"count":11,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1052\/revisions"}],"predecessor-version":[{"id":1063,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1052\/revisions\/1063"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=1052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=1052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=1052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}