Making BeOS install CDs like Pro Edition

Contributed by: Jess Tipton
This tip is valid for: Both BeOS and Haiku

Create a BeOS Personal Edition CD that˙s as slick as Pro˙s CD

By Jess Tipton

Draft version 1.1 as at August 29, 2002

Edited by Chris ´Technixˇ Simmons. Edited for BeOS Tip Server by Cyan Helkaraxe.

Introduction

This article by Jess Tipton and edited by Chris ´Technixˇ Simmons will guide you through the process of creating a professional installation CD for BeOS R5 Personal Edition. This CD will allow you to install Personal Edition in a similar manner to the commercial Pro Edition, installing onto a real partition, with software, albeit without the extras you get with Pro Edition. You will no longer need to mess around with the Windows-based BeOS Personal Edition installer, the LOADBEOS.COM file, nor the cumbersome DOS -based virtual partition every time you wish to install BeOS.

- Cyan Helkaraxe (Tip Server Editor)

See Also:Create a Free BeOS Install CD


Sections:


Image Preparation

To create the installation disc, you will need to prepare an image file which can be burned to a CD. However, before we start, certain conditions must be met.

If you are going to jam-pack the install with tons of software then you are going to need to make that 500MB ISO image bigger. For this you˙ll need a larger BFS or FAT32 partition. If you don˙t have that then you˙re going to be stuck with the 500MB image.be virtual partition.

Normally this is fine – you just have to remember to delete the swap file that may be hogging up a few hundred megabytes! (See ´Swap Killerˇ)


Get To It!

Now you have the goods. A large (at least a gig for good measure) BFS partition or a FAT32 drive with at least 700MB of free space. Now, this will vary depending on your end decision of what to burn the CD with. If you˙re going to choose NERO (Recommended for burning in Windows) you are going to be limited to an image size of 678MB. Yes, if you˙re using a 700MB CD, you˙re going to lose 20MB to the boot sector. Otherwise you can go for an image size of about 697MB. Most 700MB CDs are only 699MB or some other rather-close-but-not-quite-there number. Now to create your larger BFS ISO image we are going to use "dd". In a Terminal, type or paste the line below, making changes as you need. "698" is the size in megabytes of the ISO the line will create, and the path/filename to be created appears after the ´of=´.

With this in mind, let˙s pretend you˙re running Personal Edition on a 500MB image. You don˙t have 698MB free to make this huge file. This is where the FAT32 drive comes into use (note that we cannot write to NTFS and some Linux file systems, so make sure you attempt this with a file system BeOS has READ/ WRITE access to). Now to alter the line for, say, a FAT32 partition, mount the FAT32 partition and change the "of=" part to reflect the new path. Most Windows 95/98 volumes seem to be left unnamed so I will give you two examples below. Don˙t forget to mount the drive you˙re trying to use… heh

On BFS:

dd if=/dev/zero of=Be.img bs=1024 count=$(expr 698 \* 1024)

On FAT:

dd if/dev/zero of=/Fat32/Be.img bs=1024 count=$(expr 698 \* 1024)

Sometimes, FAT32 drives are left without names, as Windows will just show them as C:\ D:\ and so on. If this is the case, Be will show them as volumes named "no name". If you have no working knowledge of BASH, typing ´no nameˇ into the lines above is going to leave you scratching your head. You need to add a \ then a space to the line for every space in the name, as follows:

Before: no name
After: no\ name

Editor: Putting a backslash immediately before the space is called escaping. When the shell encounters a backslash, it knows to ignore the following character and pass it directly through, rather than interpreting the character itself. Without this, the shell would pick the space up as an indication that you had finished one attribute (at the end of ´noˇ), and had started the next (with the word ´nameˇ). You will also notice that

asterisks (*) are escaped; again, mostly the same reason, since asterisks have a special meaning.

-Cyan (tip server editor)

If your volume does have a name but has spaces it will need to look like this:

dd if=/dev/zero of=/My\ Drive/Be.img bs=1024 count=$(expr 698 \* 1024)

Also, if you˙re making the image somewhere other than the root of the drive, you will need to include the appropriate path on the "of=" section of the line.

dd if=/dev/zero of=/no\ name/Cool\ Stuff/BeOS/Be.img bs=1024 count=$(expr 698 \* 1024)

Now with any luck, when the shell returns things to your control, you˙re going to have a 600MB+ chunk of nothing sitting on your drive. Yep; it˙s just a big waste of nothing right now. So now you need to make it a BFS image. To do this, we are going to need to go to the image in your Terminal. So let˙s set this up for the sake of consistency.

Let˙s pretend we used this for our image:

dd if=/dev/zero of=no\ name/BeOS/Be.img bs=1024 count=$(expr 698 \* 1024)

Now in your Terminal type:

cd /no\ name/BeOS/ (now hit enter)

Now type ls and hit enter again – you should see a file called "Be.img". Now this is pretty easy as you can fall back on the defaults of the next tool and just type:

makebfs Be.img

In a moment you have a 698MB BFS image to hatch your evil plan on!

MUH HAHAHAHA

What if you˙re stuck with a 500MB drive? Well, not to worry – we can do wonders with that 500MB. Now, since you are going to need space that may be taken up by swap file, this can be a tad hairy. There are a few ideas you can call into play here. First off, this might not apply to you, as if you have a decent amount of RAM [Editor: 384 - 512MB RAM usually does it], it may have never made a swap file, stating you didn˙t have enough free space.

If this is the case, you can skip ahead.

Now let˙s say you have installed BeOS to an NTFS partition. You can read but not write to the file system your image is on. One way around this which will work for any read only file system is if you have enough room for a second 500MB image, copy the one you˙re running off while in the OS that can write to the drive. Now there are A LOT of technical things that can come into play here but I˙m going to keep it simple for now. You do not need to boot the other image, so if you have the space to do this trick but only one partition, do this… if your BeOS PE is at c:\BeOS, copy the image.be to your desktop in the OS you˙re using to write to the file system. I˙ll stick to windows stuff for most descriptions but it should be easily understood by anyone coming from Linux as well.

Now you have 2 image.be files — one to run off, and one to make your install. If you do not have the space to do this then you may end up with some tricky stuff going on. (See Swap killer). If you don˙t have the room for the 2 image.be trick, set up your running install how you like, and add what you want to be integrated (and not an option) later. Now when you boot your BeOS PE system, open a Terminal… now cd to your desktop in the other OS. For Windows 98 users I believe this will be something like (we˙ll call the win98 drive win98, but remember your drive˙s name may be different, and you must adapt this to your system):

Windows 9x would be:

cd /win98/windows/desktop

Windows 2000 would be:

cd /win2000/documents\ and\ settings/"your_profile"/desktop

Remember that each space must have a backslash before it, and BASH does not use c: or d: for drive names; instead it uses volume labels (names) to denote each drive.

Now you should be where your image is. Let˙s keep this simple, so on your desktop in BeOS, make a folder called ´mˇ. You can do this a few ways but just right click your desktop and go new->folder then name it. (remember, capitalization matters. Make sure you pay attention to case or you˙re going to get lost fast).

Now back in your Terminal type:

mount Be.img ~/Desktop/m

Now when you click the folder named ´mˇ you will see Tracker open an empty drive with nothing but a home directory in it. Now you will simply want to open up your boot volume and copy your beos, home, develop, preferences, apps from your boot volume to your now empty BFS image. Once the copying is done we can…


Adding Options

Now you want to download all the software you want to add to your install. Sadly, you may not get it all on, so pick the choice stuff and add all the bonus software to another CD. Basically what you want here is extra software that you can add via the installer when you install off the CD. So basics like your dev tools and a few good time killers. Utilities are your best choices. Later you will learn how to organize this stuff, but think of it like this: ´Ok… If I want a fast install I can choose no extras and it will rip along.ˇ ´What if I install to a system with a CD burner? I should have a CD-R tools option and groupˇ Stuff like that. Therefore, you might want to download certain Internet tools, bin tools and stuff in categories… Extra drivers… what if you have 3 or 4 computers? Well, you can create a driver subcategory where you can add special drivers for each system. One of your systems has a Radeon… another a Nvidia card, etc… you can choose your drivers when installing for each hardware config. Some people would rather just add them to the system, so then it˙s ready to adapt to any new hardware you add – that˙s a good idea too. It˙s your CD – organize it how you want! Now I hope that by the time you˙re done reading this bit of thought-provoking info, your downloads are done or you have at least figured out what you are going to add. When that˙s done you˙re going to start the dirty work. Uh and I mean dirty!


Time Killer

Now we are on to the time consuming part. The software you have chosen will probably be in a number of formats – Zips, PKGs and possibly others. For this part you are going to have to understand quite a lot about how this is going to work. The first thing to know is how each piece of software you want to add is installed and configured. I will use a few common pieces of software for example. First let˙s discuss adding BeShare to your CD. BeShare is rather simple – you unzip it, and can put it wherever you want. Now here are some catches that can make this a big deal. First off, you need a brief idea about how the installer will use your additional software, and then it will start to become clear why aspects of your chosen software need to come into play.

It goes much deeper than this, but for now we will simply look at directory order. If you have seen or own a BeOS Pro CD, you will notice a folder called _packages_. This is an ordinary folder but contains some sneaky tricks inside, but as I said we will stick to order for now. For all software you will need a folder called _packages_, and inside that folder for now, one called BeShare. Now don˙t jump ahead! If you put your BeShare files in that folder it˙s not going to work! This folder will become a flag folder… I˙ll explain more later but think of it as basically /boot/.

So what is inside boot on a normal Be system? home - beos - apps - develop - preferences, so that˙s what you need under the BeShare folder. Now, this can become a big project or stay simple. If you just want BeShare it˙s an easy task; also if you want the documentation as well, but you can also take it a step further for organizational purposes. Going simple means that in your BeShare folder, you will have two sub folders – one called apps, and another called home. In the apps folder you will put the BeShare folder containing the application. Note: all you need is the BeShare.x86 or BeShare.ppc, depending on what platform you have. No other folders or files are needed. So now if you have gotten this far you may start to see how this will work.

Also, while this will work once you˙ve added the tricks later, it˙s missing one thing… a shortcut!!! That˙s where the home directory comes in. Make a symlink to the BeShare you chose, and keep it near by. (Note the symlink must be from a BeShare.XXX IN the end install location. So if you need to put your BeShare folder and application in your apps directory for a min do so – make the symlink and now it˙s linked to boot/apps/BeShare/BeShare.x86 or ppc. Failure to do this will result in a broken symlink when installed) Now in the home directory you created in _packages_/BeShare/ home add a folder called config and in that, another called be. Then in that create yet another folder called Applications – now put your BeShare symlink in that folder. Now when you install BeShare via the installer it will also add the handy dandy symlink to your applications menu.

Now if you organize your Be menu into sub categories like net tools, applications, music, etc, then make sure you take that into account adding the necessary sub directories ( _packages_/BeShare/home/config/be/netStuff/symlink ). By now, I hope you see how you must set up each piece of software. Now, there are a few other things to take into account. BeShare is easy, but it can go much deeper and take a lot of time. Let˙s say you now want to add the documentation from BeShare to your BeOS documentation folder. You will now have to add more to your BeShare set up sub directories that will end up looking like this…

_packages_/BeShare/beos/documentation/BeShare

Now the BeShare folder at the end of that will have all the documents for BeShare in it. So now with this in mind you have to also take into account custom settings you want added on install or possibly a PKG file installs a host of libraries to you lib and bin directories. You would have to extract all these files and move them to _packages_/NewApp/ home/config/bin/, or, if you need custom settings on install – let˙s say your dead set on your BeShare nickname and want all your BeShare settings intact on every install – you would have to add this to your BeShare folder: _packages_/BeShare/home/config/settings/ beshare_settings & _packages_/BeShare/home/config/settings/beshare_user_key

Now if you have added the documents, this means you now have _packages_/BeShare, and in this top BeShare directory you now have sub folders called "home" "apps" and "beos". The apps folder will have the BeShare folder housing the application. The home directory will have the config/settings/ and the /be/symlink while the beos folder will have the /documentation/BeShare

This can become A LOT of work for each application and takes a lot of time to make sure you have all the libraries and files each app needs to run correctly.


Tips & Tricks

Now on to how it works…

The installer uses attributes to group the software in the _packages_ folder. Normally you could use Quickres to edit this, but it has a tad of a disliking for working on directories… Cometh The Tricks…

Since Quickres won˙t let you work on the directories, you must work around this. As I mentioned before, the BeShare folder in _packages_ will become a ´Flagˇ folder. So remember EVERY folder below _packages_ are flag folders. They are looked at by the installer as /boot/ and will have special attributes. Now how do you work around this you say? Open Quickres ( If you have the dev tools installed you have quickres already in /boot/develop/tools/ experimental/Quickres or you can download it at:

http://www.bebits.com/app/1504 ) and just go save it to your desktop – it will be a blank file – call it "template". Now, while still in Quickres, you will need to add new attributes to it. It should look like this:

type id

name

data

bool attr INSTALLER PACKAGE: ON_BY_DEFAULT false or true
bool attr INSTALLER PACKAGE: ALWAYS_ON false or true
cstr attr INSTALLER PACKAGE: DESCRIPTION What this does
cstr attr INSTALLER PACKAGE: NAME ex. BeShare
cstr attr INSTALLER PACKAGE: GROUP ex. Net Tools
long attr wrap 1
long attr be:encoding 65535
long attr alignment 0
long attr _trk/windwkspc 2
mims attr BEOS:TYPE application/x-vnd.Be-directory
offt attr INSTALLER PACKAGE: SIZE size in bytes
rawt attr styles
rawt attr _trk/xtpinfo_le
rawt attr _trk/pinfo_le
rawt attr _trk/columns_le
rawt attr _trk/viewstate_le
rect attr _trk/windframe (107,44)-(567,235)

Now some of those are just for a normal folder, but best to have them all. Most fields are self explanatory and if you don˙t know what it is don˙t mess with it, because it˙s not too important. The INSTALLER entries are the important guys. The on_by_default means it is pre-selected as a default package to install – always_on means you can˙t un-select it… It˙s pretty obvious, and be sure to make groups. One thing to mention is that Quickres is experimental and does not always co- operate. You will find most fields edit okay, but others, when you double click them, will open the dialog box, and after you have entered the data you wish to change and hit enter, it simply reverts. For those fields you must click on it twice and rest your mouse over the field like you would waiting for bubble help.

After a second or so it will become editable in the window and not in a pop-up dialog box. Once you have made this template you will want to do a copyattr in your Terminal. So now lets say you are adding Mozilla, BeShare, and CL-Amp to your install. In template you would change the attributes in template to reflect Mozilla˙s size, description, and other things noted, and if you want it selected by default and it˙s group. When you˙re done in your Terminal, you would type: copyattr template ~/Desktop/ _packages_/Mozilla (Note if you have closed your Terminal you will need to cd back to the directories you are working in) Now the Mozilla folder has all the attributes the Installer needs to display it as a software option at install. Now repeat this for BeShare and then CL-Amp.


Testing

Now hoping that you have made it this far and assembled many things for your install, move the _packages_ from where you where working on it to the root of the image or drive. So the root of your ISO should be _packages_ - beos - apps - home - develop - preferences. Once the move is done, run the installer on the volume you are turning into the install, and see what it lists for options, making sure the sizes, names and descriptions are correct. If all seems satisfactory, burn it. If you have lots of drive space and a few extra partitions, you may just want to install it to another partition from the created install to test it, and make sure all programs work and all links are correct… There is a lot of logic, in depth consideration and foresight needed when doing these setups, and you may find you end up with a few mistakes. At worst you will end up with a few coasters unless you really screwed up.

Editor: It is probably a very wise idea to perform your first burn on a CD-RW, since with so many steps to perform, you want to make absolutely certain that you haven˙t made any mistakes or skipped any important steps, rather than chew up expensive write-once disks. According to Murphy˙s law, burning the same ISO to a CD-RW will guarantee it working first time, but burning only to a CD-R will guarantee several coasters, a head crash, and loss of life! -Cyan


Burning

Alright; the time has come to make this thing a reality. I˙ll cover the windows method for now and possibly add to this tutorial later. I would hope that you have added the IDE replacement drivers as a SYSTEM replacement, and you have downloaded the boot image for it. (

http://www.bebits.com/bob/11639/IDE_boot_image_v0.5.zip )

Now in NERO, create a new bootable CD and select the floppy.img you just downloaded. If you haven˙t installed the updated IDE drivers, then you will want to use the floppy.img in your BeOS PE folder for your boot image. Once you have selected your boot image, burn the CD but DO NOT FINALIZE IT! Once the boot image is done being burned, from the NERO menus select file->burn an ISO. Now navigate to your BeOS directory and the image you set up to burn. We called it Be.img in most of the examples above, but you may have called it something else. Now, once you have selected your image as the ISO to burn, make sure you˙re using a block size of 1024 and this time finalize the CD… Enjoy

- Jess Tipton


SWAP KILLER

If you˙re stuck on the 500MB partition and have little RAM, BeOS will have created a swap file. This will steal much-needed space. In this event you can try a risky attempt and disable your swap and regain the space to work with. While I encourage removing the swap file, it˙s risky unless you have a decent amount of ram, and if BeOS has made a swap on the 500MB partition you˙re not really running with enough ram to qualify.

Editor: If your 500MB Personal Edition partition is relatively fresh and empty, it is still possible that you can have a swap file on a machine with buckets of RAM — 256MB or more. It is possible to run BeOS R5 without a swap on a 64MB machine, but don˙t expect it to last long when the system caches grow! 128MB is a bit more realistic; with 192MB RAM or more, you should be okay. Warning: your mileage may vary. The ´locking upˇ you might experience is very sudden and can cause immense trouble. – Cyan

The end result is that the system will lock up when you run out of ram, and that will hinder your success. I suggest installing ProcessController ( http://www.bebits.com/app/313 ) and watch your ram usage to be safe. To disable the swap you will want to first open your VirtualMemory preferences panel. That is all now close it – opening it creates the file you need if you have never opened it before. Now in / boot/home/config/settings/kernel/drivers/ you have a file called virtual_memory. Open it & change the line ´vm onˇ to ´vm offˇ save and exit (You do not have to change the size. Now open StyledEdit & for good measure save a text file named ´stop_swap_naggingˇ to your /boot/home/config/ settings directory – type anything you want in the text file as long as its named ´stop_swap_naggingˇ. Now reboot and when you have booted again open a terminal and type:

 rm /var/swap 

Watch that ram usage and move on… do one thing at a time to not overwhelm your RAM resources. Just changing a wallpaper with 64MB of RAM and no swap will take your system down, so move slow.

Editor: Some users have had trouble disabling Virtual Memory the conventional (editing the file) way, although it works on R4.5. It is very possible that the technique described here will work for you. However, if it doesn˙t work on your installation, the only other way to disable swap is to fill your disk — this is even more risky. At a Terminal, type:

cat /dev/zero > /boot/home/filler

Before you know it, your disk will be full, and it will exit with ´no space left on deviceˇ At this point, leave the machine a few seconds, and forcefully power-cycle the machine. Upon rebooting, you˙ll have one of two situations:

If your situation is serious (outcome 1), then all I can say is: I hope you keep weekly backups! You might also need to budget for a new hard drive if it doesn˙t autopark properly.

-Cyan


Final notice: Like all tip server submissions, this article has been edited and re-worded for consistency with other tip server articles. In the unlikely event of an error being introduced by this process, please get in touch with Cyan at cyan@bemail.org

No tip server submissions are guaranteed to be error-free, and are to be followed at your own risk.

Material on the tip server is usually gained from user submissions. If your material has been published on the tip server against your wishes, you are encouraged to get in touch with the tip server editor as soon as possible.