forked from alloc869/meta-overc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.install
191 lines (134 loc) · 7.49 KB
/
README.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
OverC Overview
------------------
OverC is composed of building blocks (cubes) that implement a set of related
functionality. The current cubes are:
- dom0: provides control services to the platform and is responsible for
launching other containers in the system. Dom0 is not manipulated
by non admin users.
- dom1: provides system services (such as ntpd, etc) to the platform. This
is not used by a typical user.
- domE: provides full 'enterprise' functionality. This includes man pages,
development tools, graphical desktop, etc. This domain is the primary
environment for most users.
OverC also has two essential image types, that provide a foundation for the
container runtimes. These are:
- cube-builder: This is the image which lists all the packages required to
boot the platform. cube-builder is also capable of self
hosting and building the platform itself.
- cube-essential: This is a minimal runtime which is used for both the
installer and cube-essential in the fully assembled system.
OverC build
-----------
Modify local.conf with following settings:
# build the cube distro
DISTRO ?= "cube"
# build the genericx86 machine, ussing the common-pc-64 branch
MACHINE="genericx86-64"
KMACHINE_genericx86-64 ?= "common-pc-64"
# IMPORTANT: remove 'image-mklibs image-prelink' from the default
# user classes. They break lxc-autostart.
USER_CLASSES ?= "buildstats"
Clone the layers described in the meta-overc/README, and build the images
mentioned in the overview:
% bitbake cube-dom0 cube-dom1 cube-domE cube-essential cube-builder
This will take some time, since multiple images and configurations are
being build and assembled.
Note: you can also find images at: http://openlinux.windriver.com/overc/images
Once the build (or download) completes, the build artifacts must be assembled
into an installer image (see the following sections).
OverC installer
---------------
The OverC installer must be assembled from build artifacts, and provides a
bootable USB stick that is capable of installing to a hard disk on the
target system. It also completes required installation and configuration of
the components that make up the core system (dom0, dom1, domE, essential).
The OverC installer is available from the following repository:
https://github.com/WindRiver-OpenSourceLabs/overc-installer.git
Once cloned, the installer must be configured for your target device (Sample
configurations are provided).
The following sample shows how to create an installer on a network block
device, with the outputs of a typical OverC build. Changing the target device
to a USB stick results in an installer that boots and runs on most x86 targets.
% cd usbhdinstaller
% mkdir ~/.overc
% cp config/config-usb-cube.sh.sample ~/.overc/config-usb-cube.sh
% cp config/config-usb.sh.sample ~/.overc/config-usb.sh
Edit the variables in config-usb.sh to suit the build and desired installation.
In particular:
ARTIFACTS_DIR: set this to the directory containing the built images and kernel
And confirm that the following outputs exist in the artifacts directory:
INSTALL_KERNEL="${ARTIFACTS_DIR}/bzImage"
INSTALL_ROOTFS="${ARTIFACTS_DIR}/cube-essential-genericx86-64.tar.bz2"
INSTALL_INITRAMFS="${ARTIFACTS_DIR}/cube-builder-initramfs-genericx86-64.cpio.gz"
One other important file to modify is the grub configuration for the bootable
USB device. It is controlled by the following variable:
INSTALL_GRUBUSBCFG="grub-usb.cfg"
That file, located in files/grub-usb.cfg in the installer tree is used by
grub when booting, and must be tailored to the target device AND version
of grub.
Copy the grub configuration to ~/.overc/ and edit to suit your device(s).
** NOTE: the grub installed on the machine writing the USB stick is used to
populate the bootable device.
The sample grub configuration files are for grub2, so if the machine
creating the stick is not grub2, they will not work.
The only current solution is to install grub2, or modify the files
to suit your version of grub.
Finally, edit config-usb-cube.sh to list the containers and essential rootfs
that is to be installed. This is typically:
HDINSTALL_ROOTFS="${ARTIFACTS_DIR}/cube-essential-genericx86-64.tar.bz2"
HDINSTALL_CONTAINERS="${ARTIFACTS_DIR}/cube-dom0-genericx86-64.tar.bz2 \
${ARTIFACTS_DIR}/cube-dom1-genericx86-64.tar.bz2 \
${ARTIFACTS_DIR}/cube-domE-genericx86-64.tar.bz2"
At this point we have the payload to create a bootable USB disk prepared. The
scripts (or applications) that perform the final install to the target device
are found in the installers/ subdirectory. The installers can be simple, or
complex, and should be edited to suit the desired target runtime.
** Note **: carefully inspect any sample or existing installer that is placed
on the USB installer, since they may not be appropriate for your
target device (and hence remove / wipe data).
cube-install.sh is capable of partitioning a device, installing the essential
rootfs, configuring grub, extracting container payloads and rebooting the
device. It serves as a good example for other custom installers.
Once the installer(s) have been modified to suit the target device, the
following example command produces a bootable nbd USB device (assuming that a
nbd has been created properly started):
% sudo ./sbin/cubeit --config ~/.overc/config-usb-cube.sh --artifacts `pwd` /dev/nbd0
We now have a bootable device, with an embedded installer + installation payload.
NOTES:
* Puppet - The installer is able to apply puppet configurations
during the installation. To use this functionality you will have
to add 'puppet' to your build by including meta-cloud-services
(git://git.yoctoproject.org/meta-cloud-services) to your build's
layers and adding 'IMAGE_INSTALL_append += "puppet"' to your
build. Set INSTALL_PUPPET_DIR in the install config script to then
enable puppet configuration of your installation. Puppet is run in
the context of the installed 'cube-essential' at the end of the
installation if using cube-install.sh.
OverC installation
------------------
Once a bootable installer has been created, insert it into the target and
boot. The default USB bootable image runs cube-essential, with the login of
root/root.
After logging into the bootable device, the installer should be run to move
artifacts to their final destination device.
In our cube-install.sh example from above, the following commands should be
run (assuming an installation to a second virtual disk):
% cd /opt/installer/
% ./sbin/cubeit-install images/cube-essential-* vdb
** Note: The cube installer will destroy all data on the target device, since
it re-partitions, create filesystems, installs the boot image and
the rootfs + container filesystems.
Do not run it against a device with data you cannot afford to lose.
** Note: To create the root filesystem in btrfs, add -b option to cube-install.sh
% ./sbin/cubeit-install -b images/cube-essential-* vdb
Once this completes, the device is powered off, and is ready with the OverC
runtime.
OverC runtime
-------------
Assuming that domE has been installed, once booted, a graphical XFCE desktop is
provided. Normal operations such as:
- package additions
- local development
- upgrades
Other containers in the system can be accessed via their avahi address. i.e.
ssh dom0.local to access dom0 once running inside domE.