Re: error compiling linux-2.1.121: CONFIG_BLK_DEV_INITRD

Thomas \ (vaughan@bob.nhn.ou.edu)
Thu, 10 Sep 1998 08:59:16 -0500


On Thu, Sep 10, 1998 at 02:56:19PM +0300, Linux Kernel list wrote:
>
> gcc -D__KERNEL__ -I/usr/src/linux-2.1.121/include -D__ASSEMBLY__
> -traditional -c putuser.S -o putuser.o
> rm -f lib.a
> ar rcs lib.a checksum.o semaphore.o delay.o usercopy.o getuser.o
> putuser.o
> make[2]: Leaving directory `/usr/src/linux-2.1.121/arch/i386/lib'
> make[1]: Leaving directory `/usr/src/linux-2.1.121/arch/i386/lib'
> ld -m elf_i386 -T /usr/src/linux-2.1.121/arch/i386/vmlinux.lds -e stext
> arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o
> init/version.o \
> arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
> mm/mm.o fs/fs.o ipc/ipc.o \
> fs/filesystems.a \
> net/network.a \
> drivers/block/block.a drivers/char/char.a drivers/misc/misc.a
> drivers/net/net.a drivers/scsi/scsi.a drivers/cdrom/cdrom.a
> drivers/sound/sound.a drivers/pci/pci.a drivers/pnp/pnp.a
> drivers/video/video.a \
> /usr/src/linux-2.1.121/arch/i386/lib/lib.a
> /usr/src/linux-2.1.121/lib/lib.a
> /usr/src/linux-2.1.121/arch/i386/lib/lib.a \
> -o vmlinux
> fs/fs.o: In function `change_root':
> fs/fs.o(.text+0x5ac3): undefined reference to `initmem_freed'
> make: *** [vmlinux] Error 1
> [root@lcjdap /usr/src/linux-2.1.121]#

I have seen the same problem. Apparently it will only show up if
you have initial ramdisk support compiled in (CONFIG_BLK_DEV_INITRD).
If CONFIG_BLK_DEV_INITRD is set, then some code in fs/super.c is compiled
in. That code contains an 'extern int' reference to 'initmem_freed' as
well as a function declaration for 'change_root', in which 'initmem_freed'
is used.

The problem is that nowhere else reasonable is 'initmem_freed' declared.
(I don't have support for fbcon compiled in.)

# cd /usr/src/kernel-source-2.1.121
# grep initmem_freed `find . -name '*.c'`
./fs/super.c:extern int initmem_freed;
./fs/super.c: if (initmem_freed) {
./drivers/video/fbcon.c: int initmem_freed = 1;
./drivers/video/fbcon.c: if (con != fg_console || initmem_freed || p->type == FB_TYPE_TEXT)
./drivers/video/fbcon.c: fbcon_show_logo(); /* This is protected above by initmem_freed */

However, 2.1.119, which compiles and runs nicely for me, shows the
following.

# cd /usr/src/kernel-source-2.1.119
# grep initmem_freed `find . -name '*.c'`
./fs/super.c:extern int initmem_freed;
./fs/super.c: if (initmem_freed) {
./fs/filesystems.c:int initmem_freed = 0;
./fs/filesystems.c: if (!initmem_freed) {
./fs/filesystems.c: initmem_freed = 1;
./drivers/video/fbcon.c: extern int initmem_freed;
./drivers/video/fbcon.c: if (con != fg_console || initmem_freed || p->type == FB_TYPE_TEXT)
./drivers/video/fbcon.c: fbcon_show_logo(); /* This is protected above by initmem_freed */

So the declaration of 'initmem_freed' and some code related to it seem
to have vanished from 'fs/filesystems.c'

-- 
Thomas E. Vaughan                            vaughan@mail.nhn.ou.edu
Dept. of Physics & Astronomy                 home: (405) 366-8721
University of Oklahoma, Norman               work: (405) 325-3961x36403

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/faq.html