• Hacking the SUSE boot.iso

    I’ve recently been using autoyast quite a bit to automate builds of new SUSE this is nice and easy if the machine network boots, you just use pxelinux but if the machine does not support PXE booting you have to boot from the mini boot.iso included with SUSE and then manually type in the install= and autoyast= kernel parameters.

    To save time and the hassle of doing this I have built a custom SUSE 9.2 mini boot.iso with a new grub option which includes all of the information necessary. Below is the steps involved:

    1. get the mini boot iso from a SUSE mirror, the filename I grabbed was /pub/suse/i386/9.2/iso/SUSE-Linux-9.2-mini-installation.iso
    2. mount the iso: ```

    mount -t iso9660 -o loop SUSE-Linux-9.2-mini-installation.iso /mnt/tmp

    
      3. copy the contents to a temporary directory and set them to be writeable: 
        ```
    # mkdir /tmp/boot-iso
    # cp -av /mnt/tmp/* /tmp/boot-iso/
    # chmod -R 700 /tmp/boot-iso/*
    
    1. edit the boot loader config in boot/loader/isolinux.cfg. I added the following as the second option: ``` label cmlinux kernel linux append initrd=initrd ramdisk_size=65536 splash=silent showopts
      textmode=1 install=http://192.168.22.250/install/SUSE/i386/9.2/
      autoyast=http://192.168.22.250/install/SUSE/autoinstall/repository/
      textmode=1
        
        **note**: the lines are broken here for clarity make sure the append line is all on one line and the slashes are removed
        
        **note**: the url's specified in the `install=` and `autoyast=` parameters are specific to our configuration, you will need to edit as appropriate for your own auto install setup
        
        you also need to edit the messages file which is what is displayed on screen immediately after boot, I added the following directly after the 'Boot from harddisk' option:
        
        ```
    cmlinux   - Use the CM autoyast installer
    
    1. now you are ready to make your bootable iso. Whilst inside the /tmp/boot-iso/ directory I ran the following: ``` #mkisofs -R -b boot/loader/isolinux.bin -no-emul-boot
      -boot-load-size 4 -boot-info-table -o ../custom-boot.iso .
    
      6. write this `custom-boot.iso` to a cd and boot from it. When you see the menu choose 'cmlinux' which will automatically set the install source to be the url in the `install=` parameter and set the autoyast repository to the url in the `autoyast=` parameter. If there is an entry in the rules.xml for the machine being booted an auto install should run automatically, if not you will be left with the option of doing a manual install
    


  • FreeBSD ports WITHOUT_X11

    I never remember the syntax for this, should you need to build a port without X11 support do this:

    # make WITHOUT_X11=yes
    


  • Apache Directory permissions

    I just got caught out with apache directory permissions while installing gallery for a virtual host. I previously had all the virtual hosts using the same strict directory permissions shown below:

    <Directory /sites/<domain>/www/htdocs>
                    AllowOverride AuthConfig
            </Directory>
    

    This will generate 2 errors in the virtual host error log, the first of which is a php error:

    [alert]  /sites/<domain>/www/htdocs/gallery/setup/.htaccess: php_value not allowed here
    

    This can be fixed by adding the Options option to the AllowOverride statement, the second error:

    [alert]  /sites/<domain>/www/htdocs/gallery/setup/.htaccess: RewriteEngine not allowed here
    

    can be fixed by adding the FileInfo option. So the final directory block should look like this:

    <Directory /sites/<domain>/www/htdocs>
                    AllowOverride AuthConfig Options FileInfo
            </Directory>
    


  • New OS category

    Will mainly be a parent for the other OS categories beneath it…


  • SuSE sudo weirdness

    On SuSE 9.2 we have noticed that sudo didnt seem to work out of the box. Have tracked this to SuSE changing a default from the way it is shipped in the sudo package, from the man sudoers(5) man page:

    targetpw    If set, sudo will prompt for the password the user specified
                by the -u flag (defaults to root) instead of the password of
                the invoking user.  This flag is off by default.
    

    If you comment out the following line sudo will ask for the password of the current user NOT the user they are trying to run the command as:

    Defaults targetpw
    


  • SuSE 9.1 ifconfig weirdness

    Have just found out that ifconfig on SuSE 9.2 doesnt seem to show virtual intefaces:

    message2:~ # ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:80:3F:2B:7B:60
              inet addr:192.168.0.200  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::280:3fff:fe2b:7b60/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:40203054 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4386872 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:2879540080 (2746.1 Mb)  TX bytes:321973799 (307.0 Mb)
              Base address:0x2000 Memory:dd200000-dd220000
    
    eth1      Link encap:Ethernet  HWaddr 00:80:3F:2B:7B:61
              inet addr:XXX.XXX.XXx.XXX  Bcast:XXX.XXX.XXx.XXX  Mask:255.255.255.224
              inet6 addr: fe80::280:3fff:fe2b:7b61/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:66946630 errors:0 dropped:0 overruns:0 frame:0
              TX packets:43575297 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:4317777 (4.1 Mb)  TX bytes:4011082191 (3825.2 Mb)
              Base address:0x2040 Memory:dd220000-dd240000
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:1692 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1692 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:113193 (110.5 Kb)  TX bytes:113193 (110.5 Kb)
    
    message2:~ #
    

    However if you use the ip command from the iproute2 package it shows that in fact eth1 does have some aliases:

    message2:~ # ip addr
    1: lo:  mtu 16436 qdisc noqueue
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: sit0:  mtu 1480 qdisc noqueue
        link/sit 0.0.0.0 brd 0.0.0.0
    3: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000
        link/ether 00:80:3f:2b:7b:60 brd ff:ff:ff:ff:ff:ff
        inet 192.168.0.200/24 brd 192.168.0.255 scope global eth0
        inet6 fe80::280:3fff:fe2b:7b60/64 scope link
           valid_lft forever preferred_lft forever
    4: eth1:  mtu 1500 qdisc pfifo_fast qlen 1000
        link/ether 00:80:3f:2b:7b:61 brd ff:ff:ff:ff:ff:ff
        inet XXX.XXX.XXx.XXX/YY brd XXX.XXX.XXx.XXX scope global eth1
        inet XXX.XXX.XXx.XXX/YY brd XXX.XXX.XXx.XXX scope global secondary eth1
        inet6 fe80::280:3fff:fe2b:7b61/64 scope link
           valid_lft forever preferred_lft forever
    message2:~ #
    

    How weird is that. Versions shown below:

    message2:~ # cat /etc/SuSE-release
    SuSE Linux 9.1 (i586)
    VERSION = 9.1
    message2:~ # ifconfig -V
    net-tools 1.60
    ifconfig 1.42 (2001-04-13)
    message2:~ #
    

    **NB:**IP addresses changed to protect the innocent…


  • backspace not working in xterms

    Add the following to /etc/X11/Xresources and restart X / [gkx]dm

    xterm*VT100.Translations: #override
    BackSpace: string(0x7F)n
    Delete:    string("
    Home:      string("
    End:       string("
    *ttyModes: erase ^?
    

    Tested on RHEL3.

    Thanks to Justin for this


  • Moving the /Users directory

    Recently I needed to move the /Users tree onto another partition on a OS X machine at work, I found this great howto.


  • Mapping Between Logical and Physical Device Names on a Sun E450

    If you need to find the slot that a disk is in from a given logical name (c3t3d0) you can follow this (Broken link http://sunsolve.sun.com/search/document.do?assetkey=1-9-16735-1&searchclause=16735) document from sun. I’ve mirrored the important bits below incase it disapears

    1. Determine the UNIX physical device name from the SCSI error message.
    SCSI error messages are typically displayed in the system console
           
    and logged in the /usr/adm/messages file. 
    
    ```
    

    WARNING: /pci@6,4000/scsi@4,1/sd@3,0 (sd228) Error for Command: read(10) Error level: Retryable Requested Block: 3991014 Error Block: 3991269 Vendor: FUJITSU Serial Number: 9606005441 Sense Key: Media Error ASC: 0x11 (unrecovered read error), ASCQ: 0x0, FRU: 0x0

        
        In the example SCSI error message above, the UNIX physical device name is `/pci@6,4000/scsi@4,1/sd@3`.
        
          * Determine the UNIX logical device name by listing the contents of
              
            the `/dev/rdsk` directory.
            
            Use the grep command to filter the output for any occurrence of
              
            the UNIX physical device name determined in Step 1:
            
            ```
    % ls -l /dev/rdsk | grep /pci@6,4000/scsi@4,1/sd@3
            lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s0 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:a,raw
            lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s1 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:b,raw
            lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s2 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:c,raw
            lrwxrwxrwx1 root     root        45 Jan 30 09:07 c12t3d0s3 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:d,raw
            lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s4 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:e,raw
            lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s5 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:f,raw
            lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s6 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:g,raw
            lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s7 ->
            ../../devices/pci@6,4000/scsi@4,1/sd@3,0:h,raw
    
        The resulting output indicates the associated UNIX logical device name.
       
        In this example, the logical device name is `c12t3d0`
        
          * Determine the disk slot number using the `prtconf` command.
            
            Substitute the string disk@ for sd@ in the physical device name determined in Step 1. The result in this example is
          
            `/pci@6,4000/scsi@4,1/disk@3`.
            
            Use the grep command to find this name in the output of the
          
            prtconf command:
            
            ```
    

    % prtconf -vp | grep /pci@6,4000/scsi@4,1/disk@3 slot#11: ‘/pci@6,4000/scsi@4,1/disk@3’


  • Daemontools run scripts collection

    Found this nice collection of daemontools run scripts. Will find that useful someday