I just ran into this because of a mistake I made. There are mknod's for /dev/tty1 and /dev/console that can never be successful in work/genkernel-3.4.9/generic/linuxrc. Comments and the code require that CHROOT & NEWROOT always be read-only. I would suggest that instead they should check for the existence of devices and if they don't exist, print an error. Another possibility might be a mount of /dev from the ramfs to the mounted root file system. 3.4.9 line numbers: 302: [ ! -e ${NEW_ROOT}/dev/null ] && mknod ${NEW_ROOT}/dev/null c 1 3 303: [ ! -e ${NEW_ROOT}/dev/console ] && mknod ${NEW_ROOT}/dev/console c 5 1 308: [ ! -e ${NEW_ROOT}/dev/sr0 ] && mknod ${NEW_ROOT}/dev/sr0 b 11 0 309: [ ! -e ${NEW_ROOT}/dev/loop0 ] && mknod ${NEW_ROOT}/dev/loop0 b 7 0 316: [ ! -e ${NEW_ROOT}/dev/tty1 ] && mknod ${NEW_ROOT}/dev/tty1 c 4 1 733: [ ! -e ${CHROOT}/dev/console ] && mknod ${CHROOT}/dev/console c 5 1 784: [ ! -e ${CHROOT}/dev/console ] && mknod ${CHROOT}/dev/console c 5 1 785: [ ! -e ${CHROOT}/dev/tty1 ] && mknod ${CHROOT}/dev/tty1 c 4 1
Are you seeing actual errors? If so, what?
Looking at the code right before that, there is a tmpfs mounted at ${NEW_ROOT}. That is definitely not read-only. What exactly happened and what was your mistake?
(In reply to comment #2) > That is definitely not read-only. What exactly happened and what was your > mistake? > My mistake was not having /dev populated with console & tty1 (mistakenly deleted stuff under /dev before booting, not realizing it had come from stage1). It was several days before I could boot, because I tried to install root into a 2048 byte sector flash drive, which grub fails. Anyway, I forgot what I had done. I had to install into a flash drive because my system had AHCI/SATA hard drives, and fdisk refused to read them. I missed the CDROM case in the init script that mounted root with tmpfs. Otherwise if it is not a CD, root is mounted read-only. When root is mounted read-only mknod fails, so you better have nodes present under /dev for that case. In the read-only case would be better to just check for the presence of /dev/console and /dev/tty1 and print a message, rather than doing a mknod and leading one to believe that somehow root was mounted read-only by mistake. After I read the script and realized that mknod was conditional, and I had no /dev devices, my error became clear. Relevant output: root block device() :: /dev/sdb2 >> Mounting root mknod: /newroot/dev/console: Read-only file system mknod: /newroot/dev/tty1: Read-only file system >> Booting (initramfs) switch_root: Bad Console '/dev/console' Kernel panic ...
Ok, it looks like you're triggering the mknod statements at line 783 and 784, which should only happen if the linuxrc is named /init. Why is your linuxrc named /init? What kind of crazy things are you doing?
Okay, nevermind. It's been pointed out to me that in an initramfs (as opposed to an initrd), the linuxrc is named /init to let the linuxrc know which it was booted from.
OK, I've fixed this in SVN. It'll be in the next genkernel (3.4.10_pre2)...
This was released in 3.4.10_pre2.