Forum Discussion
Altera_Forum
Honored Contributor
20 years agoThis guide worked for me. Thanks hippo! initramfs cuts down on my flash memory requirements a lot. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
To others planning to use the above guide, here are some things I ran into: - Before starting, make sure you have bison, flex, and dos2unix. Bison and flex are probably available as packages for your Linux distribution. dos2unix is a common tool, but amazingly I didn't have it and my Linux distribution didn't have a package for it! If it's the same with you, then the simplest thing to do is to use the two-line perl script for dos2unix that they give here: http://soft.zoneo.net/linux/dos_to_unix.php (http://soft.zoneo.net/linux/dos_to_unix.php). Name the script "dos2unix" (without any extension), make it executable, and put it in your path. (Note: don't get the fancy dos2unix that converts between DOS, UNIX, and Mac in any direction. It'll break the build.) - The build process for elf2flt tries to use a static libc library, which you might not have. If the build for it fails with an error like "ld: cannot find -lc", then that's probably your problem. However, you can just change the elf2flt build process to use shared libraries. After the build fails due to the error, edit buildroot/toolchain_build_nios2/elf2flt/Makefile and remove the "-static" flag in LDFLAGS. Then run "make" and "make install" in the elf2flt directory to finish it, and then continue the rest of the build process by running "make" in the buildroot directory. - The build process automatically downloads additional source code from predetermined locations on the web. However, I found that some of the sites it tries to access don't exist anymore (or at least they were down when I was doing this). If a program called "wget" keeps trying to download from some URL, that's probably what's wrong. To fix this, google for the last part of the URL that it's trying to access (e.g. "gcc-3.4.3.tar.gz"). You should find a working link to that file somewhere on the first page of results. Use your browser's "Copy Link Location" feature to get the URL of the file. Next, grep the buildroot tree for the URL that wget is using (e.g. grep -R "mirrors\.rcn\.net" ~/buildroot). One of the results should be a line like GCC_SITE=http://mirrors.rcn.net/.../gcc-3.4.3.tar.gz in some makefile or something. Edit that file and change that line to use the URL that you found instead. Then resume the build process by running "make" in the buildroot directory. The wget step should then work. - If you configured your kernel to not support loadable modules, or if you just don't need any on your system, then you can skip the two steps labeled "copy module files to rootfs and generate modules.dep" and "rebuild image for initramfs". As a note, I built buildroot using gcc version 3.4.5.