Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2572 implement freebsd support #673

Closed
wants to merge 1 commit into from

Conversation

endyman
Copy link
Contributor

@endyman endyman commented May 31, 2013

Refactored Branch including more concise usage of install media - replacement for PR: #660

Added Support for FreeBSD installation. In order to install FreeBSD Servers using foreman you need to create a mfsbsd image using https://github.com/mmatuska/mfsbsd

As we require rc.local support in order to start the sysinstall process i submitted a patch to mfsbsd, too mmatuska/mfsbsd#17

You can find a fork here: https://github.com/endyman/mfsbsd/tree/rc-local-support
Simply add a rc.local to /conf/ including the follwing code:

# create install.cfg for the installer
# if your forman server is not named foreman,
# change the name accordinly.

cat << EOF >/tmp/install.cfg
pc_config: https://foreman/unattended/provision
nic_config: dhcp-all
confirm_install: no
EOF

# start the installation process using pc-sysinstall

pc-sysinstall start-autoinstall /tmp/install.cfg
shutdown -r now

In case your foreman server is not called foreman, change it here. Currently there is no elegant way to pass params to BSD so we are using a static host here. I created a foreman CNAME in each domain pointing to the foreman server. After the kernel is booted, mfsbsd will try to fetch the installer provisioning config from https://foreman/unattended/provision

Next you need to build the mfsbsd image - BASE points to you install cdrom:

$ make BASE=/cdrom/usr/freebsd-dist

As a last step you need to copy the image to yout foreman tftpserver using this schema:

boot/FreeBSD-<arch>-<version>-mfs.img

i.e.

boot/FreeBSD-x86_64-9.1-mfs.img

In foreman do not forget to update your install media to point to a FreeBSD mirror near you :-)

@frimik
Copy link
Member

frimik commented Jun 2, 2013

👍 for FreeBSD support..

I don't know if this helps but since you added rc.local support, this actually works:
Add custom dhcp-options in the site-local range (224..254) and reading from those in rc.local.

Example dhcpd config:

option foreman-url code 224 = text;
option foreman-url "http://foreman.mg8.tmtowtdi.se";

option foreman-token code 225 = text;
option foreman-token "d3b07384d113edec49eaa6238ad5ff00";

Example mfsbsd:/etc/dhclient.conf:

request option-224, option-225;

Resulting mfsbsd:/var/db/dhclient.leases.em0:

lease {
  interface "em0";
  fixed-address 192.168.69.46;
  filename "pxelinux.0";
  option subnet-mask 255.255.255.128;
  # [...]
  option option-224 "http://foreman.mg8.tmtowtdi.se";
  option option-225 "d3b07384d113edec49eaa6238ad5ff00";
  renew 1 2013/4/15 20:39:00;
  # [...]

@endyman
Copy link
Contributor Author

endyman commented Jun 3, 2013

@frimik that looks like a pretty interesting idea - I will have a look at it if such options can be set easily based on the OS - From the mfs / OS perspective this solves the issue of passing (basic) information to the server.

@ohadlevy
Copy link
Member

ohadlevy commented Jun 3, 2013

thats a pretty good idea, we would need to extend the smart proxy a bit to
handle dhcp options on isc (we do that already for AD DHCP), this could
also save some problems with solaris deployments too.

@mmoll
Copy link
Contributor

mmoll commented Jul 2, 2013

It seems like there is some stuff happening:
http://www.secnetix.de/olli/FreeBSD/svnews/index.py?r=252506

@ohadlevy
Copy link
Member

ohadlevy commented Sep 8, 2013

@endyman ping? would love to get this in if possible

@endyman
Copy link
Contributor Author

endyman commented Sep 8, 2013

Let's chat tomorrow on irc what needs to be done.

Am 08.09.2013 um 10:47 schrieb Ohad Levy notifications@github.com:

@endyman ping? would love to get this in if possible


Reply to this email directly or view it on GitHub.

@endyman
Copy link
Contributor Author

endyman commented Sep 9, 2013

rc.local support has been integrated into mfsbsd so no need to use my fork anymore https://github.com/mmatuska/mfsbsd

end

def pxe_type
"memdisk"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. should we call it maybe differently? so if later on we use memdisk for something else? (or more specific to bsd)

@mmatuska
Copy link
Contributor

mmatuska commented Oct 8, 2013

what about chain-booting from pxelinux to pxeboot? in that case you don't need memdisk :)

@@ -0,0 +1,38 @@
class Freebsd < Operatingsystem
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of 1.3 and later this file should be stored under app/models/operatingsystems/freebsd.rb

@ohadlevy
Copy link
Member

[test]

@domcleal
Copy link
Contributor

Replaced by #956, which has been merged, thanks for the work @endyman.

@domcleal domcleal closed this Nov 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants