Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Moving filesystem into CF

Hi people,

What is the best way to go about populating the /dev directory in my compact flash file system?

After mounting the CF card, the kernel panics:

Kernel panic - not syncing: No init found. Try passing init= option to kernel

I assume this is due to the fact that there is nothing in the /dev directory? http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif

Is there are more elegant way to populate /dev than manual entry?

Thanks for your time.

Cheers,

Mark

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The easiest way is to generate a filesystem using the microtronix filesystem plugin for the Nios2 IDE.

    Create an ext2 filesystem on your flash-card

    Mount the ramfs image.

    copy everything from the ramfs image to the flash card.

    This gives you a nice base system with all the needed apps (including init http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif ) and /dev entry&#39;s to start off with.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks very much for your suggestion wgoossens.

    I made the file below, chmod +x, then ran it.

    Anyone is welcome to use this to generate entries in /dev

    mknod dev/button c 62 0
    mknod dev/console c 5 1
    mknod dev/cua0 c 5 64
    mknod dev/cua1 c 5 65
    mknod dev/cua2 c 5 66
    mknod dev/cua3 c 5 67
    mknod dev/cua4 c 5 68
    mknod dev/cua5 c 5 69
    mknod dev/cua6 c 5 70
    mknod dev/cua7 c 5 71
    mknod dev/cua8 c 5 72
    mknod dev/cua9 c 5 73
    mknod dev/fb0 c 29 0
    mknod dev/fb1 c 29 32
    mknod dev/hda b 3 0
    mknod dev/hda1 b 3 1
    mknod dev/hda2 b 3 2
    mknod dev/hda3 b 3 3
    mknod dev/hda4 b 3 4
    mknod dev/hda5 b 3 5
    mknod dev/hda6 b 3 6
    mknod dev/hda7 b 3 7
    mknod dev/hda8 b 3 8
    mknod dev/hdb b 3 64
    mknod dev/hdb1 b 3 65
    mknod dev/hdb2 b 3 66
    mknod dev/hdb3 b 3 67
    mknod dev/hdb4 b 3 68
    mknod dev/hdb5 b 3 69
    mknod dev/hdb6 b 3 70
    mknod dev/hdb7 b 3 71
    mknod dev/hdb8 b 3 72
    mknod dev/i2c-0 c 89 0
    mknod dev/i2c-1 c 89 1
    mknod dev/kmem c 1 2
    mknod dev/mem c 1 1
    mknod dev/null c 1 3
    mknod dev/ptyp0 c 2 0
    mknod dev/ptyp1 c 2 1
    mknod dev/ptyp2 c 2 2
    mknod dev/ptyp3 c 2 3
    mknod dev/ptyp4 c 2 4
    mknod dev/ptyp5 c 2 5
    mknod dev/ptyp6 c 2 6
    mknod dev/ptyp7 c 2 7
    mknod dev/ptyp8 c 2 8
    mknod dev/ptyp9 c 2 9
    mknod dev/ptypa c 2 10
    mknod dev/ptypb c 2 11
    mknod dev/ptypc c 2 12
    mknod dev/ptypd c 2 13
    mknod dev/ptype c 2 14
    mknod dev/ptypf c 2 15
    mknod dev/ram0 b 1 0
    mknod dev/ram1 b 1 1
    mknod dev/ram2 b 1 2
    mknod dev/ram3 b 1 3
    mknod dev/spi c 60 0
    mknod dev/tty c 5 0
    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/ttyJ0 c 232 16
    mknod dev/ttyS0 c 4 64
    mknod dev/ttyS1 c 4 65
    mknod dev/ttyS2 c 4 66
    mknod dev/ttyS3 c 4 67
    mknod dev/ttyS4 c 4 68
    mknod dev/ttyS5 c 4 69
    mknod dev/ttyS6 c 4 70
    mknod dev/ttyS7 c 4 71
    mknod dev/ttyS8 c 4 72
    mknod dev/ttyS9 c 4 73
    mknod dev/ttyp0 c 3 0
    mknod dev/ttyp1 c 3 1
    mknod dev/ttyp2 c 3 2
    mknod dev/ttyp3 c 3 3
    mknod dev/ttyp4 c 3 4
    mknod dev/ttyp5 c 3 5
    mknod dev/ttyp6 c 3 6
    mknod dev/ttyp7 c 3 7
    mknod dev/ttyp8 c 3 8
    mknod dev/ttyp9 c 3 9
    mknod dev/ttypa c 3 10
    mknod dev/ttypb c 3 11
    mknod dev/ttypc c 3 12
    mknod dev/ttypd c 3 13
    mknod dev/ttype c 3 14
    mknod dev/ttypf c 3 15
    mknod dev/zero c 1 5
    mkdir dev/input
    mknod dev/input/event0 c 13 64
    mknod dev/input/event1 c 13 65
    mknod dev/input/js0 c 13 0
    mknod dev/input/js1 c 13 1
    mknod dev/input/keyboard c 10 150
    mknod dev/input/mice c 13 63
    mknod dev/input/mouse c 10 149
    mknod dev/input/mouse0 c 13 32
    mknod dev/input/mouse1 c 13 33
    mknod dev/input/ttyACM0 c 166 0
    mknod dev/input/ttyACM1 c 166 1