need help with config rootfile system

After building kernel, I am learning how to build rootfile system. Could you please tell me if I want to locate my rootfile in the SD card as the way Angstrom do, how should I config the linux kernel file system?
I am still learning so my question maybe studpid, please let me know if there is sth wrong.

Best regards,
Thang Nguyen

Is it true that we can config the linux kernel so it can locate the rootfile at different places?

Yes, you can locate the rootfs pretty much anywhere provided the drivers to mount the location are built into the kernel. If they aren’t then you can use a initrd to load drivers and then mount the rootfs - so if you were sufficiently insane you could mount the rootfs using SSHFS. There probably aren’t any realistic options beyond NFS, SD card or USB drive. There isn’t really anything special about the BeagleBoard from this perspective so try Google and you should find lots of info…

After following the configuration in this instruction:

There is one difference is in the compile link I point to my local storing the CodeSourcery folder.


I do make and got errors about PAM package. By doing some researches, someone talking about missing the PAM package, but I don’t sure where should be this package locates and how to fix it.

I looked into the loginutils/login.c file to locate where these files are called:

#include <security/pam_appl.h>
#include <security/pam_misc.h>

But I cannot find where the security folder is? I guess this is the reason. Could you please tell me how I should fix this?

This is the make log:

naruto@naruto-laptop:~/oe/systemfiles/build/busybox-1.14.2$ make
SPLIT include/autoconf.h → include/config/*
GEN include/bbconfigopts.h
HOSTCC applets/usage
GEN include/usage_compressed.h
HOSTCC applets/applet_tables
GEN include/applet_tables.h
CC applets/applets.o
LD applets/built-in.o
LD archival/built-in.o
CC archival/ar.o
CC archival/bbunzip.o
CC archival/bzip2.o
CC archival/cpio.o
CC archival/gzip.o
CC archival/tar.o
CC archival/unzip.o
AR archival/lib.a
LD archival/libunarchive/built-in.o
CC archival/libunarchive/data_align.o
CC archival/libunarchive/data_extract_all.o
CC archival/libunarchive/data_extract_to_buffer.o
CC archival/libunarchive/data_extract_to_stdout.o
CC archival/libunarchive/data_skip.o
CC archival/libunarchive/decompress_bunzip2.o
CC archival/libunarchive/decompress_uncompress.o
CC archival/libunarchive/decompress_unlzma.o
CC archival/libunarchive/decompress_unzip.o
CC archival/libunarchive/filter_accept_all.o
CC archival/libunarchive/filter_accept_list.o
CC archival/libunarchive/filter_accept_reject_list.o
CC archival/libunarchive/find_list_entry.o
CC archival/libunarchive/get_header_ar.o
CC archival/libunarchive/get_header_cpio.o
CC archival/libunarchive/get_header_tar.o
CC archival/libunarchive/get_header_tar_bz2.o
CC archival/libunarchive/get_header_tar_gz.o
CC archival/libunarchive/get_header_tar_lzma.o
CC archival/libunarchive/header_list.o
CC archival/libunarchive/header_skip.o
CC archival/libunarchive/header_verbose_list.o
CC archival/libunarchive/init_handle.o
CC archival/libunarchive/open_transformer.o
CC archival/libunarchive/seek_by_jump.o
CC archival/libunarchive/seek_by_read.o
CC archival/libunarchive/unpack_ar_archive.o
AR archival/libunarchive/lib.a
LD console-tools/built-in.o
CC console-tools/clear.o
CC console-tools/reset.o
AR console-tools/lib.a
LD coreutils/built-in.o
CC coreutils/basename.o
CC coreutils/cat.o
CC coreutils/chmod.o
CC coreutils/cp.o
CC coreutils/cut.o
CC coreutils/echo.o
CC coreutils/false.o
CC coreutils/head.o
CC coreutils/hostid.o
CC coreutils/ln.o
CC coreutils/ls.o
CC coreutils/mkdir.o
CC coreutils/mkfifo.o
CC coreutils/mknod.o
CC coreutils/mv.o
CC coreutils/printf.o
CC coreutils/pwd.o
CC coreutils/rm.o
CC coreutils/sync.o
CC coreutils/tail.o
CC coreutils/test.o
CC coreutils/test_ptr_hack.o
CC coreutils/touch.o
CC coreutils/true.o
CC coreutils/uname.o
CC coreutils/yes.o
AR coreutils/lib.a
LD coreutils/libcoreutils/built-in.o
CC coreutils/libcoreutils/cp_mv_stat.o
CC coreutils/libcoreutils/getopt_mk_fifo_nod.o
AR coreutils/libcoreutils/lib.a
LD debianutils/built-in.o
CC debianutils/mktemp.o
CC debianutils/pipe_progress.o
CC debianutils/run_parts.o
CC debianutils/start_stop_daemon.o
CC debianutils/which.o
AR debianutils/lib.a
LD e2fsprogs/built-in.o
CC e2fsprogs/chattr.o
CC e2fsprogs/e2fs_lib.o
CC e2fsprogs/fsck.o
CC e2fsprogs/lsattr.o
AR e2fsprogs/lib.a
LD editors/built-in.o
CC editors/awk.o
CC editors/ed.o
CC editors/patch.o
CC editors/sed.o
CC editors/vi.o
AR editors/lib.a
LD findutils/built-in.o
CC findutils/find.o
CC findutils/grep.o
AR findutils/lib.a
LD init/built-in.o
CC init/halt.o
CC init/init.o
CC init/mesg.o
AR init/lib.a
LD libbb/built-in.o
CC libbb/appletlib.o
CC libbb/ask_confirmation.o
CC libbb/bb_askpass.o
CC libbb/bb_basename.o
CC libbb/bb_do_delay.o
CC libbb/bb_pwd.o
CC libbb/bb_qsort.o
CC libbb/bb_strtod.o
CC libbb/bb_strtonum.o
CC libbb/change_identity.o
CC libbb/chomp.o
CC libbb/compare_string_array.o
CC libbb/concat_path_file.o
CC libbb/concat_subpath_file.o
CC libbb/copy_file.o
CC libbb/copyfd.o
CC libbb/correct_password.o
CC libbb/crc32.o
CC libbb/create_icmp6_socket.o
CC libbb/create_icmp_socket.o
CC libbb/default_error_retval.o
CC libbb/device_open.o
CC libbb/dump.o
CC libbb/error_msg.o
CC libbb/error_msg_and_die.o
CC libbb/execable.o
CC libbb/fclose_nonstdin.o
CC libbb/fflush_stdout_and_exit.o
CC libbb/fgets_str.o
CC libbb/find_pid_by_name.o
CC libbb/find_root_device.o
CC libbb/full_write.o
CC libbb/get_console.o
CC libbb/get_last_path_component.o
CC libbb/get_line_from_file.o
CC libbb/getopt32.o
CC libbb/getpty.o
CC libbb/herror_msg.o
CC libbb/herror_msg_and_die.o
CC libbb/human_readable.o
CC libbb/inet_common.o
CC libbb/info_msg.o
CC libbb/inode_hash.o
CC libbb/isdirectory.o
CC libbb/kernel_version.o
CC libbb/last_char_is.o
CC libbb/lineedit.o
CC libbb/lineedit_ptr_hack.o
CC libbb/llist.o
CC libbb/login.o
CC libbb/make_directory.o
CC libbb/makedev.o
CC libbb/match_fstype.o
CC libbb/md5.o
CC libbb/messages.o
CC libbb/mode_string.o
CC libbb/mtab_file.o
CC libbb/obscure.o
CC libbb/parse_config.o
CC libbb/parse_mode.o
CC libbb/perror_msg.o
CC libbb/perror_msg_and_die.o
CC libbb/perror_nomsg.o
CC libbb/perror_nomsg_and_die.o
CC libbb/pidfile.o
CC libbb/print_flags.o
CC libbb/printable.o
CC libbb/process_escape_sequence.o
CC libbb/procps.o
CC libbb/ptr_to_globals.o
CC libbb/pw_encrypt.o
CC libbb/read.o
CC libbb/read_key.o
CC libbb/recursive_action.o
CC libbb/remove_file.o
CC libbb/restricted_shell.o
CC libbb/run_shell.o
CC libbb/safe_gethostname.o
CC libbb/safe_poll.o
CC libbb/safe_strncpy.o
CC libbb/safe_write.o
CC libbb/setup_environment.o
CC libbb/sha1.o
libbb/sha1.c:176:1: warning: “R0” redefined
In file included from /home/naruto/CodeSourcery/Sourcery_G++_Lite/bin/…/arm-none-linux-gnueabi/libc/usr/include/signal.h:351,
from include/libbb.h:22,
from libbb/sha1.c:31:
/home/naruto/CodeSourcery/Sourcery_G++_Lite/bin/…/arm-none-linux-gnueabi/libc/usr/include/sys/ucontext.h:44:1: warning: this is the location of the previous definition
libbb/sha1.c:177:1: warning: “R1” redefined
/home/naruto/CodeSourcery/Sourcery_G++_Lite/bin/…/arm-none-linux-gnueabi/libc/usr/include/sys/ucontext.h:46:1: warning: this is the location of the previous definition
CC libbb/signals.o
CC libbb/simplify_path.o
CC libbb/skip_whitespace.o
CC libbb/speed_table.o
CC libbb/str_tolower.o
CC libbb/strrstr.o
CC libbb/time.o
CC libbb/trim.o
CC libbb/u_signal_names.o
CC libbb/udp_io.o
CC libbb/uuencode.o
CC libbb/vdprintf.o
CC libbb/verror_msg.o
CC libbb/vfork_daemon_rexec.o
CC libbb/warn_ignoring_args.o
CC libbb/wfopen.o
CC libbb/wfopen_input.o
CC libbb/write.o
CC libbb/xatonum.o
CC libbb/xconnect.o
CC libbb/xfunc_die.o
CC libbb/xfuncs.o
CC libbb/xfuncs_printf.o
CC libbb/xgetcwd.o
CC libbb/xgethostbyname.o
CC libbb/xreadlink.o
CC libbb/xrealloc_vector.o
CC libbb/xregcomp.o
AR libbb/lib.a
LD libpwdgrp/built-in.o
CC libpwdgrp/pwd_grp.o
CC libpwdgrp/uidgid_get.o
AR libpwdgrp/lib.a
LD loginutils/built-in.o
CC loginutils/getty.o
CC loginutils/login.o
loginutils/login.c:22:31: error: security/pam_appl.h: No such file or directory
loginutils/login.c:23:31: error: security/pam_misc.h: No such file or directory
loginutils/login.c:24: error: variable ‘conv’ has initializer but incomplete type
loginutils/login.c:25: error: ‘misc_conv’ undeclared here (not in a function)
loginutils/login.c:25: warning: excess elements in struct initializer
loginutils/login.c:25: warning: (near initialization for ‘conv’)
loginutils/login.c:27: warning: excess elements in struct initializer
loginutils/login.c:27: warning: (near initialization for ‘conv’)
loginutils/login.c: In function ‘login_main’:
loginutils/login.c:292: error: ‘pam_handle_t’ undeclared (first use in this function)
loginutils/login.c:292: error: (Each undeclared identifier is reported only once
loginutils/login.c:292: error: for each function it appears in.)
loginutils/login.c:292: error: ‘pamh’ undeclared (first use in this function)
loginutils/login.c:293: warning: ISO C90 forbids mixed declarations and code
loginutils/login.c:355: warning: implicit declaration of function ‘pam_start’
loginutils/login.c:356: error: ‘PAM_SUCCESS’ undeclared (first use in this function)
loginutils/login.c:361: warning: implicit declaration of function ‘pam_set_item’
loginutils/login.c:361: error: ‘PAM_TTY’ undeclared (first use in this function)
loginutils/login.c:366: warning: implicit declaration of function ‘pam_authenticate’
loginutils/login.c:376: warning: implicit declaration of function ‘pam_acct_mgmt’
loginutils/login.c:385: warning: implicit declaration of function ‘pam_get_item’
loginutils/login.c:385: error: ‘PAM_USER’ undeclared (first use in this function)
loginutils/login.c:399: warning: implicit declaration of function ‘pam_open_session’
loginutils/login.c:404: warning: implicit declaration of function ‘pam_setcred’
loginutils/login.c:404: error: ‘PAM_ESTABLISH_CRED’ undeclared (first use in this function)
loginutils/login.c:413: warning: implicit declaration of function ‘pam_strerror’
loginutils/login.c:413: warning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘int’
make[1]: *** [loginutils/login.o] Error 1
make: *** [loginutils] Error 2

The method there is so 5 years ago. You mentioned angstrom in a previous mail, so why not follow the instructions on the angstrom website for that[1]?



[1] It stumps me why people keep following other guides and are surprised when those don't work, I always check upstream first for instructions.


I know that Angstrom OpenEmbedded is good, I used it already. But I am learning, so I just try to build it manually.