<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to ModifyingTheBootDisk</title><link>https://sourceforge.net/p/unattended/wiki/ModifyingTheBootDisk/</link><description>Recent changes to ModifyingTheBootDisk</description><atom:link href="https://sourceforge.net/p/unattended/wiki/ModifyingTheBootDisk/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 22 Sep 2014 00:47:36 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/unattended/wiki/ModifyingTheBootDisk/feed" rel="self" type="application/rss+xml"/><item><title>ModifyingTheBootDisk modified by Juan Jose Pablos</title><link>https://sourceforge.net/p/unattended/wiki/ModifyingTheBootDisk/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;a class="" href="../ModifyingTheBootDisk?action=diff&amp;amp;version=12"&gt;Last modified&lt;/a&gt; &lt;a class="" href="/trac/timeline?from=2012-06-23T10%3A54%3A22%2B02%3A00&amp;amp;precision=second"&gt;2 years&lt;/a&gt; ago Last modified on 23/06/12 10:54:22&lt;/p&gt;
&lt;p&gt;OK, this is the Plan. We boot a diskless Linux 2.6.x kernel, use the /sys (sysfs) file system and modules.pcimap files to autodetect the network hardware and load its driver(s), use udhcpc (from BusyBox?) to grab a DHCP lease, use mount to map the install share on /z, use sysfs and modules.pcimap again to autodetect the mass storage hardware and load its driver(s), run install.pl to partition the disk (using Parted) and generate unattend.txt. &lt;/p&gt;
&lt;p&gt;The Makefile generates the Linux boot disk. To download all required sources from their canonical locations. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;svn&lt;/span&gt; &lt;span class="n"&gt;co&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//unattended.svn.sourceforge.net/svnroot/unattended/trunk unattended&lt;/span&gt;
&lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;unattended&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;linuxboot&lt;/span&gt;
&lt;span class="n"&gt;make&lt;/span&gt; &lt;span class="n"&gt;download&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will use gobs of disk space, a fast connection, and lots of time. Do "make iso" to build linuxboot.iso. Do "make tftpboot" to populate the tftpboot/ directory. A simple &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;make&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;does both. &lt;/p&gt;
&lt;h3 id="first-create-a-build-environment-under-debianubuntu"&gt;First. Create a build environment under Debian/Ubuntu?&lt;/h3&gt;
&lt;p&gt;This assume that you are familiar with Debian. Install only the base system. See &lt;a class="" href="http://wiki.freaks-unidos.net/chrooted-debian-server" rel="nofollow"&gt;​http://wiki.freaks-unidos.net/chrooted-debian-server&lt;/a&gt; for directions on creating a chrooted virgin Debian base system on either Debian or Red Hat based distros. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;aptitude&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;subversion&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;essential&lt;/span&gt; &lt;span class="n"&gt;bison&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt; &lt;span class="n"&gt;libncurses&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt; &lt;span class="n"&gt;libncursesw5&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt; &lt;span class="n"&gt;mkisofs&lt;/span&gt; &lt;span class="n"&gt;gawk&lt;/span&gt; &lt;span class="n"&gt;mtools&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The Debian package &lt;a class="" href="http://packages.debian.org/squeeze/firmware-linux-nonfree" rel="nofollow"&gt;​firmware-linux-nonfree&lt;/a&gt; might be useful if you have a nic that isn't recognized out of the box. E.g. &lt;a class="" href="http://forums.debian.net/viewtopic.php?f=17&amp;amp;t=51393" rel="nofollow"&gt;​Broadcomm Netlink&lt;/a&gt; &lt;a class="" href="https://sourceforge.net/mailarchive/message.php?msg_name=4BF5A2FC.10209%40campnavajo.com"&gt;​BCM57780&lt;/a&gt;. Note: This should be &lt;a class="" href="http://www.mail-archive.com/unattended-info%40lists.sourceforge.net/msg09177.html"&gt;​working now with kernel 2.6.35.8&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or use a Fedora kernel that has the firmware included -&amp;gt; &lt;a class="" href="http://mirror.pnl.gov/fedora/linux/updates/13/SRPMS/kernel-2.6.34.7-61.fc13.src.rpm" rel="nofollow"&gt;​kernel-2.6.34.7-61.fc13.src.rpm&lt;/a&gt;&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;rpmbuild&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="n"&gt;i386&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bp&lt;/span&gt; &lt;span class="n"&gt;kernel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;spec&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;will give you a patched kernel source that can use the Broadcom Netlink nic above. &lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://unattended.sourceforge.net/advanced.php#modify"&gt;​Advanced info&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="linuxboot"&gt;&lt;a class="alink" href="/p/unattended/wiki/LinuxBoot"&gt;[LinuxBoot]&lt;/a&gt;&lt;/h1&gt;
&lt;h1 id="how-to-modify-a-bootdisk-without-compile"&gt;How to modify a BootDisk? WITHOUT compile&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;attention&lt;/strong&gt;: this method gave me an error: "openvt: unable to open /dev/tty2: No such file or directory."... you have been warned! &lt;/p&gt;
&lt;p&gt;Please tell me how to fix that :) &lt;/p&gt;
&lt;p&gt;copy /dev/tty2 from linux host to the extracted initrd image :) &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2nd. attention&lt;/strong&gt;:i think the correct way to do this is to uncheck the current release of unattended from cvs an build the bootdisk from source according to the README.txt file in the linuxboot directory. doing this you are able to build new kernel and modules as well. &lt;/p&gt;
&lt;h1 id="five-steps"&gt;five steps&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;get ready &lt;/p&gt;
&lt;p&gt;gunzip unattended-4.6-linuxboot.zip&lt;/p&gt;
&lt;p&gt;cd linuxboot/&lt;/p&gt;
&lt;p&gt;mkdir tmp iso initrd&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;open default iso and initrd &lt;/p&gt;
&lt;p&gt;mount -t iso9660 -o loop linuxboot.iso tmp/&lt;/p&gt;
&lt;p&gt;cp -rp tmp/* iso/.&lt;/p&gt;
&lt;p&gt;umount tmp/&lt;/p&gt;
&lt;p&gt;rmdir tmp/&lt;/p&gt;
&lt;p&gt;cd initrd/&lt;/p&gt;
&lt;p&gt;cat ../iso/isolinux/initrd | cpio -i&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;now you can modify everything! &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;create a brand new iso &lt;/p&gt;
&lt;p&gt;cd initrd&lt;/p&gt;
&lt;p&gt;find . -xdev | cpio -o -H newc &amp;gt; ../iso/isolinux/initrd&lt;/p&gt;
&lt;p&gt;cd ../iso&lt;/p&gt;
&lt;p&gt;mkisofs -o ../MegaCool-linuxboot.iso -V 'MyLinuxBoot' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \&lt;/p&gt;
&lt;p&gt;-boot-info-table -R -J -T .&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;burn it! &lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id="funnies"&gt;funnies&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;If you want to add a message at the start of the boot cd, just edit the isoboot.msg file in the iso/isolinux/ folder. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="pxe-booting"&gt;PXE Booting&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;If you are booting to the linux disk from the network, then you can change a line in the "/var/lib/tftpboot/pxelinux.cfg/default" file to read "append initrd=initrd z_user=myself z_pass=sekrit z_path=_myserver/myshare". _&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="patch-glibc"&gt;Patch GLibc&lt;/h1&gt;
&lt;p&gt;If your custom built kernel panics when starting initrd with something like &lt;code&gt;Inconsistency detected by ld.so: dynamic-link.h: 204: elf_get_dynamic_info: Assertion 'info[15] == ((void *)0)' failed!&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You'll need to patch GLibc &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="gd"&gt;--- glibc-2.11.1/elf/dynamic-link.h.orig        2010-10-25 01:24:57.392697801 +0000&lt;/span&gt;
&lt;span class="gi"&gt;+++ glibc-2.11.1/elf/dynamic-link.h     2010-10-25 01:25:35.733821785 +0000&lt;/span&gt;
&lt;span class="gu"&gt;@@ -200,8 +200,8 @@&lt;/span&gt;
   assert (info[DT_FLAGS] == NULL
          || info[DT_FLAGS]-&amp;gt;d_un.d_val == DF_BIND_NOW);
   /* Flags must not be set for ld.so.  */
&lt;span class="gd"&gt;-  assert (info[DT_RUNPATH] == NULL);&lt;/span&gt;
&lt;span class="gd"&gt;-  assert (info[DT_RPATH] == NULL);&lt;/span&gt;
&lt;span class="gi"&gt;+  info[DT_RUNPATH] == NULL;&lt;/span&gt;
&lt;span class="gi"&gt;+  info[DT_RPATH] == NULL;&lt;/span&gt;
 #else
   if (info[DT_FLAGS] != NULL)
     {
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;references &lt;a class="" href="http://devpit.org/wiki/Gnu_Toolchain/GLIBC/Building_GLIBC#patching_32-bit" rel="nofollow"&gt;​http://devpit.org/wiki/Gnu_Toolchain/GLIBC/Building_GLIBC#patching_32-bit&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="problems"&gt;problems&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;When I modify the initrd that way I only got one tty. Any solution to this? &lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Juan Jose Pablos</dc:creator><pubDate>Mon, 22 Sep 2014 00:47:36 -0000</pubDate><guid>https://sourceforge.net4ac06f612399d990e3582c6e949f280b8b810c14</guid></item></channel></rss>