NST v2.x Guidelines
Overview
While looking at the effort involved in moving NST to Fedora 10, we decided that we wanted to spend less time and effort on package maintenance and focus more on WUI development. To accomplish this, we will migrate away from our custom ISO script building techniques (that we started back in 2003) and move to the livecd-creator mechanism that has become a part of the standard Fedora distribution.
Good Things
- Users will have access to yum package manager and the ability to enhance (or trash) their NST systems to their hearts content.
- Using livecd-creator will keep us Fedora compatible.
- Hard drive installation will be through standard Fedora tool.
- Migration to the next release of Fedora should be much less painful.
- Much less effort required on our parts for installing the numerous Fedora packages we depend on.
- Potential for creating our own yum repository (allowing one to update their NST system using a standard yum update invocation).
Bad Things
- ISO will not fit on CD (will require DVD).
- Build times may be slower and it may be difficult to test individual package installations without doing a full build.
General Build Guidelines
The building of the NST ISO image will then involve the following steps:
- The building of a local yum repository for packages which we want to continue building ourselves (or are not found in the Fedora repositories). This will be located under the top level yum directory.
- The building of the ISO using the standard livecd-creator package. This will involve many custom scripts for "tweaking" the default ISO image created. This will be located under the top level livecd directory.
Local Yum Repository
Building
Initial Build
To build the NST Yum repository on a development machine (from scratch):
- Checkout the NST source tree.
- Run the top level ./configure script.
- Change to the yum directory.
- Run the ./configure script.
- Run: make help | less to review what you can build.
- Run: yum install $(make build-requires) to make sure your development system has the necessary packages for building the yum repository.
- Run make all to build the repository (the files will appear under the repo sub directory).
The command sequence looks something like the following:
nstcvs co -d nst . cd nst ./configure cd yum ./configure make all
NOTE: If the configure stage determines that your system is missing some packages, it should report what packages you need to install.
Subsequent Builds
After the initial build, you can use the following to update:
./configure make all
IMPORTANT: The make dependencies will only rebuild if the associated pkginfo.xml file is modified. This means if you modify source code for the NST WUI, a make all under the yum area will NOT detect the change and may not rebuild the package. To force the building of a package, include NAME-remove on the command line. For example, to force the building of the nstwui and nst-icons packages, use the following:
make nstwui-remove nst-icons-remove all
Rebuilding Repository
If you want to rebuild your entire repository, remove the repo sub directory and then build:
rm -fr repo make all
Rebuilding Everything
If you want to re-download all of the source and rebuild your entire repository:
make nuke make all
Single Build
Once the yum area is configured, you can force the building of a single package. For example, if you want to force the build of the nst-config package, run:
make nst-config-remove nst-config
Test Build
If you have a running instance of a NST system, you can force the building of a package and install it on the remote NST system. For example, to force the building of the nst-config and do a test installation on the NST at 192.168.100.10, run:
make HOST=192.168.100.10 nst-config-remove nst-config-probe-install
ISO
Normal Build
You need to be in the livecd sub-directory in order to build the ISO image.
cd livecd
Make sure you build your yum repository first (if you haven't done so yet):
make -C ../yum all
To build the ISO image:
./configure make iso
For more possibilities use the help target:
make help | less
Clean Build
For a clean build:
make clean ./configure make iso
Live USB Build
You can use the "liveusb USBDEV=USB_DEV" target to install the NST ISO image onto a USB flash drive (these drives are also known as: memory sticks and thumb drives). This will take a considerable amount of space on your thumb drive (plan on 3.5GB).
Before attempting this, you should review the How to create and use Live USB page at the Fedora Wiki. This page offers some useful troubleshooting tips as well. However, when reading through the How to reformat flash drive section, I found that I needed to use "-F 32" instead of "-F 16" when invoking the mkdosfs command on my 8GB memory stick.
The following demonstrates the make invocation to install the NST onto a USB flash drive. In this example invocation, I plugged in my flash drive and determined (through fdisk -l) that my flash drive partition was /dev/sdb1. Do not assume that your system will have the same device mapping if you specify a disk partition other than your USB flash drive, YOU WILL LIKELY DESTROY THE DATA ON THAT PARTITION!
make liveusb USBDEV=/dev/sdb1
NOTE: This command can only be used after the NST ISO image has already been created.
NOTE: The flash drive should not be mounted (or at least it does not need to be mounted) when invoking this make target.
You may specify a persistent overlay value using: OVERLAY=SIZE_IN_MB. This persistent overlay is used between reboots to persist changes you may make to your system. If omitted, this value defaults to 512. You can specify a value up to 2048. The following example demonstrates a invocation setting up a 1024 MB overlay:
make liveusb USBDEV=/dev/sdb1 OVERLAY=1024
RPM Tips
RPM Reference Documentation
- Maximum RPM - This is a good document to refer to in regards to RPMs.
Tips on RPM "%macros"
To find the secret "%macros", try commands like:
rpmbuild --showrc | grep _ln rpmbuild --showrc | grep share
The Available RPM "Groups"
The Group: line in a spec file should be set to one of the group names allowed by Fedora. Refer to the file: "/usr/share/doc/rpm-4.6.0/GROUPS" on your development system to see what group names are available.
Downloading/Installing Source For A Fedora Package
You can use the yumdownloader and rpm commands to download (and install) the source code for most packages which can be yum installed. For example, the following demonstrates how to get the source code for the vnc-server package:
yumdownloader --source vnc-server rpm -ivh vnc-4.1.3-1.fc10.src.rpm ls ~/rpmbuild/SPECS ~/rpmbuild/SOURCES