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.
The SBC will now begin the install process, and you can use the console/screen to finish the installation
Use the entire disk
sudo nano sources.list
## 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
sudo apt-get update sudo apt-get upgrade sudo reboot ; exit
sudo nano /etc/default/grub
sudo apt-get install wget -y
mkdir ~/download cd ~/download wget https://downloadmirror.intel.com/13663/eng/igb-5.3.5.3.tar.gz
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
sudo apt-get install build-essential \ git-core \ jed \ kernel-package \ libncurses5-dev \ md5deep \ screen \ subversion
mkdir /home/lvis/src mkdir /home/lvis/work
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
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/
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.
mkdir ~/download cd ~/download wget https://xenomai.org/downloads/xenomai/stable/xenomai-2.6.5.tar.bz2
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
cd ~/download wget https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.18.20.tar.gz
cd ~/src tar zxf ~/download/linux-3.18.20.tar.gz mv linux-3.18.20 linux-3.18.20-ipipe
cd ~/src/xenomai-2.6.5 ./scripts/prepare-kernel.sh --linux=~/src/linux-3.18.20-ipipe
* 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)
cd /home/lvis/src tar -zxvf ~/src/lvis2_extras/linux-2.6.38-git-xenomai-2.6.0.tar.gz
cd ~/src tar xvfj ~/src/lvis2_extras/xenomai-2.6.0.tar.bz2
# 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
sed -rie 's/echo "\+"/#echo "\+"/' scripts/setlocalversion
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
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
sudo update-initramfs -c -k 3.18.20-ipipe
sudo update-grub2
sudo reboot
cd ~/src/xenomai-2.6.0 ./configure --enable-smp make sudo make install
Clear off the original generic kernel to save disk space
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
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
cd ~/src tar -jxvf ~/src/lvis2_extras/gtest-1.5.0.tar.bz2
cd ~/ ln -s src/gtest-1.5.0
cd ~/gtest-1.5.0 ./configure make sudo make install sudo ldconfig
cd /home/lvis/work/lvis2/trunk/src/lib/16aio ./make_all clean ./make_all
sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8 splash textonly"
sudo update-grub2
sudo nano /etc/network/interfaces
# 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
# 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
[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 }
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.default
[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
sudo service smbd restart
cd ~/work/sigma/trunk/ make
I think there is a header dependency that requires you to do this a second time.
cd ~/work/lvis2/trunk/ make make
# 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
sudo nano /etc/ld.so.conf.d/lvisf.conf
/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
sudo ldconfig
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)
mkdir /home/lvis/iso/ mkdir /home/lvis/iso/tmp mkdir /home/lvis/iso/tmp/cd mkdir /home/lvis/iso/tmp/worktemp
export WORK=/home/lvis/iso/tmp/worktemp export CD=/home/lvis/iso/tmp/cd export FORMAT=squashfs export FS_DIR=casper
sudo mkdir -p ${CD}/{${FS_DIR},boot/grub} ${WORK}/rootfs
sudo apt-get update sudo apt-get install grub2 xorriso squashfs-tools
cd ~/work/lvis2 svn up cd ~/work/lvis2/trunk make clean make make sudo ./scripts/UNINSTALL sudo ./scripts/INSTALL
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
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
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
LANG=
apt-get update apt-get install casper lupin-casper
depmod -a $(uname -r) update-initramfs -u -k $(uname -r)
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
apt-get clean
find /var/log -type f | while read file do cat /dev/null | tee $file done
nano /etc/casper.conf
export USERNAME="lvis" export USERFULLNAME="LVIS Live" export HOST="lvisgh64" export BUILD_SYSTEM="Ubuntu 10.04 LTS Xenomai 2.6.0" export FLAVOUR="Xenomai"
nano /etc/rc.local
# do a file system check on the raid parition /sbin/e2fsck -f -p -v /dev/disk/by-label/LVISRAID
nano /etc/rc.local
# mount the raid parition /bin/mount -L LVISRAID /opt/data/raid
nano /etc/rc.local
# 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
nano /etc/rc.local
# fire off the system wide crontab /usr/bin/crontab /etc/crontab
nano /usr/share/initramfs-tools/scripts/casper-bottom/10adduser
db_set passwd/user-password-crypted U6aMy0wojraho
db_set passwd/user-password-crypted xS76ZozDlCQaM
nano /usr/share/initramfs-tools/scripts/casper-bottom/25configure_init
# Arrange for shells on virtual consoles, rather than login prompts if [ -n "$USERNAME" ]; then
if [ -n "" ]; then
rm /etc/udev/rules.d/70-persistent-net.rules rm /etc/udev/rules.d/70-persistent-cd.rules
rm /etc/resolv.conf
nano /etc/rc.local
# 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
rm -rf /tmp/* ~/.bash_history
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/*
find /usr/share/locale -mindepth 1 -maxdepth 1 ! -name 'en' |xargs rm -r
depmod -a $(uname -r) update-initramfs -u -k $(uname -r)
exit
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
sudo umount ${WORK}/rootfs/proc sudo umount ${WORK}/rootfs/sys sudo umount ${WORK}/rootfs/dev
sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} -noappend
sudo chmod 755 ${CD}/casper/filesystem.squashfs
echo -n $(sudo du -s --block-size=1 ${WORK}/rootfs | tail -1 | awk '{print $1}') | sudo tee ${CD}/${FS_DIR}/filesystem.size
find ${CD} -type f -print0 | xargs -0 md5sum | sed "s@${CD}@.@" | grep -v md5sum.txt | sudo tee -a ${CD}/md5sum.txt
sudo nano ${CD}/boot/grub/grub.cfg
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 }
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:
sudo fdisk /dev/sdX
sudo mkfs.ext3 -L LVISNAND -b 4096 -m 0 /dev/sdX1
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/*
sudo nano /etc/apt/sources.list
# LVIS-GH added for getting latest Unetbootin deb http://ppa.launchpad.net/gezakovacs/ppa/ubuntu lucid main
sudo apt-get update sudo apt-get install unetbootin
* First, log into lvis with X <code> ssh -X lvis@10.4.1.42
sudo unetbootin
These two things may not do anything, but looking in the kernel options these COULD affect the performance of the Xenomai code:
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
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