Git Product home page Git Product logo

crochet's Introduction

Crochet-FreeBSD

Crochet is a tool for building bootable FreeBSD images. This tool was formerly known as "freebsd-beaglebone" or "beaglebsd" as the original work was done for BeagleBone. But it now supports more boards and should easily extend to support many more.

FAQ

How do I log in via ssh?

The default configuration of FreeBSD doesn't allow root to log in over ssh. You have two options

  • You can use option User in your Crochet configuration file to create a non-root user than can log in over ssh.

  • If your platform has a serial console, log into the console using a serial cable and create yourself a user other than root.

Why is nothing showing up on my HDMI or VGA monitor?

Not every platform supports HDMI or VGA yet. Most platforms support RS-232.

How do I install 3rd party applications?

Packages are available via the normal pkg repos:

pkg install nginx

You can also get a copy of the FreeBSD ports tree with the following commands (as root):

 portsnap fetch
 portsnap extract

You can browse the FreeBSD port collection at https://www.freshports.org.

Supported Platforms

How to Build a Disk Image

The crochet.sh script can build a complete bootable FreeBSD image ready to be copied to a suitable device (e.g., SDHC card, Compact Flash card, disk drive, etc.). The script runs on FreeBSD-CURRENT, though some people have reported success running it on FreeBSD 9-STABLE.

Using the script to build an image consists of a few steps:

  1. READ board/board-name/README

    The board-specific directories each have a README with various details about running FreeBSD on a particular system. (Some boards have several README files in subdirectories with additional technical information.)

  2. CREATE a config file

    Start by copying config.sh.sample.

    The first line specifies the board configuration you want to use. The name here should exactly match a directory under "board/".

    The configuration file can specify a wide variety of customizations for the generated image. The config.sh.sample file includes extensive documentation in the form of comments.

  3. RUN crochet.sh as root

    $ sudo /bin/sh crochet.sh -c <config file>

    The script will first check that you have any needed sources. If you don't, the script will tell you exactly how to obtain the missing pieces. Follow the instructions and re-run the script until you have everything.

    As soon as it finds all the required pieces, the script will then compile everything and build the disk image. This part of the process can take many hours.

    Crochet keeps the built system, kernel, and other files between runs. In many cases, you can adjust the configuration and re-run crochet to build a new image in just a few minutes. However, if you update the FreeBSD sources or make a significant configuration change, you should probably delete the contents of the work directory to force everything to be rebuilt from scratch.

    Shortcut: If you only want the most basic build for a board, you can use this command without creating a config file:

    $ sudo /bin/sh crochet.sh -b <boardname>

    However, if you want to tweak the build in any way, you will need to create a config file.

  4. COPY the image to a suitable device (SD card, disk drive, etc)

    The script will suggest a 'dd' command to do this.

  5. BOOT the image on your board.

    Again, read board/board-name/README for details.

Command-line Options

  • -b : Load standard configuration for board
  • -c : Load configuration from file
  • -e : Email address to receive build status
  • -u: Update source tree

Using pkg

You can use pkg to install packages on your final crochet image if you have your own package repository. Add the following to your config:

# Package Installation Information

option PackageInit $pkg-repo
option Package sudo

# If you don't put a custom resolv.conf in your overlay use this
# Otherwise pkg will not be able to resolv hostnames

option Resolv

In the example above, change $pkg-repo to the full URL of your package repository. You can also specify more than one package at a time. Ex: option Package sudo tmux. In order for pkg to communicate with a remote package repo, you either need a custom resolv.conf in your board overlay, or use option Resolv in your config.

Potential Projects

There are still plenty of ways this script could be improved:

  • More boards. Crochet should be able to support any board for which the FreeBSD source tree can build a working kernel. The hardest part is working out the various boot pieces required. Look at board/NewBoardExample for explanations for adding support for a new board.

  • Out-of-tree kernel configuration. Right now, these scripts assume kernel configuration files are in the FreeBSD source tree. I don't think config(8) requires this; it would be nice to be able to include a tweaked kernel configuration as part of a board definition.

  • Swap. The script should allow you to specify a swap size and automatically adjust the disk layout accordingly. For now, we support creating swap files in the FreeBSD partition, which is easy and seems to work well enough.

  • Support for read-only root and other more complex partitioning approaches.

  • Improved VM building. The VMWareGuest configuration can build a VMWare virtual machine (which is more than just the disk image). There are some bugs that might be problems with VMWareGuest setting up the various VM configuration files or might be FreeBSD kernel bugs; I'm not sure. It should also be possible to directly build Bhyve, Parallels, VirtualBox, or OVF VM images.

Tracking FreeBSD-CURRENT with VMWare Fusion and Crochet

Some time back, I added some code to Crochet to build VMWare images directly. I recently had a spare MacBook sitting in my office and decided to try using this as a way to track FreeBSD-CURRENT.

So far, it seems to work pretty well; I thought I'd share what I've done so far and see if other people have ideas for improving this.

Warning: I've tried to be complete, but I know the following instructions omit a lot of details. I've listed some of the known bugs at the bottom of this article. Help in fixing them is appreciated.

Basic idea:

  • Share /Users between Mac OS and FreeBSD VMs.
  • Run Crochet inside a FreeBSD VM to build the next FreeBSD VM.

Since /Users is shared, this allows you to build and boot a new VM with a new FreeBSD version and then run the new system with the same work environment.

Get your first FreeBSD VM running with shared /Users

  1. Configure Mac OS with a case-sensitive filesystem. This generally requires reinstalling Mac OS completely from scratch; please ask on a Mac forum if you don't know how to do this.

  2. Install VMWare Fusion. (No reason this shouldn't be feasible with Parallels or VirtualBox, but Crochet doesn't yet build correct Parallels or VirtualBox VMs.)

  3. Set up NFS export of /Users on the Mac to VMWare images. My /etc/exports on the Mac looks like this:

    /Users -alldirs -maproot=root -network 192.168.177.0 -mask 255.255.255.0 /Users -alldirs -maproot=root -network 172.16.158.0 -mask 255.255.255.0

  4. Get the first FreeBSD VM running somehow. (I installed from DVD image.)

  5. Edit FreeBSD /etc/fstab to mount /Users from the Mac by adding this line:

    192.168.177.1:/Users /Users hfs rw 0 0

  6. Enable NFSv3 client support on FreeBSD (Mac OS doesn't serve NFSv4) by enabling lockd/statd on FreeBSD in rc.conf:

    rpc_lockd_enable="YES" rpc_statd_enable="YES" nfs_client_enable="YES"

  7. Add an account to FreeBSD that matches your home account on the Mac:

  • Same name
  • Same UID, GID
  • Same home directory: /Users/account/

Verify: After rebooting the FreeBSD VM, you should be able to log into the same account on FreeBSD or Mac, edit files in either place, etc.

Verify: Make sure you can do SVN checkouts and updates in either place. You'll need to verify you have the same version of SVN on either side. Mysterious SVN failures are probably due to NFS locking; SVN does not have clear error messages when it can't get file locks.

A twist: You can also build your first FreeBSD VM on any other FreeBSD system you happen to have available instead of installing a new VM from DVD. Recently, I built a FreeBSD VMWare image on my BeagleBone (cross-building i386 from ARM) and then copied the result over to my Mac.

Build a new FreeBSD VM with your old FreeBSD VM

  1. Get a copy of Crochet:
git clone https://github.com/freebsd/crochet.git
  1. Adjust the vmware.config.sh file at the bottom of this article to match your expectations.

  2. Check out FreeBSD source into the Crochet directory:

cd crochet-freebsd
git clone https://git.freebsd.org/src.git

Note: If you have everything set up properly, you should be able to perform the above three steps from Mac OS or FreeBSD.

  1. Build a new VM on FreeBSD:
./crochet -c vmware.config.sh

This should put the new VM into a directory called

FreeBSD-CURRENT-i386-GENERIC-r<revision>.vmwarevm

This may take a couple of hours depending on how fast your machine is.

At this point, you should be able to open the new VM from the Mac side and have it "just work."

Keep Climbing

In particular, you can now log into the VM you just built and use it to build the next one:

cd crochet-freebsd
cd src && git pull
cd ..
rm -rf work/*
./crochet -c vmware.config.sh

Each new VM is a completely clean "from scratch" system build, so this approach avoids propagating any leftover detritus from old systems.

You can keep the old VMs around as long as you like (simplifies bisecting to find bugs) and even have multiple versions running at once. If you have a problem with one, you can suspend it until you have time to dig into that issue.

This does require a fair bit of disk space for each VM, you should probably experiment with the ImageSize setting to see how small you can make it while still having a useful system.

Known Issues with the Above

  • I've not yet come up with a completely satisfactory way to share ports/packages across VMs.

  • VMWare launches VMs with a big "VMWare" boot splash that doesn't go away. I've found it necessary to start a new VM and immediately suspend/resume it before I can see the FreeBSD console. If you figure out how to fix this, I'm very interested. (This problem seems to have gone away since I updated to VMWare Fusion 5.0.5. Maybe it was a VMWare bug?)

  • NFSv3 file locking is not particularly robust and SVN requires good file locking. Mac OS seems to stop the lock daemon periodically which stalls a lot of NFS requests until it restarts. As a result, I generally find it easier to do SVN operations from Mac OS rather than FreeBSD. Alternatively, git seems to work better over NFS than SVN does.

  • It needs a little manual effort to keep UIDs, GIDs, etc, consistent across Mac and FreeBSD environments.

  • I've gotten confused a few times typing a command into the wrong window. In particular, Mac OS cannot run Crochet. :-)

Crochet configuration file: vmware.config.sh

# vmware.config.sh

# Find out the current FreeBSD revision and decide the
# name of the VM and the directory where it will go.
SVNVERSION=`svnlite info src | grep "Last Changed Rev" | sed -e 's/.*: *//'`
BASEIMG=FreeBSD-CURRENT-i386-GENERIC-r${SVNVERSION}
VMDIR=/Users/kientzle/projects/FreeBSD/VMWare/${BASEIMG}.vmwarevm

# Ask Crochet for a standard I386 build in a VMWare VM    
board_setup VMWareGuest
option VMWareDir ${VMDIR}
option VMWareName ${BASEIMG}
option ImageSize 8g

# Look for FreeBSD src in the Crochet dir.
FREEBSD_SRC=${TOPDIR}/src

IMG=${WORKDIR}/${BASEIMG}.img

# After the basic image has been assembled, update some of the files.    
customize_freebsd_partition ( ) {
    # TODO: Find a good way to add swap.

    # Use the SVN revision as the hostname.    
    echo 'hostname="r'$SVNVERSION'"' >> etc/rc.conf

    # Enable some useful things in /etc/rc.conf
    cat <<"EOF" >>etc/rc.conf
sshd_enable="YES"
ntpd_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
nfs_client_enable="YES"
EOF

    # Mount Mac /Users onto FreeBSD /Users
    mkdir Users
    echo '192.168.177.1:/Users /Users nfs rw 0 0' >> etc/fstab

    # Propagate the passwd file to the next VM.
    cp /etc/master.passwd etc/master.passwd
    pwd_mkdb -p -d `pwd`/etc etc/master.passwd

    # Tell ntp to step clock by as much as necessary;
    # Otherwise, NTP will stop working if a VM is suspended for a while.
    echo 'tinker panic 0' >> etc/ntp.conf
}

# After the VM is complete, update the ownership.    
customize_post_unmount ( ) {
	chown -R kientzle:staff ${VMDIR}
}

# End of file.

crochet's People

Contributors

arnobroekhof avatar brd avatar camachat avatar curtisvillamizar avatar emaste avatar erikarn avatar evadot avatar evilgjb avatar f-andrey avatar gvnn3 avatar jaredmcneill avatar jungle-boogie avatar kevans91 avatar kientzle avatar lattera avatar lifanov avatar linimon avatar loos-br avatar pauldokas avatar paulzhol avatar pkelsey avatar rozmansi avatar sietsevandermolen avatar smithwinston avatar teverett avatar trent-pr1ntf avatar vgrebenschikov avatar wca avatar zqb-all avatar zxombie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crochet's Issues

custom kernels

custom kernel configs should be supported by referring to a kernel on the crochet tree rather than by copying them to the source tree

[wandboard] Mounting from ufs:mmcsd0s2a failed with error 19

Hi,

first of all, thanks for developing such an elegant toolchain!

I am facing one issue when attempting to boot a Wandboard Quad as FreeBSD does not appear to recognize the SDcard as an mmc block device. The boot ends when attempting to mount the root filesystem:

Mounting from ufs:mmcsd0s2a failed with error 19.

Note that GEOM does not list any device at all.

The full console output shows that the uSDHC controllers are identified ok.

What's the best approach to troubleshoot this issue?

Thanks & cheerio, Harry.

libstand.a: could not read symbols

Hello,
I am faced with the fact that is not possible to build an image for RaspberryPi (r281940).

My system

# uname -a
FreeBSD des.local 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r278930: Wed Feb 18 05:34:27 MSK 2015     [email protected]:/usr/obj/usr/src/sys/GENERIC  amd64

Error

Failed to build FreeBSD ubldr
  Log in /usr/obj/ubldr-armv6-RPI-B/_.ubldr.armv6-RPI-B.build.log

Stop.
cc  -O -pipe  -mfloat-abi=softfp  -I/usr/src/sys/boot/efi/loader -I/usr/src/sys/boot/efi/loader/arch/arm -I/usr/src/sys/boot/efi/loader/../include -I/usr/src/sys/boot/efi/loader/../include/arm -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include -I/usr/src/sys/boot/efi/loader/../../.. -I/usr/src/sys/boot/efi/loader/../../i386/libi386 -DNO_PCI -DEFI -DBOOT_FORTH -I/usr/src/sys/boot/efi/loader/../../ficl -I/usr/src/sys/boot/efi/loader/../../ficl/arm -I/usr/src/sys/boot/efi/loader/../../fdt -I/usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../fdt -DLOADER_FDT_SUPPORT -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -I/usr
/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat -msoft-float -std=gnu99   -Qunused-arguments  -Wl,-T/usr/src/sys/boot/efi/loader/arch/arm/ldscript.arm -Wl,-Bsymbolic -shared -nostdlib -o loader.sym autoload.o bootinfo.o conf.o copy.o devicename.o main.o reloc.o smbios.o vers.o exec.o start.o boot.o commands.o console.o devopen.o interp.o interp_backslash.o interp_parse.o ls.o misc.o module.o panic.o load_elf32.o reloc_elf32.o disk.o part.o crc32.o bcache.o interp_forth.o /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../ficl/libficl.a /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../libefi/libefi.a /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../fdt/libfdt.a /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../efi/fdt/libefi_fdt.a /usr/lib/libstand.a
/usr/lib/libstand.a: could not read symbols: File format not recognized
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

In newsletter found here such a way, it helps
https://lists.freebsd.org/pipermail/freebsd-arm/2015-April/011005.html

setenv LIBSTAND "/usr/obj/arm.armv6/usr/src/tmp/usr/lib/libstand.a"

Cannot Find FreeBSD XDev Tools

Hi,

I am working on a prototype for something I want to suggest to the company I am currently working for. Part of this was to show how easy it is to build FreeBSD for the BeagleBone Black. Unfortunately, I have been unable to build FreeBSD for the BBB successfully for the last several months.

I have created a FreeBSD VM several times using /head, FreeBSD version 11.0. I have tried a variety of little tweaks to no avail.

A snippet of what I get when I run crochet.sh is:
Building FreeBSD version: 11.0
Image name is:
/usr/src/crochet-freebsd/work/FreeBSD-armv6-11.0-BEAGLEBONE-r269526.img
...
Can't find appropriate FreeBSD xdev tools.
Tested: armv6-freebsd-cc
...

I have build the cross platform development tools using:
make XDEV=arm XDEV_ARCH=armv6 xdev
and later, when the process started to fail:
make XDEV=arm XDEV_ARCH=armv6 xdev | tee -a /Logs/fbsd_armbuild.log

I have also tried the make command suggested by crochet when it fails:
make XDEV=arm XDEV_ARCH=armv6 WITH_GCC ...

What did I miss? Any suggestions?

The last time I successfully built a FreeBSD image was last year.

-ThothK-

eval error

I'm trying to create a raspberry pi new bootable, and faced with the following error using the default config.

Using U-Boot from previous build.
====================> Phase 301 <====================
Running: OPTION= OPTIONDIR= BOARDDIR= board_default_create_image
eval: arithmetic expression: expecting primary: "([0-9][0-9]).$/\1/p'`-RPI-B-r263927.img / 1000000"

I hardcoded the name of the image, so it worked.

Error creating Soekris image

The following error occurs when creating an image for Soekris boards

uilding FreeBSD version: 10.0
Object files are at: /usr/local/src/crochet-freebsd/work/obj/usr/src
Found suitable FreeBSD source tree in:
    /usr/src
Using FreeBSD i386 world from previous build
Using FreeBSD i386-SOEKRIS kernel from previous build
Creating a 1950MB raw disk image in:
    /usr/local/src/crochet-freebsd/work/FreeBSD-i386-10-SOEKRIS.img
Partitioning the raw disk image at Tue Jun 3 00:32:05 CEST 2014
gpart create -s MBR md11
md11 created
Creating the NanoBSD style UFS partitions at Tue Jun 3 00:32:05 CEST 2014
md11s1 created
/dev/md11s1a: 1024.0MB (2097152 sectors) block size 32768, fragment size 4096
    using 4 cylinder groups of 256.03MB, 8193 blks, 32896 inodes.
super-block backups (for fsck -b #) at:
 192, 524544, 1048896, 1573248
gpart: autofill: No space left on device
/dev/md11s1b: 16.0MB (32768 sectors) block size 32768, fragment size 4096
    using 4 cylinder groups of 4.03MB, 129 blks, 640 inodes.
super-block backups (for fsck -b #) at:
 192, 8448, 16704, 24960
/dev/md11s1d: 819.6MB (1678552 sectors) block size 32768, fragment size 4096
    using 4 cylinder groups of 204.91MB, 6557 blks, 26240 inodes.
super-block backups (for fsck -b #) at:
 192, 419840, 839488, 1259136
tunefs: soft updates set
Using inode 4 in cg 0 for 4194304 byte journal
tunefs: soft updates journaling set
tunefs: NFSv4 ACLs set
Installing bootblocks
Boot files are at: /usr/local/src/crochet-freebsd/work/obj/usr/srcsys/boot/i386
gpart: /usr/local/src/crochet-freebsd/work/obj/usr/srcsys/boot/i386/mbr/mbr: No such file or directory

Expanding filesystem on first boot

At least for the wandboard and pandaboard, crochet isn't adding an autosize script to do this the way the official FreeBSD wandboard images do.

I added this script from the FreeBSD images to the overlay

board/Wandboard/overlay/etc/rc.d/autosize

And this to board/Wandboard/overlay/rc.conf

autosize_enable="YES"

And it seems to work okay. At least with 8 and 16GB cards. I had problems with 32GB cards, but I'm not sure yet whether or not it's the cards. I'm having issues with them using Linux as well.

I can generate a simple pull request if this is of interest.

install of xdev fails if run in a jail

cd /usr/armv6-freebsd/usr/bin; for i in *; do ln -sf ../..//usr/armv6-freebsd/usr/bin/$i ../../../../usr/bin/armv6-freebsd-$i; ln -sf ../..//usr/armv6-freebsd/usr/bin/$i ../../../../usr/bin/armv6-freebsd9.1-$i; done
ln: ../../../../usr/bin/armv6-freebsd-CC: Read-only file system

email configuration

Is this only used by the email_status command?
If so, can we push it down into that module?

E.g.,
email_add_info "TOPDIR: ${TOPDIR}"
email_add_info "SOURCE TREE: ${FREEBSD_SRC}"

And arrange for that information to be included in every email_status message?

Boot File "BB-uEnv.txt" Blank?

I just did a build of 10-RELEASE for BeagleBone using Crochet, the build went seemingly fine, however the uEnv.txt file is blank, which means the system won’t boot! I’ve tried letting Crochet build U-BOOT from source and installing the u-boot-beaglebone-eabi package, with the same results.

Looking at board/BeagleBone/files/uEnv.txt shows the file that’s being copied is in fact blank! However, if we take a look at the commit history, we see that the working code has been deleted. Was this a mistake? I copied the previous revision into my BB-uEnv.txt file and it booted right up.

U-Boot Configure Failure

Hi,

Using FreeBSD 10 Stable as the base and UBoot 2014-03, I encountered an issue while attempting to build an image.

Failed to configure U-Boot
Looking at the end of the log, I see:
gcc: not found
gmake[2]: *** [gen_eth_addr.o] Error 127
gmake[2]: Leaving directory '/usr/src/crochet-freebsd/u-boot-2013.04/tools'

followed by a couple of other lines.

Did I miss something?

-thoth-

Use of $FREEBSD_OBJDIR inelegant

The variable FREEBSD_OBJDIR is defined in freebsd.h in the function freebsd_objdir ( ). FREEBSD_OBJDIR contains the absolute path to the generated object files from the compile. There are a number of places where this is used to cherry-pick files from the object files and copy them onto the generated crochet file system.

The current code generates the wrong path for native builds. Additionally it's been suggested that we should not need to know where the object files are and we should simply be able to use this idiom to install them:

"cd src-dir-location; make DESTDIR=XYZ install"

Wrong mountpoint when overriding WORKDIR

If you override WORKDIR the image creation fails because it tries to mount the partitions in ./work (the default WORKDIR) rather than the overridden WORKDIR.

It looks like the BOARD_*_MOUNTPOINT_PREFIX variables used by board_mountpoint are created when lib/board.sh is loaded, which is before the user's config file is loaded.

I'm using crotchet-freebsd with Patrick Kelsey's BBB-multi-install-config.sh configuration file.

removed dependency in HEAD

Unless I'm doing something wrong, r252439 in HEAD appears to have broken builds for RPI (around board/RaspberryPi/setup.sh:80)

Fail fast if user auditdistd does not exist

installworld fails if the user auditdistd is not present on the system.

It would be nice if Crochet could fail early if the user does not exist. Crochet currently handles other failure cases well, such as required xdev tools not being present (IE, helpful error message, not just a random "armv6-freebsd-cc: command not found").

To Crochet's credit, re-running crochet.sh will pick up at installworld again and very little time is wasted, so this feature request is quite minor in value.

Some options not being adhered in the finished image.

When I build an image with the crochet tool for rpi2 I have two options that doesn't seem to be honoured.

Option Growfs

The / is not resized to use maximum amount of the card (this is a 8 GB card), I am only getting
/dev/mmcsd0s2a 3.5G 1.8G 1.3G 58% /

When running df -h

In /etc/rc.conf I see:

# On first boot, enlarge the root filesystem to fill the SD card growfs_enable="YES"

So the directive is added. But nothing is happening.

Running service growfs start manually does resize the partition.

This is not the case with the rpi2 image on ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/11.0/ That one resizes.

option SwapFile 512mb file=/usr/swap0
Swapfile is created but is not used. There is no output in top for it either.

swap is also defined in /etc/fstab
but not mounted.

(How do I submit my configfile?)

Building U-Boot not supported out-of-the-box on 11.0-CURRENT

Naively sucking down ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2 and attempting to run a BeagleBone build fails on a fresh[1] install of 11.0-CURRENT (r256489).

The build fails on building U-boot, and _.uboot.build.log is littered with "gcc: not found". This makes sense, as gcc isn't around anymore -- but I've seen discussions on freebsd-arm@ that discuss how it's perfectly possible to build U-boot with Clang. The last few lines, retyped-by-hand-so-take-exactness-with-a-grain-of-salt, are...

gmake -C tools all
gcc: not found
gmake[1]: Entering directory `/root/crochet-freebsd/u-boot-2013.04/tools'
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -include /root/crochet-freebsd/u-boot-2013.04/include/libfdt_env.h -idirafter /root/crochet-freebsd/u-boot-2013.04/include -idirafter /root/crochet-freebsd/u-boot-2013.04/include2 -idirafter /root/crochet-freebsd/u-boot-2013.04/include -I /root/crochet-freebsd/u-boot-2013.04/lib/libfdt -I /root/crochet-freebsd/u-boot-2013.04/tools -DCONFIG_SYS_TEXT_BASE=0x80800000 -DUSEHOSTCC -D__KERNEL_STRICT_NAMES -pedantic  -o gen_eth_addr.o gen_ath_addr.c -c
gcc: not found
gmake [1]: *** [gen_eth_addre.0] Error 127
gmake [1]: Leaving directory `/root/crochet-freebsd/u-boot-2013.04/tools'
gmake : *** [tools] Error 2

[1] Well, fresh + gsed + gmake + git.

xdev broken with -head?

Instructions propose to build xdev with following command:
make XDEV=arm XDEV_ARCH=armv6 WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG=1 WITHOUT_CLANG_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1 xdev

Which seems broken right now with up-to-date -head:

/usr/home/hirenp/current/contrib/atf/atf-c++/detail/fs.hpp:37:15: error: map: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/fs.hpp:38:18: error: memory: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/fs.hpp:39:19: error: ostream: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/fs.hpp:40:15: error: set: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:39:21: error: algorithm: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:40:18: error: cctype: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:41:18: error: cerrno: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:42:19: error: cstdlib: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:43:19: error: cstring: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:44:19: error: fstream: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:45:20: error: iostream: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:46:15: error: map: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:47:18: error: memory: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:48:19: error: sstream: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:49:21: error: stdexcept: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:50:18: error: vector: No such file or directory
In file included from /usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:58:
/usr/home/hirenp/current/contrib/atf/atf-c++/tests.hpp:35:18: error: string: No such file or directory
In file included from /usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:60:
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/application.hpp:33:19: error: ostream: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/application.hpp:34:15: error: set: No such file or directory
In file included from /usr/home/hirenp/current/contrib/atf/atf-c++/tests.cpp:61:
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/auto_array.hpp:33:19: error: cstddef: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/text.cpp:34:18: error: cctype: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/text.cpp:35:19: error: cstring: No such file or directory
In file included from /usr/home/hirenp/current/contrib/atf/atf-c++/detail/text.cpp:43:
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/exceptions.hpp:33:21: error: stdexcept: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/exceptions.hpp:34:18: error: string: No such file or directory
In file included from /usr/home/hirenp/current/contrib/atf/atf-c++/detail/text.cpp:44:
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/text.hpp:37:19: error: sstream: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/detail/text.hpp:40:18: error: vector: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/utils.cpp:34:19: error: cstdlib: No such file or directory
/usr/home/hirenp/current/contrib/atf/atf-c++/utils.cpp:35:20: error: iostream: No such file or directory
In file included from /usr/home/hirenp/current/contrib/atf/atf-c++/utils.cpp:37:
/usr/home/hirenp/current/contrib/atf/atf-c++/utils.hpp:37:18: error: string: No such file or directory
mkdep: compile failed
*** Error code 1

Stop.
make[5]: stopped in /usr/home/hirenp/current/lib/atf/libatf-c++
*** Error code 1

Stop.
make[4]: stopped in /usr/home/hirenp/current/lib/atf
*** Error code 1

Renaming "strategy"

As the comment in strategy.sh shows:
# TODO: Rename 'strategy' to something more appropriate, since
# this has nothing to do with the 'strategy pattern.' That
# will involve renaming this file and a lot of internal variables
# and functions...
My proposal would be to rename strategy to sequencer and a phase of the strategy would be a sequence!?
I would offer to rename everything if all agree!

Use ubuntu to build????

Can I use ubuntu to build images??
When ever i try i always end up with this error :

ric@ric-ubuntu:~/crochet-freebsd$ sudo ./crochet.sh -b RaspberryPi
Starting at Mon Oct 13 09:07:43 IST 2014
Board: RaspberryPi
Source version is: unknown
./crochet.sh: 1: ./crochet.sh: /usr/bin/grep: not found
Building FreeBSD version:
Image name is:
/home/ric/crochet-freebsd/work/FreeBSD-armv6--RPI-B.img
Can't find appropriate FreeBSD xdev tools.
Tested: armv6-freebsd-cc
If you have FreeBSD-CURRENT sources in /usr/src, you can build these with the following command:

cd /usr/src && sudo make XDEV=arm XDEV_ARCH=armv6 WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG=1 WITHOUT_CLANG_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1 xdev

Run this script again after you have the xdev tools installed.
ric@ric-ubuntu:~/crochet-freebsd$

incorrect path to to kernel during install phase

Running crochet-freebsd to build a kernel + userland for Wandboard-quad and have run into the following issue:

<snip output>
Mounting FAT partition
Mounting UFS partition
Installing ubldr
Installing kernel
cp: /usr/home/pwright/git/crochet-freebsd/work/obj/armv6.armv6/usr/src_arm/sys/WANDBOARD-QUAD/kernel:such file or directory

a ls of that directory structure show's what the issue is:

[pwright@fbsd-current ~/git/crochet-freebsd/work]$ ls -l  obj/ | grep armv6
drwxr-xr-x  3 root  pwright  3 Feb  2 22:31 arm.armv6
[pwright@fbsd-current ~/git/crochet-freebsd/work]$ 

the kernel does exist though using the adjusted path of arm.armv6:

[pwright@fbsd-current ~/git/crochet-freebsd]$ stat work/obj/arm.armv6/usr/src_arm/sys/WANDBOARD-QUAD/kernel
3211976481 62924 -rwxr-xr-x 1 root pwright 4294967295 5863040 "Feb  3 02:20:52 2014" "Feb  3 02:20:52 2014" "Feb  3 02:20:52 2014" "Feb  3 02:20:52 2014" 131072 11537 0x800 work/obj/arm.armv6/usr/src_arm/sys/WANDBOARD-QUAD/kernel

creating a symlink from arm.armv6 to armv6.armv6 fixes this issue. i have taken a look at the code and it was not obviously apparent to me where this incorrect path was being generated from. hence the bug report :)

Issue building boot2

I'm building (essentially) the i386 target for crochet. After the kernel build, I am getting this error:

Loading configuration from config.sh
Board: Soekris
Found suitable FreeBSD source tree in:
/home/tom/fbsd/src/FreeBSD/
Using FreeBSD i386 world from previous build
Using FreeBSD i386-SOEKRIS kernel from previous build
Building MBR
install -o root -g wheel -m 444 mbr /storage/home/tom/crochet-tge/crochet-freebsd/work/boot
Building Boot2
make: don't know how to make /storage/home/tom/fbsd/src/FreeBSD/sys/boot/i386/boot2/../btx/lib/crt0.o. Stop

BeagleBoneBlack: U-Boot failing

Hey,

I want to use crochet to build a arm image for a BeagleBone Black.

I managed to get it to the last bits around u-boot but there it fails:
parallelsfreebsd

At this step there is an image file but it shouldn't be finished as it is only 512B big...

Regards,
Bodo

Wandboard boot issue

The latest build of wandboard acts differently than the previous ones. U-boot connects at 115200 8-n-1, but I need to set my serial client to 9600 in order to log in to the RS-232 console. I don't recall this being the case previously.

Python error when creating image

I'm trying to build a Raspberry Pi image, and I seem to have gotten pretty far, but I'm at the point where there seems to be a Python error in in the process of creating an image. I've included a screen dump below.

Albright@FreeBSD 10:~/crochet-freebsd % sudo /bin/sh ./crochet.sh -c config.sh
Starting at Fri Feb 14 12:55:50 MST 2014
Loading configuration from config.sh
Board: RaspberryPi
Option: ImageSize 16gib
Option: User Albright
Option: SwapFile 1gb
Option: UsrPorts 
./crochet.sh: svn: not found
Source version is: 
Building FreeBSD version: 10.0
Image name is:
    /usr/home/Albright/crochet-freebsd/work/FreeBSD-armv6-10-RPI-B.img
Building FreeBSD version: 10.0
Object files are at: /usr/home/Albright/crochet-freebsd/work/obj/arm.armv6/usr/src
Found suitable FreeBSD source tree in:
    /usr/src
Found FreeBSD xdev tools for armv6
Found U-Boot sources in:
    /usr/home/Albright/crochet-freebsd/u-boot-rpi
Using FreeBSD armv6 world from previous build
Using FreeBSD armv6-RPI-B kernel from previous build
Using ubldr from previous build
Using U-Boot from previous build.
Creating the raw disk image in:
    /usr/home/Albright/crochet-freebsd/work/FreeBSD-armv6-10-RPI-B.img
Partitioning the raw disk image at Fri Feb 14 12:55:51 MST 2014
gpart create -s MBR md1
md1 created
Creating the FAT partition at Fri Feb 14 12:55:51 MST 2014 with start block 63 of size 17m
active set on md1s1
Creating the UFS partition at Fri Feb 14 12:55:51 MST 2014
md1s2 created
/dev/md1s2a: 16367.0MB (33519584 sectors) block size 32768, fragment size 4096
    using 27 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.
super-block backups (for fsck -b #) at:
 192, 1282432, 2564672, 3846912, 5129152, 6411392, 7693632, 8975872, 10258112, 11540352, 12822592, 14104832, 15387072, 16669312,
 17951552, 19233792, 20516032, 21798272, 23080512, 24362752, 25644992, 26927232, 28209472, 29491712, 30773952, 32056192, 33338432
tunefs: soft updates set
Using inode 4 in cg 0 for 4194304 byte journal
tunefs: soft updates journaling set
tunefs: NFSv4 ACLs set
Mounting FAT partition
   Removing already-existing mount directory.
   Removed pre-existing mount directory; creating new one.
Mounting UFS partition
   Removing already-existing mount directory.
   Removed pre-existing mount directory; creating new one.
Traceback (most recent call last):
  File "imagetool-uncompressed.py", line 53, in <module>
    outfile.write("".join(mem))
TypeError: sequence item 60: expected str instance, int found
Albright@FreeBSD 10:~/crochet-freebsd % 

I don't know enough about Python to guess what might be going wrong there.

r255775 causes build world to break

After revision r255774 the build fails with this error

creating osreldate.h from newvers.sh
*** [osreldate.h] Error code 1

bmake[3]: stopped in /root/crochet-freebsd/src/include
1 error

bmake[3]: stopped in /root/crochet-freebsd/src/include
*** [includes] Error code 2

bmake[2]: stopped in /root/crochet-freebsd/src/include
1 error

bmake[2]: stopped in /root/crochet-freebsd/src/include
*** [include.includes__D] Error code 2

Reading the PR the commit was addressing, it appears to have had the opposite effect

http://www.freebsd.org/cgi/query-pr.cgi?pr=160646&cat=misc

"12: Event not found" error when running copy-to-emmc.sh

When running copy-to-emmc.sh, the error 12: Event not found appears when trying to create the msdosfs partition. The issue is the !12 in the command line; the shell is interpreting the !12 as invoke command 12 from history. The solution is to escape the ! exclamation point:

gpart add -a 63 -b 63 -s 2m -t '\!12' mmcsd1

FreeBSD checkout

Add an option to enable checkout of the tree

option FreeBSDSvnCheckout

Options UsrPorts, UsrSrc not honored

This is how my config.sh looks:

board_setup BeagleBone
IMAGE_SIZE=$((13900 * MB)) # for 16 Gigabyte card
option SwapFile 768mb
FREEBSD_SRC=/home/hirenp/current
FREEBSD_INSTALL_USR_SRC=yes
FREEBSD_INSTALL_USR_PORTS=yes
FREEBSD_WORLD_EXTRA_ARGS="-j 8"
FREEBSD_BUILDWORLD_EXTRA_ARGS="-DNOCLEAN"
FREEBSD_KERNEL_EXTRA_ARGS="-j 8"
FREEBSD_BUILDKERNEL_EXTRA_ARGS="-DNOCLEAN"

But in the generated image I do not see /usr/src/ or /usr/ports/ populated.

cheers,
Hiren

Boot Failure on RaspberryPi

Hi, I built an image for the Raspberry Pi on my FreeBSD 10.0 RC2 box using the 10.0 RC2 sources and the defaults in crochet, but the Image will not boot.

It gets to the Loader and sits on the Press Enter for normal boot line.

Are the 10.0 sources good enough or should I be using CURRENT?

Thanks

Selecting Configuration File for UBoot

Hello,

I'm trying to build an image for the Raspberry Pi and I've run into some trouble when Crochet builds uboot.

I have changed settings in < u-boot-rpi/include/configs/rpi_b.h > to disable to serial console and make the autoboot time 10 seconds instead of 3. I deleted < crochet-freebsd/work > directory to build from scratch.

I wrote the image created using dd. When I booted my RaspberryPi none of the changes I made to the rpi_b.h were there.

How do I get Crochet to build uboot using the settings I defined in < crochet-freebsd/u-boot-rpi/include/configs/rpi_b.h >?

Thanks,
Reza

no license

This project appears to lack a LICENSE.TXT.

If `svn` does not exist, fall back to /usr/bin/svnlite in lib/subversion.sh

For the two operations being performed -- update and info -- it's a drop in replacement. I've a symlink from /usr/local/bin/svn -> /usr/bin/svnlite and Crochet works as expected.

This change would remove one further dependency or fudged-step from a bare system being able to create images with Crochet.

Problem in generic_i386_build_loader()

Doing either a VMWare build or a Soekris build with this method I get this output

Building MBR sh /storage/home/tom/crochet/src/FreeBSDHead/head/tools/install.sh -o root -g wheel -m 444 mbr /storage/home/tom/crochet-kientzle/crochet-freebsd/work/boot/mbr Building Boot2 sh /storage/home/tom/crochet/src/FreeBSDHead/head/tools/install.sh -o root -g wheel -m 444 boot boot1 boot2 /storage/home/tom/crochet-kientzle/crochet-freebsd/work/boot Building Loader Failed to build i386 loader: make: "/storage/home/tom/crochet/src/FreeBSDHead/head/sys/boot/i386/loader/Makefile" line 3: Could not find src.opts.mk make: "/storage/home/tom/crochet/src/FreeBSDHead/head/sys/boot/i386/loader/Makefile" line 40: Malformed conditional (${MK_FORTH} != "no") make: "/usr/share/mk/bsd.own.mk" line 457: MK_SSP can't be set by a user.

FreeBSD 11 (v 264095) xdev tools broken

Source version is: 264095
Building FreeBSD version: 11.0
FreeBSD xdev tools are broken.
The following command should print the full path to the crossbuild
include directory (containing stdarg.h, for example):
$ armv6-freebsd-cc -print-file-name=include
Please install a newer version of the xdev tools.

command: armv6-freebsd-cc -print-file-name=include
output: include

Should be...

output: /usr/armv6-freebsd/usr/lib/include

`User` option doesn't set ownership of the users home directory

When using the User option to have crotchet create a user account on the image for the specified user, the ownership of the user's home directory isn't changed and is left as root:root.

This is probably a tricky one to solve as chown will be running in the context of the host system and the specified user account may not exist and/or may have a different uid than on the target image.

The solution would be to check passwd and group for the new uid/gid in the ${BOARD_FREEBSD_MOUNTPOINT}/etc/ directory after running pw useradd and running chown with the numeric uid/gid.

Image umount fils with "Device busy"

Using crotchet-freebsd on a VirtualBox FreeBSD x64 image, at the end, the script fails with "Device Busy" when it tries to umount the two md0 partitions:

Unmounting /home/winston/Work/crochet-freebsd/work/_.mount.boot
umount: unmount of /usr/home/winston/Work/crochet-freebsd/work/_.mount.boot failed: Device busy
rmdir: /home/winston/Work/crochet-freebsd/work/_.mount.boot: Device busy
Unmounting /home/winston/Work/crochet-freebsd/work/_.mount.freebsd
umount: unmount of /usr/home/winston/Work/crochet-freebsd/work/_.mount.freebsd failed: Device busy
rmdir: /home/winston/Work/crochet-freebsd/work/_.mount.freebsd: Device busy
Releasing md0
mdconfig: ioctl(/dev/mdctl): Device busy

According to fuser, it's gvfsd-trash (I run an Xfce4 desktop) that has the mount point open:

[root@freebsd /home/winston/Work/crochet-freebsd]# fuser /usr/home/winston/Work/crochet-freebsd/work/_.mount.boot
/usr/home/winston/Work/crochet-freebsd/work/_.mount.boot:  1058
[root@freebsd /home/winston/Work/crochet-freebsd]# ps -p 1058
 PID TT  STAT    TIME COMMAND
1058  -  I    0:00.90 /usr/local/libexec/gvfsd-trash --spawner :1.8 /org/gtk/gv

Not sure if there's a way to avoid this ... perhaps use umount -f to unmount the md0 loopback filesystems?

Typo in `beaglebone_check_uboot` in BeagleBone/setup.sh

While trying to debug why crotchet isn't using u-boot-beaglebone-eabi, I noticed in board/BeagleBone/setup.sh it uses uboot_eabi_port to detect it (line 20), or is it u_boot_eabi_port (line 21). I assume at least one of them is wrong; although I have neither on my system despite running a make install in sysutils/u-boot-beaglebone-eabi (and crotchet not detecting it).

EDIT: Line 20 & 21, not 44 & 45.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.