{"id":86,"date":"2009-07-02T17:06:59","date_gmt":"2009-07-02T16:06:59","guid":{"rendered":"http:\/\/kudzia.eu\/b\/?p=86"},"modified":"2011-04-30T10:22:26","modified_gmt":"2011-04-30T09:22:26","slug":"pre-seeding-automated-installation-of-debian","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2009\/07\/pre-seeding-automated-installation-of-debian\/","title":{"rendered":"pre-seeding &#038; automated installation of debian"},"content":{"rendered":"<p>objective &#8211; get basic debian set up automatically on dell&#8217;s PE 1950 \/ 2950 servers. without much manual clicking.<br \/>\n<!--more--><br \/>\n#1<br \/>\nset up local tftp server<br \/>\n<code>apt-get install atftpd<\/code><\/p>\n<p>make sure it runs. in my case it&#8217;ll be at 10.16.10.1<\/p>\n<p>#2<br \/>\nconfigure your dhcp server for mac of machine you want to image &#8211; in \/etc\/dhcp3\/dhcpd.conf add:<\/p>\n<pre>\r\n<code>\r\n  host install{\r\n# put mac address of the machine\r\n        hardware ethernet 00:22:19:5d:42:ca;\r\n        fixed-address 10.16.10.55;\r\n        option host-name \"fresh\";\r\n        option domain-name-servers 10.16.10.1;\r\n        option routers 10.16.10.1;\r\n        option root-path \"10.16.10.1:\/\";\r\n        option subnet-mask 255.255.255.0;\r\n        filename \"pxelinux.0\";\r\n        option broadcast-address 10.16.10.255;\r\n        next-server 10.16.10.1;\r\n  }\r\n<\/code>\r\n<\/pre>\n<p>#3<br \/>\ndownload and unpack to \/tftproot debian&#8217;s netboot [ netboot.tar.gz ].<\/p>\n<p>#4<br \/>\nadd firmware for broadcom gigabit ethernet cards. based on <a href=\"http:\/\/www.ducea.com\/2009\/03\/02\/debian-lenny-pxe-installation-on-dell-poweredge-19502950-servers-bnx2-annoyances\/\">this<\/a> article:<br \/>\n<code><br \/>\nmkdir \/tftpboot\/debian-installer\/amd64\/tmp<br \/>\ncd \/tftpboot\/debian-installer\/amd64\/tmp<br \/>\n# link might change, just remove file and find latest firmware-bnx2_XXXX_all.deb<br \/>\nwget http:\/\/ftp.fr.debian.org\/debian\/pool\/non-free\/f\/firmware-nonfree\/firmware-bnx2_0.17_all.deb<br \/>\ndpkg-deb -x firmware-bnx2_0.17_all.deb .<br \/>\nrm -rf firmware-bnx2_0.17_all.deb<br \/>\nfind . -print0 | cpio -0 -H newc -ov | gzip -c > ..\/initrd.gz<br \/>\n<\/code><\/p>\n<p>modify \/tftpboot\/pxelinux.cfg and put:<\/p>\n<pre>\r\n<code>\r\nprompt 1\r\ntimeout 0\r\nSAY i386  - install 32 bit os\r\nSAY amd64 - install 64 bit os\r\nLABEL i386\r\n       menu label i386\r\n        kernel debian-installer\/i386\/linux\r\n        append DEBCONF_DEBUG=5 vga=normal initrd=debian-installer\/i386\/initrd.gz debian-installer\/locale=en_US console-keymaps-at\/keymap=us hostname=fresh domain=mbnd.eu netcfg\/dhcp_timeout=60 preseed\/url=http:\/\/10.16.10.1\/i386-ps.cfg netcfg\/choose_interface=eth0 --\r\nlabel amd64\r\n        menu label amd64\r\n        kernel debian-installer\/i386\/linux\r\n        append DEBCONF_DEBUG=5 vga=normal initrd=debian-installer\/i386\/initrd.gz debian-installer\/locale=en_US console-keymaps-at\/keymap=us hostname=fresh domain=mbnd.eu netcfg\/dhcp_timeout=60 preseed\/url=http:\/\/10.16.10.1\/amd64-ps.cfg netcfg\/choose_interface=eth0 --\r\n<\/code>\r\n<\/pre>\n<p>#5<br \/>\nput following preseeding file on some web server [ pointed by preseed\/url directive in pxelinux config ]<\/p>\n<pre>\r\n<code>\r\n# debconf-get-selections --installer > preseed.cfg\r\n# debconf-get-selections >> preseed.cfg\r\n\r\n\r\nd-i debian-installer\/locale string en_US\r\nd-i console-keymaps-at\/keymap select us\r\nd-i netcfg\/choose_interface select eth0\r\nd-i netcfg\/get_hostname string fresh\r\nd-i netcfg\/get_domain string mbnd.eu\r\n\r\nd-i netcfg\/wireless_wep string\r\n\r\n\r\n### Mirror settings\r\n# If you select ftp, the mirror\/country string does not need to be set.\r\n#d-i mirror\/protocol string ftp\r\nd-i mirror\/country string manual\r\nd-i mirror\/http\/hostname string ftp.se.debian.org\r\nd-i mirror\/http\/directory string \/debian\r\nd-i mirror\/http\/proxy string\r\nd-i mirror\/suite  string lenny\r\n\r\nd-i clock-setup\/utc boolean true\r\n\r\n\r\n# Controls whether to use NTP to set the clock during the install\r\nd-i clock-setup\/ntp boolean true\r\n# NTP server to use. The default is almost always fine here.\r\nd-i clock-setup\/ntp-server string 0.debian.pool.ntp.org\r\nd-i     time\/zone       string Zulu\r\n\r\n\r\n### Partitioning\r\nd-i partman-auto\/disk string \/dev\/sda\r\nd-i partman-auto\/method string regular\r\nd-i partman-auto\/init_automatically_partition select biggest_free\r\nd-i partman-auto\/choose_recipe select Manual\r\nd-i partman-auto\/expert_recipe         string my-layout :: 512 2048 4096 ext3 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ \/ } . 512 4096 409600 ext3 method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ \/home } . 256 512 2048 ext3 method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ \/var\/log } . 32 32 32 ext3 method{ format } format{ } se_filesystem{ } filesystem{ ext3 } mountpoint{ \/backup } . 512 2048 300% linux-swap method{ swap } format{ } .\r\nd-i partman\/confirm_write_new_label     boolean true\r\nd-i partman\/choose_partition            select     Finish partitioning and write changes to disk\r\nd-i partman\/confirm                     boolean true\r\n\r\n# The kernel image (meta) package to be installed; \"none\" can be used if no\r\n# kernel is to be installed.\r\n#d-i base-installer\/kernel\/image string linux-image-2.6-486\r\n\r\nd-i passwd\/make-user boolean false\r\nd-i passwd\/root-password password r00tme\r\nd-i passwd\/root-password-again password r00tme\r\n\r\n\r\ntasksel tasksel\/first   multiselect\r\nd-i time\/zone string Zulu\r\n\r\n#tzdata  tzdata\/Zones\/Etc        select  Zulu\r\n\r\n\r\nd-i pkgsel\/include string openssh-server firmware-bnx2\r\nd-i pkgsel\/upgrade select full-upgrade\r\n\r\npopularity-contest popularity-contest\/participate boolean false\r\n\r\n### Boot loader installation\r\n# Grub is the default boot loader (for x86). If you want lilo installed\r\n# instead, uncomment this:\r\n#d-i grub-installer\/skip boolean true\r\n# To also skip installing lilo, and install no bootloader, uncomment this\r\n# too:\r\nd-i lilo-installer\/skip boolean true\r\n\r\nd-i grub-installer\/only_debian boolean true\r\nd-i grub-installer\/with_other_os boolean true\r\n\r\n# Avoid that last message about the install being complete.\r\nd-i finish-install\/reboot_in_progress note\r\n\r\n\r\n# This first command is run as early as possible, just after\r\n# preseeding is read.\r\n#d-i preseed\/early_command string anna-install some-udeb\r\n\r\n# This command is run just before the install finishes, but when there is\r\n# still a usable \/target directory. You can chroot to \/target and use it\r\n# directly, or use the apt-install and in-target commands to easily install\r\n# packages and run commands in the target system.\r\n#d-i preseed\/late_command string apt-install zsh; in-target chsh -s \/bin\/zsh\r\n\r\nd-i pkgsel\/include string ssh rsync less tcpdump mc bzip2 mtr-tiny screen\r\n<\/code>\r\n<\/pre>\n<p>#6<br \/>\nlet the machine boot from pxe<\/p>\n","protected":false},"excerpt":{"rendered":"<p>objective &#8211; get basic debian set up automatically on dell&#8217;s PE 1950 \/ 2950 servers. without much manual clicking.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":18,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":600,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/86\/revisions\/600"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}