On Fri, Sep 05, 2003 at 01:15:15PM -0600, Albers, Lucas wrote:
> Can we put this in the documentation?

i've committed a subset of this information - the pieces i left out
are mentioned below.
> This is useful information.

yes it is - thanks Dan.

> 1) Mount a systemimager CD : mount /mnt/cdrom
> 2) Make a directory to work in : mkdir systemimager
> 3) cd systemimager
> 4) cp /mnt/cdrom/boot/siboot.img ./
> 5) Make a loopback mountpoint for siboot.img : mkdir ./siboot_mnt
> 6) Mount the siboot.img file : mount -o loop siboot.img ./siboot_mnt

using mkautoinstallcd, it should be easy to rebuild a cd.
you can pass it a --initrd flag to tell it to use a specific initrd,
or just copy the one you created over your older one (backing it up
first, of course).

> 7) Copy out the initrd.img to CWD : cp siboot_mnt/initrd.img ./initrd.gz
> 8) Uncompress the initrd file : gunzip initrd.gz
> 9) Make a loopback mountpoint for initrd : mkdir ./initrd_mnt
> 10) Mount the initrd : mount -o loop initrd initrd_mnt/
> 11) Make a directory you can copy the loopback device files to: 
> mkdir initrd_copy
> 12) Copy the files to this directory : cp -a initrd_mnt/* initrd_copy/      
> 13) mkdir initrd_copy/lib initrd_copy/proc initrd_copy/tmp
> 14) mount --bind initrd_copy/lib initrd_copy/dev
> 15) mount --bind initrd_copy/proc initrd_copy/new_root
> 16) mount --bind initrd_copy/tmp initrd_copy/root

i don't understand the purpose of these bind mounts.
it looks like you're making the files in lib/ available under dev/
and the files in proc/ available under new_root, etc...

> 17) Apply your patch!  In this case its a : 
> vim initrd_copy/etc/init.d/rcS to fix PING_EXIT_STATUS
> 18) Reset permissions on all changed files : chown -R 20800:64 initrd_copy/

shouldn't be necesarry - cp -a maintains permissions.

> 19) Make a cramfs filesystem of your changes : mkcramfs initrd_copy/ initrd
> 20) Make a temporary mountpoint, mount the initrd and check your changes!!!
>         mkdir tmp_mount;mount -o loop initrd tmp_mount
>         cat tmp_mount/etc/init.d/rcS | grep <changes>
> 21) umount tmp_mount/
> 22) You now have a working cramfs initrd.  gzip and rename it and chmod it:
>         gzip initrd; mv initrd.gz initrd.img;chmod 755 initrd.img
> 
>                                                          
> 23) Now we need to make a bootable filesystem from this:

or just mkautoinstallcd, which does all this.

> 24) mkdir iso
> 25) dd if=/dev/zero of=iso/siboot.img bs=1k count=2880
> 26) /sbin/mkdosfs iso/siboot.img
> 27) syslinux -s iso/siboot.img
> 28) mkdir iso/siboot_mount
> 29) mount -t msdos -o loop iso/siboot.img iso/siboot_mount/
> 30) cp initrd.img iso/siboot_mount/
> 31) cp -a siboot_mnt/* iso/siboot_mount/
>         Answer "No" to overwriting initrd.img and ldlinux.sys
> 32) If you want to modify the default systemimager message text: 
>         vim iso/siboot_mount/message.txt
> 33) mkdir -p iso/iso_build_dir/boot; umount iso/siboot_mount/
> 34) cp iso/siboot.img iso/iso_build_dir/boot/
> 35) cd iso/iso_build_dir
> 36) mkisofs -b boot/siboot.img -c boot/boot.catalog -o image.iso .
> 37) cd ../../;umount siboot_mnt; umount initrd_mnt; umount /mnt/cdrom
> 38) cd
> 39) umount systemimager/initrd_copy/dev/
> 40) umount systemimager/initrd_copy/new_root/
> 41) umount systemimager/initrd_copy/root/
> 42) burn ISO!
> 
> I hope this saves someone else some hassle one day ;)

here's the patch i committed to the docs.
please feel free to suggest more content - i may be on the borderline
between terse and simple.

Index: faq.sgml
===================================================================
RCS file: /cvsroot/systemimager/systemimager/doc/manual_source/faq.sgml,v
retrieving revision 1.14
diff -u -p -u -r1.14 faq.sgml
--- faq.sgml    20 Aug 2003 16:04:50 -0000      1.14
+++ faq.sgml    30 Sep 2003 06:14:51 -0000
@@ -66,6 +66,55 @@
   <qandaentry>
    <question>
     <para>
+     How do I edit files on the initial ramdisk?
+    </para>
+   </question>
+   <answer>
+    <para>
+     In SystemImager 3.0.x, the initial ramdisk is a cramfs filesystem.
+     The following example shows you how to open it, edit a file, and 
+     create a new ramdisk.  You might want to edit this file if you want
+     to change things in the process prior to the execution of the .master
+     script.
+    </para>
+    <orderedlist>
+     <listitem>
+      <para>gunzip &lt; initrd.img &gt; /tmp/initrd</para>
+     </listitem>
+     <listitem>
+      <para>mkdir /mnt/tmp</para>
+     </listitem>
+     <listitem>
+      <para>mount /tmp/initrd /mnt/tmp -o loop</para>
+     </listitem>
+     <listitem>
+      <para>mkdir /tmp/initrd.new</para>
+     </listitem>
+     <listitem>
+      <para>cp -a /mnt/tmp/* /tmp/initrd.new</para>
+     </listitem>
+     <listitem>
+      <para>umount /mnt/tmp</para>
+     </listitem>
+     <listitem>
+      <para>cd /tmp/initrd.new</para>
+     </listitem>
+     <listitem>
+      <para>make your edits here - vi etc/init.d/rcS, for example</para>
+     </listitem>
+     <listitem>
+      <para>mkcramfs /tmp/initrd.new /tmp/newinitrd</para>
+     </listitem>
+     <listitem>
+      <para>gzip -9 &lt; /tmp/newinitrd &gt; /tmp/initrd.img</para>
+     </listitem>
+    </orderedlist>
+   </answer>
+  </qandaentry>
+     
+  <qandaentry>
+   <question>
+    <para>
      How do I configure my server to net boot ia64 clients?
     </para>
    </question>


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Sisuite-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to