Unknown Fedora initrd commands
Results 1 to 6 of 6

Thread: Unknown Fedora initrd commands

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    24

    Exclamation Unknown Fedora initrd commands

    This weekend I have been messing around a little with the boot process, and found myself inspecting the default initrd shipped with Fedora.

    Where are all of the commands listed in the init script kept? Some that I do not recognize which are not found on the nash man page are setuproot and loadpolicy.

    (See http://article.gmane.org/gmane.linux...general/323223 for example contents).

    Thanks for your help, as these commands seem to be popping up out of thin air.

  2. #2
    Banned
    Join Date
    Nov 2002
    Posts
    677
    1. If you want to know where "most" startup scripts, goto /etc/init.d
    those are all script files

    2. To find what modules are loaded before the "main" Kernel gets activated, goto /etc/rc.d | cat rc.sysinit | more

    3. If you are rebuilding a kernel, copy a known good .config file and place it into the new kernel directory, make install will autorecreate the initrd and throw it into the bootloader. It will make a backup copy in the /boot directory under <newkernel>.conf or something other.

    Fedora wants to be different from the rest of the world. To hunt down those 2 scripts, 'find / -name setuproot' or loadpolicy
    Last edited by Linen0ise; April 12th, 2009 at 11:19 PM.

  3. #3
    Junior Member
    Join Date
    Jan 2006
    Posts
    24

    My initrd script

    #!/bin/nash

    mount -t proc /proc /proc

    setquiet
    # nash: cause any late echos in this start script not to be displayed

    echo Mounting proc filesystem
    echo Mounting sysfs filesystem
    mount -t sysfs /sys /sys
    echo Creating /dev
    mount -o mode=0755 -t tmpfs /dev /dev
    mkdir /dev/pts
    mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
    mkdir /dev/shm
    mkdir /dev/mapper
    echo Creating initial device nodes
    mknod /dev/null c 1 3
    mknod /dev/zero c 1 5
    mknod /dev/systty c 4 0
    mknod /dev/tty c 5 0
    mknod /dev/console c 5 1
    mknod /dev/ptmx c 5 2
    mknod /dev/tty0 c 4 0
    mknod /dev/tty1 c 4 1
    mknod /dev/tty2 c 4 2
    mknod /dev/tty3 c 4 3
    mknod /dev/tty4 c 4 4
    mknod /dev/tty5 c 4 5
    mknod /dev/tty6 c 4 6
    mknod /dev/tty7 c 4 7
    mknod /dev/tty8 c 4 8
    mknod /dev/tty9 c 4 9
    mknod /dev/tty10 c 4 10
    mknod /dev/tty11 c 4 11
    mknod /dev/tty12 c 4 12
    mknod /dev/ttyS0 c 4 64
    mknod /dev/ttyS1 c 4 65
    mknod /dev/ttyS2 c 4 66
    mknod /dev/ttyS3 c 4 67
    echo Setting up hotplug.

    hotplug
    # /etc/sysconfig/network-scripts/net.hotplug
    # /lib/modules/2.6.25-14.fc9.i686/kernel/drivers/pci/hotplug/
    #

    echo Creating block device nodes.

    mkblkdevs
    # ?

    echo "Loading ehci-hcd module"
    modprobe -q ehci-hcd
    echo "Loading ohci-hcd module"
    modprobe -q ohci-hcd
    echo "Loading uhci-hcd module"
    modprobe -q uhci-hcd
    mount -t usbfs /proc/bus/usb /proc/bus/usb
    echo "Loading pata_via module"
    modprobe -q pata_via
    echo Waiting for driver initialization.

    stabilized --hash --interval 250 /proc/scsi/scsi
    # ?

    mkblkdevs
    # ?

    resume /dev/sda2
    # ?

    echo Creating root device.
    mkrootdev -t ext3 -o defaults,ro /dev/sda1
    echo Mounting root filesystem.
    mount /sysroot
    echo Setting up other filesystems.

    setuproot
    # ?

    loadpolicy
    # ?

    echo Switching to new root and running init.

    switchroot
    # nash command

    echo Booting has failed.
    sleep -1

  4. #4
    Junior Member
    Join Date
    Jan 2006
    Posts
    24
    Some of these commands are not found anywhere on the file system. I have also tried the following and did not produce any results.

    find /etc -print | xargs -I '{}' grep -li [command] '{}'

    Also, these are not kernel modules. This is the initialization script that is used during boot by init.

  5. #5
    Banned
    Join Date
    Nov 2002
    Posts
    677
    Quote Originally Posted by stonee View Post
    Some of these commands are not found anywhere on the file system. I have also tried the following and did not produce any results.

    find /etc -print | xargs -I '{}' grep -li [command] '{}'

    Also, these are not kernel modules. This is the initialization script that is used during boot by init.
    if you get a chance, check your kernel source code by doing make xconfig. Do a search for selinux. Is it disabled? Recompiling after enabling should do the job.

  6. #6
    Senior Member IKnowNot's Avatar
    Join Date
    Jan 2003
    Posts
    792
    From what I could find, they are undocumented nash commands.

    I found a suggestion to download the mkinitrd source (.src.rpm )

    look in nash.c to find out what they do?

    I am not a programer, so it was a little difficult for me, but maybe you will understand it.
    " And maddest of all, to see life as it is and not as it should be" --Miguel Cervantes

Similar Threads

  1. Windows Error Messages
    By cheyenne1212 in forum Miscellaneous Security Discussions
    Replies: 7
    Last Post: February 1st, 2012, 01:51 PM
  2. post dailup screen for adsl
    By aoboyz in forum Network Security Discussions
    Replies: 5
    Last Post: May 3rd, 2007, 05:59 AM
  3. Understanding FTP and FTP Commands
    By Spyder32 in forum Other Tutorials Forum
    Replies: 14
    Last Post: July 10th, 2004, 03:56 PM
  4. Fdisk and Diskpart commands
    By DeadAddict in forum Other Tutorials Forum
    Replies: 2
    Last Post: February 20th, 2004, 04:13 PM
  5. *nix Commands: 101 - Part 1 Tha' Basics
    By MrLinus in forum Other Tutorials Forum
    Replies: 7
    Last Post: December 11th, 2001, 07:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides