Split out one-time steps into their own script
Clarify the documentation on building
This commit is contained in:
parent
f3ba577269
commit
9d1694b9fd
22
README
22
README
@ -26,25 +26,23 @@ On Fedora:
|
||||
sudo dnf -y install bison flex texinfo gettext ncurses-devel unzip \
|
||||
sshpass quilt qt-devel qemu-kvm gcc-c++ make glibc-devel.i686
|
||||
|
||||
== Building the image ==
|
||||
== Building the images ==
|
||||
|
||||
To make buildroot compile the system run:
|
||||
To build both images run:
|
||||
|
||||
./run-buildroot.sh
|
||||
|
||||
After buildroot succeeds, create the qcow2 file:
|
||||
|
||||
./make-bootable-disk.sh client
|
||||
|
||||
== Cleaning ==
|
||||
|
||||
To do a simple clean after changing some config options:
|
||||
|
||||
cd buildroot
|
||||
make O=../output-client clean
|
||||
== Cleaning up ==
|
||||
|
||||
To nuke everything and start over:
|
||||
|
||||
rm -rf buildroot output* overlay*
|
||||
sudo rm *.qcow2
|
||||
|
||||
== Detailed Docs ==
|
||||
|
||||
More detailed docs are available:
|
||||
|
||||
* doc/building.txt - individual build steps
|
||||
* doc/configuring.txt - how to change the config
|
||||
* doc/testing.txt - how to test the images
|
||||
|
43
doc/building.txt
Normal file
43
doc/building.txt
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
== Initial setup ==
|
||||
|
||||
There are several one time steps that need to be done after cloning a
|
||||
new repo. These are all handled by running:
|
||||
|
||||
./init-buildroot.sh
|
||||
|
||||
== Building ==
|
||||
|
||||
It's best to look at what run-buildroot.sh does, but the basic flow
|
||||
for building an image is:
|
||||
|
||||
Create the overlay (for the client image):
|
||||
|
||||
mkdir overlay-client
|
||||
cp -a common-files/* overlay-client
|
||||
|
||||
Copy the defconfig and create an output directory (for the client
|
||||
image, for example):
|
||||
|
||||
cp conf/buildroot-client.config buildroot/configs/manila_client_defconfig
|
||||
( cd buildroot ; make O=../output-client manila_client_defconfig )
|
||||
rm buildroot/configs/manila_client_defconfig
|
||||
|
||||
Then invoke make in the appropriate directory:
|
||||
|
||||
( cd buildroot ; make O=../output-client all )
|
||||
|
||||
== Creating the qcow2 image ==
|
||||
|
||||
After buildroot succeeds, create the qcow2 file (for the client image,
|
||||
for example):
|
||||
|
||||
./make-bootable-disk.sh client
|
||||
|
||||
== Cleaning ==
|
||||
|
||||
To do a simple clean after changing some config options (for the client
|
||||
image, for example):
|
||||
|
||||
cd buildroot
|
||||
make O=../output-client clean
|
33
init-buildroot.sh
Executable file
33
init-buildroot.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2016 (C) NetApp, Inc.
|
||||
# Author: Ben Swartzlander <ben@swartzlander.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
|
||||
VERSION=2016.02
|
||||
FILENAME=buildroot-${VERSION}.tar.bz2
|
||||
|
||||
# Download buildroot if we don't have it already
|
||||
if [ ! -f download/$FILENAME ]
|
||||
then
|
||||
wget -P download http://buildroot.org/downloads/$FILENAME
|
||||
fi
|
||||
|
||||
# Untar buildroot if it's not already there
|
||||
if [ ! -d buildroot ]
|
||||
then
|
||||
mkdir buildroot
|
||||
tar -C buildroot -xf download/$FILENAME --strip 1
|
||||
fi
|
||||
|
||||
# Apply patches to buildroot if we haven't done so before
|
||||
PATCH_FLAG_FILE=buildroot/.manila-patches-applied
|
||||
if [ ! -f $PATCH_FLAG_FILE ]
|
||||
then
|
||||
( cd buildroot ; QUILT_PATCHES=../patches quilt push -a )
|
||||
touch $PATCH_FLAG_FILE
|
||||
fi
|
@ -7,30 +7,7 @@
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
|
||||
VERSION=2016.02
|
||||
FILENAME=buildroot-${VERSION}.tar.bz2
|
||||
|
||||
# Download buildroot if we don't have it already
|
||||
if [ ! -f download/$FILENAME ]
|
||||
then
|
||||
wget -P download http://buildroot.org/downloads/$FILENAME
|
||||
fi
|
||||
|
||||
# Untar buildroot if it's not already there
|
||||
if [ ! -d buildroot ]
|
||||
then
|
||||
mkdir buildroot
|
||||
tar -C buildroot -xf download/$FILENAME --strip 1
|
||||
fi
|
||||
|
||||
# Apply patches to buildroot if we haven't done so before
|
||||
PATCH_FLAG_FILE=buildroot/.manila-patches-applied
|
||||
if [ ! -f $PATCH_FLAG_FILE ]
|
||||
then
|
||||
( cd buildroot ; QUILT_PATCHES=../patches quilt push -a )
|
||||
touch $PATCH_FLAG_FILE
|
||||
fi
|
||||
./init-buildroot.sh
|
||||
|
||||
# Create the filesystem overlays
|
||||
if [ ! -d overlay-client ]
|
||||
|
Loading…
Reference in New Issue
Block a user