====== LVIS-F Live ISO ======
LVISF Resurrection of LVIS-GH!
Building the LVIS data system from CD / ISO. We are going to create our own "LIVE" ISO that will boot and operate the data system from a read only media. Power can be removed without harming the operating system install. We need to move this ISO to the USB or some other device once this is operational.
===== Required Items =====
* external CD ROM drive attached to USB3 on computer directly
* fresh blank SSD drive (using CFAST 64 GB drive for OS)
* 10.04 LTS Server Ubuntu install CD
* CP932 Kontron ethernet card with ethernet cable plugged into Ethernet 4 (Gig. Ethernet)
===== Core Install Setup =====
- Configure the embedded computer for system build
- Attach the following devices:
* USB keyboard to either of the front USB2 ports of the SBC
* USB mouse or trackball to either of the front USB2 ports of the SBC
* External CDROM attached to the front USB3 port of the SBC
- Boot the SBC (it came up on the CDROM with no intervention from me)
===== Ubuntu Core Install =====
The SBC will now begin the install process, and you can use the console/screen to finish the installation
- Choose a language: English
- Choose a country: United States
- Detect keyboard layout: No
- Origin of keyboard: USA
- Keyboard layout: USA
- CDROM will scan
- DHCP works with **gs694-lvisdev.gsfc.nasa.gov** as the host for the lab
- Hostname: lvisf
- Is your timezone correct? No, set to UTC (bottom of the list)
- Domain name: (press enter)
- Setting up the clock: will not work, as NTP is disabled (need to use local timehost.gsfc.nasa.gov) so CANCEL
- Select your time zone: Select from a worldwide list, page to the bottom, select UTC
- Partitioning method: Guided, Full Disk
Use the entire disk
- Write changes to the disks? YES
- RAID beeped at me two sets of three beeps
- Full name for new user: lvis
- Username for your account: lvis
- Choose a password for the new user:
- Encrypt your home directory: No
- HTTP proxy information: (non needed)
- How do you want to manage upgrades on this system? No automatic updates
- Choose software to install:
- OpenSSH server
- Samba file server
- Install the GRUB boot loader to the master boot record? Yes
- Installation is complete: Continue
- System will reboot and return to normal ubuntu server
===== Clean Up and Update =====
* Add the following lines to **/etc/apt/sources.list**
* Edit the file
sudo nano sources.list
* Add these lines to enable the old repository (no longer updated!)
## EOL upgrade sources.list
# Required
deb http://old-releases.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
* Update the system
sudo apt-get update
sudo apt-get upgrade
sudo reboot ; exit
* Modify **/etc/default/grub** so we have serial messages to the console
sudo nano /etc/default/grub
* Not going to mess with this right now (it is down below)
===== Grab Ethernet Driver =====
- Get **wget**
sudo apt-get install wget -y
- Grab the ethernet driver while you still have access
- Start here to check if there are newer versions: [[http://www.intel.com/content/www/us/en/support/network-and-i-o/ethernet-products/000005767.html]]
- Current driver is here: [[https://downloadmirror.intel.com/13663/eng/igb-5.3.5.3.tar.gz]]
mkdir ~/download
cd ~/download
wget https://downloadmirror.intel.com/13663/eng/igb-5.3.5.3.tar.gz
===== Configure =====
**LINK:** [[https://wiki.ubuntu.com/KernelTeam/GitKernelBuild]] <- Good building from GIT help!
NOTE: This should be in the lvis2 **cfg** and put in the repository and added to the "INSTALL" script assuming it works properly
- Installed required packages
sudo apt-get install build-essential \
git-core \
jed \
kernel-package \
libncurses5-dev \
md5deep \
screen \
subversion
- Make work environment
mkdir /home/lvis/src
mkdir /home/lvis/work
- Check out lvisgh source:
cd ~/work
svn co svn+ssh://lvis@gs694-lvisdev.gsfc.nasa.gov/srv/svn/lvis2
svn co svn+ssh://lvis@gs694-lvisdev.gsfc.nasa.gov/srv/svn/sigma
- Older Sources (for historical archive)
cd ~/work
# old repository
# svn co svn+ssh://lvis@dev01.sigmaspace.com/srv/svn/lvis2
# svn co svn+ssh://lvis@dev01.sigmaspace.com/srv/svn/lvis2tarballs
# svn co svn+ssh://lvis@dev01.sigmaspace.com/srv/svn/sigma
# repository restored from June 2013 code
svn co svn+ssh://david.rabine@gs694-lvisdev.gsfc.nasa.gov/srv/svn/lvis2
svn co svn+ssh://david.rabine@gs694-lvisdev.gsfc.nasa.gov/srv/svn/sigma
# currently
# COPY from the laptop's directory
# rsync -vaP /home/lvis/src/lvis2/ lvis@10.4.1.122:/home/lvis/work/lvis2/
# rsync -vaP /home/lvis/src/sigma/ lvis@10.4.1.122:/home/lvis/work/sigma/
# 2016.08.19 lvisf rebuild effort
rsync -vaP lvis@10.4.1.154:/home/lvis/src/lvis2/ /home/lvis/work/lvis2/
rsync -vaP lvis@10.4.1.154:/home/lvis/src/sigma/ /home/lvis/work/sigma/
# symlink into our src directory
ln -s /home/lvis/work/lvis2 /home/lvis/src/
ln -s /home/lvis/work/sigma /home/lvis/src/
- Check out lvisf source:
cd /home/lvis/src
svn co https://svn.yancich.com:8443/svn/NASA/LVIS/trunk lvisf_repo
ln -s lvisf_repo/* .
Moved this operation into the user home directory, no need to run this all as root.
For the live version, we need **aufs** and that required me to obtain the kernel source from a **git** repository and then add **aufs** into it.
- Grab the xenomai we want to use
mkdir ~/download
cd ~/download
wget https://xenomai.org/downloads/xenomai/stable/xenomai-2.6.5.tar.bz2
- Unpack xenomai and see what kernel we can use
cd ~/src
tar jxvf ~/download/xenomai-2.6.5.tar.bz2
ls -l xenomai-2.6.5/ksrc/arch/x86/patches/
# -rw-r--r-- 1 lvis lvis 420990 2016-07-09 06:49 ipipe-core-3.10.32-x86-9.patch
# -rw-r--r-- 1 lvis lvis 440553 2016-07-09 06:49 ipipe-core-3.14.44-x86-12.patch
# -rw-r--r-- 1 lvis lvis 439614 2016-07-09 06:49 ipipe-core-3.18.20-x86-7.patch
- Grab the latest kernel off this list
cd ~/download
wget https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.18.20.tar.gz
- Uncompress kernel source and rename it
cd ~/src
tar zxf ~/download/linux-3.18.20.tar.gz
mv linux-3.18.20 linux-3.18.20-ipipe
- Patch the kernel
cd ~/src/xenomai-2.6.5
./scripts/prepare-kernel.sh --linux=~/src/linux-3.18.20-ipipe
- Make configuration (use the saved one, but here I am editing it by hand) Help here -> [[http://xenomai.org/2014/06/configuring-for-x86-based-dual-kernels/]]
* Real-time sub-system --->
* Interfaces --->
* <*> Native API --->
* [*] Interrupts (CONFIG_XENO_OPT_NATIVE_INTR=y)
* Processor type and features --->
* [ ] Allow for memory compaction OFF (# CONFIG_COMPACTION is not set)
* [ ] Page migration OFF (# CONFIG_MIGRATION is not set)
* Processor family (Core 2/newer Xeon)
* Power management and ACPI options --->
* [ ] Suspend to RAM and standby (# CONFIG_SUSPEND is not set)
* [ ] Hibernation (aka 'suspend to disk') (# CONFIG_HIBERNATION is not set)
* [*] ACPI (Advanced Configuration and Power Interface) Support --->
* < > Processor (# CONFIG_ACPI_PROCESSOR is not set)
* CPU Frequency scaling --->
* [ ] CPU Frequency scaling (# CONFIG_CPU_FREQ is not set)
* CPU Idle --->
* [ ] CPU idle PM support (# CONFIG_CPU_IDLE is not set)
* Memory power savings --->
* < > Intel chipset idle memory power saving driver (# CONFIG_I7300_IDLE is not set)
* Device Drivers --->
* Network device support --->
* Ethernet driver support --->
* <*> Intel(R) PRO/1000 Gigabit Ethernet support (CONFIG_E1000=y)
* <*> Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support (CONFIG_IGB=y)
* USB support --->
* <*> xHCI HCD (USB 3.0) support (enable in kernel USB3) (CONFIG_USB_XHCI_HCD=y)
- Unpack our preserved old GIT based AUFS enabled kernel
cd /home/lvis/src
tar -zxvf ~/src/lvis2_extras/linux-2.6.38-git-xenomai-2.6.0.tar.gz
- Unpack the the Xenomai tarball in **/home/lvis/src/**: (or your directory of choice)
cd ~/src
tar xvfj ~/src/lvis2_extras/xenomai-2.6.0.tar.bz2
- Ensure a clean build
# the time needs to be correct before this works properly with a rsync of the pristine checkout
sudo ntpdate timehost.gsfc.nasa.gov
cd ~/src/linux-3.18.20-ipipe
make-kpkg clean
- Fix a bug in the local version code
sed -rie 's/echo "\+"/#echo "\+"/' scripts/setlocalversion
- **[EXPERIMENTAL!]** Change the kernel options based on this page: [[https://xenomai.org//2014/06/configuring-for-x86-based-dual-kernels/]]
- **[CHANGE]** Commented out MSI interrupt attempt in xhci.c driver (under the run function)
- **[CHANGE]** Added USB3 support under Device Drivers -> USB support -> xHCI HCD (USB 3.0) support (tried putting into kernel directly)
- **[CHANGE]** Made max cpu cores 4 (only 2 actual cores in a single cpu... two is fine)
- Build the kernel package (a source send set number of cores + 1 for concurrency level)
CONCURRENCY_LEVEL=`getconf _NPROCESSORS_ONLN` CLEAN_SOURCE=no fakeroot make-kpkg --initrd --append-to-version -ipipe --revision `date +%Y.%m.%d`.lvisgh kernel_image kernel_headers
- Install the packages
cd ~/src
sudo dpkg -i linux-headers-3.18.20-ipipe_`date +%Y.%m.%d`.lvisgh_amd64.deb
sudo dpkg -i linux-image-3.18.20-ipipe_`date +%Y.%m.%d`.lvisgh_amd64.deb
### NOTE ###
# if that doesn't work, just do:
sudo dpkg -i linux-headers-*.deb
sudo dpkg -i linux-image-*.deb
###### NOTE 2 ######
# if you want to remove, boot into another kernel first, then
# you may need to comment out in /etc/default/grub # GRUB_HIDDEN_TIMEOUT=0
# and then sudo update-grub
sudo apt-get purge linux-headers-2.6.38-git-xenomai-2.6.0
sudo apt-get purge linux-image-2.6.38-git-xenomai-2.6.0
sudo rm -rf /lib/modules/2.6.38-git-xenomai-2.6.0
- Update initramfs
sudo update-initramfs -c -k 3.18.20-ipipe
- Update GRUB2
sudo update-grub2
- Reboot the machine
sudo reboot
- Build Xenomai
cd ~/src/xenomai-2.6.0
./configure --enable-smp
make
sudo make install
Clear off the original generic kernel to save disk space
- Link where I found this information: [[http://tuxtweaks.com/2010/10/remove-old-kernels-in-ubuntu-with-one-command/]]
- Dry run (what will be removed)
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get --dry-run remove
- Actually removing the old kernels
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge
===== Required Software =====
==== gtest ====
- Uncompress the gtest library
cd ~/src
tar -jxvf ~/src/lvis2_extras/gtest-1.5.0.tar.bz2
- Symlink to the top directory
cd ~/
ln -s src/gtest-1.5.0
- Compile and install
cd ~/gtest-1.5.0
./configure
make
sudo make install
sudo ldconfig
===== Drivers =====
==== 16aio ====
- Compile the driver
cd /home/lvis/work/lvis2/trunk/src/lib/16aio
./make_all clean
./make_all
===== Optional Configuration =====
- Set up the kernel to display on the console on boot by editing **/etc/default/grub**
sudo nano /etc/default/grub
* Change this line
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
* To
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8 splash textonly"
* Then run
sudo update-grub2
- Network configuration
sudo nano /etc/network/interfaces
* And replace it all with the following:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# A network interface
auto eth0
iface eth0 inet static
address 10.2.1.42
netmask 255.255.255.0
# A network interface
auto eth1
iface eth1 inet static
address 10.3.1.42
netmask 255.255.255.0
# The primary network interface
auto eth2
iface eth2 inet static
address 10.4.1.42
netmask 255.255.255.0
network 10.4.1.0
broadcast 10.4.1.255
gateway 10.4.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8
auto eth2:1
iface eth2:1 inet static
address 129.100.0.42
netmask 255.255.0.0
- Use this for network code here at GSFC
# A network interface
auto eth0
iface eth0 inet static
address 10.4.1.2
netmask 255.255.255.0
network 10.4.1.0
broadcast 10.4.1.255
gateway 10.4.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 128.183.10.134 128.183.50.17 8.8.8.8
- Configure the system to ignore file system errors of blocks being in the future:
* Link from whence this came: [[http://forums.debian.net/viewtopic.php?f=10&t=45797]]
* Modify **/etc/e2fsck.conf** and add these lines: (should reboot and then be happy)
[problems]
# Superblock last mount time is in the future (PR_0_FUTURE_SB_LAST_MOUNT).
0x000031 = {
preen_ok = true
preen_nomessage = true
}
# Superblock last write time is in the future (PR_0_FUTURE_SB_LAST_WRITE).
0x000032 = {
preen_ok = true
preen_nomessage = true
}
* Samba file sharing (FIXME this needs to be added to the repository if you're going to stick with it)
- Save the original configuration file
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.default
- Modify your **/etc/samba/smb.conf** to contain
[global]
workgroup = MSHOME
server string = %h server (Samba, Copied from Mythbuntu)
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
dns proxy = no
security = share
[raid]
comment = RAID Share
path = /opt/data/raid
public = yes
writable = no
create mask = 0440
directory mask = 0550
force user = 999
force group = 999
- Restart the service
sudo service smbd restart
===== LVIS Software =====
==== Sigma Repository ====
- Compile the libraries
cd ~/work/sigma/trunk/
make
==== LVIS2 Repository ====
I think there is a header dependency that requires you to do this a second time.
- Compile the libraries
cd ~/work/lvis2/trunk/
make
make
- Install the system
# the make directory in the install script doesn't look to work
sudo rm /opt/lvis2
sudo mkdir /opt/lvis2
cd ~/work/lvis2/trunk/
sudo ./scripts/INSTALL
==== LVISF Configuration ====
- Edit the file
sudo nano /etc/ld.so.conf.d/lvisf.conf
- Add these lines
/usr/xenomai/lib
/home/lvis/work/lvis2/trunk/lib/
/home/lvis/work/sigma/trunk/lib/
/home/lvis/src/spectrum/shared/linux/pc64/lib
/home/lvis/src/MIC3753/linux_driver_source_3.2.7.0_64bit/libs
- Reload the library path
sudo ldconfig
===== Customize Ubuntu Live CD/USB =====
This is the source for all of this. Minor tweaks made, but the bulk comes from here: (how to make a live ISO of your current running system)
* I found the links below looking in the comments on this main [[https://help.ubuntu.com/community/LiveCDCustomization|Ubuntu Live CD Customization page]]
* [[http://ubuntuforums.org/showthread.php?t=688872]]
* Same information in the official wiki -> [[https://help.ubuntu.com/community/MakeALiveCD/DVD/BootableFlashFromHarddiskInstall]]
- Prepare the environment (NOTE: DO NOT use ~/ since sudo will be /root/ not /home/lvis )
- Create some directories
mkdir /home/lvis/iso/
mkdir /home/lvis/iso/tmp
mkdir /home/lvis/iso/tmp/cd
mkdir /home/lvis/iso/tmp/worktemp
- Set some variables
export WORK=/home/lvis/iso/tmp/worktemp
export CD=/home/lvis/iso/tmp/cd
export FORMAT=squashfs
export FS_DIR=casper
- Create the CD and the WORK directory structure:
sudo mkdir -p ${CD}/{${FS_DIR},boot/grub} ${WORK}/rootfs
- Install some packages on your current system:
sudo apt-get update
sudo apt-get install grub2 xorriso squashfs-tools
- **OPTIONAL!** Is your work directory up to date?! SVN check out, compile and install the latest code
cd ~/work/lvis2
svn up
cd ~/work/lvis2/trunk
make clean
make
make
sudo ./scripts/UNINSTALL
sudo ./scripts/INSTALL
- Make repository directories available in **/opt/lvis2/src**
sudo mkdir /opt/lvis2/src/
cd /opt/lvis2/src/
sudo svn co svn+ssh://lvis@gs694-lvisdev.gsfc.nasa.gov/srv/svn/lvis2
sudo svn co svn+ssh://lvis@gs694-lvisdev.gsfc.nasa.gov/srv/svn/sigma
cd
- Copy your installation into the new filesystem.
sudo rsync -av --one-file-system --exclude=/proc/* --exclude=/dev/* \
--exclude=/sys/* --exclude=/tmp/* --exclude=/home/* --exclude=/lost+found \
--exclude=/var/tmp/* --exclude=/boot/grub/* --exclude=/root/* \
--exclude=/var/mail/* --exclude=/var/spool/* --exclude=/media/* \
--exclude=/etc/fstab --exclude=/etc/mtab --exclude=/etc/hosts \
--exclude=/etc/timezone --exclude=/etc/shadow* --exclude=/etc/gshadow* \
--exclude=/etc/X11/xorg.conf* --exclude=/etc/gdm/custom.conf \
--exclude=/etc/lightdm/lightdm.conf --exclude=${WORK}/rootfs / ${WORK}/rootfs
- Chroot into the new system and modify it:
- Chroot into the copied system after mounting proc and dev:
sudo mount --bind /dev/ ${WORK}/rootfs/dev
sudo mount -t proc proc ${WORK}/rootfs/proc
sudo mount -t sysfs sysfs ${WORK}/rootfs/sys
sudo chroot ${WORK}/rootfs /bin/bash
- **(chroot)** Set this in the chroot environment:
LANG=
- **(chroot)** Install Packages Essential for live CD:
apt-get update
apt-get install casper lupin-casper
- **(chroot)** Update the initramfs:
depmod -a $(uname -r)
update-initramfs -u -k $(uname -r)
- **(chroot)** Remove non system users:
for i in `cat /etc/passwd | awk -F":" '{print $1}'`
do
uid=`cat /etc/passwd | grep "^${i}:" | awk -F":" '{print $3}'`
[ "$uid" -gt "998" -a "$uid" -ne "65534" ] && userdel --force ${i} 2>/dev/null
done
- **(chroot)** Clean the system
apt-get clean
- **(chroot)** Zero out any log files
find /var/log -type f | while read file
do
cat /dev/null | tee $file
done
- LVIS Specific Modifications
- **(chroot)** Update the user ID and Host name by editing **/etc/casper.conf**
nano /etc/casper.conf
* adding the following lines and comment out the original stuff
export USERNAME="lvis"
export USERFULLNAME="LVIS Live"
export HOST="lvisgh64"
export BUILD_SYSTEM="Ubuntu 10.04 LTS Xenomai 2.6.0"
export FLAVOUR="Xenomai"
- **(chroot)** Edit the **/etc/rc.local** adding the following lines to check the raid before mounting
nano /etc/rc.local
* Add this line before the lspci check
# do a file system check on the raid parition
/sbin/e2fsck -f -p -v /dev/disk/by-label/LVISRAID
- **(chroot)** Edit the **/etc/rc.local** adding the following lines to mount the raid by label
nano /etc/rc.local
* Add this line after the file system check
# mount the raid parition
/bin/mount -L LVISRAID /opt/data/raid
- **(chroot)** Edit the **/etc/rc.local** adding the following lines to fire off programs automatically
nano /etc/rc.local
* Put these near the bottom (uncomment them)
# fire off lvis2d
LVIS_RUN_LVIS2D_SCRIPT="/opt/lvis2/run_lvis2d"
if [ -e $LVIS_RUN_LVIS2D_SCRIPT ]; then
/usr/bin/screen -d -m -S "MAIN lvis2d" $LVIS_RUN_LVIS2D_SCRIPT
fi
# fire off lvisdd
LVIS_RUN_LVISDD_SCRIPT="/opt/lvis2/run_lvisdd"
if [ -e $LVIS_RUN_LVISDD_SCRIPT ]; then
/usr/bin/screen -d -m -S "DATA lvisdd" $LVIS_RUN_LVISDD_SCRIPT
fi
- **(chroot)** Edit the **/etc/rc.local** adding the following lines to kick off the cronjobs
nano /etc/rc.local
* Add this line at the end
# fire off the system wide crontab
/usr/bin/crontab /etc/crontab
- **(chroot)** Modify **/usr/share/initramfs-tools/scripts/casper-bottom/10adduser**:
nano /usr/share/initramfs-tools/scripts/casper-bottom/10adduser
* Change:
db_set passwd/user-password-crypted U6aMy0wojraho
* To our favorite password:
db_set passwd/user-password-crypted xS76ZozDlCQaM
- **(chroot)** Modify **/usr/share/initramfs-tools/scripts/casper-bottom/25configure_init**:
nano /usr/share/initramfs-tools/scripts/casper-bottom/25configure_init
* Change on about line 25 this:
# Arrange for shells on virtual consoles, rather than login prompts
if [ -n "$USERNAME" ]; then
* To this, and it will remove the auto-login:
if [ -n "" ]; then
- **(chroot)** Remove the persistent network and cdrom rules from **udev**
rm /etc/udev/rules.d/70-persistent-net.rules
rm /etc/udev/rules.d/70-persistent-cd.rules
- **(chroot)** Remove **/etc/resolv.conf** so it will not try to reverse look up IP address over the network (DNS)
rm /etc/resolv.conf
- **(chroot)** Edit the **/etc/rc.local** adding the following lines to symbolically link in source to the **lvis** user's home directory
nano /etc/rc.local
* Add this line at the end
# LVIS-GH: UNCOMMENT to symbolic link the source trees into the lvis home directory
# default user on the ISO is user # 999
/bin/mkdir /home/lvis/work
/bin/ln -s /opt/lvis2/src/lvis2 /home/lvis/work/lvis2
/bin/ln -s /opt/lvis2/src/sigma /home/lvis/work/sigma
/bin/chown -R 999 /home/lvis/work
- **(chroot)** Clean up files you really do not need for this live ISO image
- Delete temporary files and **bash** history
rm -rf /tmp/* ~/.bash_history
- Delete **/usr/share** documentation files
rm -rf /usr/share/doc/*
# we need to keep copyright files for legal reasons
rm -rf /usr/share/man/*
rm -rf /usr/share/groff/*
rm -rf /usr/share/info/*
rm -rf /usr/share/lintian/*
rm -rf /usr/share/linda/*
- Delete **locale** information for anything but English
find /usr/share/locale -mindepth 1 -maxdepth 1 ! -name 'en' |xargs rm -r
- **(chroot)** Re-run the initram-fs to capture our user and password changes (so they stick)
depmod -a $(uname -r)
update-initramfs -u -k $(uname -r)
- **(chroot)** Exit chroot
exit
- Prepare The CD directory tree:
- Copy the kernel, the updated initrd and memtest prepared in the chroot:
export kversion=`cd ${WORK}/rootfs/boot && ls -1 vmlinuz-* | tail -1 | sed 's@vmlinuz-@@'`
sudo cp -vp ${WORK}/rootfs/boot/vmlinuz-${kversion} ${CD}/${FS_DIR}/vmlinuz
sudo cp -vp ${WORK}/rootfs/boot/initrd.img-${kversion} ${CD}/${FS_DIR}/initrd.img
sudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot
- Unmount bind mounted dirs:
sudo umount ${WORK}/rootfs/proc
sudo umount ${WORK}/rootfs/sys
sudo umount ${WORK}/rootfs/dev
- Convert the directory tree into a squashfs:
sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} -noappend
- Fix permissions on the squashed file system
sudo chmod 755 ${CD}/casper/filesystem.squashfs
- Make filesystem.size
echo -n $(sudo du -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/${FS_DIR}/filesystem.size
- Calculate MD5
find ${CD} -type f -print0 | xargs -0 md5sum | sed "s@${CD}@.@" | grep -v md5sum.txt | sudo tee -a ${CD}/md5sum.txt
- Make Grub the bootloader of the CD
- Use an editor
sudo nano ${CD}/boot/grub/grub.cfg
- Enter the following into the file and save it
set default="0"
set timeout=3
menuentry "LVIS-F x86_64 Xenomai-2.6.0 Data System DHCP Network" {
linux /casper/vmlinuz boot=casper noprompt splash textonly
initrd /casper/initrd.img
}
menuentry "Memory Test" {
linux16 /boot/memtest86+.bin
}
menuentry "Boot from the first hard disk" {
set root=(hd0)
chainloader +1
}
- Options are:
- **console=ttyS0,115200n8** redirect our messages to/from serial port
- **ip=frommedia** sets the network configuration from our ISO (for static IP, DHCP is the default otherwise)
- **noprompt** do not ask to remove the media before rebooting
- **splash** no idea lol FIXME
- **textonly** for the serial port redirection
- **toram** load the entire file system into ram before running
- Build the CD/DVD
- Make the ISO file
sudo grub-mkrescue --output=/home/lvis/iso/lvisgh64_live_`date +%Y.%m.%d`.iso ${CD}
You need to put console directly in the grub.cfg file (under /boot/grub/) in the ISO. Use the example
they have for CLI (command line only also) so:
* remove **quiet**
* add console=ttyS0,115200n8
* add textonly
* add noapic THIS CAUSES IRQ FOR THE BOARDS TO MOVE. BAD. Crash!!!!
===== Create Bootable USB =====
- Use **fdisk** and delete all existing partitions
sudo fdisk /dev/sdX
* Then use option **'d'** to delete ALL paritions
- Create a partition to fill out the device
* Select option **'n'** for new, and fill out the device (take defaults)
- Set the bootable flag ON
* Select option **'a'**
- Exit fdisk
- Format the partition as ext3:
sudo mkfs.ext3 -L LVISNAND -b 4096 -m 0 /dev/sdX1
- Mount the drive
sudo mount /dev/sdX1 /mnt
# AND clear it off first, it goes much faster on an empty NAND
# BE SURE this is the drive you want to wipe... I do a df -h first to make sure it is what I think it is
sudo rm -rf /mnt/*
- Add the Unetbootin repository to our source list, so we can get the latest version (the one that WORKS!)
sudo nano /etc/apt/sources.list
* And add the following line at the bottom
# LVIS-GH added for getting latest Unetbootin
deb http://ppa.launchpad.net/gezakovacs/ppa/ubuntu lucid main
- Install Unetbootin
sudo apt-get update
sudo apt-get install unetbootin
- Run it (you will need to have logged in with X enabled, log out and do the following
* First, log into lvis with X
ssh -X lvis@10.4.1.42
* Then, you can install with the GUI
sudo unetbootin
* Select the ISO
* Click OK and GO!
* Reboot!
* Relax and have a homebrew!
===== ERRORS and Issues =====
* Seeing EDAC errros (PCI Parity) so we are causing system troubles with too much Xenomai load I think
* lvis2d.exe threads seem HIGH in CPU usage... not sure if there are loops not sleeping enough
===== KERNEL TESTS =====
These two things may not do anything, but looking in the kernel options these COULD affect the performance of the Xenomai code:
- Xenomai time slice is 1000 microseconds. Maybe that should be 100 or 50 ?
- SMI work around:
- Under: Real-time sub-system -> Machine -> SMI Work Around
- Enable SMI workaround
===== Device Tests =====
==== Delphi Digitizer ADC3255 ====
=== DMA Transfer Speed Testing ===
This program in the test suite will DMA transfer data from the card and calculate an average data rate
sudo ./adc3255_polling -dmarate -s 1000 -n 32000
===== IDL Testing =====
Loading the data into IDL and displaying time difference to check timing
cd /Users/david/idl/lvisgh_idl
idl
; IDL
read_lvisgh,h,c,/CFILEONLY
time = lvisf_timeconvert(c.BCTIME_SEC,c.BCTIME_MICROSEC)
plot,diff(time)
Plot temperatures of the Delphi digitizers
tempa = double(c.ADCAREG10) / 16.0
tempb = double(c.ADCBREG10) / 16.0
tempc = double(c.ADCCREG10) / 16.0
plot,c.shot_number,tempa,yrange=[min([tempa,tempb,tempc]),max([tempa,tempb,tempc])]
plots,c.shot_number,tempb,color=100
plots,c.shot_number,tempc,color=200