Guide to Hacking the OSD: The First Compile

From The Neuros Technology Wiki

Jump to: navigation, search
Previous Chapter Table of Contents Next Chapter

Contents

[edit] The First Compile

[edit] Obtaining the Source Code

The source for everything running on the OSD is in the SVN repository in the Neuros SVN repository. However don't run to do an svn checkout just yet: it will take ages and bring great strain kill the Neuros servers, since it's really a lot of data.

Here's the suggested procedure to get your sources more efficiently:

  • First off, download the most recent tarball of all the source that's in SVN. You can always find it in the tarball area. It's provided in two archive formats, choose the one that you prefer. (NOTE: we'll probably mirror that at sourceforge.net soon)
  • Once the download is done, unpack it to one directory of your choice. The unpacking takes ages, but eventually it will finish. Now you understand why it wasn't wise to checkout from SVN directly.
  • Enter into it that directory and then enter into the neuros-osd directory that you will find there. This will be the root of all your following operations.

From now on, you don't need to download that tarball ever again. Further updates to the source you can do with the normal SVN client, since all the directories inside the neuros-osd directory of the unpacked have SVN information in them.

These tarballs come always from an SVN tag (that is, a snapshot of an official release of the code, usually pretty stable). Some tags are for official releases, some are just for internal interim releases. There are many tags in our repository, made pretty often. You can see all their names on this page.

And, besides the tags, there's also Trunk. Trunk is the cutting edge and unstable version of the code, the place where all new commits end up. Trunk is often broken, and it won't build or won't work sometimes.

You can always switch all your code to any of the tags or to trunk, whenever you want, with this command, issued from inside neuros-osd:

 for d in $(ls) ; do svn switch svn://svn.neurostechnology.com/svn/$d/NAME $d ; done

You should replace NAME with either "trunk" or "tags/TAGNAME" with TAGNAME being any of the tag names in the page linked above (e.g. "OSD_VER_3.18-0.13_060919"). You can move to any tag or to trunk or any other way around whenever you want. Also, if the hostname svn.neurostechnology.com is not working you can substitute svn.neurosaudio.com.

Finally, only if you're on trunk and want to update to get new commits that happened since last time, you can issue this command, from inside neuros-osd:

 for d in $(ls) ; do svn up $d ; done

Note that this makes sense only for trunk, because tags are snapshots and thus are fixed in time and don't ever receive updates.

So, choose the set of sources that makes more sense to you, and go on with the rest of the guide, always keeping the neuros-osd directory as the root for everything, unless otherwise specified.


[edit] Building the Code

Make sure you have dialog, ncurses, and mkcramfs installed. Arizona also requires debian's zlib1g-dev package.

Also note that these scripts require /bin/sh to be bash or linked to bash (this is not the default in some distros, for example newer Ubuntu, so please check).

Now all you need do to to build everything from scratch is:

 cd neuros-bsp
 ./build-helper.sh all

You will be asked for your sudo password (if you have not already entered it recently), and then you will need to answer "Yes" when asked if you want to run configuration for the Linux kernel on a blue screen.

The then be prepared to watch a good time while the build rolls.


Link here to help when the build fails, forums/IRC channel

[edit] Installing the Kernel for NetBooting

This one is fairly easy.

cd /srv/tftp
mkdir -p images
ln -s /PATH/TO/neuros-osd/neuros-bsp/images/uImage images/uImage

That's it. Make sure that the uImage file is readable by your TFTP server.

Alternatively, you can also copy instead of just symlink the uImage. This is easier to bypass permissions and other issues, but on the other hand needs to be done again at each rebuild of the kernel. I suggest putting it in a script togheter with the step below.

cp /PATH/TO/neuros-osd/neuros-bsp/images/uImage /srv/tftp/images

[edit] Installing the Root Filesystem for NetBooting

Installing the rootfs for the first time involves some messing about since you need to copy the /dev nodes that require some special permissions or nothing will work and your OSD boot will fail. We use tar for that. We need to do this everytime we change our rootfs, that is everytime we rebuild anything.

 cd /PATH/TO/neuros-osd/neuros-bsp/rootfs/fs
 tar --exclude '*/.svn*' -czf ../rootfs.tgz .
 mv ../rootfs.tgz /srv/neuros-osd-rootfs
 cd /srv/neuros-osd-rootfs
 sudo tar xzf rootfs.tgz
 rm rootfs.tgz
 

Notice that you need to be root when you extract the rootfs archive, so that created permissions are correct. If you don't like sudo, become root there in your preferred way.

(Note: Optional step, you can skip this) You can do the thing above everytime (possibly in a script so you don't wear off your fingers). Or you can use a little trick with rsync if you want to update only the changed files, once the /dev nodes are in place the first time.

 rsync --verbose --archive --delete --exclude "/dev/" --exclude "/mnt/" --exclude ".svn/" /PATH/TO/neuros-osd/neuros-bsp/rootfs/fs /srv/neuros/fs

This works for me, but your experience may differ, but it's optional anyway.

Previous Chapter Table of Contents Next Chapter
Personal tools