Helper scripts: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
(add fai-cd wrapper script for easier ans faster fai-cd recreation)
No edit summary
Line 51: Line 51:


--[[User:Lazyboy|lazyboy]] 10:59, 5 Jan 2006 (CET)
--[[User:Lazyboy|lazyboy]] 10:59, 5 Jan 2006 (CET)
== turn kernel bootprompt parameters into classes ==
Every kernel parameter after the -- separator is changed to uppercase and used as a classname.
class/35-bootprompt :
<pre>
#!/usr/bin/perl
use strict;
use warnings;
my $separator = '--';
my $seen;
foreach ( split /\s+/, `cat /proc/cmdline` )
{
  if ( $_ eq $separator )
  {
    $seen = 1;
    next;
  }
  next unless $seen;
  print uc
    if m/^\w+$/;
}
</pre>
--[[User:iw|Ingo Wichmann / Linuxhotel]] 17 Jan 2006 (CET)

Revision as of 16:22, 17 January 2006

FAIlint

failint.sh a lint checker for FAI. (detects common mistakes)

FAI development and testing helpers

I created some scripts that help setting up a FAI developemnt environment, and running builds and tests in there. At the moment it's mostly about creating fai-cd's and testing them in a qemu vm. Eventually I will add functions for network installation testing with a real hardware host and a qemu client, as well as testing network install with a qemu hist and a qemu client. I am quite interested if someboy finds them useful, they are in subversion:

http://svn.debian.org/wsvn/fai/people/lazyboy/fai-dev-helpers/

--lazyboy 11:12, 21 Oct 2005 (CEST)

fast fai-cd creation script

when developing a new fai-cd it can happen that you need to create new fai-cd's very often. It gets annoying that you always need to delete fai-mirror and the old image... unless you use a script like this (change your tmp path for image and mirror):

#!/bin/sh

FAI_MIRROR_LOCATION=/data/produktion/tmp/fai-mirror

DATE=`date +%Y-%m-%d_%h-%M-%S`

if [ -z $1 ];then
  CDIMAGE=/data/produktion/tmp/fai-cd_${DATE}.iso
  echo "using default cdimage location $CDIMAGE"
else
  CDIMAGE=$1
fi

if [ -z $FAI_MIRROR_LOCATION ]; then
  echo "error - FAI_MIRROR_LOCATION is empty - exiting"
  exit 1
else
  echo "cleaning up fai-mirror at $FAI_MIRROR_LOCATION"
  rm -r $FAI_MIRROR_LOCATION
fi


mkdir -p $FAI_MIRROR_LOCATION

fai-mirror -a $FAI_MIRROR_LOCATION

CDIMAGE_BACKUP=${CDIMAGE}_bak_date +%Y-%m-%d_%h-%M-%S

if [ -f $CDIMAGE ];then
  echo "moving old cd image to $CDIMAGE_BACKUP"
fi

fai-cd -m $FAI_MIRROR_LOCATION $CDIMAGE

--lazyboy 10:59, 5 Jan 2006 (CET)

turn kernel bootprompt parameters into classes

Every kernel parameter after the -- separator is changed to uppercase and used as a classname.

class/35-bootprompt :

#!/usr/bin/perl
use strict;
use warnings;

my $separator = '--';

my $seen;
foreach ( split /\s+/, `cat /proc/cmdline` )
{
  if ( $_ eq $separator )
  {
    $seen = 1;
    next;
  }
  next unless $seen;
  print uc
    if m/^\w+$/;
}

--Ingo Wichmann / Linuxhotel 17 Jan 2006 (CET)