2012-12-27

Your first run of FreeBSD on Genesi Efika MX Smartbook

Hi everyone!

Think you already know, what framebuffer console already works on Genesi Efika MX Smartbook.

So how to done that?

Begin

Now, since SD/MMC support still a bit broken we need not only SD card, but USB flash stick also. So:
1. SD card;
2. USB flash stick;
3. FreeBSD system :)
4. Genesi Efika MX Smartbook :)
5. and U-Boot's mkimage utility;

mkimage utility

Extract, make and install U-Boot mkimage utility.

fetch http://people.freebsd.org/~ray/u-boot.new.tar.gz
tar xvzf u-boot.new.tar.gz
cd u-boot.new
make install

If I remember correct,it will install uboot_mkimage into /usr/local/bin/, otherwise rename it by hand
mv /usr/local/bin/mkimage /usr/local/bin/uboot_mkimage 
I don't think mkimage is good name for such special utility :) 

Build

Get sources

Get your own copy of project files:


mkdir efika_mx
cd efika_mx
svn co svn://svn.freebsd.org/base/projects/efika_mx/

Prepare USB Flash stick

Better to have to slices (while we still not have UFS support in U-Boot)
  1. for small MSDOS filesystem, we will store kernel here
  2. for UFS rootfs
for example, you have empty USB Flash stick as /dev/da0, then do:

# Create MBR partitioning scheme
gpart create -s MBR da0

# Create 128MB fat32 slice
gpart add -t fat32 -i 1 -s 128m da0

# Create space for swap (better at least 1G)
gpart add -t freebsd -i 2 -s 512M da0

# Anything left for FreeBSD filesystems
gpart add -t freebsd -i 3 da0

# BSD partitioning
gpart create -s BSD da0s3

# Give everything to rootfs
gpart add -t freebsd-ufs da0s3

# Make filesystems
newfs /dev/da0s3a
newfs -t msdosfs /dev/da0s1

# Done, now mount filesystems
mount -t msdosfs /dev/da0s1 /mnt/imx/dos
mount -t ufs /dev/da0s3a /mnt/imx/ufs

Don't forget to change mount point in kernel config (sys/arm/conf/EFIKA_MX) to ufs:da0s3a.

Script to build everything

Set environment variables:
SRCDIR - path to your copy of project;
OBJDIR - place to keep object files and other stuff for build, better to have it in your home and run build as regular user (not root) then you will not break your system by wrong install.
TFTPDIR - place to where kernel will be copied, so U-Boot will be able to load it by tftp.
DSTDIR - where to install world, can be NFS directory or root of mounted USB flash

And mandatory:
TARGET - architecture for which we will build everthing
TARGET_ARCH - architecture subtype
TARGET_CPUTYPE - CPU type
KERNCONF - file name of kernel configuration


Example, as build script:

#!/bin/sh

SRCDIR=/usr/home/ray/work/FreeBSD/Projects/Efika_MX/src/efika_mx/
OBJDIR=/usr/obj/
TFTPDIR="/tftpboot/efika_mx/"
DSTDIR=${OBJDIR}/ARMV6

TARGET=arm
TARGET_ARCH=armv6
TARGET_CPUTYPE=armv6
KERNCONF=EFIKA_MX

KERNOBJDIR="${OBJDIR}/${TARGET}.${TARGET_ARCH}/${SRCDIR}/sys/${KERNCONF}"

export TARGET
export TARGET_ARCH
export TARGET_CPUTYPE
# Hope someday somebody fix aicasm to not break builds for special case :)
export WITHOUT_AICASM=yes

echo -n "Start at "
date


# Uncomment next line if don't want to rebuild everithing
#FLAGS=-DNO_CLEAN

make KERNCONF=${KERNCONF} ${FLAGS} toolchain || exit 1
make KERNCONF=${KERNCONF} ${FLAGS} buildworld || exit 1
make KERNCONF=${KERNCONF} ${FLAGS} buildkernel || exit 1
# Kernel we will install into separate place (installkernel)
make DESTDIR=${DSTDIR} ${FLAGS} installworld || exit 1
make DESTDIR=${DSTDIR} ${FLAGS} distribution || exit 1

uboot_mkimage -A ARM -O Linux -T kernel -C none -a 0x90100000 -e 0x90100100 -n "FreeBSD kernel" -d "${KERNOBJDIR}/kernel" "${TFTPDIR}/kernel.uboot"

echo -n "Done at "
date
-------------8<-------------------------------------------------------------

Now you can just run the script:
sh ./script_file_name

Don't forget to enable watchdogd and virtual terminals.

First:
echo 'watchdogd_enable="YES"' >> ${WHERE_IS_NEW_ROOTFS_MOUNTED}/etc/rc.conf

For second one, open ${WHERE_IS_NEW_ROOTFS_MOUNTED}/etc/ttys in your editor and replace "off" with "on" on lines with /dev/ttyv0 - ttyv7

Without first devices will reset after 127 seconds lefts after "run bsd" command in U-Boot.
Without second one - you will not get login prompt.

Prepare card


  1. Fetch U-Boot image here 
  2. Insert unused SD card
  3. WARNING! Check your /dev/da devices first, to not damage other cards, of SCSI HDD, or USB flash stick. Assuming your unused SD is /dev/da0 
  4. dd if=u-boot_efiks_mx_smartbook.imx of=/dev/da0 bs=1k seek=1 conv=sync 
  5. Invert DIP switch under keyboard (1-OFF, 2-OFF, 3-OFF, 4-ON)
  6. Power up device (Press power button)

    \ smarttopsmartbook
DIP normOn|On|On|OffOn|On|On|Off
DIP sd.imxOff|Off|Off|OffOff|Off|Off|On
Linku-boot_st.imxu-boot_sb.imx


If you connect ASIX based USB Ethernet adapter and type "run bsd",
U-Boot will try to assign IP 192.168.10.85 to axe0 and ask
efika_mx/kernel.uboot by TFTP on host 192.168.10.90.


[0] http://people.freebsd.org/~ray/u-boot_efika_mx_smartbook.imx

Currently I use SD card to only boot machine with U-Boot. 

Boot

So after power up, U-Boot will stop and show you command prompt. If you prepare tftp boot for kernel as I say in previous paragraph, then just type:

run bsd

this line do:

setenv ipaddr 192.168.10.85
setenv serverip 192.168.10.85
tftp 0x91000000 efika_mx/kernel.uboot
mw.w 0x73f98000 0xff3c 1
bootm 0x91000000

two top lines already in environment, so they not executed actually.
tftp ... load firnel.uboot from dir efika_mx on tftp server
mw.w ... is simple command for write word (4bytes) into memory, with that args it's enable Watchdog. Watchdog will reset board after 128 seconds, if device will hang or not start watchdogd. So you have two ways: 1) start kernel with
tftp 0x91000000 efika_mx/kernel.uboot ; bootm 0x91000000
or enable watchdogd

That U-Boot binary  also have fat command. This command do:
fat=ide reset
fatload ide 0:1 0x91000000 kernel.uboot
bootm 0x91000000
Reset/init PATA controller, load kernel.uboot from first slice which have FAT fs and boot it.

Overview of boot process


1. If DIP switch set as 1-OFF, 2-OFF, 3-OFF, 4-ON, system try to load image from SD card at offset 1024 bytes (think if we will prepare USB flash same way it will boot also, but not checked it yet) to memory at address 0x97800000.
2. execute program at address 0x97800000. (We get U-Boot prompt)
3. We run U-Boot command to start kernel.
4. If kernel found mountpoint specified in option ROOTDEVNAME of kernel config file, it continue to boot. Otherwise stops and ask you to specify it manually (not sure usb keyboard works here or not). Anyway, better to compile kernel to mount from flash drive "da0s1a" (or "da0s2a" if you make FAT slice first). But then rebuild with "ada0s2a", to get kernel which will mount internal SSD drive.

Ok, enough for now :)
Let me know, if I forget something important.
Mail me ray@...








Efika MX Smartbook, your first run

Since FreeBSD port currently not require any special features, then it's
possible to boot kernel from original (first) uboot.


1. Fetch U-Boot image here
http://people.freebsd.org/~ray/u-boot_efiks_mx_smartbook.imx
2. Insert unused SD card
3. WARNING! Check your /dev/da devices first, to not damage other cards,
of SCSI HDD, or USB flash stick. Assuming your unused SD is /dev/da0
dd if=u-boot_efiks_mx_smartbook.imx of=/dev/da0 bs=1k seek=1 conv=sync
4. Invert DIP switch under keyboard (1-OFF, 2-OFF, 3-OFF, 4-ON)
5. Power up device (Press power button)

If you connect ASIX based USB Ethernet adapter and type "run bsd",
U-Boot will try to assign IP 192.168.10.88 to axe0 and ask
efika_mx/kernel.uboot by TFTP on host 192.168.10.90.




My build script (it's updated version https://raw.github.com/rayddteam/efika_mx/master/MAKE_EFIKA_MX.sh)
--------------------------------------------------------------------
#!/bin/sh

SRCDIR=/usr/home/ray/work/FreeBSD/Projects/Efika_MX/src/efika_mx/
OBJDIR=/usr/obj/
TARGET=arm
TARGET_ARCH=armv6
TARGET_CPUTYPE=armv6
KERNCONF=EFIKA_MX
KERNOBJDIR="${OBJDIR}/${TARGET}.
${TARGET_ARCH}/${SRCDIR}/sys/${KERNCONF}"

TFTPDIR="/tftpboot/efika_mx/"

DSTDIR=${OBJDIR}/ARMV6

export TARGET
export TARGET_ARCH
export TARGET_CPUTYPE
export WITHOUT_AICASM=yes

echo -n "Start at "
date
FLAGS=-DNO_CLEAN

make KERNCONF=${KERNCONF} ${FLAGS} toolchain || exit 1
make KERNCONF=${KERNCONF} ${FLAGS} buildworld || exit 1
make KERNCONF=${KERNCONF} ${FLAGS} buildkernel || exit 1
echo uboot_mkimage -A ARM -O Linux -T kernel -C none -a 0x90100000 -e 0x90100100 -n "FreeBSD kernel" -d "${KERNOBJDIR}/kernel" "${TFTPDIR}/kernel.uboot"
uboot_mkimage -A ARM -O Linux -T kernel -C none -a 0x90100000 -e 0x90100100 -n "FreeBSD kernel" -d "${KERNOBJDIR}/kernel" "${TFTPDIR}/kernel.uboot"

echo -n "Done at "
date

--------------------------------------------------------------------

Preparing card

Assuming you have connected to your PC SD card and it have device name /dev/da0.

# Create MBR partitioning scheme
gpart create -s MBR da0

# Create 128MB fat32 slice
gpart add -t fat32 -i 1 -s 128m da0


# Create space for swap (better at least 1G)
gpart add -t freebsd -i 2 -s 512M da0




# Anything left for FreeBSD filesystems
gpart add -t freebsd -i 3 da0

# BSD partitioning

gpart create -s BSD da0s3

# Give everything to rootfs
gpart add -t freebsd-ufs da0s3


# Done, now mount filesystems
mount -t msdosfs /dev/da0s1 /mnt/imx/dos
mount -t ufs /dev/da0s3a /mnt/imx/ufs

Preparing files for boot

No fill with data. We need boot script and kernel.

boot script

Create file boot and add following lines to it:

echo Initialize MMC subsystemmmcinit
echo Loading kernel ...
fatload mmc 0 0x91000000 kernel.uboot
echo Start kernel
bootm 0x91000000


Pack script into U-Boot image:
mkimage -T script -d boot boot.scr

2012-11-22

Setup FreeBSD to Efika MX (draft)

It's just my vision. So anyone who have better idea, please notify me about it and we will correct that document. Then I will reuse it to make "official" guide.

1. Invert all 4 swiches
smarttop - 4x DIP switch inside small window on bottom side (for debug board)
smartbook - 4x DIP switch under keyboard (remove/install keyboard with care)
2. Insert SD card (will prepare image for card when make sdhci works)
3. Power on device
it will do:
1. 1st uboot init mmc/SD subsystem
2. Find boot script on 1st FAT partition
3. Run script
4. Script load/run 2nd uboot
5. 2nd uboot init USB, SD, PATA
6. load/run ubldr
7. ubldr find UFS and load/run kernel
4. There must be customized bsdinstall, which must help to:
1. make FAT/EXTFS partition on PATA SSD
2. Install bootscript/uboot(second)/ubldr
3. Make his regular job to install distribution to UFS partition

(huh, enough for first time)

2012-11-13

Efika MX boot

<pre>
 U-Boot 2009.01.2.0.6-efikasb (Nov 02 2010 - 09:58:13)

CPU:   Freescale i.MX51 family 3.0V at 800 MHz
mx51 pll1: 800MHz
mx51 pll2: 665MHz
mx51 pll3: 216MHz
ipg clock     : 66500000Hz
ipg per clock : 665000000Hz
uart clock    : 66500000Hz
cspi clock    : 54000000Hz
Board: Efika MX Smartbook [POR]
PMIC ID: 0x000045d0 [Rev: 2.0a]
DRAM:  512 MB
JEDEC ID: 0xbf:0x25:0x4a
Reading SPI NOR flash 0x40000 [0x1000 bytes] -> ram 0xafd006e8
SUCCESS

In:    serial
Out:   serial
Err:   serial
Boot Source: SPI NOR FLASH BOOT
Hit any key to stop autoboot:  0
JEDEC ID: 0xbf:0x25:0x4a
4096 KiB SST25VF032B - 4MB at 0:1 is now current device
Reading SPI NOR flash 0x100000 [0x50000 bytes] -> ram 0x97800000
.SUCCESS

## Starting application at 0x97800000 ...
                                         �
U-Boot 2012.04.01-g7862ffd-dirty (Aug 16 2012 - 16:53:57)

CPU:   Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: POR
Board: Efika MX, rev1.3
DRAM:  512 MiB
WARNING: Caches not enabled
MMC:   FSL_SDHC: 0
SF: Detected SST25VF032B with page size 4 KiB, total 4 MiB
In:    serial
Out:   serial
Err:   serial
Net:   CPU Net Initialization Failed
No ethernet found.
Efika> run bsd
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 4 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
       scanning bus for ethernet devices... 1 Ethernet Device(s) found
Waiting for Ethernet connection... done.
Using asx0 device
TFTP from server 192.168.10.90; our IP address is 192.168.10.87
Filename 'efika_mx/kernel.uboot'.
Load address: 0x91000000
Loading: T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #######################################
done
Bytes transferred = 5337304 (5170d8 hex)
## Booting kernel from Legacy Image at 91000000 ...
   Image Name:   FreeBSD kernel
   Created:      2012-11-13  15:39:05 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5337240 Bytes = 5.1 MiB
   Load Address: 90100000
   Entry Point:  90100100
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #229 r242977:242979: Tue Nov 13 17:38:46 EET 2012
    ray@terran.dlink.ua:/usr/obj/arm.armv6/usr/home/ray/work/FreeBSD/Projects/Efika_MX/src/efika_mx/sys/EFIKA_MX arm
Preloaded elf kernel "kernel" at 0xc05342d0.
CPU: Cortex A8-r2 rev 5 (Cortex-A core)
 Supported features: ARM_ISA THUMB2 JAZELLE THUMBEE ARMv4 Security_Ext
 WB disabled EABT branch prediction enabled
LoUU:2 LoC:2 LoUIS:1
Cache level 1:
 32KB/64B 4-way data cache WT WB Read-Alloc
 32KB/64B 4-way instruction cache Read-Alloc
Cache level 2:
 256KB/64B 8-way unified cache WT WB Read-Alloc Write-Alloc
real memory  = 536870912 (512 MB)
Physical memory chunk(s):
0x90000000 - 0x900fffff, 1048576 bytes (256 pages)
0x905eb000 - 0xaf629fff, 520351744 bytes (127039 pages)
avail memory = 519168000 (495 MB)
random device not loaded; using insecure entropy
wlan: <802.11 Link Layer>
null: <null device, zero device>
openfirm: <Open Firmware control device>
random: <entropy source, Software, Yarrow>
mem: <memory>
nfslock: pseudo-device
fdtbus0: <FDT main bus>
simplebus0: <Flattened device tree simple bus> on fdtbus0
tzic0: <TrustZone Interrupt Controller> mem 0xcffc7000-0xcffcafff on simplebus0
simplebus1: <Flattened device tree simple bus> on fdtbus0
simplebus2: <Flattened device tree simple bus> on simplebus1
imxccm0: <Freescale Clock Control Module> mem 0xe3fd4000-0xe3fd7fff,0xcffcb000-0xcffcefff,0xcffcf000-0xcffd2fff,0xcffd3000-0xcffd6fff irq 71,72 on simplebus2
imxccm0: PLL1=800MHz, PLL2=665MHz, PLL3=216MHz
imxccm0: CPU clock=800000000, UART clock=66500000
imxccm0: mainbus clock=665000000, ahb clock=133000000 ipg clock=66500000 perclk=2000000
simplebus3: <Flattened device tree simple bus> on simplebus2
ehci0: <Freescale integrated USB controller> mem 0xe3f80000-0xe3f83fff irq 14,16,17,18 on simplebus2
ehci0: [GIANT-LOCKED]
usbus0: EHCI version 1.0
usbus0 on ehci0
ehci0: usbpf: Attached
imx_gpt0: <Freescale i.MXxxx GPT timer> mem 0xe3fa0000-0xe3fa3fff irq 39 on simplebus2
imx_gpt0: Run on 66500KHz clock.
Event timer "i.MXxxx GPT Eventtimer" frequency 66500000 Hz quality 1000
Timecounter "i.MX GPT Timecouter" frequency 66500000 Hz quality 1000
clock: hz=100 stathz = 0
imx_gpt0: timer clock frequency 66500000
uart0: <imx_uart> mem 0xe3fbc000-0xe3fbffff irq 31 on simplebus2
uart0: fast interrupt
uart0: console (115200,n,8,1)
simplebus4: <Flattened device tree simple bus> on simplebus1
atapci0: <Freescale Integrated PATA Controller> mem 0xcffef000-0xcfff2fff irq 70 on simplebus4
ata2: <ATA channel> at channel 0 on atapci0
imx_gpt0: switch DELAY to use H/W counter
Timecounters tick every 10.000 msec
lo0: bpf attached
usbus0: 480Mbps High Speed USB v2.0
ata2: reset tp1 mask=01 ostat0=d0 ostat1=00
ata2: stat0=0x50 err=0x01 lsb=0x00 msb=0x00
ata2: reset tp2 stat0=50 stat1=00 devices=0x1
ugen0.1: <Freescale> at usbus0
uhub0: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ada0 at ata2 bus 0 scbus0 target 0 lun 0
ada0: <SanDisk pSSD-P2 8GB SSD 5.20> ATA-8 device
ada0: Serial Number CFZ071510001526
ada0: 16.700MB/s transfers (PIO4, PIO 512bytes)
ada0: 7641MB (15649200 512 byte sectors: 16H 63S/T 15525C)
ada0: Previously was known as ad4
pass0 at ata2 bus 0 scbus0 target 0 lun 0
pass0: <SanDisk pSSD-P2 8GB SSD 5.20> ATA-8 device
pass0: Serial Number CFZ071510001526
pass0: 16.700MB/s transfers (PIO4, PIO 512bytes)
GEOM: new disk ada0
Root mount waiting for: usbus0
uhub0: 1 port with 1 removable, self powered
Root mount waiting for: usbus0
ugen0.2: <vendor 0x1a40> at usbus0
uhub1: <vendor 0x1a40 USB 2.0 Hub MTT, class 9/0, rev 2.00/1.00, addr 2> on usbus0
uhub1: MTT enabled
Root mount waiting for: usbus0
uhub1: 4 ports with 4 removable, self powered
Root mount waiting for: usbus0
ugen0.3: <Kingston> at usbus0
umass0: <Kingston DT 101 II, class 0/0, rev 2.00/1.10, addr 3> on usbus0
umass0:1:0:-1: Attached to scbus1
(probe0:umass-sim0:0:0:0): Down reving Protocol Version from 2 to 0?
pass1 at umass-sim0 bus 0 scbus1 target 0 lun 0
pass1: <Kingston DT 101 II PMAP> Removable Direct Access SCSI-0 device
pass1: Serial Number 0019E00149F7B9B1E000010C
pass1: 40.000MB/s transfers
da0 at umass-sim0 bus 0 scbus1 target 0 lun 0
da0: <Kingston DT 101 II PMAP> Removable Direct Access SCSI-0 device
da0: Serial Number 0019E00149F7B9B1E000010C
da0: 40.000MB/s transfers
da0: 3827MB (7837696 512 byte sectors: 255H 63S/T 487C)
GEOM: new disk da0
Root mount waiting for: usbus0
ugen0.4: <vendor 0x2001> at usbus0
axe0: <vendor 0x2001 product 0x3c05, rev 2.00/0.01, addr 4> on usbus0
axe0: PHYADDR 0xe0:0x03

Loader variables:

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:tank
        cd9660:/dev/acd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot> ufs:/dev/da0s1a ro
Trying to mount root from ufs:/dev/da0s1a [ro]...
warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
miibus0: <MII bus> on axe0
rlphy0: <IP101 10/100 PHY> PHY 3 on miibus0
rlphy0: OUI 0x0009c3, model 0x0005, rev. 4
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on axe0
ue0: bpf attached
ue0: Ethernet address: 00:80:c8:3b:cf:91
Setting hostuuid: 0d74d9c5-da2f-11e1-b9b6-8a3af74f1c98.
Setting hostid: 0x1a7a9414.
No suitable dump device was found.
Entropy harvesting: interrupts ethernet point_to_pointsha256: /kernel: No such file or directory
 kickstart.
Starting file system checks:
/dev/da0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/da0s1a: clean, 1456070 free (2750 frags, 181665 blocks, 0.1% fragmentation)
Mounting local file systems:.
Writing entropy file:.
Setting hostname: efikamx.
ue0: link state changed to DOWN
Starting Network: lo0 ue0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmask 0xff000000
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether 00:80:c8:3b:cf:91
        inet 192.168.10.87 netmask 0xffffff00 broadcast 192.168.10.255
        media: Ethernet autoselect (none)
        status: no carrier
Starting devd.
ue0: link state changed to UP
Generating host.conf.
eval: cannot create /etc/host.conf: Read-only file system
eval: cannot create /etc/host.conf: Read-only file system
eval: cannot create /etc/host.conf: Read-only file system
Creating and/or trimming log files.
Starting syslogd.
realpath: /dev/dumpdev: No such file or directory
/etc/rc: WARNING: Dump device does not exist.  Savecore not run.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Clearing /tmp (X related).
Updating motd: /etc/motd is not writable, update failed.
Starting cron.
Starting inetd.
Starting background file system checks in 60 seconds.

Tue Nov 13 09:11:33 UTC 2012

FreeBSD/arm (efikamx) (ttyu0)

login: root
Nov 13 09:11:35 efikamx login: ROOT LOGIN (root) ON ttyu0
FreeBSD ?.?.?  (UNKNOWN)

Welcome to FreeBSD!

Before seeking technical support, please use the following resources:

o  Security advisories and updated errata information for all releases are
   at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
   for your release first as it's updated frequently.

o  The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
   along with the mailing lists, can be searched by going to
   http://www.FreeBSD.org/search/.  If the doc package has been installed
   (or fetched via pkg install lang-freebsd-doc, where lang is the
   2-letter language code, e.g. en), they are also available formatted
   in /usr/local/share/doc/freebsd.

If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list.  If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page.  If you are not familiar with manual pages, type `man man'.

Edit /etc/motd to change this login announcement.

root@efikamx:~ # ps -ax
PID TT  STAT    TIME COMMAND
  0  -  DLs  0:00.00 [kernel]
  1  -  SLs  0:02.82 /sbin/init --
  2  -  DL   0:00.00 [xpt_thrd]
  3  -  DL   0:00.00 [pagedaemon]
  4  -  DL   0:00.00 [vmdaemon]
  5  -  DL   0:00.00 [pagezero]
  6  -  DL   0:00.00 [bufdaemon]
  7  -  DL   0:00.00 [syncer]
  8  -  DL   0:00.00 [vnlru]
  9  -  DL   0:00.00 [softdepflush]
 10  -  RL   0:16.45 [idle]
 11  -  WL   0:00.23 [intr]
 12  -  DL   0:00.13 [geom]
 13  -  DL   0:00.00 [yarrow]
 14  -  DL   0:00.34 [usb]
 15  -  DL   0:00.00 [schedcpu]
276  -  Ss   0:00.00 /sbin/devd
354  -  Ss   0:00.04 /usr/sbin/syslogd -s
449  -  Ss   0:00.03 /usr/sbin/cron -s
465  -  Ss   0:00.00 /usr/sbin/inetd -wW -C 60
481 u0- S    0:00.00 sh /etc/rc autoboot
482 u0- S    0:00.01 logger -p daemon.notice -t fsck
484 u0- S    0:00.00 sleep 60
485 u0  Ss   0:00.06 login [pam] (login)
486 u0  R    0:00.08 -csh (csh)
488 u0  R+   0:00.01 ps -ax
root@efikamx:~ # ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmask 0xff000000
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether 00:80:c8:3b:cf:91
        inet 192.168.10.87 netmask 0xffffff00 broadcast 192.168.10.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
root@efikamx:~ # uname -a
FreeBSD efikamx 10.0-CURRENT FreeBSD 10.0-CURRENT #229 r242977:242979: Tue Nov 13 17:38:46 EET 2012     ray@terran.dlink.ua:/usr/obj/arm.armv6/usr/home/ray/work/FreeBSD/Projects/Efika_MX/src/efika_mx/sys/EFIKA_MX  arm
root@efikamx:~ # KDB: enter: Break to debugger
[ thread pid 10 tid 100002 ]
Stopped at      kdb_enter+0x48: ldrb    r15, [r15, r15, ror r15]!
db> c

root@efikamx:~ # reboot
Nov 13 09:11:52 efikamx reboot: rebooted by root
Nov 13 09:11:52 efikamx syslogd: exiting on signal 15
Waiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining...0 0 done
All buffers synced.
Uptime: 47s
Rebooting...
�eset ...

U-Boot 2009.01.2.0.6-efikasb (Nov 02 2010 - 09:58:13)

CPU:   Freescale i.MX51 family 3.0V at 800 MHz
mx51 pll1: 800MHz
mx51 pll2: 665MHz
mx51 pll3: 216MHz
ipg clock     : 66500000Hz
ipg per clock : 665000000Hz
uart clock    : 66500000Hz
cspi clock    : 54000000Hz
Board: Efika MX Smartbook [POR]
PMIC ID: 0x000045d0 [Rev: 2.0a]
DRAM:  512 MB
JEDEC ID: 0xbf:0x25:0x4a
Reading SPI NOR flash 0x40000 [0x1000 bytes] -> ram 0xafd006e8
SUCCESS

In:    serial
Out:   serial
Err:   serial
Boot Source: SPI NOR FLASH BOOT
Hit any key to stop autoboot:  0
JEDEC ID: 0xbf:0x25:0x4a
4096 KiB SST25VF032B - 4MB at 0:1 is now current device
Reading SPI NOR flash 0x100000 [0x50000 bytes] -> ram 0x97800000
.SUCCESS

## Starting application at 0x97800000 ...
                                         �
U-Boot 2012.04.01-g7862ffd-dirty (Aug 16 2012 - 16:53:57)

CPU:   Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: POR
Board: Efika MX, rev1.3
DRAM:  512 MiB
WARNING: Caches not enabled
MMC:   FSL_SDHC: 0
SF: Detected SST25VF032B with page size 4 KiB, total 4 MiB
In:    serial
Out:   serial
Err:   serial
Net:   CPU Net Initialization Failed
No ethernet found.
Efika>

</pre>

2012-10-10

Efika MX Smartbook

Efika MX Smartbook
See?! Efika MX Smartbook checkouting FreeBSD HEAD ...
No!
No!!
No!!! :)
No FreeBSD there yet :(
Just copy tree to have it in my hands during trip.

But yes, I already have some things working and will continue work on Efika MX soon...

2012-10-05

I love Pkgng

Few days ago reinstall my workstation. New setup I done with
USB stick with 9.1-RC1.
 
But I'm not about system setup, just only about Pkgng.
 
Unlike pkg_add, it calculate dependency and fetch all required
first, and install all things very-very fast.
 
Fantastic tool! Many thanks to guys who work on it. 

One note:
Since I'm not found how to get list of packages
(for next easy install), I do my own.

`pkg query` can do conditional search, so to get such list I do: 


 # pkg query -e "%#r==0" "%o"
 print/cups
 www/firefox
 x11/gnome2
 x11/gnome2-fifth-toe
 editors/gnome2-office
 x11/gnome2-power-tools
 graphics/gqview-devel
 comms/kermit
 [cut]

next time we able setup new workstation and do just:
`pkg install cups firefox gnome2 gnome2-fifth-toe \
 gnome2-office gnome2-power-tools gqview-devel kermit ...`
 
and after 10 min we have shinny new workstation :)
 

2012-09-30

KyivBSD 2012

Huh, hate to do public talks, but think I must to do that to advertise somehow FreeBSD power and ZRouter.org project itself.

Anyway, today was a good day, and I learn a lot of small but useful and/or interesting things. Thanks to the guys who give a talks today. And thanks to all that peoples who ask interesting questions!!!

2012-09-21

ZRouter.org : Project Summary - Ohloh

My Old blog / Мой старый блог

Ohhh! Mammy! Where is all files I wrote this week?!?!

Or: another way how to extract deleted data from big HDD.


Huh, hate to code without VCS support. Just recover several hundreds of code from 0.5T on which system currently run.

How to do that?
undelete? 
unrm?
All that is too much complicated ways for me :) so I need another way.
- Which?
- Simple! 

Simple script:
#!/bin/sh
# 500GB HDD, 488386584K
MAX=$((488386584 / 1024))

i=0
while true; do
    dd if=/dev/ad7 bs=1m count=1 skip=${i} 2> /dev/null | \
        tee ./blk.${i} | \
        grep -U 'LONG_KEY_TO_SEARCH' && \
        echo "BLK ${i} match" || rm ./blk.${i};
    i=$(( ${i} + 1 ));
    if [ $(( ${i} % 0x400 )) -eq 0 ]; then
        if [ $(( ${i} % 0x4000 )) -eq 0 ]; then
            echo ;
            echo "H{${i}}";
        else
            echo -n ".";
        fi
    fi
    if [ ${i} -ge ${MAX} ]; then
        exit 0;
    fi
done
Replace LONG_KEY_TO_SEARCH with some unique string, but remember: 1. less long and unique - more false matches; 2. more long - more time to grep;
And dot forget to replace MAX with your HDD/partition size.
Good luck!

Поиск по этому блогу

Readers