forked from rh-openjdk/JSF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystemcfg.txt
96 lines (76 loc) · 3.7 KB
/
systemcfg.txt
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
System config
To verify the filesystem, mock tool is used.
As really many "install - do something - check" where install is always the same, sometimes even "do something" is same then snapshot schema in mock is used.
You need mock-lvm to have installed and set up -- not anymore, check overlayfs part of this doc
Generally you need to provide LVM group to mock.
As you probably don't have spare partitions for new group, there is some reading followed by simple example how to provide *file* as new partition and how to make it lvm group:
https://fedoraproject.org/wiki/Mock/Plugin/LvmRoot?rd=Subprojects/Mock/Plugin/LvmRoot
http://www.anthonyldechiaro.com/blog/2010/12/19/lvm-loopback-how-to/
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Logical_Volume_Manager_Administration/LVM_examples.html#vol_create_ex
as you can see:
mock -r fedora-rawhide-x86_64 --list-snapshots
ERROR: Feature list_snapshots is not provided by any of enabled plugins
it do not work out of box
mkdir MOCK_SNAPSHOT_LVM
cd MOCK_SNAPSHOT_LVM
dd if=/dev/zero of=lvm.img bs=100 count=100M
# 10GB "partition should be enough"
sudo losetup -f
# /dev/loop0
sudo losetup /dev/loop0 lvm.img
# be sure to use unused
sudo vgcreate MOCK_SNAPSHOT_LVM /dev/loop0
# Physical volume "/dev/loop0" successfully created
# Volume group "MOCK_SNAPSHOT_LVM" successfully created
Its possible to use a partition as a snapshot location, its a little bit faster than img file, you need to
create a volume group with that partition and connect it to the mock, so basically only vgcreate on that partition
- for virtual machines, use .vdi as a partition for working with mock snapshots
now use this new VG in /etc/mock/site-defaults.cfg:
config_opts['plugin_conf']['root_cache_enable'] = False
config_opts['plugin_conf']['lvm_root_enable'] = True
config_opts['plugin_conf']['lvm_root_opts'] = {
'volume_group': 'MOCK_SNAPSHOT_LVM',
'size': '9G',
'pool_name': 'mock',
'check_size': True,
}
# this example is vasing 1gb for overhead, few kilos should be enough
Simple check:
mock -r fedora-rawhide-x86_64 --list-snapshots
Snapshots for fedora-rawhide-x86_64:
says it works
If you have any mocks *before* the mock-lvm instalation and setup, they will not provide the functionality:
mock -r fedora-rawhide-x86_64 --snapshot mvn
INFO: mock.py version 1.2.18 starting (python version = 3.4.3)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
ERROR: Command failed:
# lvcreate -s MOCK_SNAPSHOT_LVM/+mock.fedora-rawhide-x86_64.head -n mock.fedora-rawhide-x86_64.mvn
Snapshot origin LV +mock.fedora-rawhide-x86_64.head not found in Volume group MOCK_SNAPSHOT_LVM.
You need to
mock -r fedora-rawhide-x86_64 --scrub=all
them all, and recreate
Now
mock -r fedora-rawhide-x86_64 --list-snapshots
Snapshots for fedora-rawhide-x86_64:
* postinit
it works.
Dependencies:
mock
mock-lvm
rpm-build
Overlayfs plugin
It is now possible to mock straight to a directory. This can be done by a simple plugin (thanks zzambers!!)
- see https://github.com/rpm-software-management/mock/wiki/Plugin-Overlayfs
In short, you need to do two things:
1. create a directory anywhere you want, call it whatever you want, e.g.
mkdir /var/MOCK_OVERLAYFS
Then add following lines to a /etc/mock/site-defaults.cfg file:
config_opts['plugin_conf']['overlayfs_enable'] = True
config_opts['plugin_conf']['root_cache_enable'] = False
config_opts['plugin_conf']['overlayfs_opts']['base_dir'] = "/var/MOCK_OVERLAYFS"
If you touch the buildroot during any operation in the framework, you need to mount the buildroot
- see https://github.com/rpm-software-management/mock/pull/175
In general, this is not desired behavior and should not be used, unless it can not be avoided.