Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Helper scripts for running linux operating system entirely in RAM
tag: 0.21

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
contrib/debian
.gitignore
README.textile

README.textile

DESCRIPTION

This project contains set of scripts to make your life with
Linux booted from USB key and running entirely in RAM much easier.

When you run Linux operating system completely in ram (/ is mounted on tmpfs),
you want preserve changes you made to system between system reboots and this is
what this project provides ;)

This project consist of the following scripts:

  • diskless-usb-save-os
    Creates gzipped tarball of / directory to specified location and
    updates syslinux configuration using diskless-usb-create-syslinux-config
  • diskless-usb-create-syslinux-config
    Creates/generates syslinux.cfg configuration from discovered
    list of operating system tarballs created by diskless-usb-save-os
  • diskless-usb-create-lilo-config
    Creates/generates lilo(8) bootloader configuration from discovered
    list of operating system tarballs created by diskless-usb-save-os
  • diskless-mkusbkey-syslinux
    Creates syslinux bootable USB key using mkdiskimage
  • diskless-mkusbkey-lilo
    Creates lilo(8) bootables USB key

HOWTO [SYSLINUX]

  • create configuration file and edit it

diskless-usb-save-os --default-config > /etc/linux-diskless/diskless-usb-save-os.conf
vi /etc/linux-usb-diskless/diskless-usb-save-os.conf
  • create syslinux configuration generator template files:

diskless-usb-create-syslinux-config --default-template > /etc/linux-diskless/syslinux.cfg.template
diskless-usb-create-syslinux-config --default-label-template > /etc/linux-diskless/syslinux-label.template
  • edit label template file

 # Available variables:
 #
 # ${ARCHIVE_FILE}:        OS archive file basename
 # ${ARCHIVE_FILE_FULL}:   OS archive file full name
 # ${INDEX}:               OS archive index number
 LABEL linux-${INDEX}
        MENU LABEL [${INDEX}] OS ${ARCHIVE_FILE}
        # change this to kernel path on your USB key
        kernel kernels/vmlinuz-2.6.35-28.49
        # change this to initrd/initramfs image on your USB key
        initrd kernels/initrd.igz
        # kernel boot parameters; you're completely on your own here;
        # if you're using linux-diskless-init, you should change at
        # least real_root parameter
        append ro tmpfs_size=500M vga=791 real_root=:/os-images/${ARCHIVE_FILE}
  • insert USB key
  • do the testrun!

diskless-usb-save-os -c /etc/linux-diskless/diskless-usb-save-os.conf

Adding System Rescue CD to list of boot images

Here is a quick and dirty recipe for adding System Rescue CD
to boot menu list:


sudo mount -o loop,ro /path/to/systemrescuecd-<arch>-<version>.iso /mnt/cdrom
  • mount your USB key

sudo mount /dev/sdc4 /mnt/usbkey
  • create system rescue cd folder on usb key

sudo mkdir /mnt/usbkey/sysrcd
  • copy system rescue cd files to usb key

# kernels
sudo cp /mnt/cdrom/isolinux/rescue{cd,64} /mnt/usbkey/sysrcd
# initramfs
sudo cp /mnt/cdrom/isolinux/initram.igz /mnt/usbkey/sysrcd
# squashfs image
sudo cp /mnt/cdrom/sysrcd.dat /mnt/usbkey
  • edit syslinux.cfg and add/uncomment system rescue cd section

LABEL rescuecd32
  MENU LABEL SystemRescueCd 32 bit
  LINUX sysrcd/rescuecd
  INITRD sysrcd/initram.igz
  APPEND scandelay=1 nomodeset vga=791
LABEL rescuecd64
  MENU LABEL SystemRescueCd 64 bit
  LINUX sysrcd/rescue64
  INITRD sysrcd/initram.igz
  APPEND scandelay=1 nomodeset vga=791
  • umount usb key and system rescue cd iso image

sudo umount /mnt/usbkey
sudo umount /mnt/cdrom

PACKAGES

See contrib/ directory for building distribution specific packages.

Debian/Ubuntu

Creating Debian/Ubuntu compatible DEB package is extremely easy:


    cd contrib/debian
    sudo ./package.debian

SEE ALSO

  • linux-diskless-init Initrd/initramfs tools for booting linux from various sources:
    • normal blockdevices (just like most linux distros)
    • tar archives on block devices (also USB keys) or via HTTP/FTP to tmpfs (==> pure diskless mode)
    • squashfs images on block devices or via HTTP/FTP

LICENSE

 Copyright (c) 2011, Brane F. Gracnar
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
 
   * Redistributions of source code must retain the above copyright notice, this list
     of conditions and the following disclaimer.
   
   * Redistributions in binary form must reproduce the above copyright notice, this
     list of conditions and the following disclaimer in the documentation and/or
     other materials provided with the distribution.
   
   * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used 
     to endorse or promote products derived from this software without specific prior 
     written permission.

 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
 SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
 OF SUCH DAMAGE.
Something went wrong with that request. Please try again.