[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NanoBSD Image



On 25/04/07, Mathieu Arnold <mat_(_at_)_mat_(_dot_)_cc> wrote:
+-le 25.04.2007 19:18:19 +1000, David N a dit :
| On 25/04/07, David N <davidn04_(_at_)_gmail_(_dot_)_com> wrote:
|> On 24/04/07, Mathieu Arnold <mat_(_at_)_mat_(_dot_)_cc> wrote:
|> > +-Le 24/04/07 14:17 +1000, David N a dit :
|> > | Hi,
|> > |
|> > | I'm just wondering if its possible to mount the _.disk.full or
|> > | _.disk.image?
|> >
|> > Yes, just use mdconfig, something like mdconfig -a -t vnode -f
|> > _.disk.full, you'll have a /dev/mdX with it in.
|> >
|> > | Also, is it possible to dd the images to a slice or partition on a HDD
|> > | as i dont have any Memory Cards to test it on at the moment.
|> > |
|> > | such as
|> > | dd if=_.disk.image of=/dev/ads2 bs=64k
|> >
|> > You can, but you'll loose a lot of space :)
|> >
|> > --
|> > Mathieu Arnold
|> >
|>
|> Thanks Mathieu, the mdconfig worked =)
|>
|> For the hdd
|> dd if=_.disk.image of=/dev/ad0s2 bs=64k worked but had to modify the
|> /etc/fstab of the image and create a /dev/ad0s3 and newfs it for the
|> /cfg. But works great =)
|>
|> David
|>
| Hello again,
|
| I've got the thing running, but the images are 256MB but I've only
| managed to get the "used" space down to around 80MB.
|
| I was hoping is there anything in the configuration file to get it
| down to bare bones and slowly add things in. Is it possible to get it
| down to pretty much a kernel + shell?
|
| My config file is

Mine is (it was for a 6.1-PRERELEASE though)

NANO_NAME=soekris64
NANO_SRC=/usr/src
NANO_TOOLS=tools/tools/nanobsd
CONF_BUILD='
'
CONF_INSTALL='
NO_INSTALLLIB=
NO_TOOLCHAIN=
'

CONF_WORLD='
CPUTYPE=i486
CFLAGS=-O -pipe
NO_ACPI=
NO_ATM=
NO_BIND_DNSSEC=
NO_BLUETOOTH=
NO_CALENDAR=
NO_CVS=
NO_CXX=
NO_DICT=
NO_EXAMPLES=
NO_FORTRAN=
NO_GAMES=
NO_GCOV=
NO_GDB=
NO_GPIB=
NO_GROFF=YES
NO_HESIOD_LIBC=
NO_HTML=
NO_I4B=
NO_INFO=
NO_IPFILTER=
NO_IPX=YES
NO_KERBEROS=
NO_LIBC_R=
NO_LIBTHR=
NO_LOCALES=
NO_LPR=
NO_MAKE=
NO_MAN=
NO_MAN=YES
NO_MISC=
NO_MODULES=
NO_NIS=
NO_NLS=
NO_NLS=YES
NO_OBJC=
NO_P1003_1B=
NO_PAM=
NO_PCVT=YES
NO_PROFILE=
NO_RCMDS=
NO_RESCUE=
NO_SENDMAIL=
NO_SHARE=
NO_SHAREDOCS=
NO_SYSCONS=
NO_TCSH=
PPP_NO_ATM=
PPP_NO_I4B=
PPP_NO_PAM=
PPP_NO_RADIUS=
MAKE_IDEA=
LOADER_TFTP_SUPPORT=YES
'

NANO_KERNEL=SOEKRIS
NANO_CUSTOMIZE=""
NANO_NEWFS="-b 4096 -f 512 -i 8192 -O2 -U -m 0"
NANO_DRIVE=ad0
FlashDevice Soekris 64
NANO_IMAGES=1
NANO_CODESIZE=0
NANO_CONFSIZE=$((1024/512*1024*2)) # 2 M
NANO_DATASIZE=0
customize_cmd cust_comconsole
customize_cmd cust_allow_ssh_root
customize_cmd cust_install_files

mat_pkg () (
        mkdir -p ${NANO_WORLDDIR}/Pkg
        cp -r /usr/src/tools/tools/nanobsd/Pkg/* ${NANO_WORLDDIR}/Pkg
        chroot ${NANO_WORLDDIR} sh -c 'pkg_add -v -p /usr/local Pkg/All/*'
        rm -rf ${NANO_WORLDDIR}/Pkg
)

customize_cmd mat_pkg

mat_ssh () (
        mkdir -p ${NANO_WORLDDIR}/root/.ssh
        install -o root -g wheel -m 0600 /home/mat/.ssh/authorized_keys
${NANO_WORLDDIR}/root/.ssh
)

customize_cmd mat_ssh

mat_root () (
        chroot ${NANO_WORLDDIR} chpass -p '$1$foobar' -s /usr/local/bin/bash
root
)

customize_cmd mat_root

mat_comconsole () (
        # Enable getty on console
        sed -i "" -e /ttyd0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys

        # Disable getty on syscons devices
        sed -i "" -e '/^ttyv[0-8]/s/    on/     off/'
${NANO_WORLDDIR}/etc/ttys

        # Tell loader to use serial console early.
        echo " -h" > ${NANO_WORLDDIR}/boot.config
)

customize_cmd mat_comconsole

The resulting fits on a 64Mo flash :
/dev/ad0s1a     57M     52M    4.7M    92%    /
/dev/ad0s3     1.8M    116K    1.7M     6%    /cfg

I was planning to upgrade my soekris to 6.2, I'll try to see if it still fits
:)

My SOEKRIS kernel contains the following :

machine         i386
cpu             I486_CPU
ident           SOEKRIS
options         SCHED_4BSD
options         PREEMPTION
options         INET
options         INET6
options         FFS
options         SOFTUPDATES
options         MD_ROOT
options         NFSCLIENT
options         NFS_ROOT
options         PROCFS
options         PSEUDOFS
options         GEOM_GPT
options         COMPAT_43
options         COMPAT_FREEBSD4
options         COMPAT_FREEBSD5
options         SCSI_DELAY=5000
options         KTRACE
options         SYSVSHM
options         SYSVMSG
options         SYSVSEM
options         _KPOSIX_PRIORITY_SCHEDULING
options         KBD_INSTALL_CDEV
options         AHC_REG_PRETTY_PRINT
options         AHD_REG_PRETTY_PRINT
options         ADAPTIVE_GIANT
device          apic
device          eisa
device          pci
device          ata
device          atadisk
options         ATA_STATIC_ID
device          pmtimer
device          sio
device          miibus
device          sis
device          loop
device          random
device          ether
device          sl
device          ppp
device          tun
device          pty
device          md
device          gif
device          bpf
options         CPU_ELAN
options         CPU_ELAN_PPS
options         CPU_SOEKRIS
options         CONSPEED=19200
options         INCLUDE_CONFIG_FILE
device          pf
device          carp
device          pflog
device          pfsync
device          vlan
device          tap
device          gre
device          if_bridge
options         PPP_BSDCOMP
options         PPP_DEFLATE
options         PPP_FILTER
options         FAST_IPSEC
options         TCP_SIGNATURE
device          crypto
device          cryptodev
options         ALTQ
options         ALTQ_HFSC
options         ALTQ_CBQ
options         ZERO_COPY_SOCKETS
options         HZ=1000
options         PPS_SYNC
options         NO_SWAPPING
options         DEVICE_POLLING
options         SMBFS
options         NETSMB
options         NETSMBCRYPTO
options         ALTQ
options         ALTQ_CBQ
options         ALTQ_RED
options         ALTQ_RIO
options         ALTQ_HFSC
options         LIBICONV
options         LIBMCHAIN


--
Mathieu Arnold

Thanks again, that did the job, got it down to 56MB on 6.2-RELEASE
just added some of your options in. Do you know where to get more
information on on the make flags available? man make and man make.conf
doesn't have much detail. I've been to
http://phk.freebsd.dk/misc/build_options/ which helped with my compile
errors =) But i'm just out of further information on how to get it
slimmer.

Cheers
David
_______________________________________________
freebsd-small_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe_(_at_)_freebsd_(_dot_)_org"