Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

[root@bsd /root]# uname -a FreeBSD bsd.localdomain 7.4-RELEASE FreeBSD 7.4-RELEASE #0: Thu Feb 17 03:51:56 UTC 2011 root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386

When I run, I get the following:

[root@bsd /usr/src/tools/tools/nanobsd]# sh -x nanobsd.sh -c custom.conf
+ set -e
+ NANO_NAME=full
+ NANO_SRC=/usr/src
+ NANO_TOOLS=tools/tools/nanobsd
+ NANO_PACKAGE_DIR=/usr/src/tools/tools/nanobsd/Pkg
+ NANO_PACKAGE_LIST=*
+ NANO_PMAKE=make -j 3
+ NANO_IMGNAME=_.disk.full
+ CONF_BUILD=
+ CONF_INSTALL=
+ CONF_WORLD=
+ NANO_KERNEL=GENERIC
+ NANO_CUSTOMIZE=
+ NANO_LATE_CUSTOMIZE=
+ NANO_NEWFS=-b 4096 -f 512 -i 8192 -O1 -U
+ NANO_DRIVE=ad0
+ NANO_MEDIASIZE=1200000
+ NANO_IMAGES=2
+ NANO_INIT_IMG2=1
+ NANO_CODESIZE=0
+ NANO_CONFSIZE=2048
+ NANO_DATASIZE=0
+ NANO_RAM_ETCSIZE=10240
+ NANO_RAM_TMPVARSIZE=10240
+ NANO_SECTS=63
+ NANO_HEADS=16
+ NANO_BOOT0CFG=-o packet -s 1 -m 3
+ NANO_BOOTLOADER=boot/boot0sio
+ NANO_MD_BACKING=file
+ PPLEVEL=4
+ NANO_ARCH=i386
+ do_clean=true
+ do_kernel=true
+ do_world=true
+ do_image=true
+ set +e
+ getopt bc:hiknqvw -c custom.conf
+ args= -c custom.conf --
+ [ 0 -ne 0 ]
+ set -e
+ set -- -c custom.conf --
+ . custom.conf
+ NANO_NAME=CUSTOM
+ NANO_KERNEL=CUSTOM
+ NANO_PMAKE=make -j 12
+
: not found

The file CUSTOM is present in /usr/src/sys/i386/conf/

It works when I only run # sh nanobsd.sh.

My custom.conf

NANO_NAME=CUSTOM
NANO_KERNEL=CUSTOM
#NANO_MD_BACKING=swap
NANO_PMAKE="make -j 12"

#NANO_PACKAGE_LIST='. -name *.tbz'
CONF_BUILD='
'

CONF_INSTALL='
WITHOUT_TOOLCHAIN=YES
WITHOUT_CPP=YES
WITHOUT_INSTALLLIB=YES
'

CONF_WORLD='
NO_MODULES=YES
WITHOUT_ACPI=YES
WITHOUT_ASSERT_DEBUG=YES
WITHOUT_ATM=YES
WITHOUT_AUDIT=YES
WITHOUT_AUTHPF=YES
WITHOUT_BIND=YES
WITHOUT_BLUETOOTH=YES
WITHOUT_CALENDAR=YES
WITHOUT_CDDL=YES
WITHOUT_CVS=YES
WITHOUT_DICT=YES
WITHOUT_DYNAMICROOT=YES
WITHOUT_EXAMPLES=YES
WITHOUT_FORTRAN=YES
WITHOUT_GAMES=YES
WITHOUT_GCOV=YES
WITHOUT_GDB=YES
WITHOUT_GPIB=YES
WITHOUT_GROFF=YES
WITHOUT_HTML=YES
WITHOUT_I4B=YES
WITHOUT_INFO=YES
WITHOUT_IPFILTER=YES
WITHOUT_IPX=YES
WITHOUT_KERBEROS=YES
WITHOUT_LPR=YES
WITHOUT_MAILWRAPPER=YES
WITHOUT_MAN=YES
WITHOUT_NCP=YES
WITHOUT_NETCAT=YES
WITHOUT_NIS=YES
WITHOUT_NS_CACHING=YES
WITHOUT_OBJC=YES
WITHOUT_PF=YES
WITHOUT_PROFILE=YES
WITHOUT_RCMDS=YES
WITHOUT_RCS=YES
WITHOUT_RESCUE=YES
WITHOUT_SENDMAIL=YES
WITHOUT_SHAREDOCS=YES
WITHOUT_SSP=YES
WITHOUT_SYSCONS=YES
WITHOUT_USB=YES
WITHOUT_ZFS=YES
WITHOUT_ZONEINFO=YES
'


BAR='
WITHOUT_NLS=YES
WITHOUT_NLS_CATALOGS=YES
WITHOUT_NETGRAPH=YES
'
FlashDevice sandisk 1g

cust_nobeastie() (
    touch ${NANO_WORLDDIR}/boot/loader.conf
    echo "beastie_disable=\"YES\"" >> ${NANO_WORLDDIR}/boot/loader.conf
)


customize_cmd cust_comconsole
#customize_cmd cust_pkg
customize_cmd cust_allow_ssh_root
customize_cmd cust_install_files
customize_cmd cust_nobeastie

Please tag nanobsd on this question.

share|improve this question
up vote 2 down vote accepted

It looks like there's a bug on the apparently empty line after NANO_PMAKE="make -j 12". The explanation that comes to mind is that you have Windows line endings in this file. Windows uses the two-character sequence \015\012 (\r\n) to store a line ending, while unix uses the single character \012 (\n), so a line in a Windows text file has a spurious \r character at the end when read under unix. This causes a silent problem in the first few lines, where the \r becomes part of the variable's value, and a visible problem on the empty line where the shell tries to interpret \r as a command name.

Run dos2unix custom.conf (IIRC dos2unix is in a port on FreeBSD), or perl -i -pe 's/\r$//' custom.conf. In the future, pay attention when editing a unix file under Windows — make sure to use unix line endings, or convert when copying the file, or just edit the file directly under unix.

share|improve this answer
    
Thanks, this worked, but pkg_add -r dos2unix failed, but perl was already installed. – CS01 May 24 '11 at 8:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .