User:Az990tony/Customizing-SysRescCD-for-XS

From OLPC
< User:Az990tony
Revision as of 14:50, 27 June 2008 by Az990tony (talk | contribs) (Define Name Server)
Jump to: navigation, search

Customizing SysRescCD for use with XS School Server

There are several things you can do to customize [| SysRescCD] for use with an XS School Server.

  • Configure the static IP addresses
  • Configure the ethernet ports to specific MAC addresses
  • Define userids to be used with SSHD
  • Have ssh public keys to allow remote administration
  • Include backup or rescue files

Download and Burn original SysRescCD

The easiest way to do this is to perform "wget" for the iso file. I had to update my resolv.conf to a DNS nameserver I could access, and then do a wget for the URL involved. The file is about 200MB and took me about 11 minutes to download on my system.

[root ~]#  echo "nameserver 205.171.3.65" >> /etc/resolv.conf
[root ~]#  wget -c http://downloads.sourceforge.net/systemrescuecd/systemerscuecd-x86-1.0.3.iso
   ... systemrescuecd-x86-1.0.3.iso saved...
[root ~]#  cdrecord -scanbus
scsibus6:
       6,0,0   600) 'ATAPI   ' 'DVD A  DH20A4H  ' 'QP53' Removable CD-ROM
[root ~]#  cdrecord dev=6,0,0 -v systemerscuecd-x86-1.0.3.iso

Unpack the files

Boot from the SysRescueCD you just made, and hit enter at the "boot: " command prompt. We are basically going to open up the CD, and put all the files on our hard-drive. I will use /dev/sda3 as an example.

[root@sysresccd /root] % mount /dev/sda3 /mnt/custom
[root@sysresccd /root] % /usr/sbin/sysresccd-custom extract
/mnt/custom is mounted -> ok
there is enough estimated free space here (25548 MB) -> ok
docache not used -> ok
[root@sysresccd /root] % cd /mnt/custom/customcd
[root@sysresccd /mnt/custom/customcd] % ls
files  isoroot
[root@sysresccd /mnt/custom/customcd] % cd isoroot
[root@sysresccd /mnt/custom/customcd/isoroot] % ls
bootdisk  isolinux  syslinux  version
[root@sysresccd /mnt/custom/customcd/isoroot] % cd isolinux
[root@sysresccd /mnt/custom/customcd/isoroot/isolinux] % ls
altker32  f1boot.msg    f4arun.msg    f7net.msg     isolinux.cfg  memtest86
altker64  f2images.msg  f5troubl.msg  initram.igz   maps          rescue64
boot.cat  f3params.msg  f6pxe.msg     isolinux.bin  memdisk       rescuecd

If you will updating the "initram.igz", you will have to further unpack that as follows:

[root@sysresccd /mnt/custom/customcd/isoroot/isolinux] % gunzip -c initram.igz > initram.img
[root@sysresccd /mnt/custom/customcd/isoroot/isolinux] % mkdir work
[root@sysresccd /mnt/custom/customcd/isoroot/isolinux] % cd work
[root@sysresccd /mnt/custom/customcd/isoroot/isolinux/work] % cpio -id < ../initram.img
36176 blocks
[root@sysresccd /mnt/custom/customcd/isoroot/isolinux/work] % ls
bin  dev  etc  init  lib  lib64  linuxrc  proc  sbin  sys  temp  usr  var
[root@sysresccd /mnt/custom/customcd/isoroot/isolinux/work] %

Create Additional Mount points

root@sysresccd /mnt/custom/customcd % cd files
root@sysresccd /mnt/custom/customcd/files % ls
bin   dev  home  lib64  mnt  proc  sbin  tftpboot  usr
boot  etc  lib   media  opt  root  sys   tmp       var
root@sysresccd /mnt/custom/customcd/files % cd mnt
root@sysresccd /mnt/custom/customcd/files/mnt % ls
cdrom  floppy
root@sysresccd /mnt/custom/customcd/files/mnt % mkdir boot fed deb usbkey scratch new old
root@sysresccd /mnt/custom/customcd/files/mnt % ls
boot  cdrom  deb  fed  floppy  new  old  scratch  usbkey

Define Name Server

root@sysresccd /mnt/custom/customcd/files/etc % echo "nameserver 205.171.3.65" >> resolv.conf

Make the MAC address values persistent

root@sysresccd /etc/udev/rules.d % ls
05-udev-early.rules               64-md-raid.rules
30-kernel-compat.rules            65-permissions.rules
40-alsa.rules                     70-persistent-cd.rules
40-gentoo.rules                   70-persistent-net.rules
40-video.rules                    75-cd-aliases-generator.rules
50-udev-default.rules             75-persistent-net-generator.rules
60-cdrom_id.rules                 80-drivers.rules
60-persistent-input.rules         90-hal.rules
60-persistent-storage.rules       90-network.rules
60-persistent-storage-tape.rules  95-udev-late.rules
61-persistent-storage-edd.rules   99-fuse.rules
64-device-mapper.rules
root@sysresccd /etc/udev/rules.d % cat 70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1g:fc:1q:4f:ed",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:n1:10:76:df",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:s1:14:1e:ee",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
root@sysresccd /mnt/custom/customcd/files % cd etc/udev/rules.d
root@sysresccd /mnt/custom/customcd/files/etc/udev/rules.d % cp /etc/udev/rules.d/70-persistent-net.rules .
root@sysresccd /mnt/custom/customcd/files/etc/udev/rules.d % ls
05-udev-early.rules               64-device-mapper.rules
30-kernel-compat.rules            64-md-raid.rules
40-alsa.rules                     65-permissions.rules
40-gentoo.rules                   70-persistent-net.rules
40-video.rules                    75-cd-aliases-generator.rules
50-udev-default.rules             75-persistent-net-generator.rules
60-cdrom_id.rules                 80-drivers.rules
60-persistent-input.rules         90-hal.rules
60-persistent-storage.rules       90-network.rules
60-persistent-storage-tape.rules  95-udev-late.rules
61-persistent-storage-edd.rules   99-fuse.rules
root@sysresccd /mnt/custom/customcd/files/etc/udev/rules.d % vi 70-persistent-net.rules
root@sysresccd /mnt/custom/customcd/files/etc/udev/rules.d %