Compare commits
578 Commits
master
...
rhel7-bran
Author | SHA1 | Date | |
---|---|---|---|
|
21ab321558 | ||
|
06a242aa0a | ||
|
3d11e7026e | ||
|
533a0cb309 | ||
|
b81a8516a0 | ||
|
6473143f44 | ||
|
d22ebad3d2 | ||
|
bebec0cf58 | ||
|
970a39f296 | ||
|
4defe98a0d | ||
|
c8bb73d9a5 | ||
|
8f5444aad2 | ||
|
2aa2ea4404 | ||
|
15772acfd1 | ||
|
5f050669e6 | ||
|
f5b781a9e6 | ||
|
d2bf2edad2 | ||
|
12da07a8f6 | ||
|
a4f6f78c2c | ||
|
05128a76fd | ||
|
c15a976832 | ||
|
7c1f29af5a | ||
|
1f89fdbfe3 | ||
|
3537fb784a | ||
|
376c480691 | ||
|
69df5f2362 | ||
|
4f373dcc10 | ||
|
3a1d7da06e | ||
|
18ee6a2a89 | ||
|
81ce55a1e5 | ||
|
fffb03d5c3 | ||
|
1ba7613036 | ||
|
ccf34b1913 | ||
|
bbbd805909 | ||
|
5499fed441 | ||
|
245e0e84df | ||
|
e3b1292262 | ||
|
1566f3d10f | ||
|
9fff793dff | ||
|
c4417470da | ||
|
bb8c7851d2 | ||
|
2ddad4dd82 | ||
|
9eb7c0d206 | ||
|
ba76efba14 | ||
|
4bfcd8fcd2 | ||
|
3cfb895054 | ||
|
957def1264 | ||
|
a5eaebeefc | ||
|
2e95b56508 | ||
|
3f7997d7ae | ||
|
f1000b448d | ||
|
25bae61520 | ||
|
33c84331fe | ||
|
82c8c3a491 | ||
|
b99d8d7f6b | ||
|
9e06f6e113 | ||
|
ce715ad15f | ||
|
7745a019c0 | ||
|
3c60f07d98 | ||
|
f26a6212d6 | ||
|
9978503a69 | ||
|
3a38a57ae1 | ||
|
050f87168a | ||
|
5b7b37860a | ||
|
ccafa76019 | ||
|
ffc3195d77 | ||
|
8eccb5d6bd | ||
|
85f365bd73 | ||
|
1fc7cff52b | ||
|
f40f7cc0fd | ||
|
d44957aa95 | ||
|
520439a7c4 | ||
|
0d7e1dacfd | ||
|
d030209d40 | ||
|
0887bd3d95 | ||
|
5efeb05aa7 | ||
|
f0d29be521 | ||
|
651e111d1f | ||
|
8c65257a5a | ||
|
c22d05032e | ||
|
540f36eee4 | ||
|
2939feadec | ||
|
fcf47904aa | ||
|
2697bb2bc7 | ||
|
020d9de4b3 | ||
|
211f1bf764 | ||
|
78c02dd7e7 | ||
|
b2f5fe2f60 | ||
|
47a3980b12 | ||
|
c15f3c89fa | ||
|
423e8cba88 | ||
|
2481c486a5 | ||
|
c58e1994e9 | ||
|
97eb262d1e | ||
|
258cecf75d | ||
|
af68a98abe | ||
|
c5a07ff80f | ||
|
5d4c550df4 | ||
|
5446cad1b0 | ||
|
6560cc6f27 | ||
|
9e16e1c0c5 | ||
|
73011c6bb0 | ||
|
114f7f348e | ||
|
579e6840f8 | ||
|
5c878a695f | ||
|
1a4a4defcc | ||
|
597c19466e | ||
|
d4b99b5ee9 | ||
|
d0676dbf7c | ||
|
aa076ee53b | ||
|
de604b37a6 | ||
|
7ad9939fac | ||
|
e425b7ccca | ||
|
2e61bc8bf9 | ||
|
60874d0197 | ||
|
37c982b66e | ||
|
dbe9c15ee1 | ||
|
56766e794f | ||
|
9ba24f305d | ||
|
d2f784e5da | ||
|
79fa1c957e | ||
|
0ea4eb5206 | ||
|
413964b92f | ||
|
b0d91204a4 | ||
|
6796861773 | ||
|
41fd9ab19c | ||
|
4ae5944567 | ||
|
59fd3934f3 | ||
|
85ee784efc | ||
|
0e3b87a1da | ||
|
74326ba7a3 | ||
|
06648d415a | ||
|
4144c3937c | ||
|
91cebe7b67 | ||
|
af8c193b52 | ||
|
5500ec8c06 | ||
|
98f3b7e7eb | ||
|
1f90455ee6 | ||
|
7f7295e3b0 | ||
|
3dd5612732 | ||
|
64ce465285 | ||
|
c399447b81 | ||
|
a1427b1a31 | ||
|
442dc43206 | ||
|
43fe00c1c2 | ||
|
4ae2e1450d | ||
|
5e075f6102 | ||
|
fdecf13299 | ||
|
daa5ed2aaf | ||
|
eb2a7208c8 | ||
|
63a7897457 | ||
|
8da6214e10 | ||
|
2e1e8c20c7 | ||
|
9603c866af | ||
|
166350fcb6 | ||
|
ff7d36bcbc | ||
|
caee8e7cdf | ||
|
072aa720ff | ||
|
8f0bca00c0 | ||
|
f1d8b10867 | ||
|
dfe8774616 | ||
|
d3d92d13b1 | ||
|
1c977b79ef | ||
|
32db249538 | ||
|
a954cde36a | ||
|
e830d9766b | ||
|
395c4a4b7f | ||
|
6a95a314e9 | ||
|
ed03ac7524 | ||
|
d3a9ec3002 | ||
|
22c03ceba7 | ||
|
b99a7756de | ||
|
3fdf3a9819 | ||
|
fdcf839753 | ||
|
91c6d1525d | ||
|
fd2aa7c79b | ||
|
520177afca | ||
|
47f21af7fb | ||
|
0065cadf2d | ||
|
9fc973366f | ||
|
67da4d6971 | ||
|
de9f5b0456 | ||
|
7372faa969 | ||
|
c92373ecd6 | ||
|
e2f4674fb3 | ||
|
0ce4197a1e | ||
|
ea4f9ed615 | ||
|
57d9d40c29 | ||
|
377f5e4124 | ||
|
916a001d73 | ||
|
0af072c77e | ||
|
7809da61e6 | ||
|
c90ea64e59 | ||
|
176b12dd8c | ||
|
da3616db72 | ||
|
53cd264ece | ||
|
e1af0c67bd | ||
|
3e5c0707bb | ||
|
a44e499eee | ||
|
cf42e1a480 | ||
|
efd15aaad7 | ||
|
d6f41fbfa1 | ||
|
c1bd07635a | ||
|
27a3f4e38c | ||
|
bae551b7ab | ||
|
6b4bf92e7f | ||
|
b8212358bc | ||
|
a85d0ced8b | ||
|
164232ba4d | ||
|
f26af06739 | ||
|
ad5ab71551 | ||
|
8fee86a5db | ||
|
a1e7e4831d | ||
|
23d90ec066 | ||
|
8635a59ac7 | ||
|
c3d495fe53 | ||
|
99140b98b9 | ||
|
0819e97646 | ||
|
105679d79d | ||
|
569ce1d3dc | ||
|
4f99c208aa | ||
|
5d6c236af6 | ||
|
8db5cdd512 | ||
|
9ec571ab23 | ||
|
1d53d00532 | ||
|
2cd4fcfd88 | ||
|
9ca9bfe46f | ||
|
950d9df217 | ||
|
9f9d227600 | ||
|
3bbbeb347a | ||
|
453082ab9f | ||
|
d701120d90 | ||
|
052a8ba991 | ||
|
a76e95dcb5 | ||
|
7f1adf120c | ||
|
3f4140d5d3 | ||
|
639d325a0c | ||
|
ab6decec0b | ||
|
c294b7747d | ||
|
c937e69d3b | ||
|
6e453e70dc | ||
|
83e13c4ca8 | ||
|
72b4c4fe28 | ||
|
711cdf53b3 | ||
|
7b5115d19c | ||
|
3c75711b30 | ||
|
02db2afb2b | ||
|
1e7335a506 | ||
|
b7f651a631 | ||
|
b6fb22133c | ||
|
90a8798f4c | ||
|
5b0d662007 | ||
|
596f06d5c0 | ||
|
afdb320266 | ||
|
bfc9c6913f | ||
|
d71290153e | ||
|
2cd4f73177 | ||
|
e9e6e5701e | ||
|
bf9ed50d51 | ||
|
a0766b1d70 | ||
|
4d8e2b5356 | ||
|
663b0f8378 | ||
|
18528b4f47 | ||
|
b15df5a0af | ||
|
7f5b492198 | ||
|
15de3e1687 | ||
|
54cdb5dbf5 | ||
|
f405aedf6e | ||
|
2008a413b6 | ||
|
798023b199 | ||
|
bf8be43c90 | ||
|
47aa2fb215 | ||
|
c5dfe8e940 | ||
|
c746e8b0c3 | ||
|
f116ee8f05 | ||
|
4788d4eb4d | ||
|
c8cee96b1c | ||
|
22392b64fc | ||
|
6f2494f9d5 | ||
|
88664f03a1 | ||
|
99254492e3 | ||
|
5479fab3e4 | ||
|
730badfebc | ||
|
8361d021a5 | ||
|
2c5ba00dc0 | ||
|
ea72c3e035 | ||
|
9429d392d6 | ||
|
db8892bef3 | ||
|
9c6575689a | ||
|
1745c4f15b | ||
|
7a0b4f2070 | ||
|
58309c2018 | ||
|
54d973e059 | ||
|
1639df6862 | ||
|
b1aa852b58 | ||
|
df35857c9b | ||
|
4f55facece | ||
|
641bbc21af | ||
|
a909182aad | ||
|
3cfd532382 | ||
|
d30143d146 | ||
|
e5c6f9e8bc | ||
|
6007b35096 | ||
|
5238b9cd18 | ||
|
1b29041089 | ||
|
7aa71188b9 | ||
|
a883412ccc | ||
|
79917e7e88 | ||
|
487618314c | ||
|
81d534670b | ||
|
694a630a89 | ||
|
aaf1cc3894 | ||
|
bbfc50b185 | ||
|
e0d9e309ae | ||
|
db32eb7295 | ||
|
1d2639cd92 | ||
|
fd7199d3b4 | ||
|
31fec67150 | ||
|
16594715cc | ||
|
5970d38a1a | ||
|
8d1e55a765 | ||
|
351b4a0ce4 | ||
|
c049f01c46 | ||
|
6d5dc9cfa3 | ||
|
985a2f1c3d | ||
|
cac3e38bcb | ||
|
77618d27b9 | ||
|
c271124e84 | ||
|
8dbdd4abd4 | ||
|
460bcd8f68 | ||
|
8c19af511e | ||
|
d7ae7a9e1f | ||
|
49321eef6f | ||
|
5d204bd21e | ||
|
e9e30a2516 | ||
|
d4437ce5ee | ||
|
8ef5f48a3e | ||
|
2ee0b0a2ae | ||
|
975c46b35f | ||
|
371286180a | ||
|
3fa988aa17 | ||
|
2543a1ee19 | ||
|
766cad3ad3 | ||
|
02dda2c00b | ||
|
05d271d0d9 | ||
|
b5d0b1fd79 | ||
|
5dbb282289 | ||
|
6268aaff6e | ||
|
c2be4bdfc8 | ||
|
8110952abb | ||
|
492d39933d | ||
|
c63963c99f | ||
|
3093ff7bac | ||
|
1f9af67806 | ||
|
6a8663c270 | ||
|
a1ef3b009b | ||
|
b7f74cdb01 | ||
|
9455d47c10 | ||
|
9a64d851f1 | ||
|
abfbd76af2 | ||
|
4bdfa33958 | ||
|
ba52b0f952 | ||
|
73b368de28 | ||
|
4ec05dd1c9 | ||
|
e2285683c4 | ||
|
1f078e5e03 | ||
|
51eac47775 | ||
|
391f1a7b57 | ||
|
424fdd5cda | ||
|
0d28b9e09c | ||
|
69daa095bf | ||
|
5be2a9c57a | ||
|
cc374548e8 | ||
|
fec7b8d7b8 | ||
|
de835d687a | ||
|
0252c5a7f1 | ||
|
a17cecdee2 | ||
|
420d006ab6 | ||
|
2795b08b1c | ||
|
cc715caaf9 | ||
|
b8bcb063cc | ||
|
7c4d7b0c42 | ||
|
5da9f5c179 | ||
|
f9dfc02fbf | ||
|
7949b7dc52 | ||
|
8a9fe5f8e2 | ||
|
3f5047dd4f | ||
|
243a29b495 | ||
|
62cfefd718 | ||
|
c5e842b58a | ||
|
94d4bc7c4a | ||
|
41715eb194 | ||
|
411fb2407c | ||
|
d93ace517e | ||
|
aab6998a49 | ||
|
f9b36c0f5f | ||
|
7db0c5834b | ||
|
c124d8277d | ||
|
4cd75072c2 | ||
|
6e86552714 | ||
|
ee9f35dc74 | ||
|
b2f6a9f129 | ||
|
84514e18ce | ||
|
4fcabd4f00 | ||
|
9c09f2a75a | ||
|
d48d0edd9c | ||
|
b3a4b56733 | ||
|
b51ff60875 | ||
|
f15503d2cc | ||
|
6b7407599b | ||
|
96371548d3 | ||
|
5688d58dcc | ||
|
50f9f48cc1 | ||
|
b3dabdd2e0 | ||
|
5e1a7e4e3c | ||
|
b7ce8b4b0f | ||
|
13ea2c5253 | ||
|
ba017a8d71 | ||
|
58929b550b | ||
|
80fcdb4f91 | ||
|
cbcfb27335 | ||
|
a37a59b3eb | ||
|
b79ad68a50 | ||
|
115d6d4c7d | ||
|
29ae3b0293 | ||
|
9b57050fc6 | ||
|
bf8d25fc91 | ||
|
680037372e | ||
|
155750a4c8 | ||
|
aff2a05f1c | ||
|
931a3bc87d | ||
|
ed3bec702e | ||
|
9d8aabded6 | ||
|
219ede2ae5 | ||
|
52cd17be3f | ||
|
28801d8d42 | ||
|
e087f5a33c | ||
|
14c3324cac | ||
|
e95d34d13c | ||
|
a0f4a50291 | ||
|
e9848670e5 | ||
|
db5e36b2b6 | ||
|
6688b96b38 | ||
|
fa2655f7d4 | ||
|
30d7c14e29 | ||
|
e1655d7c3a | ||
|
16b052e99b | ||
|
6db00b977e | ||
|
5a283bb5f7 | ||
|
8fa43fc607 | ||
|
1ef49fca1e | ||
|
923ec7f682 | ||
|
c79b291923 | ||
|
e425ee14c6 | ||
|
e543fecde0 | ||
|
253e953962 | ||
|
f259ff0e29 | ||
|
b0638ca2cd | ||
|
d646ddb5d6 | ||
|
073d5de464 | ||
|
1f56b27082 | ||
|
880a56d1c0 | ||
|
26cfe3ebc8 | ||
|
16d06ac7c9 | ||
|
771ff40c4e | ||
|
b343637745 | ||
|
036d7d1a79 | ||
|
8bd3d8d232 | ||
|
bc0976b8d6 | ||
|
5b841e69a4 | ||
|
790adbe143 | ||
|
da68471b33 | ||
|
55299e3944 | ||
|
0e6ea6be85 | ||
|
a8681aca4e | ||
|
526988651d | ||
|
8f2283cf1c | ||
|
0a9992267c | ||
|
4a05a02fe6 | ||
|
6a40fe1bfa | ||
|
74b1877f1b | ||
|
46d67de350 | ||
|
44b6948d1e | ||
|
02177d916f | ||
|
f6cc7ed16a | ||
|
84af4b08f5 | ||
|
0828f63bc9 | ||
|
d1ec67c8d2 | ||
|
ca4b3d35dd | ||
|
4589a155e4 | ||
|
da8326fd58 | ||
|
b6c4d51c65 | ||
|
7d6e8c65f3 | ||
|
af4cf82071 | ||
|
fbfc6e34f6 | ||
|
1e4af4e304 | ||
|
6f27e0bd09 | ||
|
1c9a7b3621 | ||
|
cb1c6f1c6f | ||
|
55cd4d207f | ||
|
cd8e565f78 | ||
|
1c936ee984 | ||
|
1686a1a159 | ||
|
bbec9e21bd | ||
|
ac6f0b04c5 | ||
|
39e4da7ce8 | ||
|
ee71bc9b11 | ||
|
ccb43c2a62 | ||
|
59f256e989 | ||
|
033dfac48d | ||
|
e6c12f63f4 | ||
|
ce23e3e097 | ||
|
5c468bdb7f | ||
|
c4ea32367d | ||
|
436a5aed0d | ||
|
cee25952d4 | ||
|
d2de389cba | ||
|
84528efad6 | ||
|
e6015f93c5 | ||
|
6700d862c4 | ||
|
f2c4d4a43c | ||
|
6510f5819b | ||
|
fceb957ad2 | ||
|
d30390aa9e | ||
|
b18e0f88c3 | ||
|
28bf37089b | ||
|
5b9c8c7ab5 | ||
|
9b73faef1b | ||
|
9da051cd78 | ||
|
e108883247 | ||
|
32cf10b3b8 | ||
|
d08d8081b6 | ||
|
ad4d53515a | ||
|
1cf54d3611 | ||
|
9ceff1c965 | ||
|
b506a0cf48 | ||
|
88863a63d7 | ||
|
16fe80f6b1 | ||
|
61401e2640 | ||
|
aaef9fc2e4 | ||
|
b01abcaf64 | ||
|
d65ca8d789 | ||
|
1562dbe6ef | ||
|
3a5e515d4f | ||
|
0d74373fd0 | ||
|
7f090e3311 | ||
|
ee6802a0fa | ||
|
ca3d374a64 | ||
|
7871eb592a | ||
|
0a9bdb2157 | ||
|
760b56dd9d | ||
|
26d8c14796 | ||
|
14a191009d | ||
|
123728393d | ||
|
8daa0d36d4 | ||
|
09490877a0 | ||
|
71002d3753 | ||
|
12e03abfa9 | ||
|
4d8f6d904d | ||
|
5dd01b4aef | ||
|
fa0fb57e4b | ||
|
dccaa0eeb0 | ||
|
ad19c8a2d9 | ||
|
eae915f34f | ||
|
ed5803bae8 | ||
|
ac202ee4ed | ||
|
6eb04c63cb | ||
|
e8f114b4cb | ||
|
f44d2f874d | ||
|
7d83abb8d0 | ||
|
2025a6a1df | ||
|
5228b31661 | ||
|
186999b5da | ||
|
0bf78e7acf | ||
|
22a36d3a81 | ||
|
2ea99b1810 | ||
|
70b6b8d675 | ||
|
96991655b4 |
12
.coveragerc
Normal file
12
.coveragerc
Normal file
@ -0,0 +1,12 @@
|
||||
# http://nedbatchelder.com/code/coverage/config.html
|
||||
[run]
|
||||
concurrency = multiprocessing
|
||||
parallel = True
|
||||
branch = True
|
||||
|
||||
[report]
|
||||
include = src/*
|
||||
|
||||
[paths]
|
||||
source = .
|
||||
/lorax/
|
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
.git/
|
||||
.coverage
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,2 +1,10 @@
|
||||
*.pyc
|
||||
src/pylorax/version.py*
|
||||
src/composer/version.py*
|
||||
*.swp
|
||||
.pylint.d/
|
||||
_build/
|
||||
tests/pylint/.pylint.d/
|
||||
__pycache__/
|
||||
.coverage
|
||||
pylint-log
|
||||
|
23
.travis.yml
Normal file
23
.travis.yml
Normal file
@ -0,0 +1,23 @@
|
||||
sudo: required
|
||||
language: python
|
||||
services:
|
||||
- docker
|
||||
|
||||
script:
|
||||
- make test-in-docker
|
||||
|
||||
after_success:
|
||||
- |
|
||||
|
||||
sudo docker create --name results-cont welder/lorax-composer
|
||||
sudo docker cp results-cont:/lorax/.coverage .coverage.docker
|
||||
sudo docker rm results-cont
|
||||
|
||||
pip install coverage==3.6 coveralls
|
||||
coverage combine
|
||||
coveralls
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_failure: change
|
||||
on_success: never
|
24
Dockerfile.test
Normal file
24
Dockerfile.test
Normal file
@ -0,0 +1,24 @@
|
||||
FROM centos:7
|
||||
|
||||
COPY epel.repo /etc/yum.repos.d/
|
||||
RUN yum -y install --nogpgcheck epel-release && \
|
||||
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
|
||||
yum -y install make libgit2-glib tito pylint \
|
||||
python-nose python-mako python-flask \
|
||||
python-coverage libselinux-python sudo \
|
||||
pykickstart python2-pytoml python-sphinx \
|
||||
python2-mock python-semantic_version \
|
||||
anaconda-tui python-gevent beakerlib \
|
||||
python2-rpmfluff && \
|
||||
yum clean all && \
|
||||
rm -rf /var/cache/yum && \
|
||||
useradd weldr
|
||||
|
||||
RUN mkdir /lorax
|
||||
COPY . /lorax
|
||||
# remove byte-compiled files to avoid issues between Python 2/3
|
||||
# this can happen when you switch between rhel7 and master branches
|
||||
RUN find /lorax -name "*.pyc" -exec rm -f {} \;
|
||||
|
||||
WORKDIR /lorax
|
||||
RUN make test
|
45
Makefile
45
Makefile
@ -1,32 +1,64 @@
|
||||
PYTHON ?= /usr/bin/python
|
||||
DESTDIR ?= /
|
||||
DOCKER ?= docker
|
||||
|
||||
PKGNAME = lorax
|
||||
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
|
||||
RELEASE = $(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g')
|
||||
TAG = lorax-$(VERSION)-$(RELEASE)
|
||||
PW_DIR ?= $(shell pwd)
|
||||
USER_SITE_PACKAGES ?= $(shell sudo $(PYTHON) -m site --user-site)
|
||||
|
||||
|
||||
default: all
|
||||
|
||||
src/composer/version.py: lorax.spec
|
||||
echo "num = '$(VERSION)-$(RELEASE)'" > src/composer/version.py
|
||||
|
||||
src/pylorax/version.py: lorax.spec
|
||||
echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py
|
||||
|
||||
all: src/pylorax/version.py
|
||||
all: src/pylorax/version.py src/composer/version.py
|
||||
$(PYTHON) setup.py build
|
||||
|
||||
install: all
|
||||
$(PYTHON) setup.py install --root=$(DESTDIR)
|
||||
mkdir -p $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/lorax.1 $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/man/lorax.1 $(DESTDIR)/$(mandir)/man1
|
||||
install -m 644 docs/man/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1
|
||||
|
||||
check:
|
||||
@echo "*** Running pylint ***"
|
||||
PYTHONPATH=$(PYTHONPATH):./src/ ./tests/pylint/runpylint.py
|
||||
|
||||
# /api/docs/ tests require we have the documentation already built
|
||||
test: docs
|
||||
@echo "*** Running tests ***"
|
||||
sudo mkdir -p $(USER_SITE_PACKAGES)
|
||||
sudo cp ./tests/usercustomize.py $(USER_SITE_PACKAGES)
|
||||
sudo COVERAGE_PROCESS_START=$(PW_DIR)/.coveragerc PYTHONPATH=$(PYTHONPATH):./src/ \
|
||||
$(PYTHON) -m nose -v ./src/pylorax/ ./tests/pylorax/
|
||||
sudo rm -rf $(USER_SITE_PACKAGES)
|
||||
|
||||
coverage combine
|
||||
coverage report -m
|
||||
[ -f "/usr/bin/coveralls" ] && [ -n "$(COVERALLS_REPO_TOKEN)" ] && coveralls || echo
|
||||
|
||||
|
||||
check:
|
||||
@echo "*** Running pylint ***"
|
||||
./tests/pylint/runpylint.sh
|
||||
|
||||
clean:
|
||||
-rm -rf build src/pylorax/version.py
|
||||
-rm -rf build src/composer/version.py
|
||||
|
||||
tag:
|
||||
git tag -f $(TAG)
|
||||
|
||||
docs:
|
||||
$(MAKE) -C docs apidoc html
|
||||
|
||||
archive: tag
|
||||
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
|
||||
@gzip $(PKGNAME)-$(VERSION).tar
|
||||
@ -40,3 +72,10 @@ local:
|
||||
@dir=$$PWD; cd /var/tmp; tar --gzip -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.gz $(PKGNAME)-$(VERSION)
|
||||
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
|
||||
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
|
||||
|
||||
test-in-docker:
|
||||
sudo $(DOCKER) build -t welder/lorax-composer:latest -f Dockerfile.test .
|
||||
|
||||
ci: check test
|
||||
|
||||
.PHONY: all install check test clean tag docs archive local
|
||||
|
@ -16,6 +16,14 @@ minimum you need:
|
||||
--iso to specify the Anaconda install media to use with virt-install
|
||||
--ks is the kickstart to use to install the system
|
||||
|
||||
To use livemedia-creator with virt-install you will need to install the
|
||||
following packages, as well as have libvirtd setup correctly.
|
||||
virt-install
|
||||
libvirt-python
|
||||
|
||||
If you are going to be using Anaconda directly, with --no-virt mode, make sure
|
||||
you have the anaconda package installed.
|
||||
|
||||
|
||||
QUICKSTART
|
||||
----------
|
||||
@ -74,13 +82,27 @@ written using the Mako template system which is very flexible.
|
||||
|
||||
KICKSTARTS
|
||||
----------
|
||||
Existing spin kickstarts can be used to create live media with a few changes.
|
||||
Here are the steps I used to convert the XFCE spin.
|
||||
The docs/ directory includes two example kickstarts, one to create a live desktop
|
||||
iso using GNOME, and the other to create a minimal disk image. When creating your
|
||||
own kickstarts you should start with the minimal example, it includes several
|
||||
needed packages that are not always included by dependencies.
|
||||
|
||||
livemedia-creator parses the 'part /' entry to determine how big a disk image
|
||||
needs to be created. This means that the common kickstart technique of using
|
||||
%pre to generate a partition scheme for use with %include will not work. There
|
||||
needs to be a 'part /' entry in the main part of the kickstart.
|
||||
|
||||
Only one kickstart file is supported, so if your kickstart is built from a
|
||||
number of %include commands it needs to be flattened into a single file with
|
||||
ksflatten first.
|
||||
|
||||
Or you can use existing spin kickstarts to create live media with a few
|
||||
changes. Here are the steps I used to convert the Fedora XFCE spin.
|
||||
|
||||
1. Flatten the xfce kickstart using ksflatten
|
||||
2. Add zerombr so you don't get the disk init dialog
|
||||
3. Add clearpart --all
|
||||
4. Add swap and biosboot partitions
|
||||
4. Add swap partition
|
||||
5. bootloader target
|
||||
6. Add shutdown to the kickstart
|
||||
7. Add network --bootproto=dhcp --activate to activate the network
|
||||
@ -96,7 +118,6 @@ network --bootproto=dhcp --activate
|
||||
zerombr
|
||||
clearpart --all
|
||||
bootloader --location=mbr
|
||||
part biosboot --size=1
|
||||
part swap --size=512
|
||||
shutdown
|
||||
|
||||
@ -110,8 +131,12 @@ passwd -d root > /dev/null
|
||||
|
||||
cat /dev/null > /dev/fstab
|
||||
|
||||
Do this only for live iso's, the filesystem will be mounted read only if
|
||||
there is no /etc/fstab
|
||||
|
||||
11. Don't delete initramfs files from /boot in %post
|
||||
12. Have dracut-norescue, grub-efi, memtest86+ and syslinux in the package list
|
||||
12. Have dracut-config-generic, grub2-efi, shim, memtest86+, isomd5sum and syslinux in the package list
|
||||
13. Omit dracut-config-rescue from the package list "-dracut-config-rescue"
|
||||
|
||||
One drawback to using virt-install is that it pulls the packages from
|
||||
the repo each time you run it. To speed things up you either need a local
|
||||
@ -129,6 +154,16 @@ You can also add an update repo, but don't name it updates. Add --proxy to
|
||||
it as well.
|
||||
|
||||
|
||||
UEFI Disk Image Creation
|
||||
------------------------
|
||||
When making a live iso the bootloader is added after Anaconda has run. As long as
|
||||
anaconda-tools and grub2-efi-*-cdboot are included in the kickstart the iso will
|
||||
be bootable on UEFI systems.
|
||||
|
||||
To create a disk image, eg. using rhel7-minimal.ks, livemedia-creator needs to be
|
||||
run from a UEFI system or virt running UEFI firmware.
|
||||
|
||||
|
||||
ANACONDA IMAGE INSTALL
|
||||
----------------------
|
||||
You can create images without using virt-install by passing --no-virt on the
|
||||
@ -178,7 +213,7 @@ switch. This will create the partitioned disk image and an XML file that can be
|
||||
used with virt-image to setup a virtual system.
|
||||
|
||||
The XML is generated using the Mako template from
|
||||
/usr/share/lorax/appliance/virt-image.xml You can use a different template by
|
||||
/usr/share/lorax/appliance/libvirt.xml You can use a different template by
|
||||
passing --app-template <template path>
|
||||
|
||||
Documentation on the Mako template system can be found here:
|
||||
@ -203,6 +238,41 @@ title from --title
|
||||
project from --project
|
||||
releasever from --releasever
|
||||
|
||||
The created image can be imported into libvirt using:
|
||||
|
||||
virt-image appliance.xml
|
||||
|
||||
|
||||
TAR FILE CREATION
|
||||
-----------------
|
||||
The --make-tar command can be used to create a tar of the root filesystem. By
|
||||
default it is compressed using xz, but this can be changed using the
|
||||
--compression and --compress-arg options. This option works with both virt and
|
||||
--no-virt install methods.
|
||||
|
||||
As with --make-fsimage the kickstart should be limited to a single / partition.
|
||||
|
||||
eg.
|
||||
|
||||
livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/fedora-minimal.ks \
|
||||
--image-name=fedora-root.tar.xz
|
||||
|
||||
LIVE IMAGE FOR PXE BOOT
|
||||
-----------------------
|
||||
|
||||
The --make-pxe-live command will produce squashfs image containing live root
|
||||
filesystem that can be used for pxe boot. Directory with results will contain
|
||||
the live image, kernel image, initrd image and template of pxe configuration
|
||||
for the images.
|
||||
|
||||
ATOMIC LIVE IMAGE FOR PXE BOOT
|
||||
------------------------------
|
||||
|
||||
The --make-ostree-live command will produce the same result as --make-pxe-live
|
||||
for installations of Atomic Host. Example kickstart for such an installation
|
||||
using Atomic installer iso with local repo included in the image can be found
|
||||
in docs/rhel-atomic-pxe-live.ks.
|
||||
|
||||
|
||||
DEBUGGING PROBLEMS
|
||||
------------------
|
||||
|
21
README.product
Normal file
21
README.product
Normal file
@ -0,0 +1,21 @@
|
||||
Lorax now supports creation of product.img and updates.img as part of the build
|
||||
process. This is implemented using the installimg template command which will
|
||||
take the contents of a directory and create a compressed archive from it. The
|
||||
directory must be created by one of the packages installed by
|
||||
runtime-install.tmpl or by passing ``--installpkgs <pkgname>`` to lorax at
|
||||
runtime. The x86, ppc, ppc64le and aarch64 templates all look for
|
||||
/usr/share/lorax/product/ and /usr/share/lorax/updates/ directories in the
|
||||
install chroot while creating the final install tree. If there are files in
|
||||
those directories lorax will create images/product.img and/or
|
||||
images/updates.img
|
||||
|
||||
These archives are just like an anaconda updates image -- they are copied over
|
||||
the top of the filesystem at boot time so that you can drop in files to add to
|
||||
or replace anything on the filesystem.
|
||||
|
||||
Anaconda has several places that it looks for updates, the one for product.img
|
||||
is in /run/install/product. For example, to add an installclass to Anaconda
|
||||
you would put your custom class here:
|
||||
|
||||
/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py
|
||||
|
183
docs/Makefile
Normal file
183
docs/Makefile
Normal file
@ -0,0 +1,183 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
SPHINXAPIDOC = sphinx-apidoc
|
||||
PAPER =
|
||||
BUILDDIR = .
|
||||
SOURCEDIR = ../src
|
||||
MODULE_NAMES = pylorax.rst pylorax.api.rst modules.rst composer.rst composer.cli.rst
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||
endif
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
apidoc:
|
||||
if [ -f /usr/bin/$(SPHINXAPIDOC) ]; then \
|
||||
rm $(addprefix ./, $(MODULE_NAMES)) ; \
|
||||
$(SPHINXAPIDOC) -o . $(SOURCEDIR) ; \
|
||||
fi
|
||||
|
||||
html: apidoc
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml: apidoc
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml: apidoc
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle: apidoc
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json: apidoc
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp: apidoc
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp: apidoc
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/src.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/src.qhc"
|
||||
|
||||
devhelp: apidoc
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/src"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/src"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub: apidoc
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex: apidoc
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf: apidoc
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
latexpdfja: apidoc
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text: apidoc
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man: apidoc
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo: apidoc
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info: apidoc
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext: apidoc
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes: apidoc
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck: apidoc
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest: apidoc
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
xml: apidoc
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
pseudoxml: apidoc
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
392
docs/conf.py
Normal file
392
docs/conf.py
Normal file
@ -0,0 +1,392 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# src documentation build configuration file, created by
|
||||
# sphinx-quickstart on Wed Apr 8 13:46:00 2015.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('../src/'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.coverage',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Lorax'
|
||||
copyright = u'2018, Red Hat, Inc.' # pylint: disable=redefined-builtin
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
def read_version():
|
||||
""" Read version from ../lorax.spec"""
|
||||
import re
|
||||
version_re = re.compile(r"Version:\s+(.*)")
|
||||
with open("../lorax.spec", "rt") as f:
|
||||
for line in f:
|
||||
m = version_re.match(line)
|
||||
if m:
|
||||
return m.group(1)
|
||||
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = read_version()
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = version
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build', 'html']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'Loraxdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'Lorax.tex', u'Lorax Documentation',
|
||||
u'Anaconda Team', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('lorax', 'lorax', u'Lorax Documentation', [u'Anaconda Team'], 1),
|
||||
('livemedia-creator', 'livemedia-creator', u'Live Media Creator Documentation', [u'Anaconda Team'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'Lorax', u'Lorax Documentation',
|
||||
u'Anaconda Team', 'Lorax', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
|
||||
|
||||
# -- Options for Epub output ----------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = u'Lorax'
|
||||
epub_author = u'Anaconda Team'
|
||||
epub_publisher = u'Anaconda Team'
|
||||
epub_copyright = u'2018, Red Hat, Inc.'
|
||||
|
||||
# The basename for the epub file. It defaults to the project name.
|
||||
#epub_basename = u'src'
|
||||
|
||||
# The HTML theme for the epub output. Since the default themes are not optimized
|
||||
# for small screen space, using the same theme for HTML and epub output is
|
||||
# usually not wise. This defaults to 'epub', a theme designed to save visual
|
||||
# space.
|
||||
#epub_theme = 'epub'
|
||||
|
||||
# The language of the text. It defaults to the language option
|
||||
# or en if the language is not set.
|
||||
#epub_language = ''
|
||||
|
||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||
#epub_scheme = ''
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#epub_uid = ''
|
||||
|
||||
# A tuple containing the cover image and cover page html template filenames.
|
||||
#epub_cover = ()
|
||||
|
||||
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
|
||||
#epub_guide = ()
|
||||
|
||||
# HTML files that should be inserted before the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_pre_files = []
|
||||
|
||||
# HTML files shat should be inserted after the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_post_files = []
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
epub_exclude_files = ['search.html']
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
#epub_tocdup = True
|
||||
|
||||
# Choose between 'default' and 'includehidden'.
|
||||
#epub_tocscope = 'default'
|
||||
|
||||
# Fix unsupported image types using the PIL.
|
||||
#epub_fix_images = False
|
||||
|
||||
# Scale large images.
|
||||
#epub_max_image_width = 0
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#epub_show_urls = 'inline'
|
||||
|
||||
# If false, no index is generated.
|
||||
#epub_use_index = True
|
||||
|
||||
# Example configuration for intersphinx: refer to the Python standard library.
|
||||
intersphinx_mapping = {'https://docs.python.org/2': None}
|
||||
|
||||
# on_rtd is whether we are on readthedocs.org
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
|
||||
#if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
# import sphinx_rtd_theme
|
||||
# html_theme = 'sphinx_rtd_theme'
|
||||
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
|
||||
|
||||
# This was taken directly from here:
|
||||
# http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
|
||||
# I only added the __getitem__ method.
|
||||
# NOTE: this can be removed whenever we move to sphinx-1.3, at which point we'll
|
||||
# be able to use autodoc_mock_imports (value is a list of modules to be
|
||||
# mocked).
|
||||
class Mock(object):
|
||||
|
||||
__all__ = []
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
return Mock()
|
||||
|
||||
@classmethod
|
||||
def __getattr__(cls, name):
|
||||
if name in ('__file__', '__path__'):
|
||||
return '/dev/null'
|
||||
elif name[0] == name[0].upper():
|
||||
mockType = type(name, (), {})
|
||||
mockType.__module__ = __name__
|
||||
return mockType
|
||||
else:
|
||||
return Mock()
|
||||
|
||||
@classmethod
|
||||
def __getitem__(cls, key):
|
||||
return cls.__getattr__(key)
|
||||
|
||||
MOCK_MODULES = ["selinux", "dnf", "rpmUtils", "rpmUtils.arch", "rpmUtils.transaction", "rpmUtils.miscutils", "rpmUtils.updates"]
|
||||
for mod_name in MOCK_MODULES:
|
||||
sys.modules[mod_name] = Mock()
|
@ -1,120 +0,0 @@
|
||||
# Build a basic Fedora AMI using livemedia-creator
|
||||
lang en_US.UTF-8
|
||||
keyboard us
|
||||
timezone --utc America/New_York
|
||||
auth --useshadow --enablemd5
|
||||
selinux --enforcing
|
||||
firewall --service=ssh
|
||||
bootloader --location=none
|
||||
network --bootproto=dhcp --device=eth0 --onboot=on --activate
|
||||
services --enabled=network,sshd,rsyslog
|
||||
shutdown
|
||||
|
||||
# By default the root password is emptied
|
||||
rootpw --plaintext removethispw
|
||||
|
||||
#
|
||||
# Define how large you want your rootfs to be
|
||||
# NOTE: S3-backed AMIs have a limit of 10G
|
||||
#
|
||||
zerombr
|
||||
clearpart --all
|
||||
part / --size 10000 --fstype ext4 --ondisk sda
|
||||
part biosboot --size=1
|
||||
part swap --size=512
|
||||
|
||||
#
|
||||
# Repositories
|
||||
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/19/x86_64/os/"
|
||||
|
||||
#
|
||||
#
|
||||
# Add all the packages after the base packages
|
||||
#
|
||||
%packages --nobase
|
||||
@core
|
||||
system-config-securitylevel-tui
|
||||
audit
|
||||
pciutils
|
||||
bash
|
||||
coreutils
|
||||
kernel
|
||||
|
||||
e2fsprogs
|
||||
passwd
|
||||
policycoreutils
|
||||
chkconfig
|
||||
rootfiles
|
||||
yum
|
||||
vim-minimal
|
||||
acpid
|
||||
openssh-clients
|
||||
openssh-server
|
||||
curl
|
||||
sudo
|
||||
|
||||
#Allow for dhcp access
|
||||
dhclient
|
||||
iputils
|
||||
|
||||
-firstboot
|
||||
-biosdevname
|
||||
|
||||
# package to setup cloudy bits for us
|
||||
cloud-init
|
||||
|
||||
grub
|
||||
dracut-norescue
|
||||
%end
|
||||
|
||||
# more ec2-ify
|
||||
%post --erroronfail
|
||||
|
||||
# create ec2-user
|
||||
/usr/sbin/useradd ec2-user
|
||||
/bin/echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# fstab mounting is different for x86_64 and i386
|
||||
cat <<EOL > /etc/fstab
|
||||
/dev/xvda1 / ext4 defaults 1 1
|
||||
/dev/xvda2 /mnt ext3 defaults 0 0
|
||||
/dev/xvda3 swap swap defaults 0 0
|
||||
EOL
|
||||
|
||||
if [ ! -d /lib64 ] ; then
|
||||
# workaround xen performance issue (bz 651861)
|
||||
echo "hwcap 1 nosegneg" > /etc/ld.so.conf.d/libc6-xen.conf
|
||||
fi
|
||||
|
||||
# Install grub.conf
|
||||
# idle=nomwait is to allow xen images to boot and not try use cpu features that are not supported
|
||||
INITRD=`ls /boot/initramfs-* | head -n1`
|
||||
KERNEL=`ls /boot/vmlinuz-* | head -n1`
|
||||
mkdir /boot/grub
|
||||
pushd /boot/grub
|
||||
cat <<EOL > grub.conf
|
||||
default 0
|
||||
timeout 0
|
||||
|
||||
title Fedora Linux
|
||||
root (hd0)
|
||||
kernel $KERNEL root=/dev/xvda1 idle=halt
|
||||
initrd $INITRD
|
||||
EOL
|
||||
# symlink grub.conf to menu.lst for use by EC2 pv-grub
|
||||
ln -s grub.conf menu.lst
|
||||
popd
|
||||
|
||||
# the firewall rules get saved as .old without this we end up not being able
|
||||
# ssh in as iptables blocks access
|
||||
rename -v .old "" /etc/sysconfig/*old
|
||||
|
||||
# setup systemd to boot to the right runlevel
|
||||
rm /etc/systemd/system/default.target
|
||||
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
|
||||
|
||||
# remove the root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
%end
|
||||
|
107
docs/fedora-minimized.ks
Normal file
107
docs/fedora-minimized.ks
Normal file
@ -0,0 +1,107 @@
|
||||
# Minimal Disk Image -- Example of image-minimizer usage in %post
|
||||
#
|
||||
sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled
|
||||
# Use network installation
|
||||
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/20/x86_64/os/"
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
# Installation logging level
|
||||
logging --level=info
|
||||
# Shutdown after installation
|
||||
shutdown
|
||||
# System timezone
|
||||
timezone US/Eastern
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
# Disk partitioning information
|
||||
part / --fstype="ext4" --size=4000
|
||||
part swap --size=1000
|
||||
|
||||
%post
|
||||
# Remove root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
%packages
|
||||
@core
|
||||
kernel
|
||||
memtest86+
|
||||
grub2-efi
|
||||
grub2
|
||||
shim
|
||||
syslinux
|
||||
-dracut-config-rescue
|
||||
%end
|
||||
|
||||
#
|
||||
# Use the image-minimizer to remove some packages and dirs
|
||||
#
|
||||
%post --interpreter=image-minimizer --nochroot
|
||||
|
||||
|
||||
# Kernel modules minimization
|
||||
# Drop many filesystems
|
||||
drop /lib/modules/*/kernel/fs
|
||||
keep /lib/modules/*/kernel/fs/ext*
|
||||
keep /lib/modules/*/kernel/fs/mbcache*
|
||||
keep /lib/modules/*/kernel/fs/squashfs
|
||||
keep /lib/modules/*/kernel/fs/jbd*
|
||||
keep /lib/modules/*/kernel/fs/btrfs
|
||||
keep /lib/modules/*/kernel/fs/cifs*
|
||||
keep /lib/modules/*/kernel/fs/fat
|
||||
keep /lib/modules/*/kernel/fs/nfs
|
||||
keep /lib/modules/*/kernel/fs/nfs_common
|
||||
keep /lib/modules/*/kernel/fs/fscache
|
||||
keep /lib/modules/*/kernel/fs/lockd
|
||||
keep /lib/modules/*/kernel/fs/nls/nls_utf8.ko
|
||||
keep /lib/modules/*/kernel/fs/configfs/configfs.ko
|
||||
keep /lib/modules/*/kernel/fs/fuse
|
||||
keep /lib/modules/*/kernel/fs/isofs
|
||||
# No sound
|
||||
drop /lib/modules/*/kernel/sound
|
||||
|
||||
|
||||
# Drop some unused rpms, without dropping dependencies
|
||||
droprpm checkpolicy
|
||||
droprpm dmraid-events
|
||||
droprpm gamin
|
||||
droprpm gnupg2
|
||||
droprpm linux-atm-libs
|
||||
droprpm make
|
||||
droprpm mtools
|
||||
droprpm mysql-libs
|
||||
droprpm perl
|
||||
droprpm perl-Module-Pluggable
|
||||
droprpm perl-Net-Telnet
|
||||
droprpm perl-PathTools
|
||||
droprpm perl-Pod-Escapes
|
||||
droprpm perl-Pod-Simple
|
||||
droprpm perl-Scalar-List-Utils
|
||||
droprpm perl-hivex
|
||||
droprpm perl-macros
|
||||
droprpm sgpio
|
||||
droprpm syslinux
|
||||
droprpm system-config-firewall-base
|
||||
droprpm usermode
|
||||
|
||||
%end
|
28
docs/index.rst
Normal file
28
docs/index.rst
Normal file
@ -0,0 +1,28 @@
|
||||
.. Lorax documentation master file, created by
|
||||
sphinx-quickstart on Wed Apr 8 13:46:00 2015.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to Lorax's documentation!
|
||||
=================================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
intro
|
||||
lorax
|
||||
livemedia-creator
|
||||
lorax-composer
|
||||
product-images
|
||||
modules
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
67
docs/intro.rst
Normal file
67
docs/intro.rst
Normal file
@ -0,0 +1,67 @@
|
||||
Introduction to Lorax
|
||||
=====================
|
||||
|
||||
I am the Lorax. I speak for the trees [and images].
|
||||
|
||||
Lorax is used to build the Anaconda Installer boot.iso, it consists of a
|
||||
library, pylorax, a set of templates, and the lorax script. Its operation
|
||||
is driven by a customized set of Mako templates that lists the packages
|
||||
to be installed, steps to execute to remove unneeded files, and creation
|
||||
of the iso for all of the supported architectures.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Before Lorax
|
||||
============
|
||||
|
||||
Tree building tools such as pungi and revisor rely on 'buildinstall' in
|
||||
anaconda/scripts/ to produce the boot images and other such control files
|
||||
in the final tree. The existing buildinstall scripts written in a mix of
|
||||
bash and Python are unmaintainable. Lorax is an attempt to replace them
|
||||
with something more flexible.
|
||||
|
||||
|
||||
EXISTING WORKFLOW:
|
||||
|
||||
pungi and other tools call scripts/buildinstall, which in turn call other
|
||||
scripts to do the image building and data generation. Here's how it
|
||||
currently looks:
|
||||
|
||||
-> buildinstall
|
||||
* process command line options
|
||||
* write temporary yum.conf to point to correct repo
|
||||
* find anaconda release RPM
|
||||
* unpack RPM, pull in those versions of upd-instroot, mk-images,
|
||||
maketreeinfo.py, makestamp.py, and buildinstall
|
||||
|
||||
-> call upd-instroot
|
||||
|
||||
-> call maketreeinfo.py
|
||||
|
||||
-> call mk-images (which figures out which mk-images.ARCH to call)
|
||||
|
||||
-> call makestamp.py
|
||||
|
||||
* clean up
|
||||
|
||||
|
||||
PROBLEMS:
|
||||
|
||||
The existing workflow presents some problems with maintaining the scripts.
|
||||
First, almost all knowledge of what goes in to the stage 1 and stage 2
|
||||
images lives in upd-instroot. The mk-images* scripts copy things from the
|
||||
root created by upd-instroot in order to build the stage 1 image, though
|
||||
it's not completely clear from reading the scripts.
|
||||
|
||||
|
||||
NEW IDEAS:
|
||||
|
||||
Create a new central driver with all information living in Python modules.
|
||||
Configuration files will provide the knowledge previously contained in the
|
||||
upd-instroot and mk-images* scripts.
|
||||
|
||||
|
||||
|
391
docs/livemedia-creator.rst
Normal file
391
docs/livemedia-creator.rst
Normal file
@ -0,0 +1,391 @@
|
||||
livemedia-creator
|
||||
=================
|
||||
|
||||
:Authors:
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
|
||||
livemedia-creator uses `Anaconda <https://github.com/rhinstaller/anaconda>`_,
|
||||
`kickstart <https://github.com/rhinstaller/pykickstart>`_ and `Lorax
|
||||
<https://github.com/rhinstaller/lorax>`_ to create bootable media that use the
|
||||
same install path as a normal system installation. It can be used to make live
|
||||
isos, bootable (partitioned) disk images, tarfiles, and filesystem images for
|
||||
use with virtualization and container solutions like libvirt, docker, and
|
||||
OpenStack.
|
||||
|
||||
The general idea is to use virt-install with kickstart and an Anaconda boot.iso to
|
||||
install into a disk image and then use the disk image to create the bootable
|
||||
media.
|
||||
|
||||
livemedia-creator --help will describe all of the options available. At the
|
||||
minimum you need:
|
||||
|
||||
``--make-iso`` to create a final bootable .iso or one of the other ``--make-*`` options.
|
||||
|
||||
``--iso`` to specify the Anaconda install media to use with virt-install.
|
||||
|
||||
``--ks`` to select the kickstart file describing what to install.
|
||||
|
||||
To use livemedia-creator with virtualization you will need to have virt-install installed.
|
||||
|
||||
If you are going to be using Anaconda directly, with ``--no-virt`` mode, make sure
|
||||
you have the anaconda-tui package installed.
|
||||
|
||||
Conventions used in this document:
|
||||
|
||||
``lmc`` is an abbreviation for livemedia-creator.
|
||||
|
||||
``builder`` is the system where livemedia-creator is being run
|
||||
|
||||
``image`` is the disk image being created by running livemedia-creator
|
||||
|
||||
|
||||
livemedia-creator cmdline arguments
|
||||
-----------------------------------
|
||||
|
||||
See the output from ``livemedia-creator --help`` for the commandline arguments.
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
|
||||
Run this to create a bootable live iso::
|
||||
|
||||
sudo livemedia-creator --make-iso \
|
||||
--iso=/extra/iso/boot.iso --ks=./docs/rhel7-livemedia.ks
|
||||
|
||||
You can run it directly from the lorax git repo like this::
|
||||
|
||||
sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \
|
||||
--make-iso --iso=/extra/iso/boot.iso \
|
||||
--ks=./docs/rhel7-livemedia.ks --lorax-templates=./share/
|
||||
|
||||
You can observe the installation using vnc. The logs will show what port was
|
||||
chosen, or you can use a specific port by passing it. eg. ``--vnc vnc:127.0.0.1:5``
|
||||
|
||||
This is usually a good idea when testing changes to the kickstart. lmc tries
|
||||
to monitor the logs for fatal errors, but may not catch everything.
|
||||
|
||||
|
||||
How ISO creation works
|
||||
----------------------
|
||||
|
||||
There are 2 stages, the install stage which produces a disk or filesystem image
|
||||
as its output, and the boot media creation which uses the image as its input.
|
||||
Normally you would run both stages, but it is possible to stop after the
|
||||
install stage, by using ``--image-only``, or to skip the install stage and use
|
||||
a previously created disk image by passing ``--disk-image`` or ``--fs-image``
|
||||
|
||||
When creating an iso virt-install boots using the passed Anaconda installer iso
|
||||
and installs the system based on the kickstart. The ``%post`` section of the
|
||||
kickstart is used to customize the installed system in the same way that
|
||||
current spin-kickstarts do.
|
||||
|
||||
livemedia-creator monitors the install process for problems by watching the
|
||||
install logs. They are written to the current directory or to the base
|
||||
directory specified by the --logfile command. You can also monitor the install
|
||||
by using a vnc client. This is recommended when first modifying a kickstart,
|
||||
since there are still places where Anaconda may get stuck without the log
|
||||
monitor catching it.
|
||||
|
||||
The output from this process is a partitioned disk image. kpartx can be used
|
||||
to mount and examine it when there is a problem with the install. It can also
|
||||
be booted using kvm.
|
||||
|
||||
When creating an iso the disk image's / partition is copied into a formatted
|
||||
filesystem image which is then used as the input to lorax for creation of the
|
||||
final media.
|
||||
|
||||
The final image is created by lorax, using the templates in /usr/share/lorax/live/
|
||||
or the live directory below the directory specified by ``--lorax-templates``. The
|
||||
templates are written using the Mako template system with some extra commands
|
||||
added by lorax.
|
||||
|
||||
|
||||
Kickstarts
|
||||
----------
|
||||
|
||||
The docs/ directory includes several example kickstarts, one to create a live
|
||||
desktop iso using GNOME, and another to create a minimal disk image. When
|
||||
creating your own kickstarts you should start with the minimal example, it
|
||||
includes several needed packages that are not always included by dependencies.
|
||||
|
||||
Or you can use existing spin kickstarts to create live media with a few
|
||||
changes. Here are the steps I used to convert the Fedora XFCE spin.
|
||||
|
||||
1. Flatten the xfce kickstart using ksflatten
|
||||
2. Add zerombr so you don't get the disk init dialog
|
||||
3. Add clearpart --all
|
||||
4. Add swap partition
|
||||
5. bootloader target
|
||||
6. Add shutdown to the kickstart
|
||||
7. Add network --bootproto=dhcp --activate to activate the network
|
||||
This works for F16 builds but for F15 and before you need to pass
|
||||
something on the cmdline that activate the network, like sshd:
|
||||
|
||||
``livemedia-creator --kernel-args="sshd"``
|
||||
|
||||
8. Add a root password::
|
||||
|
||||
rootpw rootme
|
||||
network --bootproto=dhcp --activate
|
||||
zerombr
|
||||
clearpart --all
|
||||
bootloader --location=mbr
|
||||
part swap --size=512
|
||||
shutdown
|
||||
|
||||
9. In the livesys script section of the %post remove the root password. This
|
||||
really depends on how the spin wants to work. You could add the live user
|
||||
that you create to the %wheel group so that sudo works if you wanted to.
|
||||
|
||||
``passwd -d root > /dev/null``
|
||||
|
||||
10. Remove /etc/fstab in %post, dracut handles mounting the rootfs
|
||||
|
||||
``cat /dev/null > /dev/fstab``
|
||||
|
||||
Do this only for live iso's, the filesystem will be mounted read only if
|
||||
there is no /etc/fstab
|
||||
|
||||
11. Don't delete initramfs files from /boot in %post
|
||||
12. When creating live iso's you need to have, at least, these packages in the %package section::
|
||||
dracut-config-generic
|
||||
dracut-live
|
||||
-dracut-config-rescue
|
||||
grub-efi
|
||||
memtest86+
|
||||
syslinux
|
||||
|
||||
One drawback to using virt-install is that it pulls the packages from the repo
|
||||
each time you run it. To speed things up you either need a local mirror of the
|
||||
packages, or you can use a caching proxy. When using a proxy you pass it to
|
||||
livemedia-creator like this:
|
||||
|
||||
``--proxy=http://proxy.yourdomain.com:3128``
|
||||
|
||||
You also need to use a specific mirror instead of mirrormanager so that the
|
||||
packages will get cached, so your kickstart url would look like:
|
||||
|
||||
``url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"``
|
||||
|
||||
You can also add an update repo, but don't name it updates. Add --proxy to it
|
||||
as well.
|
||||
|
||||
|
||||
Anaconda image install (no-virt)
|
||||
--------------------------------
|
||||
|
||||
You can create images without using virt-install by passing ``--no-virt`` on
|
||||
the cmdline. This will use Anaconda's directory install feature to handle the
|
||||
install. There are a couple of things to keep in mind when doing this:
|
||||
|
||||
1. It will be most reliable when building images for the same release that the
|
||||
host is running. Because Anaconda has expectations about the system it is
|
||||
running under you may encounter strange bugs if you try to build newer or
|
||||
older releases.
|
||||
|
||||
2. Make sure selinux is set to permissive or disabled. It won't install
|
||||
correctly with selinux set to enforcing yet.
|
||||
|
||||
3. It may totally trash your host. So far I haven't had this happen, but the
|
||||
possibility exists that a bug in Anaconda could result in it operating on
|
||||
real devices. I recommend running it in a virt or on a system that you can
|
||||
afford to lose all data from.
|
||||
|
||||
The logs from anaconda will be placed in an ./anaconda/ directory in either
|
||||
the current directory or in the directory used for --logfile
|
||||
|
||||
Example cmdline:
|
||||
|
||||
``sudo livemedia-creator --make-iso --no-virt --ks=./rhel7-livemedia.ks``
|
||||
|
||||
.. note::
|
||||
Using no-virt to create a partitioned disk image (eg. --make-disk or
|
||||
--make-vagrant) will only create disks usable on the host platform (BIOS
|
||||
or UEFI). You can create BIOS partitioned disk images on UEFI by using
|
||||
virt.
|
||||
|
||||
|
||||
AMI Images
|
||||
----------
|
||||
|
||||
Amazon EC2 images can be created by using the --make-ami switch and an appropriate
|
||||
kickstart file. All of the work to customize the image is handled by the kickstart.
|
||||
The example currently included was modified from the cloud-kickstarts version so
|
||||
that it would work with livemedia-creator.
|
||||
|
||||
Example cmdline:
|
||||
|
||||
``sudo livemedia-creator --make-ami --iso=/path/to/boot.iso --ks=./docs/rhel7-livemedia-ec2.ks``
|
||||
|
||||
This will produce an ami-root.img file in the working directory.
|
||||
|
||||
At this time I have not tested the image with EC2. Feedback would be welcome.
|
||||
|
||||
|
||||
Appliance Creation
|
||||
------------------
|
||||
|
||||
livemedia-creator can now replace appliance-tools by using the --make-appliance
|
||||
switch. This will create the partitioned disk image and an XML file that can be
|
||||
used with virt-image to setup a virtual system.
|
||||
|
||||
The XML is generated using the Mako template from
|
||||
/usr/share/lorax/appliance/libvirt.xml You can use a different template by
|
||||
passing ``--app-template <template path>``
|
||||
|
||||
Documentation on the Mako template system can be found at the `Mako site
|
||||
<http://docs.makotemplates.org/en/latest/index.html>`_
|
||||
|
||||
The name of the final output XML is appliance.xml, this can be changed with
|
||||
``--app-file <file path>``
|
||||
|
||||
The following variables are passed to the template:
|
||||
|
||||
``disks``
|
||||
A list of disk_info about each disk.
|
||||
Each entry has the following attributes:
|
||||
|
||||
``name``
|
||||
base name of the disk image file
|
||||
|
||||
``format``
|
||||
"raw"
|
||||
|
||||
``checksum_type``
|
||||
"sha256"
|
||||
|
||||
``checksum``
|
||||
sha256 checksum of the disk image
|
||||
|
||||
``name``
|
||||
Name of appliance, from --app-name argument
|
||||
|
||||
``arch``
|
||||
Architecture
|
||||
|
||||
``memory``
|
||||
Memory in KB (from ``--ram``)
|
||||
|
||||
``vcpus``
|
||||
from ``--vcpus``
|
||||
|
||||
``networks``
|
||||
list of networks from the kickstart or []
|
||||
|
||||
``title``
|
||||
from ``--title``
|
||||
|
||||
``project``
|
||||
from ``--project``
|
||||
|
||||
``releasever``
|
||||
from ``--releasever``
|
||||
|
||||
The created image can be imported into libvirt using:
|
||||
|
||||
``virt-image appliance.xml``
|
||||
|
||||
You can also create qcow2 appliance images using ``--image-type=qcow2``, for example::
|
||||
|
||||
sudo livemedia-creator --make-appliance --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks \
|
||||
--image-type=qcow2 --app-file=minimal-test.xml --image-name=minimal-test.img
|
||||
|
||||
|
||||
Filesystem Image Creation
|
||||
-------------------------
|
||||
|
||||
livemedia-creator can be used to create un-partitined filesystem images using
|
||||
the ``--make-fsimage`` option. As of version 21.8 this works with both virt and
|
||||
no-virt modes of operation. Previously it was only available with no-virt.
|
||||
|
||||
Kickstarts should have a single / partition with no extra mountpoints.
|
||||
|
||||
``livemedia-creator --make-fsimage --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks``
|
||||
|
||||
You can name the output image with ``--image-name`` and set a label on the filesystem with ``--fs-label``
|
||||
|
||||
|
||||
TAR File Creation
|
||||
-----------------
|
||||
|
||||
The ``--make-tar`` command can be used to create a tar of the root filesystem. By
|
||||
default it is compressed using xz, but this can be changed using the
|
||||
``--compression`` and ``--compress-arg`` options. This option works with both virt and
|
||||
no-virt install methods.
|
||||
|
||||
As with ``--make-fsimage`` the kickstart should be limited to a single / partition.
|
||||
|
||||
For example::
|
||||
|
||||
livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks \
|
||||
--image-name=rhel7-root.tar.xz
|
||||
|
||||
|
||||
Live Image for PXE Boot
|
||||
-----------------------
|
||||
|
||||
The ``--make-pxe-live`` command will produce squashfs image containing live root
|
||||
filesystem that can be used for pxe boot. Directory with results will contain
|
||||
the live image, kernel image, initrd image and template of pxe configuration
|
||||
for the images.
|
||||
|
||||
|
||||
Atomic Live Image for PXE Boot
|
||||
------------------------------
|
||||
|
||||
The ``--make-ostree-live`` command will produce the same result as ``--make-pxe-live``
|
||||
for installations of Atomic Host. Example kickstart for such an installation
|
||||
using Atomic installer iso with local repo included in the image can be found
|
||||
in docs/rhel-atomic-pxe-live.ks.
|
||||
|
||||
The PXE images can also be created with ``--no-virt`` by using the example
|
||||
kickstart in docs/rhel-atomic-pxe-live-novirt.ks. This also works inside the
|
||||
mock environment.
|
||||
|
||||
|
||||
Debugging problems
|
||||
------------------
|
||||
|
||||
Sometimes an installation will get stuck. When using virt-install the logs will
|
||||
be written to ./virt-install.log and most of the time any problems that happen
|
||||
will be near the end of the file. lmc tries to detect common errors and will
|
||||
cancel the installation when they happen. But not everything can be caught.
|
||||
When creating a new kickstart it is helpful to use vnc so that you can monitor
|
||||
the installation as it happens, and if it gets stuck without lmc detecting the
|
||||
problem you can switch to tty1 and examine the system directly.
|
||||
|
||||
If it does get stuck the best way to cancel is to use kill -9 on the virt-install pid,
|
||||
lmc will detect that the process died and cleanup.
|
||||
|
||||
If lmc didn't handle the cleanup for some reason you can do this:
|
||||
1. ``sudo umount /tmp/lmc-XXXX`` to unmount the iso from its mountpoint.
|
||||
2. ``sudo rm -rf /tmp/lmc-XXXX``
|
||||
3. ``sudo rm /var/tmp/lmc-disk-XXXXX`` to remove the disk image.
|
||||
|
||||
Note that lmc uses the lmc- prefix for all of its temporary files and
|
||||
directories to make it easier to find and clean up leftovers.
|
||||
|
||||
The logs from the virt-install run are stored in virt-install.log, logs from
|
||||
livemedia-creator are in livemedia.log and program.log
|
||||
|
||||
You can add ``--image-only`` to skip the .iso creation and examine the resulting
|
||||
disk image. Or you can pass ``--keep-image`` to keep it around after the iso has
|
||||
been created.
|
||||
|
||||
Cleaning up aborted ``--no-virt`` installs can sometimes be accomplished by
|
||||
running the ``anaconda-cleanup`` script. As of Fedora 18 anaconda is
|
||||
multi-threaded and it can sometimes become stuck and refuse to exit. When this
|
||||
happens you can usually clean up by first killing the anaconda process then
|
||||
running ``anaconda-cleanup``.
|
||||
|
||||
|
||||
Hacking
|
||||
-------
|
||||
|
||||
Development on this will take place as part of the lorax project, and on the
|
||||
anaconda-devel-list mailing list, and `on github <https://github.com/rhinstaller/lorax>`_
|
||||
|
||||
Feedback, enhancements and bugs are welcome. You can use `bugzilla
|
||||
<https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=lorax>`_ to
|
||||
report bugs against the lorax component.
|
||||
|
156
docs/lorax-composer.rst
Normal file
156
docs/lorax-composer.rst
Normal file
@ -0,0 +1,156 @@
|
||||
lorax-composer
|
||||
==============
|
||||
|
||||
:Authors:
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
|
||||
lorax-composer is an API server that is compatible with the Weldr project's
|
||||
bdcs-api REST protocol. More information on Weldr can be found `on the Weldr
|
||||
blog <http://www.weldr.io>`_.
|
||||
|
||||
The server runs as root, and communication with it is via a unix domain socket
|
||||
(``/run/weldr/api.socket`` by default). The directory and socket are owned by
|
||||
root:weldr so that any user in the weldr group can use the API to control
|
||||
lorax-composer.
|
||||
|
||||
When starting the server it will check for the correct permissions and
|
||||
ownership of a pre-existing directory, or it will create a new one if it
|
||||
doesn't exist. The socket path and group owner's name can be changed from the
|
||||
cmdline by passing it the ``--socket`` and ``--group`` arguments.
|
||||
|
||||
As of version 19.7.7 it will drop root privileges for the API thread. The queue
|
||||
and compose thread still runs as root because it needs to be able to
|
||||
mount/umount files and run Anaconda.
|
||||
|
||||
Logs
|
||||
----
|
||||
|
||||
Logs are stored under ``/var/log/lorax-composer/`` and include all console
|
||||
messages as well as extra debugging info and API requests.
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
|
||||
1. Create a ``weldr`` user and group by running ``useradd weldr``
|
||||
2. Remove any pre-existing socket directory with ``rm -rf /run/weldr/``
|
||||
A new directory with correct permissions will be created the first time the server runs.
|
||||
3. Either start it via systemd with ``systemctl start lorax-composer`` or
|
||||
run it directly with ``lorax-composer /path/to/blueprints/``
|
||||
|
||||
The ``/path/to/blueprints/`` is where the blueprint's git repo will be created, and
|
||||
all the blueprints created with the ``/api/v0/blueprints/new`` route will be stored.
|
||||
If there are blueprint ``.toml`` files in the top level of the directory they will
|
||||
be imported into the blueprint git storage.
|
||||
|
||||
Composing Images
|
||||
----------------
|
||||
|
||||
As of version 19.7.7 lorax-composer can create ``tar`` output images. You can use curl to start
|
||||
a compose like this::
|
||||
|
||||
curl --unix-socket /run/weldr/api.socket -X POST -H "Content-Type: application/json" -d '{"blueprint_name": "http-server", "compose_type": "tar", "branch": "master"}' http:///api/v0/compose
|
||||
|
||||
And then monitor it by passing the returned build UUID to ``/compose/status/<uuid>``.
|
||||
|
||||
Version 19.7.10 adds support for ``live-iso`` and ``partitioned-disk``
|
||||
|
||||
Adding Output Types
|
||||
-------------------
|
||||
|
||||
livemedia-creator supports a large number of output types, and only some of
|
||||
these are currently available via lorax-composer. To add a new output type to
|
||||
lorax-composer a kickstart file needs to be added to ``./share/composer/``. The
|
||||
name of the kickstart is what will be used by the ``/compose/types`` route, and the
|
||||
``compose_type`` field of the POST to start a compose. It also needs to have
|
||||
code added to the :py:func:`pylorax.api.compose.compose_args` function. The
|
||||
``_MAP`` entry in this function defines what lorax-composer will pass to
|
||||
:py:func:`pylorax.installer.novirt_install` when it runs the compose. When the
|
||||
compose is finished the output files need to be copied out of the build
|
||||
directory (``/var/lib/lorax/composer/results/<UUID>/compose/``),
|
||||
:py:func:`pylorax.api.compose.move_compose_results` handles this for each type.
|
||||
You should move them instead of copying to save space.
|
||||
|
||||
If the new output type does not have support in livemedia-creator it should be
|
||||
added there first. This will make the output available to the widest number of
|
||||
users.
|
||||
|
||||
Example: Add partitioned disk support
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Partitioned disk support is something that livemedia-creator already supports
|
||||
via the ``--make-disk`` cmdline argument. To add this to lorax-composer it
|
||||
needs 3 things:
|
||||
|
||||
* A ``partitioned-disk.ks`` file in ``./share/composer/``
|
||||
* A new entry in the _MAP in :py:func:`pylorax.api.compose.compose_args`
|
||||
* Add a bit of code to :py:func:`pylorax.api.compose.move_compose_results` to move the disk image from
|
||||
the compose directory to the results directory.
|
||||
|
||||
The ``partitioned-disk.ks`` is pretty similar to the example minimal kickstart
|
||||
in ``./docs/rhel7-minimal.ks``. You should remove the ``url`` and ``repo``
|
||||
commands, they will be added by the compose process. Make sure the bootloader
|
||||
packages are included in the ``%packages`` section at the end of the kickstart,
|
||||
and you will want to leave off the ``%end`` so that the compose can append the
|
||||
list of packages from the blueprint.
|
||||
|
||||
The new ``_MAP`` entry should be a copy of one of the existing entries, but with ``make_disk`` set
|
||||
to ``True``. Make sure that none of the other ``make_*`` options are ``True``. The ``image_name`` is
|
||||
what the name of the final image will be.
|
||||
|
||||
``move_compose_results()`` can be as simple as moving the output file into
|
||||
the results directory, or it could do some post-processing on it. The end of
|
||||
the function should always clean up the ``./compose/`` directory, removing any
|
||||
unneeded extra files. This is especially true for the ``live-iso`` since it produces
|
||||
the contents of the iso as well as the boot.iso itself.
|
||||
|
||||
Package Sources
|
||||
---------------
|
||||
|
||||
By default lorax-composer uses the host's configured repositories. It copies
|
||||
the ``*.repo`` files from ``/etc/yum.repos.d/`` into
|
||||
``/var/lib/lorax/composer/repos.d/`` at startup, these are immutable system
|
||||
repositories and cannot be deleted or changed. If you want to add additional
|
||||
repos you can put them into ``/var/lib/lorax/composer/repos.d/`` or use the
|
||||
``/api/v0/projects/source/*`` API routes to create them.
|
||||
|
||||
The new source can be added by doing a POST to the ``/api/v0/projects/source/new``
|
||||
route using JSON (with `Content-Type` header set to `application/json`) or TOML
|
||||
(with it set to `text/x-toml`). The format of the source looks like this (in
|
||||
TOML)::
|
||||
|
||||
name = "custom-source-1"
|
||||
url = "https://url/path/to/repository/"
|
||||
type = "yum-baseurl"
|
||||
proxy = "https://proxy-url/"
|
||||
check_ssl = true
|
||||
check_gpg = true
|
||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
||||
|
||||
The ``proxy`` and ``gpgkey_urls`` entries are optional. All of the others are required. The supported
|
||||
types for the urls are:
|
||||
|
||||
* ``yum-baseurl`` is a URL to a yum repository.
|
||||
* ``yum-mirrorlist`` is a URL for a mirrorlist.
|
||||
* ``yum-metalink`` is a URL for a metalink.
|
||||
|
||||
If ``check_ssl`` is true the https certificates must be valid. If they are self-signed you can either set
|
||||
this to false, or add your Certificate Authority to the host system.
|
||||
|
||||
If ``check_gpg`` is true the GPG key must either be installed on the host system, or ``gpgkey_urls``
|
||||
should point to it.
|
||||
|
||||
You can edit an existing source (other than system sources), by doing a POST to the ``new`` route
|
||||
with the new version of the source. It will overwrite the previous one.
|
||||
|
||||
A list of existing sources is available from ``/api/v0/projects/source/list``, and detailed info
|
||||
on a source can be retrieved with the ``/api/v0/projects/source/info/<source-name>`` route. By default
|
||||
it returns JSON but it can also return TOML if ``?format=toml`` is added to the request.
|
||||
|
||||
Non-system sources can be deleted by doing a ``DELETE`` request to the
|
||||
``/api/v0/projects/source/delete/<source-name>`` route.
|
||||
|
||||
The documentation for the source API routes can be `found here <pylorax.api.html#api-v0-projects-source-list>`_
|
||||
|
||||
The configured sources are used for all blueprint depsolve operations, and for composing images.
|
||||
When adding additional sources you must make sure that the packages in the source do not
|
||||
conflict with any other package sources, otherwise depsolving will fail.
|
148
docs/lorax.rst
Normal file
148
docs/lorax.rst
Normal file
@ -0,0 +1,148 @@
|
||||
Lorax
|
||||
=====
|
||||
|
||||
:Authors:
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
|
||||
"I am the Lorax. I speak for the trees [and images]."
|
||||
|
||||
The `lorax <https://github.com/rhinstaller/lorax>`_ tool is used to create the
|
||||
`Anaconda <https://github.com/rhinstaller/anaconda>`_ installer boot.iso as
|
||||
well as the basic release tree, and .treeinfo metadata file. Its dependencies
|
||||
are fairly light-weight because it needs to be able to run in a mock chroot
|
||||
environment. It is best to run lorax from the same release as is being targeted
|
||||
because the templates may have release specific logic in them. eg. Use the
|
||||
rawhide version to build the boot.iso for rawhide, along with the rawhide
|
||||
repositories.
|
||||
|
||||
|
||||
lorax cmdline arguments
|
||||
-----------------------
|
||||
|
||||
See the output from ``lorax --help`` for the commandline arguments.
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
|
||||
Run this as root to create a boot.iso in ``./results/``::
|
||||
|
||||
yum install lorax
|
||||
setenforce 0
|
||||
lorax -p RHEL -v 7 -r 7 \
|
||||
-s http://mirror.centos.org/centos-7/7/os/x86_64/ \
|
||||
-s http://mirror.centos.org/centos-7/7/updates/x86_64/ \
|
||||
./results/
|
||||
setenforce 1
|
||||
|
||||
You can add your own repos with ``-s`` and packages with higher NVRs will
|
||||
override the ones in the distribution repositories.
|
||||
|
||||
Under ``./results/`` will be the release tree files: .discinfo, .treeinfo, everything that
|
||||
goes onto the boot.iso, the pxeboot directory, and the boot.iso under ``./images/``.
|
||||
|
||||
|
||||
Running inside of mock
|
||||
----------------------
|
||||
|
||||
If you are using lorax with mock v1.3.4 or later you will need to pass
|
||||
``--old-chroot`` to mock. Mock now defaults to using systemd-nspawn which cannot
|
||||
create the needed loop device nodes. Passing ``--old-chroot`` will use the old
|
||||
system where ``/dev/loop*`` is setup for you.
|
||||
|
||||
|
||||
How it works
|
||||
------------
|
||||
|
||||
Lorax uses `yum <https://github.com/rpm-software-management/yum>`_ to install
|
||||
packages into a temporary directory, sets up configuration files, it then
|
||||
removes unneeded files to save space, and creates a squashfs filesystem of the
|
||||
files. The iso is then built using a generic initramfs and the kernel from the
|
||||
selected repositories.
|
||||
|
||||
To drive these processes Lorax uses a custom template system, based on `Mako
|
||||
templates <http://www.makotemplates.org/>`_ with the addition of custom
|
||||
commands (documented in :class:`pylorax.ltmpl.LoraxTemplateRunner`). Mako
|
||||
supports ``%if/%endif`` blocks as well as free-form python code inside ``<%
|
||||
%>`` tags and variable substitution with ``${}``. The default templates are
|
||||
shipped with lorax in ``/usr/share/lorax/`` and use the
|
||||
``.tmpl`` extension.
|
||||
|
||||
|
||||
runtime-install.tmpl
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``runtime-install.tmpl`` template lists packages to be installed using the
|
||||
``installpkg`` command. This template is fairly simple, installing common packages and
|
||||
architecture specific packages. It must end with the ``run_pkg_transaction``
|
||||
command which tells dnf to download and install the packages.
|
||||
|
||||
|
||||
runtime-postinstall.tmpl
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``runtime-postinstall.tmpl`` template is where the system configuration
|
||||
happens. The installer environment is similar to a normal running system, but
|
||||
needs some special handling. Configuration files are setup, systemd is told to
|
||||
start the anaconda.target instead of a default system target, and a number of
|
||||
unneeded services are disabled, some of which can interfere with the
|
||||
installation. A number of template commands are used here:
|
||||
|
||||
* :func:`append <pylorax.ltmpl.LoraxTemplateRunner.append>` to add text to a file.
|
||||
* :func:`chmod <pylorax.ltmpl.LoraxTemplateRunner.chmod>` changes the file's mode.
|
||||
* :func:`gconfset <pylorax.ltmpl.LoraxTemplateRunner.gconfset>` runs gconfset.
|
||||
* :func:`install <pylorax.ltmpl.LoraxTemplateRunner.install>` to install a file into the installroot.
|
||||
* :func:`mkdir <pylorax.ltmpl.LoraxTemplateRunner.mkdir>` makes a new directory.
|
||||
* :func:`move <pylorax.ltmpl.LoraxTemplateRunner.move>` to move a file into the installroot
|
||||
* :func:`replace <pylorax.ltmpl.LoraxTemplateRunner.replace>` does text substitution in a file
|
||||
* :func:`remove <pylorax.ltmpl.LoraxTemplateRunner.remove>` deletes a file
|
||||
* :func:`runcmd <pylorax.ltmpl.LoraxTemplateRunner.runcmd>` run arbitrary commands.
|
||||
* :func:`symlink <pylorax.ltmpl.LoraxTemplateRunner.symlink>` creates a symlink
|
||||
* :func:`systemctl <pylorax.ltmpl.LoraxTemplateRunner.systemctl>` runs systemctl in the installroot
|
||||
|
||||
|
||||
runtime-cleanup.tmpl
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``runtime-cleanup.tmpl`` template is used to remove files that aren't strictly needed
|
||||
by the installation environment. In addition to the ``remove`` template command it uses:
|
||||
|
||||
* :func:`removepkg <pylorax.ltmpl.LoraxTemplateRunner.removepkg>`
|
||||
remove all of a specific package's contents. A package may be pulled in as a dependency, but
|
||||
not really used. eg. sound support.
|
||||
* :func:`removefrom <pylorax.ltmpl.LoraxTemplateRunner.removefrom>`
|
||||
Removes some files from a package. A file glob can be used, or the --allbut option to
|
||||
remove everything except a select few.
|
||||
* :func:`removekmod <pylorax.ltmpl.LoraxTemplateRunner.removekmod>`
|
||||
Removes kernel modules
|
||||
|
||||
|
||||
The squashfs filesystem
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
After ``runtime-*.tmpl`` templates have finished their work lorax creates an
|
||||
empty ext4 filesystem, copies the remaining files to it, and makes a squashfs
|
||||
filesystem of it. This file is the / of the boot.iso's installer environment
|
||||
and is what is in the LiveOS/squashfs.img file on the iso.
|
||||
|
||||
|
||||
iso creation
|
||||
~~~~~~~~~~~~
|
||||
|
||||
The iso creation is handled by another set of templates. The one used depends
|
||||
on the architecture that the iso is being created for. They are also stored in
|
||||
``/usr/share/lorax/`` and are named after the arch, like
|
||||
``x86.tmpl`` and ``aarch64.tmpl``. They handle creation of the tree, copying
|
||||
configuration template files, configuration variable substitution, treeinfo
|
||||
metadata (via the :func:`treeinfo <pylorax.ltmpl.LoraxTemplateRunner.treeinfo>`
|
||||
template command). Kernel and initrd are copied from the installroot to their
|
||||
final locations and then mkisofs is run to create the boot.iso
|
||||
|
||||
|
||||
Custom Templates
|
||||
----------------
|
||||
|
||||
The default set of templates and configuration files are shipped in the
|
||||
``/usr/share/lorax/`` directory. You can make a copy of them and place them
|
||||
into another directory and then select the new template directory by passing
|
||||
``--sharedir`` to lorax.
|
||||
|
@ -1,13 +1,17 @@
|
||||
.TH LIVEMEDIA-CREATOR 1 2013\-07\-26
|
||||
.TH LIVEMEDIA-CREATOR 1 2018\-08\-14
|
||||
.SH NAME
|
||||
livemedia-creator \- Create live install media
|
||||
|
||||
.SH SYNOPSIS
|
||||
livemedia-creator [-h]
|
||||
(--make-iso | --make-disk | --make-fsimage | --make-appliance | --make-ami)
|
||||
(--make-iso | --make-disk | --make-fsimage | --make-appliance | --make-ami | --make-tar | --make-pxe-live | --make-ostree-live)
|
||||
[--iso ISO] [--disk-image DISK_IMAGE]
|
||||
[--fs-image FS_IMAGE] [--ks KS]
|
||||
[--image-name IMAGE_NAME] [--image-only]
|
||||
[--fs-label FS_LABEL]
|
||||
[--compression] [--compress-arg]
|
||||
[--live-rootfs-size LIVE_ROOTFS_SIZE]
|
||||
[--live-rootfs-keep-size LIVE_ROOTFS_KEEP_SIZE]
|
||||
[--keep-image] [--no-virt] [--proxy PROXY]
|
||||
[--anaconda-arg ANACONDA_ARGS]
|
||||
[--armplatform ARMPLATFORM] [--location LOCATION]
|
||||
@ -20,6 +24,7 @@ livemedia-creator [-h]
|
||||
[--dracut-arg DRACUT_ARGS] [--title TITLE]
|
||||
[--project PROJECT] [--releasever RELEASEVER]
|
||||
[--volid VOLID] [--squashfs_args SQUASHFS_ARGS]
|
||||
[--virt-uefi] [--ovmf-path OVMF_PATH]
|
||||
|
||||
.SH DESCRIPTION
|
||||
livemedia-creator uses Anaconda, kickstart and Lorax to create bootable media
|
||||
@ -63,6 +68,18 @@ Build an appliance image and XML description
|
||||
\fB\-\-make\-ami\fR
|
||||
Build an ami image
|
||||
|
||||
.TP
|
||||
\fB\-\-make\-tar\fR
|
||||
Build a tar of the root filesystem. Defaults to root.tar.xz
|
||||
|
||||
.TP
|
||||
\fB\-\-make\-pxe\-live\fR
|
||||
Build a live pxe boot squashfs image
|
||||
|
||||
.TP
|
||||
\fB\-\-make\-ostree\-live\fR
|
||||
Build a live pxe boot squashfs image of Atomic Host
|
||||
|
||||
.TP
|
||||
\fB\-\-iso ISO\fR
|
||||
Anaconda installation .iso path to use for virt-install
|
||||
@ -73,7 +90,24 @@ Path to disk image to use for creating final image
|
||||
|
||||
.TP
|
||||
\fB\-\-fs\-image FS_IMAGE\fR
|
||||
Path to filesystem image to use for creating final image
|
||||
Path to existing filesystem image to use for creating final image.
|
||||
|
||||
.TP
|
||||
\fB\-\-qcow2\fR
|
||||
Create qcow2 image instead of raw sparse image when making disk images.
|
||||
|
||||
.TP
|
||||
\fB\-\-qcow2\-arg\fR
|
||||
Arguments to pass to qemu-img. Pass once for each argument
|
||||
>>>>>>> d04a99e... livemedia-creator: Add support for making tarfiles
|
||||
|
||||
.TP
|
||||
\fB\-\-compression\fR
|
||||
Compression binary for make-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default.
|
||||
|
||||
.TP
|
||||
\fB\-\-compress\-arg\fR
|
||||
Arguments to pass to compression. Pass once for each argument
|
||||
|
||||
.TP
|
||||
\fB\-\-ks KS\fR
|
||||
@ -160,6 +194,15 @@ Path to template to use for appliance data.
|
||||
\fB\-\-app\-file APP_FILE\fR
|
||||
Appliance template results file.
|
||||
|
||||
.SH PXE\-LIVE ARGUMENTS:
|
||||
.TP
|
||||
\fB\-\-live\-rootfs\-size\fR
|
||||
Size of root filesystem of live image in GiB. By default approximate size of space used in root filesystem is used.
|
||||
|
||||
.TP
|
||||
\fB\-\-live\-rootfs\-keep\-size\fR
|
||||
Keep the size of original root filesystem (rounded down to GiB) in live image
|
||||
|
||||
.SH VIRT\-INSTALL ARGUMENTS:
|
||||
.TP
|
||||
\fB\-\-ram MEMORY\fR
|
||||
@ -181,10 +224,20 @@ Passed to --arch command
|
||||
\fB\-\-kernel\-args KERNEL_ARGS\fR
|
||||
Additional argument to pass to the installation kernel
|
||||
|
||||
.TP
|
||||
\fB\-\-virt\-uefi\fR
|
||||
Boot the virtual machine in UEFI mode. Requires OVMF_CODE.fd and OVMF_VARS.fd
|
||||
|
||||
.TP
|
||||
\fB\-\-ovmf\-path\fR
|
||||
Path to OVMF_CODE.fd and OVMF_VARS.fd. Defaults to /usr/share/OVMF/, the UEFI
|
||||
firmware files need to be installed manually, they are not shipped with RHEL.
|
||||
|
||||
.SH DRACUT ARGUMENTS:
|
||||
.TP
|
||||
\fB\-\-dracut\-arg DRACUT_ARGS\fR
|
||||
Argument to pass to dracut when rebuilding the initramfs. Pass this once foreach argument. NOTE: this overrides the default.
|
||||
\fB\-\-dracut-arg='ARG'\fR
|
||||
Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument, single quoting
|
||||
the arguments like this: '--xz' NOTE: this overrides the default, so all dracut arguments must be included.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Documentation in /usr/share/docs/lorax/README.livemedia-creator
|
@ -1,9 +1,9 @@
|
||||
.TH LORAX 1 2013\-07\-26
|
||||
.TH LORAX 1 2018\-08\-14
|
||||
.SH NAME
|
||||
lorax \- Create installer boot iso
|
||||
|
||||
.SH SYNOPSIS
|
||||
lorax -p PRODUCT -v VERSION -r RELEASE -s REPOSITORY OUTPUTDIR
|
||||
lorax -p PRODUCT -v VERSION -r RELEASE [-s REPOSITORY|--repo CONFIG] OUTPUTDIR
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
@ -37,6 +37,10 @@ release information
|
||||
\fB\-s REPOSITORY, \-\-source=REPOSITORY\fR
|
||||
source repository (may be listed multiple times)
|
||||
|
||||
.TP
|
||||
\fB\--repo CONFIG\fR
|
||||
repository configuration file (may be listed multiple times)
|
||||
|
||||
.SH
|
||||
OPTIONAL ARGUMENTS:
|
||||
|
||||
@ -89,6 +93,16 @@ Path to logfile
|
||||
\fB\-\-tmp=TMP\fR
|
||||
Top level temporary directory
|
||||
|
||||
.TP
|
||||
\fB\-\-noverifyssl\fR
|
||||
This disables SSL certificate checking. eg. to allow using https: sources with self-signed certificates.
|
||||
|
||||
.SH DRACUT ARGUMENTS:
|
||||
.TP
|
||||
\fB\-\-dracut-arg='ARG'\fR
|
||||
Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument, single quoting
|
||||
the arguments like this: '--xz' NOTE: this overrides the default, so all dracut arguments must be included.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Martin Gracik
|
27
docs/product-images.rst
Normal file
27
docs/product-images.rst
Normal file
@ -0,0 +1,27 @@
|
||||
Product and Updates Images
|
||||
==========================
|
||||
|
||||
Lorax now supports creation of product.img and updates.img as part of the build
|
||||
process. This is implemented using the installimg template command which will
|
||||
take the contents of a directory and create a compressed archive from it. The
|
||||
directory must be created by one of the packages installed by
|
||||
runtime-install.tmpl or by passing ``--installpkgs <pkgname>`` to lorax at
|
||||
runtime. The x86, ppc, ppc64le and aarch64 templates all look for
|
||||
/usr/share/lorax/product/ and /usr/share/lorax/updates/ directories in the
|
||||
install chroot while creating the final install tree. If there are files in
|
||||
those directories lorax will create images/product.img and/or
|
||||
images/updates.img
|
||||
|
||||
These archives are just like an anaconda updates image -- their contents are
|
||||
copied over the top of the filesystem at boot time so that you can drop in
|
||||
files to add to or replace anything on the filesystem.
|
||||
|
||||
Anaconda has several places that it looks for updates, the one for product.img
|
||||
is in /run/install/product. So for example, to add an installclass to Anaconda
|
||||
you would put your custom class here:
|
||||
|
||||
``/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py``
|
||||
|
||||
If the packages containing the product/updates files are not included as part
|
||||
of normal dependencies you can add specific packages with the ``--installpkgs``
|
||||
command or the installpkgs paramater of :class:`pylorax.treebuilder.RuntimeBuilder`
|
26
docs/rhel-atomic-pxe-live.ks
Normal file
26
docs/rhel-atomic-pxe-live.ks
Normal file
@ -0,0 +1,26 @@
|
||||
# Settings for unattended installation:
|
||||
lang en_US.UTF-8
|
||||
keyboard us
|
||||
timezone America/New_York
|
||||
zerombr
|
||||
clearpart --all --initlabel
|
||||
rootpw --plaintext atomic
|
||||
network --bootproto=dhcp --device=link --activate
|
||||
|
||||
# We are only able to install atomic with separate /boot partition currently
|
||||
part / --fstype="ext4" --size=6000
|
||||
part /boot --size=500 --fstype="ext4"
|
||||
|
||||
shutdown
|
||||
|
||||
# Using ostree repo included in installation iso. Respective ostreesetup command is included here.
|
||||
# The included kickstart file with the command is created during installation iso compose.
|
||||
%include /usr/share/anaconda/interactive-defaults.ks
|
||||
|
||||
services --disabled=cloud-init,cloud-init-local,cloud-final,cloud-config,docker-storage-setup
|
||||
|
||||
# We copy content of separate /boot partition to root part when building live squashfs image,
|
||||
# and we don't want systemd to try to mount it when pxe booting
|
||||
%post
|
||||
cat /dev/null > /etc/fstab
|
||||
%end
|
@ -3,18 +3,19 @@ sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled --service=mdns
|
||||
# Use network installation
|
||||
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/19/x86_64/os/"
|
||||
url --url=http://repo/rhel7.4/Server/os
|
||||
repo --name=optional --baseurl=http://repo/rhel7.4/Server/optional/os
|
||||
|
||||
# X Window System configuration information
|
||||
xconfig --startxonboot
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --device=eth0 --onboot=on --activate
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard us
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
@ -34,8 +35,9 @@ zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
# Disk partitioning information
|
||||
reqpart
|
||||
part biosboot --size=1
|
||||
part / --fstype="ext4" --size=4000
|
||||
part / --fstype="ext4" --size=5500
|
||||
part swap --size=1000
|
||||
|
||||
%post
|
||||
@ -307,16 +309,8 @@ rm -f /core*
|
||||
rm -f /.readahead_collect
|
||||
touch /var/lib/readahead/early.sorted
|
||||
|
||||
%end
|
||||
|
||||
%post --nochroot
|
||||
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
|
||||
|
||||
# only works on x86, x86_64
|
||||
if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
|
||||
if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
|
||||
cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS
|
||||
fi
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
%post
|
||||
@ -346,9 +340,6 @@ gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults
|
||||
# Turn off PackageKit-command-not-found while uninstalled
|
||||
sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
|
||||
|
||||
# Use the animated laughlin background by default
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -t str -s /desktop/gnome/background/picture_filename /usr/share/backgrounds/laughlin/default-tod/laughlin.xml
|
||||
|
||||
EOF
|
||||
|
||||
# Remove root password
|
||||
@ -361,30 +352,23 @@ cat /dev/null > /etc/fstab
|
||||
%end
|
||||
|
||||
%packages
|
||||
@admin-tools
|
||||
@standard
|
||||
@base-x
|
||||
# Packages needed by anaconda, but not directly required.
|
||||
# Includes all of the grub2 and shim packages needed, except
|
||||
# for the grub2-efi-*-cdboot package
|
||||
@anaconda-tools --optional
|
||||
@core
|
||||
@dial-up
|
||||
@fonts
|
||||
@x11
|
||||
@gnome-desktop
|
||||
@graphical-internet
|
||||
@hardware-support
|
||||
@input-methods
|
||||
#@office
|
||||
#@printing
|
||||
#@sound-and-video
|
||||
anaconda
|
||||
isomd5sum
|
||||
kernel
|
||||
laughlin-backgrounds-animated-gnome
|
||||
memtest86+
|
||||
nss-mdns
|
||||
-ibus-pinyin-db-open-phrase
|
||||
-smartmontools
|
||||
grub2-efi
|
||||
grub2
|
||||
shim
|
||||
syslinux
|
||||
dracut-norescue
|
||||
-dracut-config-rescue
|
||||
|
||||
# This package is needed to boot the iso on UEFI
|
||||
grub2-efi-*-cdboot
|
||||
grub2-efi-ia32
|
||||
%end
|
64
docs/rhel7-minimal.ks
Normal file
64
docs/rhel7-minimal.ks
Normal file
@ -0,0 +1,64 @@
|
||||
# Minimal Disk Image
|
||||
#
|
||||
sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled
|
||||
# Use network installation
|
||||
url --url=http://repo/rhel7.4/Server/os
|
||||
repo --name=optional --baseurl=http://repo/rhel7.4/Server/optional/os
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
# Installation logging level
|
||||
logging --level=info
|
||||
# Shutdown after installation
|
||||
shutdown
|
||||
# System timezone
|
||||
timezone US/Eastern
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
# Disk partitioning information
|
||||
reqpart
|
||||
part / --fstype="ext4" --size=4000
|
||||
part swap --size=1000
|
||||
|
||||
%post
|
||||
# Remove root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
%packages
|
||||
@core
|
||||
kernel
|
||||
memtest86+
|
||||
efibootmgr
|
||||
grub2-efi
|
||||
grub2
|
||||
shim
|
||||
syslinux
|
||||
-dracut-config-rescue
|
||||
|
||||
# Boot on 32bit UEFI
|
||||
shim-ia32
|
||||
grub2-efi-ia32
|
||||
|
||||
# NOTE: To build a bootable UEFI disk image livemedia-creator needs to be
|
||||
# run on a UEFI system or virt.
|
||||
%end
|
8
epel.repo
Normal file
8
epel.repo
Normal file
@ -0,0 +1,8 @@
|
||||
[epel]
|
||||
name=Extra Packages for Enterprise Linux 7 - $basearch
|
||||
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
|
||||
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
|
||||
failovermethod=priority
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
|
1
etc/composer.conf
Normal file
1
etc/composer.conf
Normal file
@ -0,0 +1 @@
|
||||
# lorax-composer configuration file
|
700
lorax.spec
700
lorax.spec
@ -1,16 +1,21 @@
|
||||
%define debug_package %{nil}
|
||||
|
||||
Name: lorax
|
||||
Version: 19.6
|
||||
Version: 19.7.28
|
||||
Release: 1%{?dist}
|
||||
Summary: Tool for creating the anaconda install images
|
||||
|
||||
Group: Applications/System
|
||||
License: GPLv2+
|
||||
URL: http://git.fedorahosted.org/git/?p=lorax.git
|
||||
Source0: https://fedorahosted.org/releases/l/o/%{name}/%{name}-%{version}.tar.gz
|
||||
URL: https://github.com/weldr/lorax
|
||||
# To generate Source0 do:
|
||||
# git clone https://github.com/weldr/lorax
|
||||
# git checkout -b archive-branch lorax-%%{version}-%%{release}
|
||||
# tito build --tgz
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: python2-devel
|
||||
BuildRequires: python-sphinx yum python-mako pykickstart
|
||||
|
||||
Requires: GConf2
|
||||
Requires: cpio
|
||||
@ -34,6 +39,7 @@ Requires: util-linux
|
||||
Requires: xz
|
||||
Requires: yum
|
||||
Requires: pykickstart
|
||||
Requires: dracut >= 030
|
||||
|
||||
%if 0%{?fedora}
|
||||
# Fedora specific deps
|
||||
@ -41,18 +47,30 @@ Requires: fedup-dracut
|
||||
Requires: fedup-dracut-plymouth
|
||||
%endif
|
||||
|
||||
%if 0%{?el7}
|
||||
# RHEL 7 specific deps
|
||||
Requires: redhat-upgrade-dracut
|
||||
Requires: redhat-upgrade-dracut-plymouth
|
||||
%endif
|
||||
|
||||
%ifarch %{ix86} x86_64
|
||||
Requires: syslinux >= 4.02-5
|
||||
%endif
|
||||
|
||||
%ifarch ppc ppc64
|
||||
%ifarch ppc ppc64 ppc64le
|
||||
Requires: kernel-bootwrapper
|
||||
Requires: grub2
|
||||
Requires: grub2-tools
|
||||
%endif
|
||||
|
||||
%ifarch s390 s390x
|
||||
Requires: openssh
|
||||
%endif
|
||||
|
||||
# Moved image-minimizer tool to lorax
|
||||
Provides: appliance-tools-minimizer = %{version}-%{release}
|
||||
Obsoletes: appliance-tools-minimizer < 007.7-3
|
||||
|
||||
%description
|
||||
Lorax is a tool for creating the anaconda install images.
|
||||
|
||||
@ -64,26 +82,694 @@ Anaconda's image install feature.
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
make docs
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
|
||||
|
||||
# Do Not Package lorax-composer or composer-cli files
|
||||
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/pylorax/api
|
||||
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/composer
|
||||
rm -rf $RPM_BUILD_ROOT/%{_datadir}/lorax/composer
|
||||
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/lorax/composer.conf
|
||||
rm -f $RPM_BUILD_ROOT/%{_sbindir}/lorax-composer
|
||||
rm -f $RPM_BUILD_ROOT/%{_bindir}/composer-cli
|
||||
rm -f $RPM_BUILD_ROOT/%{_unitdir}/lorax-composer.*
|
||||
rm -f $RPM_BUILD_ROOT/%{_tmpfilesdir}/lorax-composer.conf
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING AUTHORS README.livemedia-creator
|
||||
%doc COPYING AUTHORS README.livemedia-creator README.product
|
||||
%doc docs/*ks
|
||||
%doc docs/html
|
||||
%{python_sitelib}/pylorax
|
||||
%exclude %{python_sitelib}/pylorax/api
|
||||
%{python_sitelib}/*.egg-info
|
||||
%{_sbindir}/lorax
|
||||
%{_sbindir}/mkefiboot
|
||||
%{_sbindir}/livemedia-creator
|
||||
%{_bindir}/image-minimizer
|
||||
%{_bindir}/mk-s390-cdboot
|
||||
%dir %{_sysconfdir}/lorax
|
||||
%config(noreplace) %{_sysconfdir}/lorax/lorax.conf
|
||||
%dir %{_datadir}/lorax
|
||||
%{_datadir}/lorax/*
|
||||
%exclude %{_datadir}/lorax/composer
|
||||
%{_mandir}/man1/*.1*
|
||||
%{_tmpfilesdir}/lorax.conf
|
||||
|
||||
%changelog
|
||||
* Thu May 14 2020 Brian C. Lane <bcl@redhat.com> 19.7.28-1
|
||||
- rhel7-livemedia: Increase the rootfilesystem size (bcl)
|
||||
Resolves: rhbz#1829204
|
||||
|
||||
* Mon Apr 20 2020 Brian C. Lane <bcl@redhat.com> 19.7.27-1
|
||||
- Change --make-pxe-live --no-virt to use a fsimage (bcl)
|
||||
Resolves: rhbz#1802591
|
||||
- Makefile: Add the ability to use podman instead of docker (bcl)
|
||||
Related: rhbz#1472622
|
||||
- tests: Add tests for _install_branding with and without variant (bcl)
|
||||
Related: rhbz#1472622
|
||||
- lorax: Move get_yum_base_object into pylorax.yumbase (bcl)
|
||||
Related: rhbz#1472622
|
||||
- lorax: Update how the release package is chosen (bcl)
|
||||
Resolves: rhbz#1472622
|
||||
|
||||
* Mon Dec 16 2019 Brian C. Lane <bcl@redhat.com> 19.7.26-1
|
||||
- Remove unneeded scap-security-guide files (bcl)
|
||||
Related: rhbz#1779659
|
||||
|
||||
* Tue Jun 04 2019 Brian C. Lane <bcl@redhat.com> 19.7.25-1
|
||||
- lorax: Add --rootfs-size (bcl)
|
||||
Resolves: rhbz#1715116
|
||||
- lorax: pass size from Lorax.run to create_runtime (bcl)
|
||||
Related: rhbz#1715116
|
||||
- Fix path to generic.prm (jstodola)
|
||||
Resolves: rhbz#1712491
|
||||
|
||||
* Mon Apr 29 2019 Brian C. Lane <bcl@redhat.com> 19.7.24-1
|
||||
- Update PPC isolabel to allow escaping spaces (bcl)
|
||||
Resolves: rhbz#1402328
|
||||
|
||||
* Thu Apr 04 2019 Brian C. Lane <bcl@redhat.com> 19.7.23-1
|
||||
- lorax: Install redhat-release-eula (bcl)
|
||||
Resolves: rhbz#1696335
|
||||
|
||||
* Tue Mar 26 2019 Brian C. Lane <bcl@redhat.com> 19.7.22-1
|
||||
- Improve logging for template syntax errors (bcl)
|
||||
Related: rhbz#1689314
|
||||
- Add extra boot args to the livemedia-creator iso templates (bcl)
|
||||
Resolves: rhbz#1689314
|
||||
- Use hd:LABEL= for inst.stage2 on ppc (bcl)
|
||||
Resolves: rhbz#1402328
|
||||
- Don't remove chmem and lsmem from install.img (bcl)
|
||||
Resolves: rhbz#1511358
|
||||
|
||||
* Mon Mar 18 2019 Brian C. Lane <bcl@redhat.com> 19.7.21-1
|
||||
- Do not include /usr/bin/delv (bcl)
|
||||
Resolves: rhbz#1688767
|
||||
- Remove SELinux Permissive checks (bcl)
|
||||
Resolves: rhbz#1654795
|
||||
- Remove lorax-composer tests (bcl)
|
||||
Resolves: rhbz#1679798
|
||||
|
||||
* Mon Feb 25 2019 Brian C. Lane <bcl@redhat.com> 19.7.20-1
|
||||
- Add cancel_func to virt and novirt_install functions (bcl)
|
||||
Resolves: rhbz#1659129
|
||||
- lorax: Move default tmp dir to /var/tmp/lorax (bcl)
|
||||
Resolves: rhbz#1668520
|
||||
- New cli test covering basic compose commands (atodorov) (atodorov)
|
||||
- Execute bash tests for composer-cli (atodorov) (atodorov)
|
||||
- Add pylint testing (bcl) (bcl)
|
||||
|
||||
* Wed Aug 15 2018 Brian C. Lane <bcl@redhat.com> 19.7.19-1
|
||||
- Add documentation for --dracut-arg to lorax.1 (bcl)
|
||||
Related: rhbz#1452220
|
||||
- Add the dracut options to the lorax help output (bcl)
|
||||
Related: rhbz#1452220
|
||||
|
||||
* Thu Jun 21 2018 Brian C. Lane <bcl@redhat.com> 19.7.18-1
|
||||
- Add redhat.exec to s390 .treeinfo (bcl)
|
||||
Resolves: rhbz#1593657
|
||||
|
||||
* Tue Jun 19 2018 Brian C. Lane <bcl@redhat.com> 19.7.17-1
|
||||
- Exclude lorax-composer and composer-cli code from the lorax build (bcl)
|
||||
Resolves: rhbz#1547759
|
||||
|
||||
* Fri Jun 15 2018 Brian C. Lane <bcl@redhat.com> 19.7.16-2
|
||||
- Fixup the lorax.spec after rebasing on 19.6.105-1 (bcl)
|
||||
Resolves: rhbz#1547759
|
||||
|
||||
* Fri Jun 15 2018 Brian C. Lane <bcl@redhat.com> 19.7.16-2
|
||||
- Rebase of lorax-composer branch onto 19.6.105-1
|
||||
- See https://github.com/weldr/lorax/tree/lorax-composer for individual commits
|
||||
for 19.7.1-1 thru 19.7.16-1
|
||||
Resolves: rhbz#1547759
|
||||
|
||||
* Mon Jun 11 2018 Brian C. Lane <bcl@redhat.com> 19.6.105-1
|
||||
- Retry losetup if loop_attach fails (bcl)
|
||||
Resolves: rhbz#1589084
|
||||
- Add reqpart to example kickstart files (bcl)
|
||||
Resolves: rhbz#1545289
|
||||
- Increase default ram used with lmc and virt to 2048 (bcl)
|
||||
Resolves: rhbz#1538747
|
||||
- Add --virt-uefi to boot the VM using OVMF (bcl)
|
||||
Resolves: rhbz#1546715
|
||||
Resolves: rhbz#1544805
|
||||
- Add --dracut-arg support to lorax (bcl)
|
||||
Resolves: rhbz#1452220
|
||||
- livemedia-creator: Search for kernel/initrd under /images/pxeboot (bcl)
|
||||
Resolves: rhbz#1522629
|
||||
|
||||
* Wed Jan 24 2018 Brian C. Lane <bcl@redhat.com> 19.6.104-1
|
||||
- Replace fedora-gnome-theme with gnome-themes-standard (bcl)
|
||||
Resolves: rhbz#1537573
|
||||
|
||||
* Thu Jan 11 2018 Brian C. Lane <bcl@redhat.com> 19.6.103-1
|
||||
- Keep hid-multitouch and i2c-hid modules. (rhbz#1526323) (sbueno+anaconda)
|
||||
Resolves: rhbz#1526323
|
||||
|
||||
* Tue Jan 02 2018 Brian C. Lane <bcl@redhat.com> 19.6.102-1
|
||||
- Add grub2-tools to aarch64 (bcl)
|
||||
Resolves: rhbz#1489707
|
||||
|
||||
* Tue Oct 17 2017 Brian C. Lane <bcl@redhat.com> 19.6.101-1
|
||||
- Restore all of the grub2-tools on x86_64 and i386 (bcl)
|
||||
Resolves: rhbz#1489707
|
||||
|
||||
* Mon Oct 09 2017 Brian C. Lane <bcl@redhat.com> 19.6.100-1
|
||||
- Add dependencies for SE/HMC (vponcova)
|
||||
Resolves: rhbz#1498834
|
||||
|
||||
* Fri Sep 29 2017 Brian C. Lane <bcl@redhat.com> 19.6.99-1
|
||||
- s390 doesn't need to graft product.img and updates.img into /images (bcl)
|
||||
Related: rhbz#1478448
|
||||
|
||||
* Wed Sep 27 2017 Brian C. Lane <bcl@redhat.com> 19.6.98-1
|
||||
- Write a list of installed packages to /root/lorax-packages.log (bcl)
|
||||
Resolves: rhbz#1416155
|
||||
- Set the releasever and install gpg keys when using --repo (bcl)
|
||||
Related: rhbz#1430479
|
||||
|
||||
* Fri Aug 18 2017 Brian C. Lane <bcl@redhat.com> 19.6.97-1
|
||||
- Remove -boot-info-table from s390 boot.iso creation (bcl)
|
||||
Related: rhbz#1478448
|
||||
|
||||
* Tue Aug 15 2017 Brian C. Lane <bcl@redhat.com> 19.6.96-1
|
||||
- Install mk-s390-cdboot to /usr/bin/ (bcl)
|
||||
Related: rhbz#1478448
|
||||
|
||||
* Fri Aug 11 2017 Brian C. Lane <bcl@redhat.com> 19.6.95-1
|
||||
- IsoMountpoint: Add ppc64le kernel to search (bcl)
|
||||
Resolves: rhbz#1373358
|
||||
- livemedia-creator: Report correct results dir (bcl)
|
||||
Resolves: rhbz#1374609
|
||||
- Add creation of a bootable s390 iso (bcl)
|
||||
Resolves: rhbz#1478448
|
||||
- Add mk-s360-cdboot utility (bcl)
|
||||
Related: rhbz#1478448
|
||||
- Fix systemctl command (bcl)
|
||||
Resolves: rhbz#1478247
|
||||
- Add the version to the log (bcl)
|
||||
Resolves: rhbz#1335456
|
||||
- Include the dracut fips module in the initrd (bcl)
|
||||
Resolves: rhbz#1341280
|
||||
- Fix loop_wait (bcl)
|
||||
Resolves: rhbz#1462150
|
||||
- Document kickstart restrictions on %%include (bcl)
|
||||
Resolves: rhbz#1418500
|
||||
- Add support for --repo to read yum .repo files directly (bcl)
|
||||
Resolves: rhbz#1430479
|
||||
- Package grub2-efi-ia32 need to be added explicitly to example kickstarts.
|
||||
(mhruscak)
|
||||
Resolves: rhbz#1458937
|
||||
|
||||
* Fri Jun 23 2017 Brian C. Lane <bcl@redhat.com> 19.6.94-1
|
||||
- Fix waiting for loop devices (bcl)
|
||||
Resolves: rhbz#1462150
|
||||
|
||||
* Thu Jun 22 2017 Brian C. Lane <bcl@redhat.com> 19.6.93-1
|
||||
- Make sure loop device is setup (bcl)
|
||||
Resolves: rhbz#1462150
|
||||
|
||||
* Tue Jun 20 2017 Brian C. Lane <bcl@redhat.com> 19.6.92-1
|
||||
- Remove the iso-graft check from the aarch64.tmpl (bcl)
|
||||
Resolves: rhbz#1369014
|
||||
|
||||
* Thu Jun 15 2017 Brian C. Lane <bcl@redhat.com> 19.6.91-1
|
||||
- Update livemedia-creator examples (bcl)
|
||||
Resolves: rhbz#1458937
|
||||
|
||||
* Mon Jun 05 2017 Brian C. Lane <bcl@redhat.com> 19.6.90-1
|
||||
- Fix aarch64 efi.tmpl invocation for live images (bcl)
|
||||
Related: rhbz#1310775
|
||||
|
||||
* Wed May 31 2017 Brian C. Lane <bcl@redhat.com> 19.6.89-1
|
||||
- Remove incorrect variables from rhel7-livemedia.ks example (bcl)
|
||||
Resolves: rhbz#1430547
|
||||
|
||||
* Tue May 30 2017 Brian C. Lane <bcl@redhat.com> 19.6.88-1
|
||||
- Add support for aarch64 live images (bcl)
|
||||
Resolves: rhbz#1369014
|
||||
|
||||
* Thu May 18 2017 Brian C. Lane <bcl@redhat.com> 19.6.87-1
|
||||
- Increase rootfs size for rhel7-livemedia.ks example (bcl)
|
||||
Resolves: rhbz#1451760
|
||||
* Tue Apr 11 2017 Brian C. Lane <bcl@redhat.com> 19.6.86-1
|
||||
- lorax: Remove cairo-sphinx from the image (bcl)
|
||||
Resolves: rhbz#1355681
|
||||
|
||||
* Fri Apr 07 2017 Brian C. Lane <bcl@redhat.com> 19.6.85-1
|
||||
- Fix aarch64 efi.tmpl invocation (pjones)
|
||||
Related: rhbz#1310775
|
||||
|
||||
* Tue Mar 28 2017 Brian C. Lane <bcl@redhat.com> 19.6.84-1
|
||||
- runtime-cleanup.tmpl: don't delete localedef (jlebon)
|
||||
Related: rhbz#1429576
|
||||
|
||||
* Wed Mar 22 2017 Brian C. Lane <bcl@redhat.com> 19.6.83-1
|
||||
- Make 64-bit kernel on 32-bit firmware work for x86 efi machines (pjones)
|
||||
Resolves: rhbz#1310775
|
||||
|
||||
* Fri Mar 17 2017 Brian C. Lane <bcl@redhat.com> 19.6.82-1
|
||||
- Add --noverifyssl to lorax (bcl)
|
||||
Resolves: rhbz#1430483
|
||||
|
||||
* Thu Mar 02 2017 Brian C. Lane <bcl@redhat.com> 19.6.81-1
|
||||
- Keep fsfreeze in install environment (rmarshall)
|
||||
Related: rhbz#1315468
|
||||
- Fix duplicate kernel messages in /tmp/syslog (rvykydal)
|
||||
Resolves: rhbz#1382611
|
||||
|
||||
* Wed Feb 22 2017 Brian C. Lane <bcl@redhat.com> 19.6.80-1
|
||||
- Add dependency for lvmdump -l command (jkonecny)
|
||||
Related: rhbz#1255659
|
||||
|
||||
* Fri Feb 17 2017 Brian C. Lane <bcl@redhat.com> 19.6.79-1
|
||||
- templates: Enusre basic.target.wants dir exists for rngd (walters)
|
||||
Resolves: rhbz#1377430
|
||||
|
||||
* Thu Sep 08 2016 Brian C. Lane <bcl@redhat.com> 19.6.78-1
|
||||
- Don't log dracut initrd regeneration messages into /tmp/syslog (rvykydal)
|
||||
Related: rhbz#1369439
|
||||
- Use imjournal for rsyslogd instead of sharing /dev/log with journal (rvykydal)
|
||||
Resolves: rhbz#1369439
|
||||
|
||||
* Mon Aug 01 2016 Brian C. Lane <bcl@redhat.com> 19.6.77-1
|
||||
- livemedia-creator: Install genericdvd.prm (bcl)
|
||||
Related: rhbz#1269213
|
||||
- livemedia-creator: Use imgutils.copytree for results (bcl)
|
||||
Resolves: rhbz#1362157
|
||||
|
||||
* Thu Jul 28 2016 Brian C. Lane <bcl@redhat.com> 19.6.76-1
|
||||
- livemedia-creator: Fix logging (bcl)
|
||||
Resolves: rhbz#1361031
|
||||
|
||||
* Tue Jul 26 2016 Brian C. Lane <bcl@redhat.com> 19.6.75-1
|
||||
- livemedia-creator: Use hd:LABEL for stage2 iso (bcl)
|
||||
Resolves: rhbz#1355882
|
||||
|
||||
* Mon Jul 18 2016 Brian C. Lane <bcl@redhat.com> 19.6.74-1
|
||||
- Keep fb_sys_fops module needed for ast support (bcl)
|
||||
Resolves: rhbz#1272658
|
||||
|
||||
* Fri Jun 24 2016 Brian C. Lane <bcl@redhat.com> 19.6.73-1
|
||||
- Add back libraries needed by spice-vdagent (dshea)
|
||||
Resolves: rhbz#1347737
|
||||
|
||||
* Wed Jun 22 2016 Brian C. Lane <bcl@redhat.com> 19.6.72-1
|
||||
- Make sure cmdline config file exists (bcl)
|
||||
Resolves: rhbz#1348302
|
||||
- Keep all of the kernel drivers/target/ modules (bcl)
|
||||
Resolves: rhbz#1348381
|
||||
- Keep the pci utilities for use in kickstarts (bcl)
|
||||
Resolves: rhbz#1344926
|
||||
|
||||
* Thu May 05 2016 Brian C. Lane <bcl@redhat.com> 19.6.71-1
|
||||
- Create an empty selinux config file (bcl)
|
||||
Resolves: rhbz#1332147
|
||||
|
||||
* Thu Apr 21 2016 Brian C. Lane <bcl@redhat.com> 19.6.70-1
|
||||
- Use eurlatgr as the console font (bcl)
|
||||
Resolves: rhbz#1265354
|
||||
|
||||
* Fri Apr 15 2016 Brian C. Lane <bcl@redhat.com> 19.6.69-1
|
||||
- Remove Metacity override and theme (bcl)
|
||||
Resolves: rhbz#1324890
|
||||
- Copying same file shouldn't crash (bcl)
|
||||
Resolves: rhbz#1269213
|
||||
|
||||
* Wed Mar 30 2016 Brian C. Lane <bcl@redhat.com> 19.6.68-1
|
||||
- livemedia-creator: Use correct suffix on default image names (bcl)
|
||||
Resolves: rhbz#1318958
|
||||
- Fix livemedia-creator manpage (bcl)
|
||||
Resolves: rhbz#1318952
|
||||
|
||||
* Tue Mar 01 2016 Brian C. Lane <bcl@redhat.com> 19.6.67-1
|
||||
- templates: Reinstate gpgme-pthread.so for ostree (walters)
|
||||
- Resolves: rhbz#1311793
|
||||
- Add rng-tools and start rngd.service by default (bcl)
|
||||
- Resolves: rhbz#1258516
|
||||
- Add (bcl)
|
||||
- Resolves: rhbz#1269891
|
||||
- Include grub2-efi-modules on the boot.iso (bcl)
|
||||
- Resolves: rhbz#1277227
|
||||
- Keep modules needed for ast video driver support (bcl)
|
||||
- Resolves: rhbz#1272658
|
||||
- configure NetworkManager to loglevel=DEBUG (rvykydal)
|
||||
- Resolves: rhbz#1274647
|
||||
- Update docs for product.img (bcl)
|
||||
- Resolves: rhbz#1272361
|
||||
- paste is needed by os-prober (bcl)
|
||||
- Resolves: rhbz#1275105
|
||||
- Keep libthread so that gdb will work correctly (bcl)
|
||||
- Resolves: rhbz#1269055
|
||||
- Add --installpkgs argument (walters)
|
||||
- Resolves: rhbz#1272222
|
||||
- livemedia-creator: Clean up resultdir handling (bcl)
|
||||
- Resolves: rhbz#1290552
|
||||
- https is a sane package source URL scheme (walters)
|
||||
- Resolves: rhbz#1292680
|
||||
- Add product.img support for s390 templates (dan)
|
||||
- Resolves: rhbz#1272359
|
||||
|
||||
* Wed Sep 02 2015 Brian C. Lane <bcl@redhat.com> 19.6.66-1
|
||||
- livemedia-creator: Remove random-seed from images (bcl)
|
||||
Resolves: rhbz#1258986
|
||||
|
||||
* Tue Sep 01 2015 Brian C. Lane <bcl@redhat.com> 19.6.65-1
|
||||
- Don't include early microcode in initramfs (bcl)
|
||||
- Resolves: rhbz#1258498
|
||||
|
||||
* Mon Aug 31 2015 Brian C. Lane <bcl@redhat.com> 19.6.64-1
|
||||
- Fix metacity theme path (bcl)
|
||||
Related: rhbz#1231856
|
||||
- Run spice-vdagentd without systemd-logind integration (dshea)
|
||||
Related: rhbz#1169991
|
||||
|
||||
* Thu Aug 27 2015 Brian C. Lane <bcl@redhat.com> 19.6.63-1
|
||||
- Replace the metacity theme file. (dshea)
|
||||
Related: rhbz#1231856
|
||||
|
||||
* Sun Aug 16 2015 Brian C. Lane <bcl@redhat.com> 19.6.62-1
|
||||
- Change default releasever to 7 (bcl)
|
||||
- Resolves: rhbz#1253242
|
||||
|
||||
* Wed Aug 12 2015 Brian C. Lane <bcl@redhat.com> 19.6.61-1
|
||||
- Add lldptool (rvykydal)
|
||||
Related: rhbz#1085325
|
||||
|
||||
* Wed Aug 05 2015 Brian C. Lane <bcl@redhat.com> 19.6.60-1
|
||||
- Fix tito tagger to bump version, not release (bcl)
|
||||
Related: rhbz#1085013
|
||||
|
||||
* Wed Aug 05 2015 Brian C. Lane <bcl@redhat.com> 19.6.59-2
|
||||
- Fix chronyd not working in the installation (jkonecny)
|
||||
Related: rhbz#1085013
|
||||
|
||||
* Tue Jul 14 2015 Brian C. Lane <bcl@redhat.com> 19.6.59-1
|
||||
- Add installimg command for use in the templates (bcl@redhat.com)
|
||||
Related: rhbz#1202278
|
||||
|
||||
* Tue Jun 30 2015 Brian C. Lane <bcl@redhat.com> 19.6.58-1
|
||||
- Keep hyperv_fb driver in the image (bcl@redhat.com)
|
||||
Resolves: rhbz#834791
|
||||
|
||||
* Fri Jun 26 2015 Brian C. Lane <bcl@redhat.com> 19.6.57-1
|
||||
- livemedia-creator: fix base repo log monitor (#1196721) (bcl@redhat.com)
|
||||
Related: rhbz#1196721
|
||||
- network: turn slaves autoconnection on (rvykydal@redhat.com)
|
||||
Resolves: rhbz#1172751
|
||||
Resolves: rhbz#1134090
|
||||
|
||||
* Thu Jun 25 2015 Brian C. Lane <bcl@redhat.com> 19.6.56-1
|
||||
- Add ability for external templates to graft content into boot.iso (walters@verbum.org)
|
||||
Resolves: rhbz#1202278
|
||||
- Update templates to use installimg for product and updates (bcl@redhat.com)
|
||||
Related: rhbz#1202278
|
||||
|
||||
* Mon Jun 22 2015 Brian C. Lane <bcl@redhat.com> 19.6.55-1
|
||||
- Add ntp configuration file to installation (jkonecny@redhat.com)
|
||||
Related: rhbz#1085013
|
||||
- livemedia-creator: Add option to create qcow2 disk images (bcl@redhat.com)
|
||||
Resolves: rhbz#1210413
|
||||
- Add support for creating qcow2 images (bcl@redhat.com)
|
||||
Related: rhbz#1210413
|
||||
- Install the oscap-anaconda-addon (vpodzime@redhat.com)
|
||||
Resolves: rhbz#1190685
|
||||
|
||||
* Mon Jun 15 2015 Brian C. Lane <bcl@redhat.com> 19.6.54-1
|
||||
- Add removekmod template command (bcl@redhat.com)
|
||||
Resolves: rhbz#1230356
|
||||
- Disable systemd-tmpfiles-clean (bcl@redhat.com)
|
||||
Resolves: rhbz#1202545
|
||||
- Add bridge-utils (bcl@redhat.com)
|
||||
Resolves: rhbz#1188812
|
||||
|
||||
* Fri Jun 05 2015 Brian C. Lane <bcl@redhat.com> 19.6.53-1
|
||||
- Keep the zram kernel module (bcl@redhat.com)
|
||||
- Keep seq and getconf utilities in the image (vpodzime@redhat.com)
|
||||
- Don't remove usr/lib/rpm/platform/ (#1116450) (bcl@redhat.com)
|
||||
- Include /sbin/ldconfig from glibc. (dlehman@redhat.com)
|
||||
|
||||
* Fri Apr 17 2015 Brian C. Lane <bcl@redhat.com> 19.6.52-1
|
||||
- Backport --make-ostree-live (rvykydal)
|
||||
Resolves: rhbz#1184021
|
||||
|
||||
* Fri Jan 16 2015 Brian C. Lane <bcl@redhat.com> 19.6.51-1
|
||||
- Remove imggraft from aarch64.tmpl (bcl@redhat.com)
|
||||
Related: rhbz#1174475
|
||||
|
||||
* Wed Jan 14 2015 Brian C. Lane <bcl@redhat.com> 19.6.50-1
|
||||
- Use gcdaa64.efi and make boot.iso on aarch64 (pjones@redhat.com)
|
||||
Resolves: rhbz#1174475
|
||||
|
||||
* Wed Jan 07 2015 Brian C. Lane <bcl@redhat.com> 19.6.49-1
|
||||
- runtime-cleanup.tmpl: keep virtio-rng (#1179000) (lersek@redhat.com)
|
||||
Resolves: rhbz#1179000
|
||||
|
||||
* Fri Dec 19 2014 Brian C. Lane <bcl@redhat.com> 19.6.48-1
|
||||
- aarch64 no longer needs explicit console setting (#1170413) (bcl@redhat.com)
|
||||
Resolves: rhbz#1170413
|
||||
|
||||
* Tue Dec 02 2014 Brian C. Lane <bcl@redhat.com> 19.6.47-1
|
||||
- Drop 32 bit for loop from ppc64 grub2 config (#1169878) (bcl@redhat.com)
|
||||
Resolves: rhbz#1169878
|
||||
|
||||
* Thu Nov 20 2014 Brian C. Lane <bcl@redhat.com> 19.6.46-1
|
||||
- Add --add-template{,-var} (walters@verbum.org)
|
||||
Resolves: rhbz#1157777
|
||||
|
||||
* Fri Oct 31 2014 Brian C. Lane <bcl@redhat.com> 19.6.45-1
|
||||
- Don't include the stock lvm.conf. (dlehman@redhat.com)
|
||||
|
||||
* Wed Oct 22 2014 Brian C. Lane <bcl@redhat.com> 19.6.44-1
|
||||
- move image-minimizer to lorax (bcl@redhat.com)
|
||||
Resolves: rhbz#1082642
|
||||
|
||||
* Thu Oct 16 2014 Brian C. Lane <bcl@redhat.com> 19.6.43-1
|
||||
- Use all upper case for shim in live/efi.tmpl (bcl@redhat.com)
|
||||
Related: rhbz#1100048
|
||||
|
||||
* Tue Oct 07 2014 Brian C. Lane <bcl@redhat.com> 19.6.42-1
|
||||
- Revert "Don't remove /usr/share/doc/anaconda." (mkolman@redhat.com)
|
||||
Related: rhbz#1072033
|
||||
- Look for "BOOT${efiarch}.EFI" in mkefiboot as well. (pjones@redhat.com)
|
||||
Related: rhbz#1100048
|
||||
- Libgailutil is required yelp, don't remove it (mkolman@redhat.com)
|
||||
Related: rhbz#1072033
|
||||
|
||||
* Fri Oct 03 2014 Brian C. Lane <bcl@redhat.com> 19.6.41-1
|
||||
- Make sure shim is actually in the package list on aarch64 as well. (pjones@redhat.com)
|
||||
Related: rhbz#1100048
|
||||
|
||||
* Thu Oct 02 2014 Brian C. Lane <bcl@redhat.com> 19.6.40-1
|
||||
- Use shim on aarch64. (pjones@redhat.com)
|
||||
Related: rhbz#1100048
|
||||
- Keep the /etc/lvm/profiles directory in the image (vpodzime@redhat.com)
|
||||
Related: rhbz#869456
|
||||
|
||||
* Tue Sep 30 2014 Brian C. Lane <bcl@redhat.com> 19.6.39-1
|
||||
- Don't remove /usr/share/doc/anaconda. (clumens@redhat.com)
|
||||
Resolves: rhbz#1147518
|
||||
- Stop removing libXt from the installation media. (clumens@redhat.com)
|
||||
Related: rhbz#1147518
|
||||
- network: add support for bridge (#1075195) (rvykydal@redhat.com)
|
||||
Related: rhbz#1075195
|
||||
|
||||
* Tue Sep 23 2014 Brian C. Lane <bcl@redhat.com> 19.6.38-1
|
||||
- livemedia-creator: Make sure ROOT_PATH exists (bcl@redhat.com)
|
||||
Related: rhbz#1144140
|
||||
- livemedia-creator: Use RHEL7 version of kickstart (bcl@redhat.com)
|
||||
Related: rhbz#1144140
|
||||
- RHEL7 doesn't include pigz or pbzip2 (bcl@redhat.com)
|
||||
Related: rhbz#1144140
|
||||
- livemedia-creator: Add --no-recursion to mktar (bcl@redhat.com)
|
||||
Related: rhbz#1144140
|
||||
- livemedia-creator: Add support for making tarfiles (bcl@redhat.com)
|
||||
Resolves: rhbz#1144140
|
||||
- livemedia-creator: Check fsimage kickstart for single partition (bcl@redhat.com)
|
||||
Related: rhbz#1144140
|
||||
- livemedia-creator: Copy fsimage if hardlink fails (bcl@redhat.com)
|
||||
Related: rhbz#1144140
|
||||
- livemedia-creator: Make --make-fsimage work with virt-install (bcl@redhat.com)
|
||||
Related: rhbz#1144140
|
||||
|
||||
* Mon Sep 15 2014 Brian C. Lane <bcl@redhat.com> 19.6.37-1
|
||||
- Let the plymouth dracut module back into the ppc64 upgrade.img (dshea@redhat.com)
|
||||
Resolves: rhbz#1069671
|
||||
|
||||
* Tue Sep 09 2014 Brian C. Lane <bcl@redhat.com> 19.6.36-1
|
||||
- Add more tools for rescue mode (bcl@redhat.com)
|
||||
Resolves: rhbz#1109785
|
||||
- Add kexec anaconda addon (bcl@redhat.com)
|
||||
Resolves: rhbz#1116335
|
||||
|
||||
* Wed Sep 03 2014 Brian C. Lane <bcl@redhat.com> 19.6.35-1
|
||||
- Add ppc64le arch (bcl@redhat.com)
|
||||
Resolves: rhbz#1136490
|
||||
|
||||
* Fri Aug 29 2014 Brian C. Lane <bcl@redhat.com> 19.6.34-1
|
||||
- allow setting additional dracut parameters for DVD s390x installs (dan@danny.cz)
|
||||
Resolves: rhbz#1132050
|
||||
|
||||
* Thu Aug 28 2014 Brian C. Lane <bcl@redhat.com> 19.6.33-1
|
||||
- livemedia-creator: Update ppc64 live to use grub2 (bcl@redhat.com)
|
||||
Related: rhbz#1102318
|
||||
Related: rhbz#1131199
|
||||
|
||||
* Tue Aug 19 2014 Brian C. Lane <bcl@redhat.com> 19.6.32-1
|
||||
- Yaboot to grub2 conversion cleanup. (dwa@redhat.com)
|
||||
Related: rhbz#1131199
|
||||
- GRUB2 as the ISO boot loader for POWER arch (#1131199) (pfsmorigo@br.ibm.com)
|
||||
Resolves: rhbz#1131199
|
||||
- Revert "Require 32bit glibc on ppc64" (bcl@redhat.com)
|
||||
Related: rhbz#1131199
|
||||
|
||||
* Fri Aug 15 2014 Brian C. Lane <bcl@redhat.com> 19.6.31-1
|
||||
- Add efibootmgr to installpkg list for aarch64. (dmarlin@redhat.com)
|
||||
Resolves: rhbz#1130366
|
||||
|
||||
* Tue Aug 12 2014 Brian C. Lane <bcl@redhat.com> 19.6.30-1
|
||||
- livemedia-creator: Cleanup temp yum files (bcl@redhat.com)
|
||||
Resolves: rhbz#1073502
|
||||
- Require 32bit glibc on ppc64 (bcl@redhat.com)
|
||||
Resolves: rhbz#1105054
|
||||
- Add xfsdump and remove extra files from xfsprogs (bcl@redhat.com)
|
||||
Resolves: rhbz#1118654
|
||||
- Add ipmitool and drivers (bcl@redhat.com)
|
||||
Resolves: rhbz#1126009
|
||||
- Update grub2-efi.cfg for aarch64 to more closely match x86 (dmarlin@redhat.com)
|
||||
Resolves: rhbz#1089418
|
||||
|
||||
* Fri Aug 08 2014 Brian C. Lane <bcl@redhat.com> 19.6.29-1
|
||||
- utf-8 encode yum actions before displaying them (#1072362) (bcl@redhat.com)
|
||||
- Use BOOTAA64.efi for AARCH64 bootloader filename (#1080113) (bcl@redhat.com)
|
||||
- Drop devicetree from aarch64 grub2-efi.cfg (#1089418) (bcl@redhat.com)
|
||||
- livemedia-creator: Add ppc64 live creation support (#1102318)
|
||||
(bcl@redhat.com)
|
||||
- runtime-install: Add rpm-ostree (walters@verbum.org)
|
||||
|
||||
* Wed Apr 23 2014 Brian C. Lane <bcl@redhat.com> 19.6.28-1
|
||||
- Install rdma so that dracut will use it along with libmlx4 (bcl)
|
||||
Resolves: rhbz#1089564
|
||||
|
||||
* Thu Apr 03 2014 Brian C. Lane <bcl@redhat.com> 19.6.27-1
|
||||
- Stop removing curl after adding it (#1083205) (bcl@redhat.com)
|
||||
|
||||
* Fri Feb 28 2014 Brian C. Lane <bcl@redhat.com> 19.6.26-1
|
||||
- Use string for releasever not int (bcl@redhat.com)
|
||||
Related: rhbz#1067746
|
||||
- Make lorax's installation of lockdown.efi conditional on its existence. (pjones@redhat.com)
|
||||
Resolves: rhbz#1071380
|
||||
|
||||
* Wed Feb 26 2014 Brian C. Lane <bcl@redhat.com> 19.6.25-1
|
||||
- createrepo is needed by driver disks (bcl@redhat.com)
|
||||
Related: rhbz#1016004
|
||||
|
||||
* Tue Feb 25 2014 Brian C. Lane <bcl@redhat.com> 19.6.24-1
|
||||
- Improve aarch64 UEFI support (dmarlin@redhat.com)
|
||||
Resolves: rhbz#1067671
|
||||
|
||||
* Fri Feb 21 2014 Brian C. Lane <bcl@redhat.com> 19.6.23-1
|
||||
- livemedia-creator: Set the product and release version env variables (bcl@redhat.com)
|
||||
Resolves: rhbz#1067746
|
||||
- Remove unneeded images from the product -logos (bcl@redhat.com)
|
||||
Resolves: rhbz#1068721
|
||||
|
||||
* Tue Feb 18 2014 Brian C. Lane <bcl@redhat.com> 19.6.22-1
|
||||
- fedora- services are named rhel- (#1066118) (bcl@redhat.com)
|
||||
- Remove unneeded packages from runtime-install (#1065557) (bcl@redhat.com)
|
||||
|
||||
* Thu Feb 13 2014 Brian C. Lane <bcl@redhat.com> 19.6.21-1
|
||||
- Check initrd size on ppc64 and warn (#1060691) (bcl@redhat.com)
|
||||
- Remove drivers and modules on ppc64 (#1060691) (bcl@redhat.com)
|
||||
|
||||
* Wed Feb 12 2014 Brian C. Lane <bcl@redhat.com> 19.6.20-1
|
||||
- Include mesa-dri-drivers (#1053940) (bcl@redhat.com)
|
||||
|
||||
* Tue Feb 11 2014 Brian C. Lane <bcl@redhat.com> 19.6.19-1
|
||||
- livemedia-creator: virt-image needs ram in MiB not KiB (#1061773)
|
||||
(bcl@redhat.com)
|
||||
- Include all the example kickstarts (#1019728) (bcl@redhat.com)
|
||||
|
||||
* Wed Feb 05 2014 Brian C. Lane <bcl@redhat.com> 19.6.18-1
|
||||
- Remove floppy and scsi_debug from initrd (#1060691) (bcl@redhat.com)
|
||||
|
||||
* Fri Jan 31 2014 Brian C. Lane <bcl@redhat.com> 19.6.17-1
|
||||
- Don't activate default auto connections after switchroot (#1012511)
|
||||
(rvykydal@redhat.com)
|
||||
Related: rhbz#1012511
|
||||
|
||||
* Fri Jan 24 2014 Brian C. Lane <bcl@redhat.com> 19.6.16-1
|
||||
- Activate anaconda-shell@.service on switch to empty VT (#980062)
|
||||
(wwoods@redhat.com)
|
||||
- flush data to disk after mkfsimage (#1052175) (bcl@redhat.com)
|
||||
|
||||
* Tue Dec 17 2013 Brian C. Lane <bcl@redhat.com> 19.6.15-1
|
||||
- Add initial 64-bit ARM (aarch64) support (#1034432) (dmarlin@redhat.com)
|
||||
|
||||
* Mon Dec 16 2013 Brian C. Lane <bcl@redhat.com> 19.6.14-1
|
||||
- s390 switch to generic condev (#1042765) (bcl@redhat.com)
|
||||
|
||||
* Fri Nov 15 2013 Brian C. Lane <bcl@redhat.com> 19.6.13-1
|
||||
- Add SB lockdown to EFI grub menu (#1030495) (bcl@redhat.com)
|
||||
Resolves: rhbz#1030495
|
||||
|
||||
* Thu Nov 14 2013 Brian C. Lane <bcl@redhat.com> 19.6.12-1
|
||||
- Include partx (#1022899) (bcl@redhat.com)
|
||||
Resolves: rhbz#1022899
|
||||
|
||||
* Thu Nov 14 2013 Brian C. Lane <bcl@redhat.com> 19.6.11-1
|
||||
- Create upgrade.img using redhat-upgrade-dracut (dshea@redhat.com)
|
||||
|
||||
* Mon Nov 11 2013 Vratislav Podzimek <vpodzime@redhat.com> 19.6.10-1
|
||||
- Do not remove libdaemon from the runtime environment (vpodzime)
|
||||
Resolves: rhbz#1028938
|
||||
|
||||
* Thu Nov 07 2013 Brian C. Lane <bcl@redhat.com> 19.6.9-1
|
||||
- Install subscription-manager (#1026304) (bcl@redhat.com)
|
||||
Resolves: rhbz#1026304
|
||||
* Fri Nov 01 2013 Brian C. Lane <bcl@redhat.com> 19.6.8-1
|
||||
- Set UEFI defaults to match BIOS (#1021451,#1021446) (bcl@redhat.com)
|
||||
Resolves: rhbz#1021451
|
||||
Resolves: rhbz#1021446
|
||||
- livemedia-creator: Set default name to Red Hat Enterprise Linux 7 (#1002027)
|
||||
(bcl@redhat.com)
|
||||
Resolves: rhbz#1002027
|
||||
- livemedia-creator: Add minimal disk example kickstart (#1019728)
|
||||
(bcl@redhat.com)
|
||||
Resolves: rhbz#1019728
|
||||
|
||||
* Thu Oct 17 2013 Brian C. Lane <bcl@redhat.com> 19.6.7-1
|
||||
- Keep virtio_console module (#750231) (bcl@redhat.com)
|
||||
|
||||
* Mon Oct 07 2013 Brian C. Lane <bcl@redhat.com> 19.6.6-1
|
||||
- livemedia-creator: Update minimal packages in README (#1003078) (bcl@redhat.com)
|
||||
- macboot defaults to no on rhel7 (#1012529) (bcl@redhat.com)
|
||||
- Add macboot option (#1012529) (bcl@redhat.com)
|
||||
|
||||
* Wed Sep 25 2013 Brian C. Lane <bcl@redhat.com> 19.6.5-1
|
||||
- drop dracut args from config files (#1008054) (bcl@redhat.com)
|
||||
|
||||
* Fri Sep 20 2013 Brian C. Lane <bcl@redhat.com> 19.6.4-1
|
||||
- livemedia-creator: Fix gcdx64.efi path to work for other distros than Fedora
|
||||
(#1003078) (bcl@redhat.com)
|
||||
- livemedia-creator: Update example kickstart for rhel7 (#922064)
|
||||
(bcl@redhat.com)
|
||||
|
||||
* Fri Aug 23 2013 Brian C. Lane <bcl@redhat.com> 19.6.3-1
|
||||
- Keep liblzo2.* (#997976) (dshea@redhat.com)
|
||||
|
||||
* Thu Aug 01 2013 Brian C. Lane <bcl@redhat.com> 19.6.2-1
|
||||
- dracut-nohostonly and dracut-norescue got renamed for dracut >= 030 (#990305)
|
||||
(harald@redhat.com)
|
||||
- Don't remove xkeyboard-config message files (#989757) (dshea@redhat.com)
|
||||
|
||||
* Fri Jul 26 2013 Brian C. Lane <bcl@redhat.com> 19.6.1-1
|
||||
- remove yum-plugin-fastestmirror (#876135) (bcl@redhat.com)
|
||||
|
||||
* Fri Jul 26 2013 Brian C. Lane <bcl@redhat.com> 19.6-1
|
||||
- Add manpage for lorax (bcl@redhat.com)
|
||||
- Add manpage for livemedia-creator (bcl@redhat.com)
|
||||
@ -442,7 +1128,7 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
|
||||
- Allow specifying buildarch on the command line (#771382) (mgracik)
|
||||
- lorax: Don't touch /etc/mtab in cleanup (bcl)
|
||||
- Update TODO and POLICY to reflect the current state of things (wwoods)
|
||||
- consider %ghost files part of the filelists in templates (wwoods)
|
||||
- consider %%ghost files part of the filelists in templates (wwoods)
|
||||
- lorax: Add option to exclude packages (bcl)
|
||||
- dracut needs kbd directories (#769932) (bcl)
|
||||
- better debug, handle relative output paths (bcl)
|
||||
@ -461,7 +1147,7 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
|
||||
- Changes needed for livecd creation (bcl)
|
||||
- dracut has moved to /usr/bin (bcl)
|
||||
|
||||
* Mon Oct 21 2011 Will Woods <wwoods@redhat.com> 17.0-1
|
||||
* Fri Oct 21 2011 Will Woods <wwoods@redhat.com> 17.0-1
|
||||
- Merges the 'treebuilder' branch of lorax
|
||||
- images are split into two parts again (initrd.img, LiveOS/squashfs.img)
|
||||
- base memory use reduced to ~200M (was ~550M in F15, ~320MB in F16)
|
||||
|
3
rel-eng/lorax_tito/__init__.py
Normal file
3
rel-eng/lorax_tito/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
from lorax_tito.tagger import LoraxRHELTagger
|
||||
|
||||
__all__ = ['LoraxRHELTagger']
|
118
rel-eng/lorax_tito/tagger.py
Normal file
118
rel-eng/lorax_tito/tagger.py
Normal file
@ -0,0 +1,118 @@
|
||||
import re
|
||||
from tito.common import run_command
|
||||
from tito.tagger import VersionTagger
|
||||
|
||||
|
||||
class LoraxRHELTagger(VersionTagger):
|
||||
"""
|
||||
Tagger which is based on ReleaseTagger and use Red Hat Enterprise Linux
|
||||
format of Changelog:
|
||||
- description
|
||||
Resolves/Related: rhbz#1111
|
||||
|
||||
Used for:
|
||||
- Red Hat Enterprise Linux
|
||||
|
||||
If you want it put in tito.pros:
|
||||
[buildconfig]
|
||||
tagger = lorax_tito.LoraxRHELTagger
|
||||
"""
|
||||
def _getCommitDetail(self, commit, field):
|
||||
""" Get specific details about the commit using git log format field specifiers.
|
||||
"""
|
||||
command = ['git', 'log', '-1', "--pretty=format:%s" % field, commit]
|
||||
output = run_command(" ".join(command))
|
||||
ret = output.strip('\n').split('\n')
|
||||
|
||||
if len(ret) == 1 and ret[0].find('@') != -1:
|
||||
ret = [ret[0].split('@')[0]]
|
||||
elif len(ret) == 1:
|
||||
ret = [ret[0]]
|
||||
else:
|
||||
ret = [x for x in ret if x != '']
|
||||
|
||||
return ret
|
||||
|
||||
def _generate_default_changelog(self, last_tag):
|
||||
"""
|
||||
Run git-log and will generate changelog, which still can be edited by user
|
||||
in _make_changelog.
|
||||
use format:
|
||||
- description
|
||||
Resolves/Related: rhbz#1111
|
||||
"""
|
||||
patch_command = "git log --pretty=oneline --relative %s..%s -- %s" % (last_tag, "HEAD", ".")
|
||||
output = filter(lambda x: x.find('l10n: ') != 41 and \
|
||||
x.find('Merge commit') != 41 and \
|
||||
x.find('Merge branch') != 41,
|
||||
run_command(patch_command).strip('\n').split('\n'))
|
||||
|
||||
rpm_log = []
|
||||
for line in output:
|
||||
if not line:
|
||||
continue
|
||||
|
||||
rhbz = set()
|
||||
commit = line.split(' ')[0]
|
||||
summary = self._getCommitDetail(commit, "%s")[0]
|
||||
body = self._getCommitDetail(commit, "%b")
|
||||
author = self._getCommitDetail(commit, "%aE")[0]
|
||||
|
||||
# prepend Related/Resolves if subject contains BZ number
|
||||
m = re.search(r"\(#\d+(\,.*)*\)", summary)
|
||||
if m:
|
||||
fullbug = summary[m.start():m.end()]
|
||||
bugstr = summary[m.start()+2:m.end()-1]
|
||||
|
||||
bug = ''
|
||||
for c in bugstr:
|
||||
if c.isdigit():
|
||||
bug += c
|
||||
else:
|
||||
break
|
||||
|
||||
if len(bugstr) > len(bug):
|
||||
tmp = bugstr[len(bug):]
|
||||
|
||||
for c in tmp:
|
||||
if not c.isalpha():
|
||||
tmp = tmp[1:]
|
||||
else:
|
||||
break
|
||||
|
||||
if len(tmp) > 0:
|
||||
author = tmp
|
||||
|
||||
summary = summary.replace(fullbug, "(%s)" % author)
|
||||
rhbz.add("Resolves: rhbz#%s" % bug)
|
||||
|
||||
summary_bug = bug
|
||||
else:
|
||||
summary = summary.strip()
|
||||
summary += " (%s)" % author
|
||||
summary_bug = None
|
||||
|
||||
for bodyline in body:
|
||||
m = re.match(r"^(Resolves|Related|Conflicts):\ +rhbz#\d+.*$", bodyline)
|
||||
if not m:
|
||||
continue
|
||||
|
||||
actionre = re.search("(Resolves|Related|Conflicts)", bodyline)
|
||||
bugre = re.search(r"\d+", bodyline)
|
||||
if actionre and bugre:
|
||||
action = actionre.group()
|
||||
bug = bugre.group()
|
||||
rhbz.add("%s: rhbz#%s" % (action, bug))
|
||||
|
||||
# Remove the summary bug's Resolves action if it is for the same bug
|
||||
if action != 'Resolves':
|
||||
summary_str = "Resolves: rhbz#%s" % summary_bug
|
||||
if summary_bug and bug == summary_bug and summary_str in rhbz:
|
||||
rhbz.remove(summary_str)
|
||||
|
||||
if rhbz:
|
||||
rpm_log.append("%s\n%s" %(summary.strip(),"\n".join(rhbz)))
|
||||
else:
|
||||
rpm_log.append("%s (%s)" % (summary.strip(), author))
|
||||
|
||||
return "\n".join(rpm_log)
|
@ -1 +1 @@
|
||||
19.6-1 /
|
||||
19.7.28-1 ./
|
||||
|
@ -1,5 +1,6 @@
|
||||
[globalconfig]
|
||||
default_builder = tito.builder.Builder
|
||||
default_tagger = tito.tagger.VersionTagger
|
||||
[buildconfig]
|
||||
builder = tito.builder.Builder
|
||||
tagger = lorax_tito.LoraxRHELTagger
|
||||
changelog_do_not_remove_cherrypick = 0
|
||||
changelog_format = %s (%ae)
|
||||
lib_dir = ./rel-eng/
|
||||
|
25
setup.py
25
setup.py
@ -1,13 +1,17 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
from distutils.core import setup
|
||||
from glob import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
# config file
|
||||
data_files = [("/etc/lorax", ["etc/lorax.conf"])]
|
||||
data_files = [("/etc/lorax", ["etc/lorax.conf"]),
|
||||
("/etc/lorax", ["etc/composer.conf"]),
|
||||
("/usr/lib/systemd/system", ["systemd/lorax-composer.service",
|
||||
"systemd/lorax-composer.socket"]),
|
||||
("/usr/lib/tmpfiles.d/", ["systemd/lorax-composer.conf",
|
||||
"systemd/lorax.conf"])]
|
||||
|
||||
# shared files
|
||||
for root, dnames, fnames in os.walk("share"):
|
||||
@ -17,7 +21,10 @@ for root, dnames, fnames in os.walk("share"):
|
||||
|
||||
# executable
|
||||
data_files.append(("/usr/sbin", ["src/sbin/lorax", "src/sbin/mkefiboot",
|
||||
"src/sbin/livemedia-creator"]))
|
||||
"src/sbin/livemedia-creator", "src/sbin/lorax-composer"]))
|
||||
data_files.append(("/usr/bin", ["src/bin/image-minimizer",
|
||||
"src/bin/mk-s390-cdboot",
|
||||
"src/bin/composer-cli"]))
|
||||
|
||||
# get the version
|
||||
sys.path.insert(0, "src")
|
||||
@ -34,13 +41,13 @@ finally:
|
||||
setup(name="lorax",
|
||||
version=vernum,
|
||||
description="Lorax",
|
||||
long_description="",
|
||||
author="Martin Gracik",
|
||||
author_email="mgracik@redhat.com",
|
||||
url="http://",
|
||||
download_url="http://",
|
||||
long_description="Tools for creating bootable images, including the Anaconda boot.iso",
|
||||
author="Brian C. Lane, Will Woods, Martin Gracik",
|
||||
author_email="bcl@redhat.com",
|
||||
url="https://rhinstaller.github.io/lorax/",
|
||||
download_url="https://github.com/rhinstaller/lorax/releases",
|
||||
license="GPLv2+",
|
||||
packages=["pylorax"],
|
||||
packages=["pylorax", "pylorax.api", "composer", "composer.cli"],
|
||||
package_dir={"" : "src"},
|
||||
data_files=data_files
|
||||
)
|
||||
|
63
share/aarch64.tmpl
Normal file
63
share/aarch64.tmpl
Normal file
@ -0,0 +1,63 @@
|
||||
<%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/>
|
||||
<%
|
||||
configdir="tmp/config_files/aarch64"
|
||||
PXEBOOTDIR="images/pxeboot"
|
||||
KERNELDIR=PXEBOOTDIR
|
||||
LIVEDIR="LiveOS"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
%>
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
install ${runtime_img} ${LIVEDIR}/squashfs.img
|
||||
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
||||
|
||||
## install kernels
|
||||
mkdir ${KERNELDIR}
|
||||
%for kernel in kernels:
|
||||
## normal aarch64
|
||||
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
|
||||
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
||||
%if doupgrade:
|
||||
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
#FIXME: this will need adjusted when we have a real bootloader.
|
||||
## WHeeeeeeee, EFI.
|
||||
## We could remove the basearch restriction someday..
|
||||
<% efiargs=""; efigraft="" %>
|
||||
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
|
||||
<%
|
||||
efiarch = 'AA64'
|
||||
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
|
||||
images = ["images/efiboot.img"]
|
||||
for img in images:
|
||||
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
|
||||
efigraft += " {0}={1}/{0}".format(img,outroot)
|
||||
%>
|
||||
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=None, efiarch64=efiarch, isolabel=isolabel"/>
|
||||
|
||||
# Create optional product.img and updates.img
|
||||
<% imggraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
# Inherit iso-graft/ if it exists from external templates
|
||||
<%
|
||||
import os
|
||||
if os.path.exists(workdir + "/iso-graft"):
|
||||
imggraft += " " + workdir + "/iso-graft"
|
||||
%>
|
||||
|
||||
## make boot.iso
|
||||
runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||||
${efiargs} -R -J -V '${isolabel}' -T -graft-points \
|
||||
${KERNELDIR}=${outroot}/${KERNELDIR} \
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR} \
|
||||
${efigraft} ${imggraft}
|
||||
treeinfo images-${basearch} boot.iso images/boot.iso
|
||||
%endif
|
@ -112,5 +112,12 @@ mkdir ${KERNELDIR}
|
||||
treeinfo ${basearch} platforms ${platforms}
|
||||
|
||||
|
||||
# Inherit iso-graft/ if it exists from external templates
|
||||
<%
|
||||
import os
|
||||
if os.path.exists(workdir + "/iso-graft"):
|
||||
imggraft += " " + workdir + "/iso-graft"
|
||||
%>
|
||||
|
||||
## FIXME: ARM may need some extra boot config
|
||||
|
||||
|
46
share/composer/ext4-filesystem.ks
Normal file
46
share/composer/ext4-filesystem.ks
Normal file
@ -0,0 +1,46 @@
|
||||
# Lorax Composer filesystem output kickstart template
|
||||
|
||||
#
|
||||
sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
# Installation logging level
|
||||
logging --level=info
|
||||
# Shutdown after installation
|
||||
shutdown
|
||||
# System timezone
|
||||
timezone US/Eastern
|
||||
# System bootloader configuration
|
||||
bootloader --location=none
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
# Disk partitioning information
|
||||
part / --fstype="ext4" --size=4000
|
||||
part swap --size=1000
|
||||
|
||||
%post
|
||||
# Remove root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
%packages --nobase
|
||||
|
||||
# NOTE lorax-composer will add the recipe packages below here, including the final %end
|
368
share/composer/live-iso.ks
Normal file
368
share/composer/live-iso.ks
Normal file
@ -0,0 +1,368 @@
|
||||
# Lorax Composer Live ISO output kickstart template
|
||||
|
||||
#
|
||||
sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled --service=mdns
|
||||
|
||||
# X Window System configuration information
|
||||
xconfig --startxonboot
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
# Installation logging level
|
||||
logging --level=info
|
||||
# Shutdown after installation
|
||||
shutdown
|
||||
# System services
|
||||
services --disabled="network,sshd" --enabled="NetworkManager"
|
||||
# System timezone
|
||||
timezone US/Eastern
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
# Disk partitioning information
|
||||
|
||||
%post
|
||||
# FIXME: it'd be better to get this installed from a package
|
||||
cat > /etc/rc.d/init.d/livesys << EOF
|
||||
#!/bin/bash
|
||||
#
|
||||
# live: Init script for live image
|
||||
#
|
||||
# chkconfig: 345 00 99
|
||||
# description: Init script for live image.
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -e /.liveimg-configured ] ; then
|
||||
configdone=1
|
||||
fi
|
||||
|
||||
exists() {
|
||||
which \$1 >/dev/null 2>&1 || return
|
||||
\$*
|
||||
}
|
||||
|
||||
touch /.liveimg-configured
|
||||
|
||||
# mount live image
|
||||
if [ -b \`readlink -f /dev/live\` ]; then
|
||||
mkdir -p /mnt/live
|
||||
mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
|
||||
fi
|
||||
|
||||
livedir="LiveOS"
|
||||
for arg in \`cat /proc/cmdline\` ; do
|
||||
if [ "\${arg##live_dir=}" != "\${arg}" ]; then
|
||||
livedir=\${arg##live_dir=}
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
# enable swaps unless requested otherwise
|
||||
swaps=\`blkid -t TYPE=swap -o device\`
|
||||
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
|
||||
for s in \$swaps ; do
|
||||
action "Enabling swap partition \$s" swapon \$s
|
||||
done
|
||||
fi
|
||||
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /mnt/live/\${livedir}/swap.img ] ; then
|
||||
action "Enabling swap file" swapon /mnt/live/\${livedir}/swap.img
|
||||
fi
|
||||
|
||||
mountPersistentHome() {
|
||||
# support label/uuid
|
||||
if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
|
||||
homedev=\`/sbin/blkid -o device -t "\$homedev"\`
|
||||
fi
|
||||
|
||||
# if we're given a file rather than a blockdev, loopback it
|
||||
if [ "\${homedev##mtd}" != "\${homedev}" ]; then
|
||||
# mtd devs don't have a block device but get magic-mounted with -t jffs2
|
||||
mountopts="-t jffs2"
|
||||
elif [ ! -b "\$homedev" ]; then
|
||||
loopdev=\`losetup -f\`
|
||||
if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then
|
||||
action "Remounting live store r/w" mount -o remount,rw /mnt/live
|
||||
fi
|
||||
losetup \$loopdev \$homedev
|
||||
homedev=\$loopdev
|
||||
fi
|
||||
|
||||
# if it's encrypted, we need to unlock it
|
||||
if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
|
||||
echo
|
||||
echo "Setting up encrypted /home device"
|
||||
plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
|
||||
homedev=/dev/mapper/EncHome
|
||||
fi
|
||||
|
||||
# and finally do the mount
|
||||
mount \$mountopts \$homedev /home
|
||||
# if we have /home under what's passed for persistent home, then
|
||||
# we should make that the real /home. useful for mtd device on olpc
|
||||
if [ -d /home/home ]; then mount --bind /home/home /home ; fi
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon /home
|
||||
if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
|
||||
}
|
||||
|
||||
findPersistentHome() {
|
||||
for arg in \`cat /proc/cmdline\` ; do
|
||||
if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
|
||||
homedev=\${arg##persistenthome=}
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
|
||||
findPersistentHome
|
||||
elif [ -e /mnt/live/\${livedir}/home.img ]; then
|
||||
homedev=/mnt/live/\${livedir}/home.img
|
||||
fi
|
||||
|
||||
# if we have a persistent /home, then we want to go ahead and mount it
|
||||
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
|
||||
action "Mounting persistent /home" mountPersistentHome
|
||||
fi
|
||||
|
||||
# make it so that we don't do writing to the overlay for things which
|
||||
# are just tmpdirs/caches
|
||||
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
|
||||
mount -t tmpfs tmp /tmp
|
||||
mount -t tmpfs vartmp /var/tmp
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
|
||||
|
||||
if [ -n "\$configdone" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# add fedora user with no passwd
|
||||
action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
|
||||
passwd -d liveuser > /dev/null
|
||||
|
||||
# turn off firstboot for livecd boots
|
||||
chkconfig --level 345 firstboot off 2>/dev/null
|
||||
# We made firstboot a native systemd service, so it can no longer be turned
|
||||
# off with chkconfig. It should be possible to turn it off with systemctl, but
|
||||
# that doesn't work right either. For now, this is good enough: the firstboot
|
||||
# service will start up, but this tells it not to run firstboot. I suspect the
|
||||
# other services 'disabled' below are not actually getting disabled properly,
|
||||
# with systemd, but we can look into that later. - AdamW 2010/08 F14Alpha
|
||||
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
|
||||
|
||||
# don't start yum-updatesd for livecd boots
|
||||
chkconfig --level 345 yum-updatesd off 2>/dev/null
|
||||
|
||||
# turn off mdmonitor by default
|
||||
chkconfig --level 345 mdmonitor off 2>/dev/null
|
||||
|
||||
# turn off setroubleshoot on the live image to preserve resources
|
||||
chkconfig --level 345 setroubleshoot off 2>/dev/null
|
||||
|
||||
# don't do packagekit checking by default
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_updates never >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_upgrades never >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_refresh_cache never >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_available false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_distro_upgrades false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_firmware false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
|
||||
|
||||
|
||||
# don't start cron/at as they tend to spawn things which are
|
||||
# disk intensive that are painful on a live image
|
||||
chkconfig --level 345 crond off 2>/dev/null
|
||||
chkconfig --level 345 atd off 2>/dev/null
|
||||
chkconfig --level 345 anacron off 2>/dev/null
|
||||
chkconfig --level 345 readahead_early off 2>/dev/null
|
||||
chkconfig --level 345 readahead_later off 2>/dev/null
|
||||
|
||||
# Stopgap fix for RH #217966; should be fixed in HAL instead
|
||||
touch /media/.hal-mtab
|
||||
|
||||
# workaround clock syncing on shutdown that we don't want (#297421)
|
||||
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
|
||||
|
||||
# and hack so that we eject the cd on shutdown if we're using a CD...
|
||||
if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then
|
||||
cat >> /sbin/halt.local << FOE
|
||||
#!/bin/bash
|
||||
# XXX: This often gets stuck during shutdown because /etc/init.d/halt
|
||||
# (or something else still running) wants to read files from the block\
|
||||
# device that was ejected. Disable for now. Bug #531924
|
||||
# we want to eject the cd on halt, but let's also try to avoid
|
||||
# io errors due to not being able to get files...
|
||||
#cat /sbin/halt > /dev/null
|
||||
#cat /sbin/reboot > /dev/null
|
||||
#/usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1
|
||||
#echo "Please remove the CD from your drive and press Enter to finish restarting"
|
||||
#read -t 30 < /dev/console
|
||||
FOE
|
||||
chmod +x /sbin/halt.local
|
||||
fi
|
||||
|
||||
EOF
|
||||
|
||||
# bah, hal starts way too late
|
||||
cat > /etc/rc.d/init.d/livesys-late << EOF
|
||||
#!/bin/bash
|
||||
#
|
||||
# live: Late init script for live image
|
||||
#
|
||||
# chkconfig: 345 99 01
|
||||
# description: Late init script for live image.
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exists() {
|
||||
which \$1 >/dev/null 2>&1 || return
|
||||
\$*
|
||||
}
|
||||
|
||||
touch /.liveimg-late-configured
|
||||
|
||||
# read some variables out of /proc/cmdline
|
||||
for o in \`cat /proc/cmdline\` ; do
|
||||
case \$o in
|
||||
ks=*)
|
||||
ks="--kickstart=\${o#ks=}"
|
||||
;;
|
||||
xdriver=*)
|
||||
xdriver="\${o#xdriver=}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# if liveinst or textinst is given, start anaconda
|
||||
if strstr "\`cat /proc/cmdline\`" liveinst ; then
|
||||
plymouth --quit
|
||||
/usr/sbin/liveinst \$ks
|
||||
fi
|
||||
if strstr "\`cat /proc/cmdline\`" textinst ; then
|
||||
plymouth --quit
|
||||
/usr/sbin/liveinst --text \$ks
|
||||
fi
|
||||
|
||||
# configure X, allowing user to override xdriver
|
||||
if [ -n "\$xdriver" ]; then
|
||||
cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
|
||||
Section "Device"
|
||||
Identifier "Videocard0"
|
||||
Driver "\$xdriver"
|
||||
EndSection
|
||||
FOE
|
||||
fi
|
||||
|
||||
EOF
|
||||
|
||||
chmod 755 /etc/rc.d/init.d/livesys
|
||||
/sbin/restorecon /etc/rc.d/init.d/livesys
|
||||
/sbin/chkconfig --add livesys
|
||||
|
||||
chmod 755 /etc/rc.d/init.d/livesys-late
|
||||
/sbin/restorecon /etc/rc.d/init.d/livesys-late
|
||||
/sbin/chkconfig --add livesys-late
|
||||
|
||||
# work around for poor key import UI in PackageKit
|
||||
rm -f /var/lib/rpm/__db*
|
||||
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
|
||||
echo "Packages within this LiveCD"
|
||||
rpm -qa
|
||||
|
||||
# go ahead and pre-make the man -k cache (#455968)
|
||||
/usr/bin/mandb
|
||||
|
||||
# make sure there aren't core files lying around
|
||||
rm -f /core*
|
||||
|
||||
# convince readahead not to collect
|
||||
rm -f /.readahead_collect
|
||||
touch /var/lib/readahead/early.sorted
|
||||
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
%post
|
||||
cat >> /etc/rc.d/init.d/livesys << EOF
|
||||
# disable screensaver locking
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-screensaver/lock_enabled false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /desktop/gnome/lockdown/disable_lock_screen true >/dev/null
|
||||
|
||||
# set up timed auto-login for after 60 seconds
|
||||
cat >> /etc/gdm/custom.conf << FOE
|
||||
[daemon]
|
||||
AutomaticLoginEnable=True
|
||||
AutomaticLogin=liveuser
|
||||
FOE
|
||||
|
||||
# Show harddisk install on the desktop
|
||||
sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop
|
||||
mkdir /home/liveuser/Desktop
|
||||
cp /usr/share/applications/liveinst.desktop /home/liveuser/Desktop
|
||||
chown -R liveuser.liveuser /home/liveuser/Desktop
|
||||
chmod a+x /home/liveuser/Desktop/liveinst.desktop
|
||||
|
||||
# But not trash and home
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/nautilus/desktop/trash_icon_visible false >/dev/null
|
||||
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/nautilus/desktop/home_icon_visible false >/dev/null
|
||||
|
||||
# Turn off PackageKit-command-not-found while uninstalled
|
||||
sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
|
||||
|
||||
EOF
|
||||
|
||||
# Remove root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
# fstab from the install won't match anything. remove it and let dracut
|
||||
# handle mounting.
|
||||
cat /dev/null > /etc/fstab
|
||||
|
||||
%end
|
||||
|
||||
# NOTE Do NOT add any other sections after %packages
|
||||
%packages
|
||||
# Packages requires to support this output format go here
|
||||
isomd5sum
|
||||
kernel
|
||||
memtest86+
|
||||
syslinux
|
||||
-dracut-config-rescue
|
||||
|
||||
# This package is needed to boot the iso on UEFI
|
||||
shim
|
||||
shim-ia32
|
||||
grub2
|
||||
grub2-efi
|
||||
grub2-efi-*-cdboot
|
||||
grub2-efi-ia32
|
||||
efibootmgr
|
||||
|
||||
|
||||
# NOTE lorax-composer will add the recipe packages below here, including the final %end%packages
|
53
share/composer/partitioned-disk.ks
Normal file
53
share/composer/partitioned-disk.ks
Normal file
@ -0,0 +1,53 @@
|
||||
# Lorax Composer partitioned disk output kickstart template
|
||||
|
||||
#
|
||||
sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
# Installation logging level
|
||||
logging --level=info
|
||||
# Shutdown after installation
|
||||
shutdown
|
||||
# System timezone
|
||||
timezone US/Eastern
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
|
||||
%post
|
||||
# Remove root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
%packages
|
||||
kernel
|
||||
-dracut-config-rescue
|
||||
|
||||
shim
|
||||
shim-ia32
|
||||
grub2
|
||||
grub2-efi
|
||||
grub2-efi-*-cdboot
|
||||
grub2-efi-ia32
|
||||
efibootmgr
|
||||
|
||||
# NOTE lorax-composer will add the recipe packages below here, including the final %end
|
53
share/composer/qcow2.ks
Normal file
53
share/composer/qcow2.ks
Normal file
@ -0,0 +1,53 @@
|
||||
# Lorax Composer qcow2 output kickstart template
|
||||
|
||||
#
|
||||
sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
# Installation logging level
|
||||
logging --level=info
|
||||
# Shutdown after installation
|
||||
shutdown
|
||||
# System timezone
|
||||
timezone US/Eastern
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
|
||||
%post
|
||||
# Remove root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
%packages
|
||||
kernel
|
||||
-dracut-config-rescue
|
||||
|
||||
shim
|
||||
shim-ia32
|
||||
grub2
|
||||
grub2-efi
|
||||
grub2-efi-*-cdboot
|
||||
grub2-efi-ia32
|
||||
efibootmgr
|
||||
|
||||
# NOTE lorax-composer will add the recipe packages below here, including the final %end
|
46
share/composer/tar.ks
Normal file
46
share/composer/tar.ks
Normal file
@ -0,0 +1,46 @@
|
||||
# Lorax Composer tar output kickstart template
|
||||
|
||||
#
|
||||
sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled
|
||||
|
||||
# Root password
|
||||
rootpw --plaintext removethispw
|
||||
# Network information
|
||||
network --bootproto=dhcp --onboot=on --activate
|
||||
# System authorization information
|
||||
auth --useshadow --enablemd5
|
||||
# System keyboard
|
||||
keyboard --xlayouts=us --vckeymap=us
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
# Installation logging level
|
||||
logging --level=info
|
||||
# Shutdown after installation
|
||||
shutdown
|
||||
# System timezone
|
||||
timezone US/Eastern
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
clearpart --all
|
||||
|
||||
%post
|
||||
# Remove root password
|
||||
passwd -d root > /dev/null
|
||||
|
||||
# Remove random-seed
|
||||
rm /var/lib/systemd/random-seed
|
||||
%end
|
||||
|
||||
# NOTE Do NOT add any other sections after %packages
|
||||
%packages
|
||||
# Packages requires to support this output format go here
|
||||
|
||||
|
||||
# NOTE lorax-composer will add the recipe packages below here, including the final %end
|
5
share/config_files/aarch64/boot.msg
Normal file
5
share/config_files/aarch64/boot.msg
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
splash.lss
|
||||
|
||||
- Press the 01<ENTER>07 key to begin the installation process.
|
||||
|
13
share/config_files/aarch64/grub.conf
Normal file
13
share/config_files/aarch64/grub.conf
Normal file
@ -0,0 +1,13 @@
|
||||
#debug --graphics
|
||||
default=0
|
||||
splashimage=@SPLASHPATH@
|
||||
timeout 5
|
||||
hiddenmenu
|
||||
title Install @PRODUCT@ @VERSION@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@ quiet
|
||||
initrd @INITRDPATH@
|
||||
title Test this media & install @PRODUCT@ @VERSION@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@ rd.live.check quiet
|
||||
initrd @INITRDPATH@
|
46
share/config_files/aarch64/grub2-efi.cfg
Normal file
46
share/config_files/aarch64/grub2-efi.cfg
Normal file
@ -0,0 +1,46 @@
|
||||
set default="1"
|
||||
|
||||
function load_video {
|
||||
if [ x$feature_all_video_module = xy ]; then
|
||||
insmod all_video
|
||||
else
|
||||
insmod efi_gop
|
||||
insmod efi_uga
|
||||
insmod ieee1275_fb
|
||||
insmod vbe
|
||||
insmod vga
|
||||
insmod video_bochs
|
||||
insmod video_cirrus
|
||||
fi
|
||||
}
|
||||
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod gzio
|
||||
insmod part_gpt
|
||||
insmod ext2
|
||||
|
||||
set timeout=60
|
||||
### END /etc/grub.d/00_header ###
|
||||
|
||||
search --no-floppy --set=root -l '@ISOLABEL@'
|
||||
|
||||
### BEGIN /etc/grub.d/10_linux ###
|
||||
menuentry 'Install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ ro
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ rd.live.check
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
submenu 'Troubleshooting -->' {
|
||||
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ nomodeset
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ rescue
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
[main]
|
||||
no-auto-default=*
|
@ -0,0 +1,2 @@
|
||||
[connection]
|
||||
connection.autoconnect-slaves=1
|
@ -0,0 +1,2 @@
|
||||
[logging]
|
||||
level=DEBUG
|
@ -1 +1 @@
|
||||
SYSFONT="latarcyrheb-sun16"
|
||||
SYSFONT="eurlatgr"
|
||||
|
@ -1,21 +0,0 @@
|
||||
[org.gnome.desktop.wm.keybindings]
|
||||
switch-to-workspace-left=[]
|
||||
switch-to-workspace-right=[]
|
||||
switch-to-workspace-up=[]
|
||||
switch-to-workspace-down=[]
|
||||
switch-group=[]
|
||||
switch-windows=[]
|
||||
switch-panels=[]
|
||||
cycle-group=[]
|
||||
cycle-windows=[]
|
||||
cycle-panels=[]
|
||||
activate-window-menu=[]
|
||||
toggle-maximized=[]
|
||||
maximize=[]
|
||||
unmaximize=[]
|
||||
begin-move=[]
|
||||
begin-resize=[]
|
||||
move-to-workspace-left=[]
|
||||
move-to-workspace-right=[]
|
||||
move-to-workspace-up=[]
|
||||
move-to-workspace-down=[]
|
@ -1,7 +1,24 @@
|
||||
# rsyslog configuration file
|
||||
|
||||
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
|
||||
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
|
||||
|
||||
#### MODULES ####
|
||||
$ModLoad imuxsock.so # provides support for local system logging
|
||||
|
||||
# The imjournal module bellow is now used as a message source instead of imuxsock.
|
||||
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
|
||||
$SystemLogRateLimitInterval 0 # disables message dropping, we need all of them
|
||||
$ModLoad imklog.so # provides kernel logging support
|
||||
$ModLoad imjournal # provides access to the systemd journal
|
||||
#$ModLoad imklog # reads kernel messages (the same are read from journald)
|
||||
#$ModLoad immark # provides --MARK-- message capability
|
||||
|
||||
# Provides UDP syslog reception
|
||||
#$ModLoad imudp
|
||||
#$UDPServerRun 514
|
||||
|
||||
# Provides TCP syslog reception
|
||||
#$ModLoad imtcp
|
||||
#$InputTCPServerRun 514
|
||||
|
||||
$ModLoad imfile
|
||||
$InputFileName /tmp/X.log
|
||||
@ -15,10 +32,29 @@ $InputFileStateFile anaconda-tb-statefile
|
||||
$InputFileFacility local1
|
||||
$InputRunFileMonitor
|
||||
|
||||
|
||||
#### GLOBAL DIRECTIVES ####
|
||||
|
||||
# Where to place auxiliary files
|
||||
#$WorkDirectory /var/lib/rsyslog
|
||||
|
||||
# Use default timestamp format
|
||||
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
|
||||
|
||||
# File syncing capability is disabled by default. This feature is usually not required,
|
||||
# not useful and an extreme performance hit
|
||||
#$ActionFileEnableSync on
|
||||
|
||||
# Include all config files in /etc/rsyslog.d/
|
||||
$IncludeConfig /etc/rsyslog.d/*.conf
|
||||
|
||||
# Turn off message reception via local log socket;
|
||||
# local messages are retrieved through imjournal now.
|
||||
$OmitLocalLogging on
|
||||
|
||||
# File to store the position in the journal
|
||||
$IMJournalStateFile imjournal.state
|
||||
|
||||
#### TEMPLATES ####
|
||||
|
||||
$template anaconda_tty4, "%syslogseverity-text:::uppercase% %programname%:%msg%\n"
|
||||
@ -26,24 +62,32 @@ $template anaconda_syslog, "%timestamp:8:$:date-rfc3164%,%timestamp:1:3:date-sub
|
||||
$template virtio_ForwardFormat, "<%PRI%>%TIMESTAMP:::date-rfc3339% localhost %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%\n"
|
||||
|
||||
#### RULES ####
|
||||
|
||||
# log everything except anaconda-specific records from local1 (those are stored
|
||||
# directly into files via python logging)
|
||||
|
||||
# discard messages from dracut regenerating initrd
|
||||
:programname,isequal,"dracut" ~
|
||||
|
||||
*.*;\
|
||||
authpriv.none;\
|
||||
local1.none /tmp/syslog;anaconda_syslog
|
||||
& /dev/tty4;anaconda_tty4
|
||||
|
||||
|
||||
# ### begin forwarding rule ###
|
||||
# The statement between the begin ... end define a SINGLE forwarding
|
||||
# rule. They belong together, do NOT split them. If you create multiple
|
||||
# forwarding rules, duplicate the whole block!
|
||||
# Remote Logging (we use TCP for reliable delivery)
|
||||
#
|
||||
# An on-disk queue is created for this action. If the remote host is
|
||||
# down, messages are spooled to disk and sent when it is up again.
|
||||
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files
|
||||
$ActionQueueMaxDiskSpace 1m # space limit (use as much as possible)
|
||||
$ActionQueueSaveOnShutdown off # do not save messages to disk on shutdown
|
||||
$ActionQueueType LinkedList # run asynchronously
|
||||
$ActionResumeRetryCount -1 # infinite retries if host is down
|
||||
#$ActionQueueType LinkedList # run asynchronously
|
||||
#$ActionResumeRetryCount -1 # infinite retries if host is down
|
||||
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
|
||||
#*.* @@remote-host:514
|
||||
# ### end of the forwarding rule ###
|
||||
|
||||
|
1
share/config_files/common/spice-vdagentd
Normal file
1
share/config_files/common/spice-vdagentd
Normal file
@ -0,0 +1 @@
|
||||
SPICE_VDAGENTD_EXTRA_ARGS=-X
|
2
share/config_files/common/vconsole.conf
Normal file
2
share/config_files/common/vconsole.conf
Normal file
@ -0,0 +1,2 @@
|
||||
KEYMAP=us
|
||||
FONT=eurlatgr
|
@ -1,6 +1,7 @@
|
||||
<chrp-boot> <description>Linux</description>
|
||||
<os-name>Linux</os-name>
|
||||
<boot-script>boot &device;:\ppc\chrp\yaboot</boot-script>
|
||||
<chrp-boot>
|
||||
<description>grub 2.00</description>
|
||||
<os-name>grub 2.00</os-name>
|
||||
<boot-script>boot &device;:\boot\grub\powerpc-ieee1275\core.elf</boot-script>
|
||||
<icon size=64,64 color-space=3,3,2>
|
||||
<bitmap> FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
|
30
share/config_files/ppc/grub.cfg.in
Normal file
30
share/config_files/ppc/grub.cfg.in
Normal file
@ -0,0 +1,30 @@
|
||||
set default=0
|
||||
set timeout=5
|
||||
|
||||
echo -e "\nWelcome to the @PRODUCT@ @VERSION@ installer!\n\n"
|
||||
|
||||
menuentry "Install @PRODUCT@ @VERSION@ (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
|
||||
linux /ppc/ppc64/vmlinuz @ROOT@ ro
|
||||
initrd /ppc/ppc64/initrd.img
|
||||
}
|
||||
|
||||
menuentry "Test this media & install @PRODUCT@ @VERSION@ (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
|
||||
linux /ppc/ppc64/vmlinuz @ROOT@ rd.live.check ro
|
||||
initrd /ppc/ppc64/initrd.img
|
||||
}
|
||||
|
||||
menuentry "Rescue a @PRODUCT@ system (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
|
||||
linux /ppc/ppc64/vmlinuz @ROOT@ rescue ro
|
||||
initrd /ppc/ppc64/initrd.img
|
||||
}
|
||||
|
||||
submenu 'Other options...' {
|
||||
menuentry 'Reboot' {
|
||||
reboot
|
||||
}
|
||||
|
||||
menuentry 'Exit to Open Firmware' {
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
1
share/config_files/s390/cdboot.prm
Normal file
1
share/config_files/s390/cdboot.prm
Normal file
@ -0,0 +1 @@
|
||||
ro
|
@ -1,5 +1,5 @@
|
||||
* minimal lpar ins file
|
||||
images/kernel.img 0x00000000
|
||||
images/initrd.img @INITRD_LOAD_ADDRESS@
|
||||
images/generic.prm 0x00010480
|
||||
images/genericdvd.prm 0x00010480
|
||||
images/initrd.addrsize 0x00010408
|
||||
|
@ -1 +1 @@
|
||||
ro ramdisk_size=40000 cio_ignore=all,!0.0.0009
|
||||
ro ramdisk_size=40000 cio_ignore=all,!condev
|
||||
|
1
share/config_files/s390/genericdvd.prm
Normal file
1
share/config_files/s390/genericdvd.prm
Normal file
@ -0,0 +1 @@
|
||||
ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask
|
@ -1,7 +1,7 @@
|
||||
#debug --graphics
|
||||
default=0
|
||||
default=1
|
||||
splashimage=@SPLASHPATH@
|
||||
timeout 5
|
||||
timeout 60
|
||||
hiddenmenu
|
||||
title Install @PRODUCT@ @VERSION@
|
||||
findiso
|
||||
|
43
share/config_files/x86/grub2-efi-lockdown.cfg
Normal file
43
share/config_files/x86/grub2-efi-lockdown.cfg
Normal file
@ -0,0 +1,43 @@
|
||||
set default="1"
|
||||
|
||||
function load_video {
|
||||
insmod efi_gop
|
||||
insmod efi_uga
|
||||
insmod video_bochs
|
||||
insmod video_cirrus
|
||||
insmod all_video
|
||||
}
|
||||
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod gzio
|
||||
insmod part_gpt
|
||||
insmod ext2
|
||||
|
||||
set timeout=60
|
||||
### END /etc/grub.d/00_header ###
|
||||
|
||||
search --no-floppy --set=root -l '@ISOLABEL@'
|
||||
|
||||
### BEGIN /etc/grub.d/10_linux ###
|
||||
menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.check quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
submenu 'Troubleshooting -->' {
|
||||
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ xdriver=vesa nomodeset quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rescue quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry '@PRODUCT@ @VERSION@ Secure Boot Lockdown' {
|
||||
chainloader /EFI/BOOT/lockdown.efi
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
set default="0"
|
||||
set default="1"
|
||||
|
||||
function load_video {
|
||||
insmod efi_gop
|
||||
@ -14,7 +14,7 @@ insmod gzio
|
||||
insmod part_gpt
|
||||
insmod ext2
|
||||
|
||||
set timeout=5
|
||||
set timeout=60
|
||||
### END /etc/grub.d/00_header ###
|
||||
|
||||
search --no-floppy --set=root -l '@ISOLABEL@'
|
||||
|
@ -1,5 +1,6 @@
|
||||
<%page args="configdir, KERNELDIR, efiarch, isolabel"/>
|
||||
<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/>
|
||||
<%
|
||||
from string import lower
|
||||
EFIBOOTDIR="EFI/BOOT"
|
||||
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
|
||||
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
||||
@ -7,9 +8,19 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
||||
|
||||
mkdir ${EFIBOOTDIR}
|
||||
mkdir ${EFIBOOTDIR}/fonts/
|
||||
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
||||
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
|
||||
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
|
||||
%if exists("usr/share/shim/lockdown.efi"):
|
||||
install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
|
||||
%endif
|
||||
%if efiarch64:
|
||||
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
|
||||
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
|
||||
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
|
||||
%endif
|
||||
%if efiarch32:
|
||||
install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
|
||||
install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
|
||||
install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
|
||||
%endif
|
||||
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
|
||||
|
||||
## actually make the EFI images
|
||||
@ -31,7 +42,11 @@ ${make_efiboot("images/efiboot.img")}
|
||||
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
|
||||
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
|
||||
%endif
|
||||
install ${configdir}/grub2-efi.cfg ${eficonf}
|
||||
%if exists("usr/share/shim/lockdown.efi"):
|
||||
install ${configdir}/grub2-efi-lockdown.cfg ${eficonf}
|
||||
%else:
|
||||
install ${configdir}/grub2-efi.cfg ${eficonf}
|
||||
%endif
|
||||
replace @PRODUCT@ '${product.name}' ${eficonf}
|
||||
replace @VERSION@ ${product.version} ${eficonf}
|
||||
replace @KERNELNAME@ vmlinuz ${eficonf}
|
||||
@ -43,9 +58,6 @@ ${make_efiboot("images/efiboot.img")}
|
||||
%else:
|
||||
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
|
||||
%endif
|
||||
%if efiarch == 'IA32':
|
||||
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
|
||||
%endif
|
||||
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
|
||||
%if include_kernel:
|
||||
remove ${EFIBOOTDIR}/vmlinuz
|
||||
|
85
share/live/aarch64.tmpl
Normal file
85
share/live/aarch64.tmpl
Normal file
@ -0,0 +1,85 @@
|
||||
<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/>
|
||||
<%
|
||||
configdir="tmp/config_files/aarch64"
|
||||
PXEBOOTDIR="images/pxeboot"
|
||||
KERNELDIR=PXEBOOTDIR
|
||||
LIVEDIR="LiveOS"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
|
||||
## Don't allow spaces or escape characters in the iso label
|
||||
def valid_label(ch):
|
||||
return ch.isalnum() or ch == '_'
|
||||
|
||||
isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel)
|
||||
|
||||
from os.path import basename
|
||||
%>
|
||||
|
||||
## Test ${runtime_img} to see if udf is needed
|
||||
<%
|
||||
import os
|
||||
from pylorax.sysutils import joinpaths
|
||||
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
|
||||
udfargs = "-allow-limited-size"
|
||||
else:
|
||||
udfargs = ""
|
||||
%>
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
install ${runtime_img} ${LIVEDIR}/squashfs.img
|
||||
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
||||
|
||||
## install kernels
|
||||
mkdir ${KERNELDIR}
|
||||
%for kernel in kernels:
|
||||
## normal aarch64
|
||||
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
|
||||
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
||||
%endfor
|
||||
|
||||
#FIXME: this will need adjusted when we have a real bootloader.
|
||||
## WHeeeeeeee, EFI.
|
||||
## We could remove the basearch restriction someday..
|
||||
<% efiargs=""; efigraft="" %>
|
||||
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
|
||||
<%
|
||||
efiarch = 'AA64'
|
||||
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
|
||||
images = ["images/efiboot.img"]
|
||||
%>
|
||||
%for img in images:
|
||||
<%
|
||||
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
|
||||
efigraft += " {0}={1}/{0}".format(img,outroot)
|
||||
%>
|
||||
treeinfo images-${basearch} ${img|basename} ${img}
|
||||
%endfor
|
||||
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=None, efiarch64=efiarch, isolabel=isolabel, extra_boot_args=extra_boot_args"/>
|
||||
%endif
|
||||
|
||||
# Create optional product.img and updates.img
|
||||
<% filegraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
treeinfo images-${basearch} ${img}.img images/${img}.img
|
||||
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
# Add the license files
|
||||
%for f in glob("/usr/share/licenses/*-release/*"):
|
||||
install ${f} ${f|basename}
|
||||
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
|
||||
%endfor
|
||||
|
||||
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
|
||||
## make boot.iso
|
||||
runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||||
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
|
||||
-graft-points \
|
||||
${KERNELDIR}=${outroot}/${KERNELDIR} \
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR} \
|
||||
${efigraft} ${filegraft}
|
||||
treeinfo images-${basearch} boot.iso images/boot.iso
|
||||
%endif
|
42
share/live/config_files/aarch64/grub2-efi.cfg
Normal file
42
share/live/config_files/aarch64/grub2-efi.cfg
Normal file
@ -0,0 +1,42 @@
|
||||
set default="1"
|
||||
|
||||
function load_video {
|
||||
if [ x$feature_all_video_module = xy ]; then
|
||||
insmod all_video
|
||||
else
|
||||
insmod efi_gop
|
||||
insmod efi_uga
|
||||
insmod ieee1275_fb
|
||||
insmod vbe
|
||||
insmod vga
|
||||
insmod video_bochs
|
||||
insmod video_cirrus
|
||||
fi
|
||||
}
|
||||
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod gzio
|
||||
insmod part_gpt
|
||||
insmod ext2
|
||||
|
||||
set timeout=60
|
||||
### END /etc/grub.d/00_header ###
|
||||
|
||||
search --no-floppy --set=root -l '@ISOLABEL@'
|
||||
|
||||
### BEGIN /etc/grub.d/10_linux ###
|
||||
menuentry 'Start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
submenu 'Troubleshooting -->' {
|
||||
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os {
|
||||
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset quiet
|
||||
initrd @INITRDPATH@
|
||||
}
|
||||
}
|
170
share/live/config_files/ppc/bootinfo.txt
Normal file
170
share/live/config_files/ppc/bootinfo.txt
Normal file
@ -0,0 +1,170 @@
|
||||
<chrp-boot>
|
||||
<description>grub 2.00</description>
|
||||
<os-name>grub 2.00</os-name>
|
||||
<boot-script>boot &device;:\boot\grub\powerpc-ieee1275\core.elf</boot-script>
|
||||
<icon size=64,64 color-space=3,3,2>
|
||||
<bitmap> FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 </bitmap> </icon> </chrp-boot>
|
34
share/live/config_files/ppc/grub.cfg.in
Normal file
34
share/live/config_files/ppc/grub.cfg.in
Normal file
@ -0,0 +1,34 @@
|
||||
set default=0
|
||||
set timeout=5
|
||||
|
||||
echo -e "\nWelcome to the @PRODUCT@ @VERSION@ installer!\n\n"
|
||||
|
||||
for BITS in 32 64; do
|
||||
if [ -d "/ppc/ppc${BITS}" ]; then
|
||||
menuentry "Start @PRODUCT@ @VERSION@ (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
|
||||
linux /ppc/ppc${2}/vmlinuz @ROOT@ @EXTRA@ ro rd.live.image quiet
|
||||
initrd /ppc/ppc${2}/initrd.img
|
||||
}
|
||||
|
||||
menuentry "Test this media & start @PRODUCT@ @VERSION@ (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
|
||||
linux /ppc/ppc${2}/vmlinuz @ROOT@ @EXTRA@ rd.live.image rd.live.check ro quiet
|
||||
initrd /ppc/ppc${2}/initrd.img
|
||||
}
|
||||
|
||||
menuentry "Rescue a @PRODUCT@ system (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
|
||||
linux /ppc/ppc${2}/vmlinuz @ROOT@ rd.live.image rescue ro
|
||||
initrd /ppc/ppc${2}/initrd.img
|
||||
}
|
||||
fi
|
||||
done
|
||||
|
||||
submenu 'Other options...' {
|
||||
menuentry 'Reboot' {
|
||||
reboot
|
||||
}
|
||||
|
||||
menuentry 'Exit to Open Firmware' {
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
81
share/live/config_files/ppc/magic
Normal file
81
share/live/config_files/ppc/magic
Normal file
@ -0,0 +1,81 @@
|
||||
#
|
||||
# Example magic file for mkhybrid
|
||||
#
|
||||
# The "message" for the offset MUST be 4 characters for the CREATOR
|
||||
# and 4 characters for the TYPE - white space is optional between them.
|
||||
# Any other characters on this line are ignored. Continuation lines (starting
|
||||
# with '>') are also ignored i.e. only the initial offset lines are used.
|
||||
#
|
||||
# The continuation lines are given here, but they do not need to exist.
|
||||
|
||||
#
|
||||
# James Pearson 20/5/98
|
||||
|
||||
# off type test message
|
||||
|
||||
# GIF
|
||||
0 string GIF8 8BIM GIFf
|
||||
>4 string 7a \b, version 8%s,
|
||||
>4 string 9a \b, version 8%s,
|
||||
>6 leshort >0 %hd x
|
||||
>8 leshort >0 %hd,
|
||||
#>10 byte &0x80 color mapped,
|
||||
#>10 byte&0x07 =0x00 2 colors
|
||||
#>10 byte&0x07 =0x01 4 colors
|
||||
#>10 byte&0x07 =0x02 8 colors
|
||||
#>10 byte&0x07 =0x03 16 colors
|
||||
#>10 byte&0x07 =0x04 32 colors
|
||||
#>10 byte&0x07 =0x05 64 colors
|
||||
#>10 byte&0x07 =0x06 128 colors
|
||||
#>10 byte&0x07 =0x07 256 colors
|
||||
|
||||
# JPEG images
|
||||
#
|
||||
0 ubeshort 0xffd8 8BIM JPEG image data
|
||||
|
||||
# StuffIt
|
||||
#
|
||||
0 string SIT! SIT!SIT!
|
||||
|
||||
# standard unix compress
|
||||
0 string \037\235 LZIV ZIVU
|
||||
>2 byte&0x80 >0 block compressed
|
||||
>2 byte&0x1f x %d bits
|
||||
|
||||
# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
|
||||
0 string \037\213 GNUz ZIVU gzip compressed data
|
||||
>2 byte <8 \b, reserved method,
|
||||
>2 byte 8 \b, deflated,
|
||||
>3 byte &0x01 ASCII,
|
||||
>3 byte &0x02 continuation,
|
||||
>3 byte &0x04 extra field,
|
||||
>3 byte &0x08 original filename,
|
||||
>3 byte &0x10 comment,
|
||||
>3 byte &0x20 encrypted,
|
||||
>4 ledate x last modified: %s,
|
||||
>8 byte 2 max compression,
|
||||
>8 byte 4 max speed,
|
||||
>9 byte =0x00 os: MS-DOS
|
||||
>9 byte =0x01 os: Amiga
|
||||
>9 byte =0x02 os: VMS
|
||||
>9 byte =0x03 os: Unix
|
||||
>9 byte =0x05 os: Atari
|
||||
>9 byte =0x06 os: OS/2
|
||||
>9 byte =0x07 os: MacOS
|
||||
>9 byte =0x0A os: Tops/20
|
||||
>9 byte =0x0B os: Win/32
|
||||
|
||||
# Postscript
|
||||
0 string %! ASPSTEXT
|
||||
>2 string PS-Adobe- conforming
|
||||
>>11 string >\0 at level %.3s
|
||||
>>>15 string EPS - type %s
|
||||
>>>15 string Query - type %s
|
||||
>>>15 string ExitServer - type %s
|
||||
# Some PCs have the annoying habit of adding a ^D as a document separator
|
||||
0 string \004%! ASPS TEXT PostScript document text
|
||||
>3 string PS-Adobe- conforming
|
||||
>>12 string >\0 at level %.3s
|
||||
>>>16 string EPS - type %s
|
||||
>>>16 string Query - type %s
|
||||
>>>16 string ExitServer - type %s
|
27
share/live/config_files/ppc/mapping
Normal file
27
share/live/config_files/ppc/mapping
Normal file
@ -0,0 +1,27 @@
|
||||
# Example filename mapping file
|
||||
#
|
||||
# yaboot Raw 'UNIX' 'boot' "Bootstrap"
|
||||
# vmlinux Raw 'UNIX' 'boot' "Bootstrap"
|
||||
#
|
||||
# EXTN XLate CREATOR TYPE Comment
|
||||
COPYING Ascii 'ttxt' 'ttro' "Text File"
|
||||
CREDITS Ascii 'ttxt' 'ttro' "Text File"
|
||||
README Ascii 'ttxt' 'ttro' "Text File"
|
||||
RPM-GPG-KEY Ascii 'ttxt' 'ttro' "Text File"
|
||||
RELEASE_NOTES Ascii 'ttxt' 'ttro' "Text File"
|
||||
.b Raw 'chrp' 'tbxi' "Macintosh Toolbox ROM file"
|
||||
.gif Raw '8BIM' 'GIFf' "Gif File"
|
||||
.jpg Raw '8BIM' 'JPEG' "Jpeg File"
|
||||
.tif Raw '8BIM' 'TIFF' "Photoshop TIFF image"
|
||||
.hqx Ascii 'BnHq' 'TEXT' "BinHex file"
|
||||
.doc Raw 'MSWD' 'WDBN' "Word file"
|
||||
.mov Raw 'TVOD' 'MooV' "QuickTime Movie"
|
||||
.html Ascii 'MOSS' 'TEXT' "HTML File"
|
||||
.htm Ascii 'MOSS' 'TEXT' "HTML File"
|
||||
.conf Ascii 'ttxt' 'TEXT' "config file"
|
||||
.txt Ascii 'ttxt' 'TEXT' "Text File"
|
||||
.tbxi Raw 'chrp' 'tbxi' "Macintosh Toolbox ROM file"
|
||||
.sea Raw 'aust' 'APPL' "Self Expanding Archive"
|
||||
.sit Raw 'SIT!' 'SITD' "Stuffit Expander file"
|
||||
* Raw '????' '????' "Unknown"
|
||||
|
74
share/live/config_files/ppc/ofboot.b
Normal file
74
share/live/config_files/ppc/ofboot.b
Normal file
@ -0,0 +1,74 @@
|
||||
<CHRP-BOOT>
|
||||
<COMPATIBLE>
|
||||
MacRISC MacRISC3 MacRISC4
|
||||
</COMPATIBLE>
|
||||
|
||||
<DESCRIPTION>
|
||||
Boot Chooser
|
||||
</DESCRIPTION>
|
||||
|
||||
<BOOT-SCRIPT>
|
||||
" screen" output
|
||||
load-base release-load-area
|
||||
" /cpus/@0" find-package if
|
||||
" 64-bit" rot get-package-property 0= if
|
||||
2drop
|
||||
" boot cd:,\ppc\mac\yaboot conf=cd:,\ppc\ppc64\yaboot.conf" eval
|
||||
else
|
||||
" boot cd:,\ppc\mac\yaboot conf=cd:,\ppc\ppc32\yaboot.conf" eval
|
||||
then
|
||||
then
|
||||
</BOOT-SCRIPT>
|
||||
|
||||
<OS-BADGE-ICONS>
|
||||
1010
|
||||
000000000000F8FEACF6000000000000
|
||||
0000000000F5FFFFFEFEF50000000000
|
||||
00000000002BFAFEFAFCF70000000000
|
||||
0000000000F65D5857812B0000000000
|
||||
0000000000F5350B2F88560000000000
|
||||
0000000000F6335708F8FE0000000000
|
||||
00000000005600F600F5FD8100000000
|
||||
00000000F9F8000000F5FAFFF8000000
|
||||
000000008100F5F50000F6FEFE000000
|
||||
000000F8F700F500F50000FCFFF70000
|
||||
00000088F70000F50000F5FCFF2B0000
|
||||
0000002F582A00F5000008ADE02C0000
|
||||
00090B0A35A62B0000002D3B350A0000
|
||||
000A0A0B0B3BF60000505E0B0A0B0A00
|
||||
002E350B0B2F87FAFCF45F0B2E090000
|
||||
00000007335FF82BF72B575907000000
|
||||
000000000000ACFFFF81000000000000
|
||||
000000000081FFFFFFFF810000000000
|
||||
0000000000FBFFFFFFFFAC0000000000
|
||||
000000000081DFDFDFFFFB0000000000
|
||||
000000000081DD5F83FFFD0000000000
|
||||
000000000081DDDF5EACFF0000000000
|
||||
0000000000FDF981F981FFFF00000000
|
||||
00000000FFACF9F9F981FFFFAC000000
|
||||
00000000FFF98181F9F981FFFF000000
|
||||
000000ACACF981F981F9F9FFFFAC0000
|
||||
000000FFACF9F981F9F981FFFFFB0000
|
||||
00000083DFFBF981F9F95EFFFFFC0000
|
||||
005F5F5FDDFFFBF9F9F983DDDD5F0000
|
||||
005F5F5F5FDD81F9F9E7DF5F5F5F5F00
|
||||
0083DD5F5F83FFFFFFFFDF5F835F0000
|
||||
000000FBDDDFACFBACFBDFDFFB000000
|
||||
000000000000FFFFFFFF000000000000
|
||||
0000000000FFFFFFFFFFFF0000000000
|
||||
0000000000FFFFFFFFFFFF0000000000
|
||||
0000000000FFFFFFFFFFFF0000000000
|
||||
0000000000FFFFFFFFFFFF0000000000
|
||||
0000000000FFFFFFFFFFFF0000000000
|
||||
0000000000FFFFFFFFFFFFFF00000000
|
||||
00000000FFFFFFFFFFFFFFFFFF000000
|
||||
00000000FFFFFFFFFFFFFFFFFF000000
|
||||
000000FFFFFFFFFFFFFFFFFFFFFF0000
|
||||
000000FFFFFFFFFFFFFFFFFFFFFF0000
|
||||
000000FFFFFFFFFFFFFFFFFFFFFF0000
|
||||
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
|
||||
00FFFFFFFFFFFFFFFFFFFFFFFFFFFF00
|
||||
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
|
||||
000000FFFFFFFFFFFFFFFFFFFF000000
|
||||
</OS-BADGE-ICONS>
|
||||
</CHRP-BOOT>
|
16
share/live/config_files/ppc/yaboot.conf.3264
Normal file
16
share/live/config_files/ppc/yaboot.conf.3264
Normal file
@ -0,0 +1,16 @@
|
||||
init-message = "\nWelcome to the @PRODUCT@ @VERSION@ installer!\nUse 'linux32' for 32-bit kernel.\n\n"
|
||||
timeout=6000
|
||||
default=linux
|
||||
|
||||
image=/ppc/ppc64/vmlinuz
|
||||
label=linux64
|
||||
alias=linux
|
||||
initrd=/ppc/ppc64/ramdisk.image.gz
|
||||
read-only
|
||||
append="@ROOT@"
|
||||
|
||||
image=/ppc/ppc32/vmlinuz
|
||||
label=linux32
|
||||
initrd=/ppc/ppc32/ramdisk.image.gz
|
||||
read-only
|
||||
append="@ROOT@"
|
9
share/live/config_files/ppc/yaboot.conf.in
Normal file
9
share/live/config_files/ppc/yaboot.conf.in
Normal file
@ -0,0 +1,9 @@
|
||||
init-message = "\nWelcome to the @BITS@-bit @PRODUCT@ @VERSION@ installer!\nHit <TAB> for boot options.\n\n"
|
||||
timeout=6000
|
||||
default=linux
|
||||
|
||||
image=/ppc/ppc@BITS@/vmlinuz
|
||||
label=linux
|
||||
initrd=/ppc/ppc@BITS@/initrd.img
|
||||
read-only
|
||||
append="@ROOT@ rd.live.image quiet"
|
5
share/live/config_files/s390/generic.ins
Normal file
5
share/live/config_files/s390/generic.ins
Normal file
@ -0,0 +1,5 @@
|
||||
* minimal lpar ins file
|
||||
images/kernel.img 0x00000000
|
||||
images/initrd.img @INITRD_LOAD_ADDRESS@
|
||||
images/genericdvd.prm 0x00010480
|
||||
images/initrd.addrsize 0x00010408
|
1
share/live/config_files/s390/generic.prm
Normal file
1
share/live/config_files/s390/generic.prm
Normal file
@ -0,0 +1 @@
|
||||
ro ramdisk_size=40000 cio_ignore=all,!condev @EXTRA@
|
1
share/live/config_files/s390/genericdvd.prm
Normal file
1
share/live/config_files/s390/genericdvd.prm
Normal file
@ -0,0 +1 @@
|
||||
ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask
|
9
share/live/config_files/s390/redhat.exec
Normal file
9
share/live/config_files/s390/redhat.exec
Normal file
@ -0,0 +1,9 @@
|
||||
/* */
|
||||
'CL RDR'
|
||||
'PURGE RDR ALL'
|
||||
'SPOOL PUNCH * RDR'
|
||||
'PUNCH KERNEL IMG A (NOH'
|
||||
'PUNCH GENERIC PRM A (NOH'
|
||||
'PUNCH INITRD IMG A (NOH'
|
||||
'CH RDR ALL KEEP NOHOLD'
|
||||
'I 00C'
|
@ -1,13 +1,13 @@
|
||||
#debug --graphics
|
||||
default=0
|
||||
default=1
|
||||
splashimage=@SPLASHPATH@
|
||||
timeout 5
|
||||
timeout 60
|
||||
hiddenmenu
|
||||
title Start @PRODUCT@ @VERSION@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 quiet
|
||||
kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet
|
||||
initrd @INITRDPATH@
|
||||
title Test this media & start @PRODUCT@ @VERSION@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rd.live.check quiet
|
||||
kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
|
||||
initrd @INITRDPATH@
|
||||
|
43
share/live/config_files/x86/grub2-efi-lockdown.cfg
Normal file
43
share/live/config_files/x86/grub2-efi-lockdown.cfg
Normal file
@ -0,0 +1,43 @@
|
||||
set default="1"
|
||||
|
||||
function load_video {
|
||||
insmod efi_gop
|
||||
insmod efi_uga
|
||||
insmod video_bochs
|
||||
insmod video_cirrus
|
||||
insmod all_video
|
||||
}
|
||||
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod gzio
|
||||
insmod part_gpt
|
||||
insmod ext2
|
||||
|
||||
set timeout=60
|
||||
### END /etc/grub.d/00_header ###
|
||||
|
||||
search --no-floppy --set=root -l '@ISOLABEL@'
|
||||
|
||||
### BEGIN /etc/grub.d/10_linux ###
|
||||
menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.live.check quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
submenu 'Troubleshooting -->' {
|
||||
menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image xdriver=vesa nomodeset quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rescue quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry '@PRODUCT@ @VERSION@ Secure Boot Lockdown' {
|
||||
chainloader /EFI/BOOT/lockdown.efi
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
set default="0"
|
||||
set default="1"
|
||||
|
||||
function load_video {
|
||||
insmod efi_gop
|
||||
@ -14,27 +14,27 @@ insmod gzio
|
||||
insmod part_gpt
|
||||
insmod ext2
|
||||
|
||||
set timeout=5
|
||||
set timeout=60
|
||||
### END /etc/grub.d/00_header ###
|
||||
|
||||
search --no-floppy --set=root -l '@ISOLABEL@'
|
||||
|
||||
### BEGIN /etc/grub.d/10_linux ###
|
||||
menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 quiet
|
||||
linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rd.live.check quiet
|
||||
linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
submenu 'Troubleshooting -->' {
|
||||
menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 xdriver=vesa nomodeset quiet
|
||||
linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image xdriver=vesa nomodeset quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
|
||||
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rescue quiet
|
||||
linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rescue quiet
|
||||
initrdefi @INITRDPATH@
|
||||
}
|
||||
}
|
||||
|
@ -61,13 +61,13 @@ menu separator # insert an empty line
|
||||
label linux
|
||||
menu label ^Start @PRODUCT@ @VERSION@
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 quiet
|
||||
append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image quiet
|
||||
|
||||
label check
|
||||
menu label Test this ^media & start @PRODUCT@ @VERSION@
|
||||
menu default
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rd.live.check quiet
|
||||
append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
|
||||
|
||||
menu separator # insert an empty line
|
||||
|
||||
@ -83,7 +83,7 @@ label vesa
|
||||
@PRODUCT@ @VERSION@.
|
||||
endtext
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 xdriver=vesa nomodeset quiet
|
||||
append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image xdriver=vesa nomodeset quiet
|
||||
|
||||
label rescue
|
||||
menu indent count 5
|
||||
@ -93,7 +93,7 @@ label rescue
|
||||
and edit config files to try to get it booting again.
|
||||
endtext
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rescue quiet
|
||||
append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image rescue quiet
|
||||
|
||||
label memtest
|
||||
menu label Run a ^memory test
|
||||
|
@ -1,5 +1,6 @@
|
||||
<%page args="configdir, KERNELDIR, efiarch, isolabel"/>
|
||||
<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel, extra_boot_args"/>
|
||||
<%
|
||||
from string import lower
|
||||
EFIBOOTDIR="EFI/BOOT"
|
||||
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
|
||||
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
||||
@ -7,8 +8,19 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
||||
|
||||
mkdir ${EFIBOOTDIR}
|
||||
mkdir ${EFIBOOTDIR}/fonts/
|
||||
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
||||
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
|
||||
%if exists("usr/share/shim/lockdown.efi"):
|
||||
install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
|
||||
%endif
|
||||
%if efiarch64:
|
||||
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
|
||||
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
|
||||
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
|
||||
%endif
|
||||
%if efiarch32:
|
||||
install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
|
||||
install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
|
||||
install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
|
||||
%endif
|
||||
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
|
||||
|
||||
## actually make the EFI images
|
||||
@ -30,21 +42,23 @@ ${make_efiboot("images/efiboot.img")}
|
||||
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
|
||||
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
|
||||
%endif
|
||||
install ${configdir}/grub2-efi.cfg ${eficonf}
|
||||
%if exists("usr/share/shim/lockdown.efi"):
|
||||
install ${configdir}/grub2-efi-lockdown.cfg ${eficonf}
|
||||
%else:
|
||||
install ${configdir}/grub2-efi.cfg ${eficonf}
|
||||
%endif
|
||||
replace @PRODUCT@ '${product.name}' ${eficonf}
|
||||
replace @VERSION@ ${product.version} ${eficonf}
|
||||
replace @KERNELNAME@ vmlinuz ${eficonf}
|
||||
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
|
||||
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
|
||||
replace @ISOLABEL@ '${isolabel}' ${eficonf}
|
||||
replace @EXTRA@ '${extra_boot_args}' ${eficonf}
|
||||
%if disk:
|
||||
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
|
||||
%else:
|
||||
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf}
|
||||
%endif
|
||||
%if efiarch == 'IA32':
|
||||
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
|
||||
%endif
|
||||
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
|
||||
%if include_kernel:
|
||||
remove ${EFIBOOTDIR}/vmlinuz
|
||||
|
@ -1,24 +1,17 @@
|
||||
<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/>
|
||||
<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel, extra_boot_args"/>
|
||||
<%
|
||||
configdir="tmp/config_files/ppc"
|
||||
BOOTDIR="ppc"
|
||||
GRUBDIR="boot/grub"
|
||||
LIVEDIR="LiveOS"
|
||||
MACDIR=BOOTDIR+"/mac"
|
||||
NETBOOTDIR="images/netboot"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
|
||||
WRAPPER="usr/sbin/wrapper"
|
||||
WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
|
||||
|
||||
bitsizes = set()
|
||||
prepboot = ""
|
||||
|
||||
## NOTE: yaboot freaks out and stops parsing its config if it sees a '\',
|
||||
## so we can't use the udev escape sequences in the root arg.
|
||||
## Instead we'll just replace any non-ASCII characters in the isolabel
|
||||
## with '_', which means we won't need any udev escapes.
|
||||
isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel)
|
||||
|
||||
rootarg = "root=live:CDLABEL=%s" % isolabel
|
||||
%>
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
@ -35,43 +28,40 @@ treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
||||
mkdir ${BOOTDIR}
|
||||
## boot stuff for normal (CHRP/PREP) PPC systems
|
||||
install ${configdir}/bootinfo.txt ${BOOTDIR}
|
||||
install boot/efika.forth ${BOOTDIR}
|
||||
mkdir ${BOOTDIR}/chrp
|
||||
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp
|
||||
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot
|
||||
## special boot dir for PowerMacs
|
||||
mkdir ${MACDIR}
|
||||
install usr/lib/yaboot/yaboot ${MACDIR}
|
||||
install ${configdir}/ofboot.b ${MACDIR}
|
||||
|
||||
mkdir ${GRUBDIR}/powerpc-ieee1275
|
||||
runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \
|
||||
-o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
|
||||
install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
|
||||
install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
|
||||
|
||||
|
||||
install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg
|
||||
replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg
|
||||
replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg
|
||||
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg
|
||||
replace @EXTRA@ '${extra_boot_args}' ${GRUBDIR}/grub.cfg
|
||||
|
||||
## copy mapping and magic files needed for isos
|
||||
install ${configdir}/mapping ${BOOTDIR}
|
||||
install ${configdir}/magic ${BOOTDIR}
|
||||
|
||||
## NOTE: PPC is kind of funky. There's three possible "arch" setups here:
|
||||
## ppc, ppc64, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
|
||||
## ppc, ppc64, ppc64le and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
|
||||
|
||||
## Install kernel and bootloader config (in separate places for each arch)
|
||||
%for kernel in kernels:
|
||||
<%
|
||||
bits = 64 if kernel.arch == "ppc64" else 32
|
||||
bits = 64 if kernel.arch in ("ppc64", "ppc64le") else 32
|
||||
## separate dirs/images for each arch
|
||||
KERNELDIR=BOOTDIR+"/ppc%s" % bits
|
||||
NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
|
||||
bitsizes.add(bits)
|
||||
%>
|
||||
## install kernel
|
||||
mkdir ${KERNELDIR} ${NETBOOTDIR}
|
||||
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
|
||||
installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
||||
|
||||
## install arch-specific bootloader config
|
||||
install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf
|
||||
replace @BITS@ ${bits} ${KERNELDIR}/yaboot.conf
|
||||
replace @PRODUCT@ '${product.name}' ${KERNELDIR}/yaboot.conf
|
||||
replace @VERSION@ ${product.version} ${KERNELDIR}/yaboot.conf
|
||||
replace @ROOT@ "${rootarg}" ${KERNELDIR}/yaboot.conf
|
||||
|
||||
## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
|
||||
runcmd ${inroot}/${WRAPPER} -p of \
|
||||
-D ${inroot}/${WRAPPER_DATA} \
|
||||
@ -86,18 +76,14 @@ install ${configdir}/magic ${BOOTDIR}
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
## choose correct yaboot.conf
|
||||
mkdir etc
|
||||
%if len(bitsizes) == 2:
|
||||
## both kernels means hybrid - use the magic hybrid config
|
||||
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf
|
||||
replace @PRODUCT@ ${product.name} etc/yaboot.conf
|
||||
replace @VERSION@ ${product.version} etc/yaboot.conf
|
||||
replace @ROOT@ "${rootarg}" etc/yaboot.conf
|
||||
%else:
|
||||
## single arch - use the arch-specific yaboot.conf from above
|
||||
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
|
||||
%endif
|
||||
# Create optional product.img and updates.img
|
||||
<% imggraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
## make boot.iso
|
||||
runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
|
||||
@ -107,10 +93,10 @@ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
|
||||
-hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \
|
||||
-map ${inroot}/${configdir}/mapping \
|
||||
-no-desktop -allow-multidot -graft-points \
|
||||
etc=${outroot}/etc \
|
||||
${BOOTDIR}=${outroot}/${BOOTDIR} \
|
||||
${GRUBDIR}=${outroot}/${GRUBDIR} \
|
||||
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR}
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR} ${imggraft}
|
||||
|
||||
%for kernel in kernels:
|
||||
treeinfo images-${kernel.arch} boot.iso images/boot.iso
|
||||
|
@ -1,9 +1,10 @@
|
||||
<%page args="kernels, runtime_img, runtime_base, basearch, outroot"/>
|
||||
<%page args="kernels, runtime_img, runtime_base, basearch, outroot, extra_boot_args"/>
|
||||
<%
|
||||
configdir="tmp/config_files/s390"
|
||||
BOOTDIR="images"
|
||||
KERNELDIR=BOOTDIR
|
||||
INITRD_ADDRESS="0x02000000"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
# The assumption seems to be that there is only one s390 kernel, ever
|
||||
kernel = kernels[0]
|
||||
%>
|
||||
@ -15,10 +16,12 @@ treeinfo stage2 mainimage images/${runtime_base}
|
||||
## install bootloader (such as it is) and bootloader config
|
||||
install ${configdir}/redhat.exec ${BOOTDIR}
|
||||
install ${configdir}/generic.prm ${BOOTDIR}
|
||||
install ${configdir}/genericdvd.prm ${BOOTDIR}
|
||||
install ${configdir}/generic.ins .
|
||||
|
||||
## configure bootloader
|
||||
replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
|
||||
replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/generic.prm
|
||||
|
||||
## install kernel
|
||||
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
|
||||
@ -30,4 +33,15 @@ createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${B
|
||||
## s390 also has some special treeinfo data
|
||||
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
|
||||
treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm
|
||||
treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm
|
||||
treeinfo images-${basearch} generic.ins generic.ins
|
||||
treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
|
||||
|
||||
# Create optional product.img and updates.img
|
||||
<% imggraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
||||
%endif
|
||||
%endfor
|
||||
|
@ -1,4 +1,4 @@
|
||||
<%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/>
|
||||
<%page args="kernels, runtime_img, basearch, outroot, product, isolabel, extra_boot_args"/>
|
||||
<%
|
||||
configdir="tmp/config_files/x86"
|
||||
SYSLINUXDIR="usr/share/syslinux"
|
||||
@ -6,6 +6,7 @@ PXEBOOTDIR="images/pxeboot"
|
||||
BOOTDIR="isolinux"
|
||||
KERNELDIR=PXEBOOTDIR
|
||||
LIVEDIR="LiveOS"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
%>
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
@ -26,6 +27,7 @@ install boot/memtest* ${BOOTDIR}/memtest
|
||||
replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
|
||||
replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
|
||||
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
|
||||
replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/isolinux.cfg
|
||||
|
||||
## install kernels
|
||||
mkdir ${KERNELDIR}
|
||||
@ -47,11 +49,15 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
|
||||
%endif
|
||||
|
||||
## WHeeeeeeee, EFI.
|
||||
## We could remove the basearch restriction someday..
|
||||
<% efiargs=""; efigraft=""; efihybrid="" %>
|
||||
%if exists("boot/efi/EFI/fedora/gcdx64.efi") and basearch != 'i386':
|
||||
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
|
||||
%if exists("boot/efi/EFI/*/gcdia32.efi"):
|
||||
<% efiarch32 = 'IA32' %>
|
||||
%endif
|
||||
%if exists("boot/efi/EFI/*/gcdx64.efi"):
|
||||
<% efiarch64 = 'X64' %>
|
||||
%endif
|
||||
%if efiarch32 or efiarch64:
|
||||
<%
|
||||
efiarch = 'X64' if basearch=='x86_64' else 'IA32'
|
||||
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
|
||||
images = ["images/efiboot.img"]
|
||||
if domacboot:
|
||||
@ -61,9 +67,18 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
|
||||
efigraft += " {0}={1}/{0}".format(img,outroot)
|
||||
efihybrid = "--uefi --mac" if domacboot else "--uefi"
|
||||
%>
|
||||
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch, isolabel=isolabel"/>
|
||||
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, extra_boot_args=extra_boot_args"/>
|
||||
%endif
|
||||
|
||||
# Create optional product.img and updates.img
|
||||
<% imggraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
## make boot.iso
|
||||
runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||||
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
|
||||
@ -72,6 +87,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||||
${BOOTDIR}=${outroot}/${BOOTDIR} \
|
||||
${KERNELDIR}=${outroot}/${KERNELDIR} \
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR} \
|
||||
${efigraft}
|
||||
${efigraft} ${imggraft}
|
||||
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
|
||||
treeinfo images-${basearch} boot.iso images/boot.iso
|
||||
|
@ -2,24 +2,16 @@
|
||||
<%
|
||||
configdir="tmp/config_files/ppc"
|
||||
BOOTDIR="ppc"
|
||||
GRUBDIR="boot/grub"
|
||||
LIVEDIR="LiveOS"
|
||||
MACDIR=BOOTDIR+"/mac"
|
||||
NETBOOTDIR="images/netboot"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
|
||||
WRAPPER="usr/sbin/wrapper"
|
||||
WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
|
||||
|
||||
bitsizes = set()
|
||||
prepboot = ""
|
||||
|
||||
## NOTE: yaboot freaks out and stops parsing its config if it sees a '\',
|
||||
## so we can't use the udev escape sequences in the root arg.
|
||||
## Instead we'll just replace any non-ASCII characters in the isolabel
|
||||
## with '_', which means we won't need any udev escapes.
|
||||
isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel)
|
||||
|
||||
## Anaconda finds the CDROM device automatically
|
||||
rootarg = ""
|
||||
%>
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
@ -36,30 +28,33 @@ treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
||||
mkdir ${BOOTDIR}
|
||||
## boot stuff for normal (CHRP/PREP) PPC systems
|
||||
install ${configdir}/bootinfo.txt ${BOOTDIR}
|
||||
install boot/efika.forth ${BOOTDIR}
|
||||
mkdir ${BOOTDIR}/chrp
|
||||
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp
|
||||
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot
|
||||
## special boot dir for PowerMacs
|
||||
mkdir ${MACDIR}
|
||||
install usr/lib/yaboot/yaboot ${MACDIR}
|
||||
install ${configdir}/ofboot.b ${MACDIR}
|
||||
|
||||
mkdir ${GRUBDIR}/powerpc-ieee1275
|
||||
runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \
|
||||
-o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
|
||||
install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
|
||||
install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
|
||||
|
||||
|
||||
install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg
|
||||
replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg
|
||||
replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg
|
||||
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg
|
||||
|
||||
## copy mapping and magic files needed for isos
|
||||
install ${configdir}/mapping ${BOOTDIR}
|
||||
install ${configdir}/magic ${BOOTDIR}
|
||||
|
||||
## NOTE: PPC is kind of funky. There's three possible "arch" setups here:
|
||||
## ppc, ppc64, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
|
||||
## ppc, ppc64, ppc64le, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
|
||||
|
||||
## Install kernel and bootloader config (in separate places for each arch)
|
||||
%for kernel in kernels:
|
||||
<%
|
||||
bits = 64 if kernel.arch == "ppc64" else 32
|
||||
bits = 64 if kernel.arch in ("ppc64", "ppc64le") else 32
|
||||
## separate dirs/images for each arch
|
||||
KERNELDIR=BOOTDIR+"/ppc%s" % bits
|
||||
NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
|
||||
bitsizes.add(bits)
|
||||
%>
|
||||
## install kernel
|
||||
mkdir ${KERNELDIR} ${NETBOOTDIR}
|
||||
@ -71,13 +66,6 @@ install ${configdir}/magic ${BOOTDIR}
|
||||
installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
|
||||
%endif
|
||||
|
||||
## install arch-specific bootloader config
|
||||
install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf
|
||||
replace @BITS@ ${bits} ${KERNELDIR}/yaboot.conf
|
||||
replace @PRODUCT@ '${product.name}' ${KERNELDIR}/yaboot.conf
|
||||
replace @VERSION@ ${product.version} ${KERNELDIR}/yaboot.conf
|
||||
replace @ROOT@ "${rootarg}" ${KERNELDIR}/yaboot.conf
|
||||
|
||||
## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
|
||||
runcmd ${inroot}/${WRAPPER} -p of \
|
||||
-D ${inroot}/${WRAPPER_DATA} \
|
||||
@ -92,18 +80,21 @@ install ${configdir}/magic ${BOOTDIR}
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
## choose correct yaboot.conf
|
||||
mkdir etc
|
||||
%if len(bitsizes) == 2:
|
||||
## both kernels means hybrid - use the magic hybrid config
|
||||
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf
|
||||
replace @PRODUCT@ ${product.name} etc/yaboot.conf
|
||||
replace @VERSION@ ${product.version} etc/yaboot.conf
|
||||
replace @ROOT@ "${rootarg}" etc/yaboot.conf
|
||||
%else:
|
||||
## single arch - use the arch-specific yaboot.conf from above
|
||||
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
|
||||
%endif
|
||||
# Create optional product.img and updates.img
|
||||
<% imggraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
# Inherit iso-graft/ if it exists from external templates
|
||||
<%
|
||||
import os
|
||||
if os.path.exists(workdir + "/iso-graft"):
|
||||
imggraft += " " + workdir + "/iso-graft"
|
||||
%>
|
||||
|
||||
## make boot.iso
|
||||
runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
|
||||
@ -113,10 +104,11 @@ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
|
||||
-hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \
|
||||
-map ${inroot}/${configdir}/mapping \
|
||||
-no-desktop -allow-multidot -graft-points \
|
||||
etc=${outroot}/etc \
|
||||
${BOOTDIR}=${outroot}/${BOOTDIR} \
|
||||
${GRUBDIR}=${outroot}/${GRUBDIR} \
|
||||
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR}
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR} ${imggraft}
|
||||
|
||||
|
||||
%for kernel in kernels:
|
||||
treeinfo images-${kernel.arch} boot.iso images/boot.iso
|
||||
|
3
share/pxe-live/pxe-config.tmpl
Normal file
3
share/pxe-live/pxe-config.tmpl
Normal file
@ -0,0 +1,3 @@
|
||||
# PXE configuration template generated by livemedia-creator
|
||||
kernel <PXE_DIR>${kernel}
|
||||
append initrd=<PXE_DIR>${initrd} root=live:<URL>/${liveimg} ${addargs}
|
@ -10,22 +10,27 @@ remove usr/share/i18n
|
||||
removepkg perl*
|
||||
%endif
|
||||
## no sound support, thanks
|
||||
removepkg alsa* flac gstreamer-tools libsndfile pulseaudio* sound-theme-freedesktop
|
||||
## ...except alsa-libs, which are needed by spice-vdagent
|
||||
removepkg alsa-*firmware* flac gstreamer-tools libsndfile pulseaudio* sound-theme-freedesktop
|
||||
removepkg midisport-firmware
|
||||
## no fancy video, either
|
||||
removepkg libcrystalhd crystalhd-firmware ivtv-firmware cx18-firmware
|
||||
removepkg mesa-dri-drivers
|
||||
## we don't create new initramfs/bootloader conf inside anaconda
|
||||
## (that happens inside the target system after we install dracut/grubby)
|
||||
removepkg dracut-network grubby anaconda-dracut
|
||||
removefrom ${product.name}-logos /usr/share/plymouth/*
|
||||
## In order to execute the /usr move on upgrades we need convertfs from dracut
|
||||
## We also need dracut-shutdown.service and dracut-initramfs-restore to reboot
|
||||
removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.sh \
|
||||
/usr/lib/dracut/modules.d/99base/dracut-lib.sh \
|
||||
/usr/lib/systemd/* /usr/lib/dracut/dracut-initramfs-restore
|
||||
/usr/lib/systemd/* /usr/lib/dracut/modules.d/98systemd/*.service \
|
||||
/usr/lib/dracut/dracut-initramfs-restore
|
||||
## we don't run SELinux (not in enforcing, anyway)
|
||||
removepkg checkpolicy selinux-policy libselinux-utils
|
||||
|
||||
## selinux checks for the /etc/selinux/config file's existance
|
||||
## The removepkg above removes it, create an empty one. See rhbz#1243168
|
||||
append etc/selinux/config ""
|
||||
|
||||
## anaconda has its own repo files
|
||||
removefrom fedora-release --allbut /etc/os-release
|
||||
removepkg fedora-release-rawhide
|
||||
@ -39,8 +44,6 @@ removepkg gnupg2 pinentry
|
||||
removepkg cups-libs iscan-firmware
|
||||
## no storage device monitoring
|
||||
removepkg device-mapper-event dmraid-events sgpio
|
||||
## we don't (currently) support deltarpms in anaconda
|
||||
removepkg deltarpm
|
||||
## no notifications in anaconda
|
||||
removepkg notification-daemon
|
||||
## logrotate isn't useful in anaconda
|
||||
@ -48,13 +51,15 @@ removepkg logrotate
|
||||
remove /etc/logrotate.d
|
||||
## anaconda needs this to do media check
|
||||
removefrom isomd5sum --allbut /usr/bin/checkisomd5
|
||||
## remove ntp keep only config file
|
||||
removefrom ntp --allbut /etc/ntp.conf
|
||||
|
||||
## various other things we remove to save space
|
||||
removepkg avahi-autoipd coreutils-libs curl dash db4-utils diffutils file
|
||||
removepkg avahi-autoipd coreutils-libs dash db4-utils diffutils file
|
||||
removepkg genisoimage gnome-python2 info iptables
|
||||
removepkg jasper-libs libXt libXxf86misc
|
||||
removepkg libasyncns libdaemon libhbaapi libhbalinux
|
||||
removepkg libmcpp libpcap libtiff libutempter linux-atm-libs
|
||||
removepkg jasper-libs libXxf86misc
|
||||
removepkg libasyncns libhbaapi libhbalinux
|
||||
removepkg libmcpp libtiff libutempter linux-atm-libs
|
||||
removepkg lvm2-libs m4 mailx makebootfat mcpp
|
||||
removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth
|
||||
removepkg rmt rpcbind squashfs-tools system-config-firewall-base
|
||||
@ -62,7 +67,7 @@ removepkg tigervnc-license ttmkfdir xml-common xorg-x11-font-utils
|
||||
removepkg xorg-x11-server-common yum-utils
|
||||
|
||||
## other removals
|
||||
remove /boot /home /media /opt /srv /tmp/*
|
||||
remove /home /media /opt /srv /tmp/*
|
||||
remove /usr/etc /usr/games /usr/local /usr/tmp
|
||||
remove /usr/share/doc /usr/share/info /usr/share/man /usr/share/gnome
|
||||
remove /usr/share/mime/application /usr/share/mime/audio /usr/share/mime/image
|
||||
@ -77,22 +82,23 @@ remove /var/lib/rpm/* /var/lib/yum
|
||||
remove /usr/share/icons/*/icon-theme.cache
|
||||
|
||||
## clean up kernel modules
|
||||
<%
|
||||
removekmods = """
|
||||
sound drivers/media drivers/hwmon drivers/video drivers/char
|
||||
net/atm net/bluetooth net/sched net/sctp net/bridge
|
||||
net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6
|
||||
drivers/watchdog drivers/target drivers/rtc drivers/input/joystick
|
||||
drivers/bluetooth drivers/hid drivers/edac drivers/staging
|
||||
drivers/usb/serial drivers/usb/host drivers/usb/misc
|
||||
fs/ocfs2 fs/ceph fs/nfsd fs/ubifs fs/nilfs2
|
||||
arch/x86/kvm
|
||||
"""
|
||||
%>
|
||||
%for kmodpath in removekmods.split():
|
||||
remove lib/modules/*/kernel/${kmodpath}
|
||||
%endfor
|
||||
removekmod sound drivers/media drivers/hwmon \
|
||||
net/atm net/bluetooth net/sched net/sctp \
|
||||
net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6 \
|
||||
drivers/watchdog drivers/rtc drivers/input/joystick \
|
||||
drivers/bluetooth drivers/edac drivers/usb/serial \
|
||||
drivers/usb/host drivers/usb/misc fs/ocfs2 fs/ceph fs/nfsd \
|
||||
fs/ubifs fs/nilfs2 arch/x86/kvm
|
||||
## Need to keep virtio_console.ko and ipmi stuff in drivers/char
|
||||
## Also keep virtio-rng so that the installer can get sufficient randomness for
|
||||
## LUKS setup.
|
||||
removekmod drivers/char --allbut virtio_console hw_random \
|
||||
virtio-rng ipmi hmcdrv
|
||||
removekmod drivers/staging --allbut zram
|
||||
removekmod drivers/video --allbut hyperv_fb syscopyarea sysfillrect sysimgblt fb_sys_fops
|
||||
remove lib/modules/*/{build,source,*.map}
|
||||
## Need to keep hid-multitouch and i2c-hid in drivers/hid, rhbz#1526323
|
||||
removekmod drivers/hid --allbut hid-multitouch i2c-hid
|
||||
## NOTE: depmod gets re-run after cleanup finishes
|
||||
|
||||
## remove unused themes, theme engines, icons, etc.
|
||||
@ -112,7 +118,8 @@ removefrom metacity --allbut /usr/bin/* /usr/${libdir}/* /etc/*
|
||||
|
||||
## filesystem tools
|
||||
removefrom e2fsprogs /usr/share/locale/*
|
||||
removefrom xfsprogs /usr/share/locale/*
|
||||
removefrom xfsprogs /usr/share/locale/* /usr/share/doc/* /usr/share/man/*
|
||||
removefrom xfsdump --allbut /usr/sbin/*
|
||||
|
||||
## other package specific removals
|
||||
removefrom GConf2 /etc/rpm/* /etc/xdg/* /usr/bin/*
|
||||
@ -135,11 +142,11 @@ removefrom authconfig /usr/sbin/* /usr/share/*
|
||||
removefrom bash /etc/* /usr/bin/bashbug* /usr/share/*
|
||||
removefrom bind-libs-lite /usr/${libdir}/libirs*
|
||||
removefrom bind-libs-lite /usr/${libdir}/libisccfg-export*
|
||||
removefrom bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nsupdate
|
||||
removefrom bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nsupdate /usr/bin/delv
|
||||
removefrom bitmap-fangsongti-fonts /usr/share/fonts/*
|
||||
removefrom ca-certificates /etc/pki/java/*
|
||||
removefrom ca-certificates /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/*
|
||||
removefrom cairo /usr/${libdir}/libcairo-script*
|
||||
removefrom cairo /usr/${libdir}/libcairo-script* /usr/bin/cairo-sphinx
|
||||
removefrom coreutils /etc/* /usr/bin/link /usr/bin/nice /usr/bin/stty /usr/bin/su /usr/bin/unlink
|
||||
removefrom coreutils /usr/sbin/runuser /usr/bin/[ /usr/bin/base64 /usr/bin/chcon
|
||||
removefrom coreutils /usr/bin/cksum /usr/bin/comm /usr/bin/csplit
|
||||
@ -148,9 +155,9 @@ removefrom coreutils /usr/bin/expand /usr/bin/factor
|
||||
removefrom coreutils /usr/bin/fold /usr/bin/groups /usr/bin/hostid
|
||||
removefrom coreutils /usr/bin/install /usr/bin/join /usr/bin/logname
|
||||
removefrom coreutils /usr/bin/mkfifo /usr/bin/nl /usr/bin/nohup /usr/bin/nproc
|
||||
removefrom coreutils /usr/bin/od /usr/bin/paste /usr/bin/pathchk
|
||||
removefrom coreutils /usr/bin/pathchk
|
||||
removefrom coreutils /usr/bin/pinky /usr/bin/pr /usr/bin/printenv
|
||||
removefrom coreutils /usr/bin/printf /usr/bin/ptx /usr/bin/runcon /usr/bin/seq
|
||||
removefrom coreutils /usr/bin/printf /usr/bin/ptx /usr/bin/runcon
|
||||
removefrom coreutils /usr/bin/sha224sum /usr/bin/sha384sum
|
||||
removefrom coreutils /usr/bin/sha512sum /usr/bin/shuf /usr/bin/stat
|
||||
removefrom coreutils /usr/bin/stdbuf /usr/bin/sum /usr/bin/test
|
||||
@ -160,7 +167,6 @@ removefrom coreutils /usr/bin/who /usr/bin/whoami /usr/bin/yes /usr/share/*
|
||||
removefrom cpio /usr/share/*
|
||||
removefrom cracklib /usr/sbin/*
|
||||
removefrom cracklib-dicts /usr/${libdir}/* /usr/sbin/*
|
||||
removefrom createrepo /usr/bin/* /usr/share/*
|
||||
removefrom cryptsetup-luks /usr/share/*
|
||||
removefrom cyrus-sasl-lib /usr/sbin/*
|
||||
removefrom db4 /usr/*
|
||||
@ -192,12 +198,14 @@ removefrom glibc /lib/*/nosegneg/* /${libdir}/libBrokenLocale*
|
||||
removefrom glibc /${libdir}/libSegFault* /${libdir}/libanl*
|
||||
removefrom glibc /${libdir}/libcidn* /${libdir}/libnss_compat*
|
||||
removefrom glibc /${libdir}/libnss_hesiod* /${libdir}/libnss_nis*
|
||||
removefrom glibc /${libdir}/libthread* /${libdir}/rtkaio* /sbin/*
|
||||
# python-pyudev uses ctypes.util.find_library, which uses /sbin/ldconfig
|
||||
removefrom glibc /${libdir}/rtkaio* /sbin/sln
|
||||
removefrom glibc /usr/libexec/* /usr/sbin/*
|
||||
removefrom glibc-common /etc/* /usr/bin/catchsegv /usr/bin/gencat
|
||||
removefrom glibc-common /usr/bin/getconf /usr/bin/getent
|
||||
removefrom glibc-common /usr/bin/getent
|
||||
removefrom glibc-common /usr/bin/locale /usr/bin/rpcgen /usr/bin/sprof
|
||||
removefrom glibc-common /usr/bin/tzselect /usr/bin/localedef
|
||||
# NB: we keep /usr/bin/localedef so anaconda can inspect payload locale info
|
||||
removefrom glibc-common /usr/bin/tzselect
|
||||
removefrom glibc-common /usr/libexec/* /usr/sbin/*
|
||||
removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.*
|
||||
removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth*
|
||||
@ -208,13 +216,11 @@ removefrom gnome-keyring /usr/share/glib-2.0/* /usr/share/gnome-keyring*
|
||||
removefrom gnome-keyring /usr/share/locale/*
|
||||
removefrom gnome-python2-gconf /usr/share/pygtk/*
|
||||
removefrom gnutls /usr/share/locale/*
|
||||
removefrom gpgme /usr/${libdir}/libgpgme-*
|
||||
removefrom grep /etc/* /usr/share/locale/*
|
||||
removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/*
|
||||
removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/*
|
||||
removefrom gtk2 /usr/bin/update-gtk-immodules
|
||||
removefrom gtk3 /usr/${libdir}/gtk-3.0/*
|
||||
removefrom gtk3 /usr/${libdir}/libgailutil*
|
||||
removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew}
|
||||
removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
|
||||
removefrom hwdata /usr/share/hwdata/upgradelist
|
||||
@ -249,9 +255,8 @@ removefrom libvorbis /usr/${libdir}/libvorbisenc.*
|
||||
removefrom libxml2 /usr/bin/*
|
||||
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.a
|
||||
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.la
|
||||
removefrom lldpad /etc/* /usr/sbin/lldptool
|
||||
removefrom lldpad /etc/*
|
||||
removefrom lua /usr/bin/*
|
||||
removefrom lzo /usr/${libdir}/liblzo2.*
|
||||
removefrom madan-fonts /usr/share/fonts/madan/*
|
||||
removefrom mdadm /etc/*
|
||||
removefrom module-init-tools /etc/* /usr/sbin/insmod.static /usr/sbin/weak-modules
|
||||
@ -287,7 +292,6 @@ removefrom openssh-clients /usr/libexec/*
|
||||
removefrom openssh-server /etc/ssh/* /usr/libexec/*
|
||||
removefrom openssl /etc/pki/* /usr/bin/* /usr/${libdir}/openssl/*
|
||||
removefrom pam /usr/sbin/* /usr/share/locale/*
|
||||
removefrom pciutils /usr/sbin/*
|
||||
removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/*
|
||||
removefrom polkit /usr/bin/*
|
||||
removefrom polkit-desktop-policy /var/lib/*
|
||||
@ -304,7 +308,7 @@ removefrom python-ethtool /usr/sbin/*
|
||||
removefrom python-meh /usr/share/locale/*
|
||||
removefrom readline /usr/${libdir}/*
|
||||
removefrom libreport /usr/bin/* /usr/share/locale/*
|
||||
removefrom rpm /usr/bin/* /usr/lib/rpm/platform/* /usr/share/locale/*
|
||||
removefrom rpm /usr/share/locale/*
|
||||
removefrom rsync /etc/*
|
||||
removefrom sed /usr/share/locale/*
|
||||
removefrom smartmontools /etc/* /usr/sbin/smartd
|
||||
@ -320,11 +324,10 @@ removefrom util-linux --allbut \
|
||||
/usr/bin/{dmesg,getopt,kill,login,lsblk,more,mount,umount,mountpoint} \
|
||||
/etc/mtab /etc/pam.d/login /etc/pam.d/remote \
|
||||
/usr/sbin/{agetty,blkid,blockdev,clock,fdisk,fsck,fstrim,hwclock,losetup} \
|
||||
/usr/sbin/{mkswap,nologin,sfdisk,swapoff,swapon,wipefs} \
|
||||
/usr/bin/logger
|
||||
/usr/sbin/{mkswap,nologin,sfdisk,swapoff,swapon,wipefs,partx,fsfreeze} \
|
||||
/usr/bin/{logger,hexdump,flock,chmem,lsmem}
|
||||
removefrom volume_key-libs /usr/share/locale/*
|
||||
removefrom wget /etc/* /usr/share/locale/*
|
||||
removefrom xkeyboard-config /usr/share/locale/*
|
||||
removefrom xorg-x11-drv-intel /usr/${libdir}/libI*
|
||||
removefrom xorg-x11-drv-openchrome /usr/${libdir}/libchrome*
|
||||
removefrom xorg-x11-drv-synaptics /usr/bin/*
|
||||
@ -332,14 +335,27 @@ removefrom xorg-x11-drv-wacom /usr/bin/*
|
||||
removefrom xorg-x11-fonts-misc --allbut /usr/share/X11/fonts/misc/{6x13,encodings,fonts,*cursor}*
|
||||
removefrom xorg-x11-server-utils --allbut /usr/bin/xrandr /usr/share/X11/rgb.txt
|
||||
removefrom yum /etc/* /usr/share/locale/* /usr/share/yum-cli/*
|
||||
removefrom ${product.name}-logos /etc/*
|
||||
removefrom ${product.name}-logos /usr/share/icons/{Bluecurve,oxygen}/*
|
||||
removefrom ${product.name}-logos /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/*
|
||||
removefrom redhat-logos /etc/*
|
||||
removefrom redhat-logos /usr/share/icons/{Bluecurve,oxygen}/*
|
||||
removefrom redhat-logos /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/*
|
||||
removefrom redhat-logos /usr/share/{plymouth,backgrounds}*
|
||||
|
||||
## RHEL cleanups
|
||||
removefrom subscription-manager --allbut /etc/rhsm/* /usr/share/rhsm/* /var/log/rhsm/* \
|
||||
/etc/yum/pluginconf.d/product-id.conf /usr/lib/yum-plugins/product-id.py
|
||||
|
||||
## OSCAP cleanups
|
||||
removefrom scap-security-guide --allbut /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml
|
||||
|
||||
## cleanup_python_files()
|
||||
runcmd find ${root} -name "*.pyo" -type f -delete
|
||||
runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \;
|
||||
|
||||
## cleanup /boot/ leaving vmlinuz, and .*hmac files
|
||||
runcmd chroot ${root} find /boot \! -name "vmlinuz*" \
|
||||
-and \! -name ".vmlinuz*" \
|
||||
-and \! -name boot -delete
|
||||
|
||||
## remove any broken links in /etc or /usr
|
||||
## (broken systemd service links lead to confusing noise at boot)
|
||||
## NOTE: not checking /var because we want to keep /var/run
|
||||
|
@ -3,24 +3,26 @@
|
||||
|
||||
## anaconda package
|
||||
installpkg anaconda anaconda-widgets
|
||||
|
||||
## anaconda deps that aren't in the RPM
|
||||
installpkg tmux
|
||||
installpkg firstboot
|
||||
installpkg iscsi-initiator-utils
|
||||
## speed up compression on multicore systems
|
||||
installpkg pigz
|
||||
|
||||
## firstaidkit (rescue mode) packages
|
||||
installpkg firstaidkit-plugin-{passwd,key-recovery,mdadm-conf}
|
||||
## Other available payloads
|
||||
installpkg rpm-ostree
|
||||
|
||||
## kernel and firmware
|
||||
installpkg kernel
|
||||
%if basearch != "s390x":
|
||||
installpkg *-firmware
|
||||
installpkg b43-openfwwf
|
||||
%endif
|
||||
|
||||
## arch-specific packages (bootloaders etc.)
|
||||
%if basearch == "aarch64":
|
||||
installpkg efibootmgr grub2-efi-aa64-cdboot grubby shim-aa64
|
||||
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
|
||||
%endif
|
||||
%if basearch in ("arm", "armhfp"):
|
||||
installpkg kernel-lpae kernel-tegra
|
||||
installpkg uboot-tools
|
||||
@ -28,28 +30,37 @@ installpkg kernel
|
||||
%if basearch == "i386":
|
||||
installpkg kernel-PAE gpart
|
||||
%endif
|
||||
%if basearch == "x86_64":
|
||||
installpkg grub2-tools-efi
|
||||
installpkg shim-x64 grub2-efi-x64-cdboot
|
||||
%endif
|
||||
%if basearch in ("i386", "x86_64"):
|
||||
installpkg grub2 grub2-tools biosdevname memtest86+ syslinux
|
||||
installpkg efibootmgr grub2-efi shim shim-unsigned
|
||||
installpkg biosdevname memtest86+ syslinux
|
||||
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
|
||||
installpkg efibootmgr
|
||||
installpkg shim-ia32 grub2-efi-ia32-cdboot
|
||||
%endif
|
||||
%if basearch in ("ppc", "ppc64"):
|
||||
installpkg grub2 grub2-tools yaboot fbset hfsutils kernel-bootwrapper ppc64-utils
|
||||
%if basearch in ("ppc", "ppc64", "ppc64le"):
|
||||
installpkg fbset hfsutils kernel-bootwrapper ppc64-utils
|
||||
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
|
||||
installpkg grub2-${basearch}
|
||||
%endif
|
||||
|
||||
%if basearch == "s390x":
|
||||
installpkg lsscsi s390utils-base s390utils-cmsfs-fuse
|
||||
installpkg lsscsi s390utils-base s390utils-cmsfs-fuse s390utils-hmcdrvfs
|
||||
%endif
|
||||
|
||||
## yay, plymouth
|
||||
installpkg plymouth
|
||||
|
||||
## extra dracut modules
|
||||
installpkg anaconda-dracut dracut-network dracut-nohostonly dracut-norescue
|
||||
installpkg anaconda-dracut dracut-network dracut-config-generic dracut-fips
|
||||
|
||||
## fedup-dracut handles upgrades
|
||||
installpkg fedup-dracut fedup-dracut-plymouth
|
||||
## install other fedup scripts, if there are any. It's OK if there aren't.
|
||||
log "Looking for extra fedup-dracut packages..."
|
||||
-installpkg *-fedup-dracut
|
||||
## redhat-upgrade-dracut handles upgrades on RHEL
|
||||
installpkg redhat-upgrade-dracut redhat-upgrade-dracut-plymouth
|
||||
log "Looking for extra redhat-upgrade-dracut packages..."
|
||||
-installpkg *-redhat-upgrade-dracut
|
||||
installpkg redhat-release-eula
|
||||
|
||||
## rpcbind or portmap needed by dracut nfs module
|
||||
installpkg rpcbind
|
||||
@ -79,10 +90,11 @@ installpkg gnome-keyring
|
||||
installpkg python-imaging
|
||||
|
||||
## filesystem tools
|
||||
installpkg btrfs-progs jfsutils xfsprogs reiserfs-utils gfs2-utils ntfs-3g ntfsprogs
|
||||
installpkg btrfs-progs xfsprogs gfs2-utils
|
||||
installpkg python-volume_key volume_key
|
||||
installpkg system-storage-manager
|
||||
installpkg device-mapper-persistent-data
|
||||
installpkg xfsdump
|
||||
|
||||
## SELinux support
|
||||
installpkg selinux-policy-targeted audit libsemanage-python
|
||||
@ -94,14 +106,20 @@ installpkg tigervnc-server-minimal
|
||||
installpkg tigervnc-server-module
|
||||
%endif
|
||||
installpkg net-tools
|
||||
installpkg bridge-utils
|
||||
installpkg nmap-ncat
|
||||
|
||||
## ntp packages
|
||||
installpkg ntp
|
||||
|
||||
## hardware utilities/libraries
|
||||
installpkg pciutils usbutils
|
||||
installpkg pciutils usbutils ipmitool
|
||||
installpkg mt-st smartmontools
|
||||
%if basearch != "s390x":
|
||||
installpkg hdparm pcmciautils
|
||||
installpkg hdparm
|
||||
%endif
|
||||
installpkg libmlx4
|
||||
installpkg libmlx4 rdma
|
||||
installpkg rng-tools
|
||||
|
||||
## translations & language packs
|
||||
installpkg yum-langpacks
|
||||
@ -124,22 +142,27 @@ installpkg xorg-x11-fonts-misc
|
||||
installpkg gnome-themes-standard gnome-icon-theme-legacy
|
||||
|
||||
## branding & logos
|
||||
installpkg fedora-gnome-theme fedora-icon-theme
|
||||
installpkg gnome-themes-standard
|
||||
|
||||
## debugging/bug reporting tools
|
||||
installpkg gdb-gdbserver
|
||||
installpkg python-epdb
|
||||
installpkg libreport-plugin-bugzilla libreport-plugin-reportuploader
|
||||
installpkg fpaste
|
||||
|
||||
## extra tools not required by anaconda
|
||||
installpkg vim-minimal strace lsof dump xz less eject
|
||||
installpkg wget rsync rsh bind-utils ftp mtr vconfig
|
||||
installpkg icfg spice-vdagent
|
||||
installpkg gdisk
|
||||
installpkg wget rsync rsh bind-utils ftp mtr
|
||||
installpkg spice-vdagent
|
||||
installpkg gdisk hexedit sg3_utils
|
||||
|
||||
## yum plugins
|
||||
installpkg yum-plugin-fastestmirror yum-langpacks
|
||||
installpkg yum-langpacks
|
||||
|
||||
## RHEL packages
|
||||
installpkg subscription-manager
|
||||
|
||||
## addons
|
||||
installpkg kexec-tools-anaconda-addon
|
||||
installpkg oscap-anaconda-addon
|
||||
|
||||
## actually install all the requested packages
|
||||
run_pkg_transaction
|
||||
|
@ -26,6 +26,10 @@ symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
|
||||
mkdir etc/systemd/system/local-fs.target.wants/
|
||||
symlink /lib/systemd/system/tmp.mount etc/systemd/system/local-fs.target.wants/tmp.mount
|
||||
|
||||
## Start rngd
|
||||
mkdir etc/systemd/system/basic.target.wants/
|
||||
symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
|
||||
|
||||
## Disable unwanted systemd services
|
||||
systemctl disable systemd-readahead-collect.service \
|
||||
systemd-readahead-replay.service \
|
||||
@ -34,9 +38,17 @@ systemctl disable systemd-readahead-collect.service \
|
||||
lvm2-monitor.service
|
||||
## These services can't be disabled normally (they're linked into place in
|
||||
## /usr/lib/systemd rather than /etc/systemd), so we have to mask them.
|
||||
systemctl mask fedora-configure.service fedora-loadmodules.service \
|
||||
fedora-autorelabel.service fedora-autorelabel-mark.service \
|
||||
fedora-wait-storage.service media.mount
|
||||
systemctl mask rhel-configure.service rhel-loadmodules.service \
|
||||
rhel-autorelabel.service rhel-autorelabel-mark.service \
|
||||
rhel-wait-storage.service media.mount \
|
||||
systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer
|
||||
|
||||
## remove because it cannot be disabled
|
||||
remove usr/lib/systemd/system-generators/lvm2-activation-generator
|
||||
|
||||
## Make logind activate anaconda-shell@.service on switch to empty VT
|
||||
symlink anaconda-shell@.service lib/systemd/system/autovt@.service
|
||||
replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf
|
||||
|
||||
## Don't write the journal to the overlay, just keep it in RAM
|
||||
remove var/log/journal
|
||||
@ -50,9 +62,12 @@ install ${configdir}/bash_history root/.bash_history
|
||||
install ${configdir}/profile root/.profile
|
||||
install ${configdir}/libuser.conf etc
|
||||
install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf
|
||||
%if exists(root+"/etc/selinux/targeted"):
|
||||
install ${configdir}/selinux.config etc/selinux/config
|
||||
%endif
|
||||
install ${configdir}/spice-vdagentd etc/sysconfig
|
||||
mkdir etc/NetworkManager/conf.d
|
||||
install ${configdir}/90-anaconda-no-auto-default.conf etc/NetworkManager/conf.d
|
||||
install ${configdir}/91-anaconda-autoconnect-slaves.conf etc/NetworkManager/conf.d
|
||||
install ${configdir}/92-anaconda-loglevel-debug.conf etc/NetworkManager/conf.d
|
||||
install ${configdir}/vconsole.conf etc
|
||||
|
||||
## set up sshd
|
||||
install ${configdir}/sshd_config.anaconda etc/ssh
|
||||
@ -91,10 +106,6 @@ gconfset /apps/metacity/global_keybindings/switch_windows string disabled
|
||||
gconfset /desktop/gnome/interface/accessibility bool true
|
||||
gconfset /desktop/gnome/interface/at-spi-corba bool true
|
||||
|
||||
## Some settings are controlled by gsettings now.
|
||||
install ${configdir}/org.gnome.desktop.wm.keybindings.gschema.override usr/share/glib-2.0/schemas
|
||||
runcmd chroot ${root} glib-compile-schemas /usr/share/glib-2.0/schemas
|
||||
|
||||
move usr/libexec/anaconda/auditd sbin
|
||||
|
||||
## for compatibility with Ancient Anaconda Traditions
|
||||
@ -109,7 +120,13 @@ append etc/depmod.d/dd.conf "search updates built-in"
|
||||
append etc/multipath.conf "defaults {\n\tfind_multipaths yes\n\tuser_friendly_names yes\n}\n"
|
||||
|
||||
## make lvm auto-activate
|
||||
remove etc/lvm/*
|
||||
remove etc/lvm/archive/*
|
||||
remove etc/lvm/archive
|
||||
remove etc/lvm/backup/*
|
||||
remove etc/lvm/backup
|
||||
remove etc/lvm/cache/*
|
||||
remove etc/lvm/cache
|
||||
remove etc/lvm/lvm.conf
|
||||
append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n"
|
||||
|
||||
## TODO: we could run prelink here if we wanted?
|
||||
|
@ -4,6 +4,7 @@ configdir="tmp/config_files/s390"
|
||||
BOOTDIR="images"
|
||||
KERNELDIR=BOOTDIR
|
||||
INITRD_ADDRESS="0x02000000"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
# The assumption seems to be that there is only one s390 kernel, ever
|
||||
kernel = kernels[0]
|
||||
%>
|
||||
@ -15,6 +16,8 @@ treeinfo stage2 mainimage images/${runtime_base}
|
||||
## install bootloader (such as it is) and bootloader config
|
||||
install ${configdir}/redhat.exec ${BOOTDIR}
|
||||
install ${configdir}/generic.prm ${BOOTDIR}
|
||||
install ${configdir}/genericdvd.prm ${BOOTDIR}
|
||||
install ${configdir}/cdboot.prm ${BOOTDIR}
|
||||
install ${configdir}/generic.ins .
|
||||
|
||||
## configure bootloader
|
||||
@ -35,4 +38,36 @@ createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${B
|
||||
## s390 also has some special treeinfo data
|
||||
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
|
||||
treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm
|
||||
treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm
|
||||
treeinfo images-${basearch} generic.ins generic.ins
|
||||
treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
|
||||
|
||||
# Create optional product.img and updates.img in /images/
|
||||
<% imggraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
# Inherit iso-graft/ if it exists from external templates
|
||||
<%
|
||||
import os
|
||||
if os.path.exists(workdir + "/iso-graft"):
|
||||
imggraft += " " + workdir + "/iso-graft"
|
||||
%>
|
||||
|
||||
## Make a combined kernel+initrd image for the iso
|
||||
runcmd mk-s390-cdboot -i ${outroot}/${KERNELDIR}/kernel.img \
|
||||
-r ${outroot}/${KERNELDIR}/initrd.img \
|
||||
-p ${outroot}/${BOOTDIR}/cdboot.prm \
|
||||
-o ${outroot}/${BOOTDIR}/cdboot.img
|
||||
|
||||
## make boot.iso
|
||||
runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||||
-b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \
|
||||
-boot-load-size 4 -no-emul-boot \
|
||||
-R -J -V '${isolabel}' -T -graft-points \
|
||||
${BOOTDIR}=${outroot}/${BOOTDIR} \
|
||||
${imggraft}
|
||||
treeinfo images-${basearch} boot.iso images/boot.iso
|
||||
|
@ -6,6 +6,7 @@ PXEBOOTDIR="images/pxeboot"
|
||||
BOOTDIR="isolinux"
|
||||
KERNELDIR=PXEBOOTDIR
|
||||
LIVEDIR="LiveOS"
|
||||
LORAXDIR="usr/share/lorax/"
|
||||
%>
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
@ -61,11 +62,15 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
|
||||
%endif
|
||||
|
||||
## WHeeeeeeee, EFI.
|
||||
## We could remove the basearch restriction someday..
|
||||
<% efiargs=""; efigraft=""; efihybrid="" %>
|
||||
%if exists("boot/efi/EFI/*/gcdx64.efi") and basearch != 'i386':
|
||||
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
|
||||
%if exists("boot/efi/EFI/*/gcdia32.efi"):
|
||||
<% efiarch32 = 'IA32' %>
|
||||
%endif
|
||||
%if exists("boot/efi/EFI/*/gcdx64.efi"):
|
||||
<% efiarch64 = 'X64' %>
|
||||
%endif
|
||||
%if efiarch32 or efiarch64:
|
||||
<%
|
||||
efiarch = 'X64' if basearch=='x86_64' else 'IA32'
|
||||
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
|
||||
images = ["images/efiboot.img"]
|
||||
if domacboot:
|
||||
@ -75,9 +80,25 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
|
||||
efigraft += " {0}={1}/{0}".format(img,outroot)
|
||||
efihybrid = "--uefi --mac" if domacboot else "--uefi"
|
||||
%>
|
||||
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch, isolabel=isolabel"/>
|
||||
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
|
||||
%endif
|
||||
|
||||
# Create optional product.img and updates.img
|
||||
<% imggraft=""; images=["product", "updates"] %>
|
||||
%for img in images:
|
||||
%if exists("%s/%s/" % (LORAXDIR, img)):
|
||||
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
||||
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
||||
%endif
|
||||
%endfor
|
||||
|
||||
# Inherit iso-graft/ if it exists from external templates
|
||||
<%
|
||||
import os
|
||||
if os.path.exists(workdir + "/iso-graft"):
|
||||
imggraft += " " + workdir + "/iso-graft"
|
||||
%>
|
||||
|
||||
## make boot.iso
|
||||
runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||||
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
|
||||
@ -86,6 +107,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \
|
||||
${BOOTDIR}=${outroot}/${BOOTDIR} \
|
||||
${KERNELDIR}=${outroot}/${KERNELDIR} \
|
||||
${LIVEDIR}=${outroot}/${LIVEDIR} \
|
||||
${efigraft}
|
||||
${efigraft} ${imggraft}
|
||||
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
|
||||
treeinfo images-${basearch} boot.iso images/boot.iso
|
||||
|
142
src/bin/composer-cli
Executable file
142
src/bin/composer-cli
Executable file
@ -0,0 +1,142 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# composer-cli
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
from composer import vernum
|
||||
from composer.cli import main
|
||||
|
||||
VERSION = "{0}-{1}".format(os.path.basename(sys.argv[0]), vernum)
|
||||
|
||||
# Documentation for the commands
|
||||
epilog = """
|
||||
compose start <blueprint> <type> Start a compose using the selected blueprint and output type.
|
||||
types List the supported output types.
|
||||
status List the status of all running and finished composes.
|
||||
log <uuid> [<size>kB] Show the last 1kB of the compose log.
|
||||
cancel <uuid> Cancel a running compose and delete any intermediate results.
|
||||
delete <uuid,...> Delete the listed compose results.
|
||||
details <uuid> Show detailed information on the compose.
|
||||
metadata <uuid> Download the metadata use to create the compose to <uuid>-metadata.tar
|
||||
logs <uuid> Download the compose logs to <uuid>-logs.tar
|
||||
results <uuid> Download all of the compose results; metadata, logs, and image to <uuid>.tar
|
||||
image <uuid> Download the output image from the compose. Filename depends on the type.
|
||||
blueprints list List the names of the available blueprints.
|
||||
show <blueprint,...> Display the blueprint in TOML format.
|
||||
changes <blueprint,...> Display the changes for each blueprint.
|
||||
diff <blueprint-name> Display the differences between 2 versions of a blueprint.
|
||||
<from-commit> Commit hash or NEWEST
|
||||
<to-commit> Commit hash, NEWEST, or WORKSPACE
|
||||
save <blueprint,...> Save the blueprint to a file, <blueprint-name>.toml
|
||||
delete <blueprint> Delete a blueprint from the server
|
||||
depsolve <blueprint,...> Display the packages needed to install the blueprint.
|
||||
push <blueprint> Push a blueprint TOML file to the server.
|
||||
freeze <blueprint,...> Display the frozen blueprint's modules and packages.
|
||||
freeze show <blueprint,...> Display the frozen blueprint in TOML format.
|
||||
freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
|
||||
tag <blueprint> Tag the most recent blueprint commit as a release.
|
||||
undo <blueprint> <commit> Undo changes to a blueprint by reverting to the selected commit.
|
||||
workspace <blueprint> Push the blueprint TOML to the temporary workspace storage.
|
||||
modules list List the available modules.
|
||||
projects list List the available projects.
|
||||
info <project,...> Show details about the listed projects.
|
||||
sources list List the available sources
|
||||
sources info <source,...> Details about the source.
|
||||
sources add <source.toml> Add a package source to the server.
|
||||
sources change <source.toml> Change an existing source
|
||||
sources delete <source> Delete a package source.
|
||||
"""
|
||||
|
||||
def get_parser():
|
||||
""" Return the ArgumentParser for composer-cli"""
|
||||
|
||||
parser = argparse.ArgumentParser(description="Lorax Composer commandline tool",
|
||||
epilog=epilog,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
fromfile_prefix_chars="@")
|
||||
|
||||
parser.add_argument("-j", "--json", action="store_true", default=False,
|
||||
help="Output the raw JSON response instead of the normal output.")
|
||||
parser.add_argument("-s", "--socket", default="/run/weldr/api.socket", metavar="SOCKET",
|
||||
help="Path to the socket file to listen on")
|
||||
parser.add_argument("--log", dest="logfile", default="./composer-cli.log", metavar="LOG",
|
||||
help="Path to logfile (./composer-cli.log)")
|
||||
parser.add_argument("-a", "--api", dest="api_version", default="0", metavar="APIVER",
|
||||
help="API Version to use")
|
||||
parser.add_argument("--test", dest="testmode", default=0, type=int, metavar="TESTMODE",
|
||||
help="Pass test mode to compose. 1=Mock compose with fail. 2=Mock compose with finished.")
|
||||
parser.add_argument("-V", action="store_true", dest="showver",
|
||||
help="show program's version number and exit")
|
||||
|
||||
# Commands are implemented by parsing the remaining arguments outside of argparse
|
||||
parser.add_argument('args', nargs=argparse.REMAINDER)
|
||||
|
||||
|
||||
return parser
|
||||
|
||||
def setup_logging(logfile):
|
||||
# Setup logging to console and to logfile
|
||||
log.setLevel(logging.DEBUG)
|
||||
|
||||
sh = logging.StreamHandler()
|
||||
sh.setLevel(logging.INFO)
|
||||
fmt = logging.Formatter("%(asctime)s: %(message)s")
|
||||
sh.setFormatter(fmt)
|
||||
log.addHandler(sh)
|
||||
|
||||
fh = logging.FileHandler(filename=logfile)
|
||||
fh.setLevel(logging.DEBUG)
|
||||
fmt = logging.Formatter("%(asctime)s %(levelname)s %(name)s: %(message)s")
|
||||
fh.setFormatter(fmt)
|
||||
log.addHandler(fh)
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parse the arguments
|
||||
opts = get_parser().parse_args()
|
||||
|
||||
if opts.showver:
|
||||
print(VERSION)
|
||||
sys.exit(0)
|
||||
|
||||
logpath = os.path.abspath(os.path.dirname(opts.logfile))
|
||||
if not os.path.isdir(logpath):
|
||||
os.makedirs(logpath)
|
||||
setup_logging(opts.logfile)
|
||||
log.debug("opts=%s", opts)
|
||||
|
||||
errors = []
|
||||
|
||||
# Check to see if the socket exists and can be accessed
|
||||
if not os.path.exists(opts.socket):
|
||||
errors.append("%s does not exist" % opts.socket)
|
||||
elif not os.access(opts.socket, os.R_OK|os.W_OK):
|
||||
errors.append("This user cannot access %s" % opts.socket)
|
||||
|
||||
# No point in continuing if there are errors
|
||||
if errors:
|
||||
for e in errors:
|
||||
log.error(e)
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(main(opts))
|
197
src/bin/image-minimizer
Executable file
197
src/bin/image-minimizer
Executable file
@ -0,0 +1,197 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# image-minimizer: removes files and packages on the filesystem
|
||||
#
|
||||
# Copyright 2007-2010 Red Hat Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
import glob
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
import rpm
|
||||
|
||||
class ImageMinimizer:
|
||||
filename = ''
|
||||
dryrun = False
|
||||
verbose = False
|
||||
prefix = None
|
||||
drops = set()
|
||||
visited = set()
|
||||
drops_rpm = set()
|
||||
ts = None
|
||||
|
||||
def __init__(self, _filename, root, dryrun, verbose):
|
||||
self.filename = _filename
|
||||
self.prefix = root
|
||||
self.dryrun = dryrun
|
||||
self.verbose = verbose
|
||||
self.ts = None
|
||||
|
||||
# Recursively adds all files and directories.
|
||||
# This is done becuase globbing does not allow
|
||||
# ** for arbitrary nesting.
|
||||
def add_directory(self, files, dirname):
|
||||
self.visited.add(dirname)
|
||||
for root, dirs, items in os.walk(dirname):
|
||||
for _dir in dirs:
|
||||
self.visited.add(os.path.join(root, _dir))
|
||||
for name in items:
|
||||
files.add(os.path.join(root, name))
|
||||
|
||||
def add_pattern(self, files, pattern):
|
||||
globs = glob.glob(pattern)
|
||||
if self.verbose and len(globs) == 0:
|
||||
print "%s file not found" % pattern
|
||||
for g in globs:
|
||||
if os.path.isdir(g):
|
||||
self.add_directory(files, g)
|
||||
else:
|
||||
files.add(g)
|
||||
|
||||
def add_pattern_rpm(self, rpms, pattern):
|
||||
if self.ts is None:
|
||||
if self.prefix is None:
|
||||
raise Exception ('Must specify installation root for droprpm/keeprpm')
|
||||
self.ts = rpm.TransactionSet(self.prefix)
|
||||
mi = self.ts.dbMatch()
|
||||
mi.pattern('name', rpm.RPMMIRE_GLOB, pattern)
|
||||
not_found = True
|
||||
for hdr in mi:
|
||||
not_found = False
|
||||
rpms.add(hdr['name'])
|
||||
if self.verbose and not_found:
|
||||
print "%s package not found" % pattern
|
||||
|
||||
# Parses each line in the ifle
|
||||
def parse_line(self, line):
|
||||
command = ""
|
||||
pattern = ""
|
||||
tok = line.split(None,1)
|
||||
if len(tok) > 0:
|
||||
command = tok[0].lower()
|
||||
if len(tok) > 1:
|
||||
pattern = tok[1].strip()
|
||||
|
||||
# Strip out all the comments and blank lines
|
||||
if not (command.startswith('#') or command==''):
|
||||
if command == 'keep':
|
||||
if self.prefix is not None :
|
||||
pattern = pattern.lstrip('/')
|
||||
pattern = os.path.join(self.prefix, pattern)
|
||||
keeps = set()
|
||||
self.add_pattern(keeps, pattern)
|
||||
self.drops.difference_update(keeps)
|
||||
keeps = None
|
||||
elif command == 'drop':
|
||||
if self.prefix is not None :
|
||||
pattern = pattern.lstrip('/')
|
||||
pattern = os.path.join(self.prefix, pattern)
|
||||
self.add_pattern(self.drops, pattern)
|
||||
elif command == 'keeprpm':
|
||||
keeps_rpm = set()
|
||||
self.add_pattern_rpm(keeps_rpm, pattern)
|
||||
self.drops_rpm.difference_update(keeps_rpm)
|
||||
keeps_rpm = None
|
||||
elif command == 'droprpm':
|
||||
self.add_pattern_rpm(self.drops_rpm, pattern)
|
||||
else:
|
||||
raise Exception ('Unknown Command: ' + command)
|
||||
|
||||
def remove(self):
|
||||
for tag in sorted(self.drops, reverse=True):
|
||||
self.visited.add(os.path.split(tag)[0])
|
||||
if os.path.isdir(tag):
|
||||
self.visited.add(tag)
|
||||
else:
|
||||
if self.dryrun:
|
||||
print 'rm ' + tag
|
||||
else:
|
||||
if self.verbose:
|
||||
print 'rm ' + tag
|
||||
os.remove(tag)
|
||||
|
||||
#remove all empty directory. Every 8k counts!
|
||||
for _dir in sorted(self.visited, reverse=True):
|
||||
if len(os.listdir(_dir)) == 0:
|
||||
if self.dryrun:
|
||||
print 'rm -rf ' + _dir
|
||||
else:
|
||||
if self.verbose:
|
||||
print 'rm -rf ' + _dir
|
||||
os.rmdir(_dir)
|
||||
|
||||
def remove_rpm(self):
|
||||
|
||||
def runCallback(reason, amount, total, key, client_data):
|
||||
if self.verbose and reason == rpm.RPMCALLBACK_UNINST_STOP:
|
||||
print key, "erased"
|
||||
|
||||
if len(self.drops_rpm) == 0:
|
||||
return
|
||||
|
||||
for pkg in self.drops_rpm:
|
||||
if self.dryrun:
|
||||
print "erasing ", pkg
|
||||
else:
|
||||
self.ts.addErase(pkg)
|
||||
if not self.dryrun:
|
||||
# skip ts.check(), equivalent to --nodeps
|
||||
self.ts.run(runCallback, "erase")
|
||||
|
||||
def filter(self):
|
||||
for line in (open(self.filename).readlines()):
|
||||
self.parse_line(line.strip())
|
||||
self.remove()
|
||||
self.remove_rpm()
|
||||
|
||||
|
||||
def parse_options():
|
||||
usage = "usage: %prog [options] filename"
|
||||
parser = optparse.OptionParser(usage=usage)
|
||||
|
||||
parser.set_defaults(root=os.environ.get('INSTALL_ROOT', '/mnt/sysimage/'), dry_run=False)
|
||||
|
||||
parser.add_option("-i", "--installroot", type="string", dest="root",
|
||||
help="Root path to prepend to all file patterns and installation root for RPM "
|
||||
"operations. Defaults to INSTALL_ROOT or /mnt/sysimage/")
|
||||
|
||||
parser.add_option("--dryrun", action="store_true", dest="dryrun",
|
||||
help="If set, no filesystem changes are made.")
|
||||
|
||||
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
|
||||
help="Display every action as it is performed.")
|
||||
|
||||
(_options, _args) = parser.parse_args()
|
||||
if len(args) == 0:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
return (_options, _args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
(options, args) = parse_options()
|
||||
filename = args[0]
|
||||
minimizer = ImageMinimizer(filename, options.root, options.dryrun,
|
||||
options.verbose)
|
||||
minimizer.filter()
|
||||
except SystemExit, e:
|
||||
sys.exit(e.code)
|
||||
except KeyboardInterrupt, e:
|
||||
print >> sys.stderr, "Aborted at user request"
|
||||
except Exception, e:
|
||||
print e
|
||||
sys.exit(1)
|
113
src/bin/mk-s390-cdboot
Executable file
113
src/bin/mk-s390-cdboot
Executable file
@ -0,0 +1,113 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# mk-s390-cdboot
|
||||
#
|
||||
# Copyright (C) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
from struct import pack
|
||||
import sys
|
||||
|
||||
|
||||
INITRD_START = 0x0000000000800000
|
||||
START_PSW_ADDRESS = 0x80010000
|
||||
KERNEL_PSW_ADDRESS = 0x04
|
||||
KERNEL_INITRD_START = 0x10408
|
||||
KERNEL_INITRD_SIZE = 0x10410
|
||||
KERNEL_CMDLINE = 0x10480
|
||||
# See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/s390/include/uapi/asm/setup.h
|
||||
KERNEL_CMDLINE_SIZE = 896
|
||||
|
||||
|
||||
def setup_parser():
|
||||
""" Setup the cmdline parser"""
|
||||
parser = argparse.ArgumentParser(description="Create s390 boot image")
|
||||
parser.add_argument("-i", dest="kernel", required=True, metavar="KERNEL",
|
||||
help="The kernel.img file")
|
||||
parser.add_argument("-r", dest="ramdisk", required=True, metavar="RAMDISK",
|
||||
help="The initrd.img file")
|
||||
parser.add_argument("-p", dest="parmfile", required=True, metavar="PARMFILE",
|
||||
help="The parm file")
|
||||
parser.add_argument("-o", dest="outfile", required=True, metavar="OUTFILE",
|
||||
help="The output image file")
|
||||
return parser
|
||||
|
||||
|
||||
def copy_kernel(kernel, outfile):
|
||||
""" Copy the kernel to the outfile"""
|
||||
shutil.copy2(kernel, outfile)
|
||||
|
||||
|
||||
def append_ramdisk(ramdisk, outfile):
|
||||
""" Append the ramdisk to the kernel and return its size"""
|
||||
with open(ramdisk, "rb") as ram_fd:
|
||||
with open(outfile, "r+b") as out_fd:
|
||||
out_fd.seek(INITRD_START)
|
||||
out_fd.write(ram_fd.read())
|
||||
return os.stat(ramdisk).st_size
|
||||
|
||||
|
||||
def configure_kernel(outfile, parmfile, size):
|
||||
""" Configure the kernel with the ramdisk start address and size."""
|
||||
with open(outfile, "r+b") as out_fd:
|
||||
# Change the start PSW address
|
||||
out_fd.seek(KERNEL_PSW_ADDRESS)
|
||||
out_fd.write(pack(">L", START_PSW_ADDRESS))
|
||||
|
||||
# Write the initrd start and size
|
||||
out_fd.seek(KERNEL_INITRD_START)
|
||||
out_fd.write(pack(">Q", INITRD_START))
|
||||
out_fd.seek(KERNEL_INITRD_SIZE)
|
||||
out_fd.write(pack(">Q", size))
|
||||
|
||||
# Erase the previous COMMAND_LINE, write zeros
|
||||
out_fd.seek(KERNEL_CMDLINE)
|
||||
out_fd.write("\0" * KERNEL_CMDLINE_SIZE)
|
||||
|
||||
# Write the first line of the parmfile
|
||||
cmdline = open(parmfile, "r").readline().strip()
|
||||
out_fd.seek(KERNEL_CMDLINE)
|
||||
out_fd.write(cmdline)
|
||||
|
||||
|
||||
def main():
|
||||
parser = setup_parser()
|
||||
args = parser.parse_args()
|
||||
|
||||
errors = []
|
||||
for f in [args.kernel, args.ramdisk, args.parmfile]:
|
||||
if not os.path.exists(f):
|
||||
errors.append("ERROR: %s is missing" % f)
|
||||
if errors:
|
||||
map(print, errors)
|
||||
sys.exit(1)
|
||||
|
||||
print("Creating bootable CD-ROM image...")
|
||||
print("kernel is : %s" % args.kernel)
|
||||
print("ramdisk is : %s" % args.ramdisk)
|
||||
print("parmfile is: %s" % args.parmfile)
|
||||
print("outfile is : %s" % args.outfile)
|
||||
|
||||
copy_kernel(args.kernel, args.outfile)
|
||||
size = append_ramdisk(args.ramdisk, args.outfile)
|
||||
configure_kernel(args.outfile, args.parmfile, size)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
27
src/composer/__init__.py
Normal file
27
src/composer/__init__.py
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# composer-cli
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# get composer version
|
||||
try:
|
||||
import composer.version
|
||||
except ImportError:
|
||||
vernum = "devel"
|
||||
else:
|
||||
vernum = composer.version.num
|
57
src/composer/cli/__init__.py
Normal file
57
src/composer/cli/__init__.py
Normal file
@ -0,0 +1,57 @@
|
||||
#
|
||||
# composer-cli
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
from composer.cli.blueprints import blueprints_cmd
|
||||
from composer.cli.modules import modules_cmd
|
||||
from composer.cli.projects import projects_cmd
|
||||
from composer.cli.compose import compose_cmd
|
||||
from composer.cli.sources import sources_cmd
|
||||
|
||||
command_map = {
|
||||
"blueprints": blueprints_cmd,
|
||||
"modules": modules_cmd,
|
||||
"projects": projects_cmd,
|
||||
"compose": compose_cmd,
|
||||
"sources": sources_cmd
|
||||
}
|
||||
|
||||
|
||||
def main(opts):
|
||||
""" Main program execution
|
||||
|
||||
:param opts: Cmdline arguments
|
||||
:type opts: argparse.Namespace
|
||||
"""
|
||||
if len(opts.args) == 0:
|
||||
log.error("Missing command")
|
||||
return 1
|
||||
elif opts.args[0] not in command_map:
|
||||
log.error("Unknown command %s", opts.args[0])
|
||||
return 1
|
||||
if len(opts.args) == 1:
|
||||
log.error("Missing %s sub-command", opts.args[0])
|
||||
return 1
|
||||
else:
|
||||
try:
|
||||
return command_map[opts.args[0]](opts)
|
||||
except Exception as e:
|
||||
log.error(str(e))
|
||||
return 1
|
520
src/composer/cli/blueprints.py
Normal file
520
src/composer/cli/blueprints.py
Normal file
@ -0,0 +1,520 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
from composer import http_client as client
|
||||
from composer.cli.utilities import argify, frozen_toml_filename, toml_filename, handle_api_result
|
||||
from composer.cli.utilities import packageNEVRA
|
||||
|
||||
def blueprints_cmd(opts):
|
||||
"""Process blueprints commands
|
||||
|
||||
:param opts: Cmdline arguments
|
||||
:type opts: argparse.Namespace
|
||||
:returns: Value to return from sys.exit()
|
||||
:rtype: int
|
||||
|
||||
This dispatches the blueprints commands to a function
|
||||
"""
|
||||
cmd_map = {
|
||||
"list": blueprints_list,
|
||||
"show": blueprints_show,
|
||||
"changes": blueprints_changes,
|
||||
"diff": blueprints_diff,
|
||||
"save": blueprints_save,
|
||||
"delete": blueprints_delete,
|
||||
"depsolve": blueprints_depsolve,
|
||||
"push": blueprints_push,
|
||||
"freeze": blueprints_freeze,
|
||||
"tag": blueprints_tag,
|
||||
"undo": blueprints_undo,
|
||||
"workspace": blueprints_workspace
|
||||
}
|
||||
if opts.args[1] not in cmd_map:
|
||||
log.error("Unknown blueprints command: %s", opts.args[1])
|
||||
return 1
|
||||
|
||||
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json)
|
||||
|
||||
def blueprints_list(socket_path, api_version, args, show_json=False):
|
||||
"""Output the list of available blueprints
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints list
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/blueprints/list")
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
print("blueprints: " + ", ".join([r for r in result["blueprints"]]))
|
||||
|
||||
return 0
|
||||
|
||||
def blueprints_show(socket_path, api_version, args, show_json=False):
|
||||
"""Show the blueprints, in TOML format
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints show <blueprint,...> Display the blueprint in TOML format.
|
||||
|
||||
Multiple blueprints will be separated by \n\n
|
||||
"""
|
||||
for blueprint in argify(args):
|
||||
api_route = client.api_url(api_version, "/blueprints/info/%s?format=toml" % blueprint)
|
||||
print(client.get_url_raw(socket_path, api_route) + "\n\n")
|
||||
|
||||
return 0
|
||||
|
||||
def blueprints_changes(socket_path, api_version, args, show_json=False):
|
||||
"""Display the changes for each of the blueprints
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints changes <blueprint,...> Display the changes for each blueprint.
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/blueprints/changes/%s" % (",".join(argify(args))))
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
for blueprint in result["blueprints"]:
|
||||
print(blueprint["name"])
|
||||
for change in blueprint["changes"]:
|
||||
prettyCommitDetails(change)
|
||||
|
||||
return 0
|
||||
|
||||
def prettyCommitDetails(change, indent=4):
|
||||
"""Print the blueprint's change in a nice way
|
||||
|
||||
:param change: The individual blueprint change dict
|
||||
:type change: dict
|
||||
:param indent: Number of spaces to indent
|
||||
:type indent: int
|
||||
"""
|
||||
def revision():
|
||||
if change["revision"]:
|
||||
return " revision %d" % change["revision"]
|
||||
else:
|
||||
return ""
|
||||
|
||||
print " " * indent + change["timestamp"] + " " + change["commit"] + revision()
|
||||
print " " * indent + change["message"] + "\n"
|
||||
|
||||
def blueprints_diff(socket_path, api_version, args, show_json=False):
|
||||
"""Display the differences between 2 versions of a blueprint
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints diff <blueprint-name> Display the differences between 2 versions of a blueprint.
|
||||
<from-commit> Commit hash or NEWEST
|
||||
<to-commit> Commit hash, NEWEST, or WORKSPACE
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("blueprints diff is missing the blueprint name, from commit, and to commit")
|
||||
return 1
|
||||
elif len(args) == 1:
|
||||
log.error("blueprints diff is missing the from commit, and the to commit")
|
||||
return 1
|
||||
elif len(args) == 2:
|
||||
log.error("blueprints diff is missing the to commit")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/blueprints/diff/%s/%s/%s" % (args[0], args[1], args[2]))
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
for err in result.get("errors", []):
|
||||
log.error(err)
|
||||
|
||||
if result.get("errors", False):
|
||||
return 1
|
||||
|
||||
for diff in result["diff"]:
|
||||
print(prettyDiffEntry(diff))
|
||||
|
||||
return 0
|
||||
|
||||
def prettyDiffEntry(diff):
|
||||
"""Generate nice diff entry string.
|
||||
|
||||
:param diff: Difference entry dict
|
||||
:type diff: dict
|
||||
:returns: Nice string
|
||||
"""
|
||||
def change(diff):
|
||||
if diff["old"] and diff["new"]:
|
||||
return "Changed"
|
||||
elif diff["new"] and not diff["old"]:
|
||||
return "Added"
|
||||
elif diff["old"] and not diff["new"]:
|
||||
return "Removed"
|
||||
else:
|
||||
return "Unknown"
|
||||
|
||||
def name(diff):
|
||||
if diff["old"]:
|
||||
return diff["old"].keys()[0]
|
||||
elif diff["new"]:
|
||||
return diff["new"].keys()[0]
|
||||
else:
|
||||
return "Unknown"
|
||||
|
||||
def details(diff):
|
||||
if change(diff) == "Changed":
|
||||
if name(diff) == "Description":
|
||||
return '"%s" -> "%s"' % (diff["old"][name(diff)], diff["new"][name(diff)])
|
||||
elif name(diff) == "Version":
|
||||
return "%s -> %s" % (diff["old"][name(diff)], diff["new"][name(diff)])
|
||||
elif name(diff) in ["Module", "Package"]:
|
||||
return "%s %s -> %s" % (diff["old"][name(diff)]["name"], diff["old"][name(diff)]["version"],
|
||||
diff["new"][name(diff)]["version"])
|
||||
else:
|
||||
return "Unknown"
|
||||
elif change(diff) == "Added":
|
||||
if name(diff) in ["Module", "Package"]:
|
||||
return "%s %s" % (diff["new"][name(diff)]["name"], diff["new"][name(diff)]["version"])
|
||||
else:
|
||||
return " ".join([diff["new"][k] for k in diff["new"]])
|
||||
elif change(diff) == "Removed":
|
||||
if name(diff) in ["Module", "Package"]:
|
||||
return "%s %s" % (diff["old"][name(diff)]["name"], diff["old"][name(diff)]["version"])
|
||||
else:
|
||||
return " ".join([diff["old"][k] for k in diff["old"]])
|
||||
|
||||
return change(diff) + " " + name(diff) + " " + details(diff)
|
||||
|
||||
def blueprints_save(socket_path, api_version, args, show_json=False):
|
||||
"""Save the blueprint to a TOML file
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints save <blueprint,...> Save the blueprint to a file, <blueprint-name>.toml
|
||||
"""
|
||||
for blueprint in argify(args):
|
||||
api_route = client.api_url(api_version, "/blueprints/info/%s?format=toml" % blueprint)
|
||||
blueprint_toml = client.get_url_raw(socket_path, api_route)
|
||||
open(toml_filename(blueprint), "w").write(blueprint_toml)
|
||||
|
||||
return 0
|
||||
|
||||
def blueprints_delete(socket_path, api_version, args, show_json=False):
|
||||
"""Delete a blueprint from the server
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
delete <blueprint> Delete a blueprint from the server
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/blueprints/delete/%s" % args[0])
|
||||
result = client.delete_url_json(socket_path, api_route)
|
||||
|
||||
return handle_api_result(result, show_json)
|
||||
|
||||
def blueprints_depsolve(socket_path, api_version, args, show_json=False):
|
||||
"""Display the packages needed to install the blueprint
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints depsolve <blueprint,...> Display the packages needed to install the blueprint.
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/blueprints/depsolve/%s" % (",".join(argify(args))))
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
for blueprint in result["blueprints"]:
|
||||
if blueprint["blueprint"].get("version", ""):
|
||||
print("blueprint: %s v%s" % (blueprint["blueprint"]["name"], blueprint["blueprint"]["version"]))
|
||||
else:
|
||||
print("blueprint: %s" % (blueprint["blueprint"]["name"]))
|
||||
for dep in blueprint["dependencies"]:
|
||||
print(" " + packageNEVRA(dep))
|
||||
|
||||
return 0
|
||||
|
||||
def blueprints_push(socket_path, api_version, args, show_json=False):
|
||||
"""Push a blueprint TOML file to the server, updating the blueprint
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
push <blueprint> Push a blueprint TOML file to the server.
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/blueprints/new")
|
||||
rval = 0
|
||||
for blueprint in argify(args):
|
||||
if not os.path.exists(blueprint):
|
||||
log.error("Missing blueprint file: %s", blueprint)
|
||||
continue
|
||||
blueprint_toml = open(blueprint, "r").read()
|
||||
|
||||
result = client.post_url_toml(socket_path, api_route, blueprint_toml)
|
||||
if handle_api_result(result, show_json):
|
||||
rval = 1
|
||||
|
||||
return rval
|
||||
|
||||
def blueprints_freeze(socket_path, api_version, args, show_json=False):
|
||||
"""Handle the blueprints freeze commands
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints freeze <blueprint,...> Display the frozen blueprint's modules and packages.
|
||||
blueprints freeze show <blueprint,...> Display the frozen blueprint in TOML format.
|
||||
blueprints freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
|
||||
"""
|
||||
if args[0] == "show":
|
||||
return blueprints_freeze_show(socket_path, api_version, args[1:], show_json)
|
||||
elif args[0] == "save":
|
||||
return blueprints_freeze_save(socket_path, api_version, args[1:], show_json)
|
||||
|
||||
if len(args) == 0:
|
||||
log.error("freeze is missing the blueprint name")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/blueprints/freeze/%s" % (",".join(argify(args))))
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
else:
|
||||
for entry in result["blueprints"]:
|
||||
blueprint = entry["blueprint"]
|
||||
if blueprint.get("version", ""):
|
||||
print("blueprint: %s v%s" % (blueprint["name"], blueprint["version"]))
|
||||
else:
|
||||
print("blueprint: %s" % (blueprint["name"]))
|
||||
|
||||
for m in blueprint["modules"]:
|
||||
print(" %s-%s" % (m["name"], m["version"]))
|
||||
|
||||
for p in blueprint["packages"]:
|
||||
print(" %s-%s" % (p["name"], p["version"]))
|
||||
|
||||
# Print any errors
|
||||
for err in result.get("errors", []):
|
||||
log.error(err)
|
||||
|
||||
# Return a 1 if there are any errors
|
||||
if result.get("errors", []):
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def blueprints_freeze_show(socket_path, api_version, args, show_json=False):
|
||||
"""Show the frozen blueprint in TOML format
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints freeze show <blueprint,...> Display the frozen blueprint in TOML format.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("freeze show is missing the blueprint name")
|
||||
return 1
|
||||
|
||||
for blueprint in argify(args):
|
||||
api_route = client.api_url(api_version, "/blueprints/freeze/%s?format=toml" % blueprint)
|
||||
print(client.get_url_raw(socket_path, api_route))
|
||||
|
||||
return 0
|
||||
|
||||
def blueprints_freeze_save(socket_path, api_version, args, show_json=False):
|
||||
"""Save the frozen blueprint to a TOML file
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("freeze save is missing the blueprint name")
|
||||
return 1
|
||||
|
||||
for blueprint in argify(args):
|
||||
api_route = client.api_url(api_version, "/blueprints/freeze/%s?format=toml" % blueprint)
|
||||
blueprint_toml = client.get_url_raw(socket_path, api_route)
|
||||
open(frozen_toml_filename(blueprint), "w").write(blueprint_toml)
|
||||
|
||||
return 0
|
||||
|
||||
def blueprints_tag(socket_path, api_version, args, show_json=False):
|
||||
"""Tag the most recent blueprint commit as a release
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints tag <blueprint> Tag the most recent blueprint commit as a release.
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/blueprints/tag/%s" % args[0])
|
||||
result = client.post_url(socket_path, api_route, "")
|
||||
|
||||
return handle_api_result(result, show_json)
|
||||
|
||||
def blueprints_undo(socket_path, api_version, args, show_json=False):
|
||||
"""Undo changes to a blueprint
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints undo <blueprint> <commit> Undo changes to a blueprint by reverting to the selected commit.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("undo is missing the blueprint name and commit hash")
|
||||
return 1
|
||||
elif len(args) == 1:
|
||||
log.error("undo is missing commit hash")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/blueprints/undo/%s/%s" % (args[0], args[1]))
|
||||
result = client.post_url(socket_path, api_route, "")
|
||||
|
||||
return handle_api_result(result, show_json)
|
||||
|
||||
def blueprints_workspace(socket_path, api_version, args, show_json=False):
|
||||
"""Push the blueprint TOML to the temporary workspace storage
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
blueprints workspace <blueprint> Push the blueprint TOML to the temporary workspace storage.
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/blueprints/workspace")
|
||||
rval = 0
|
||||
for blueprint in argify(args):
|
||||
if not os.path.exists(blueprint):
|
||||
log.error("Missing blueprint file: %s", blueprint)
|
||||
continue
|
||||
blueprint_toml = open(blueprint, "r").read()
|
||||
|
||||
result = client.post_url_toml(socket_path, api_route, blueprint_toml)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
|
||||
for err in result.get("errors", []):
|
||||
log.error(err)
|
||||
|
||||
# Any errors results in returning a 1, but we continue with the rest first
|
||||
if not result.get("status", False):
|
||||
rval = 1
|
||||
|
||||
return rval
|
457
src/composer/cli/compose.py
Normal file
457
src/composer/cli/compose.py
Normal file
@ -0,0 +1,457 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
||||
from composer import http_client as client
|
||||
from composer.cli.utilities import argify, handle_api_result, packageNEVRA
|
||||
|
||||
def compose_cmd(opts):
|
||||
"""Process compose commands
|
||||
|
||||
:param opts: Cmdline arguments
|
||||
:type opts: argparse.Namespace
|
||||
:returns: Value to return from sys.exit()
|
||||
:rtype: int
|
||||
|
||||
This dispatches the compose commands to a function
|
||||
"""
|
||||
cmd_map = {
|
||||
"status": compose_status,
|
||||
"types": compose_types,
|
||||
"start": compose_start,
|
||||
"log": compose_log,
|
||||
"cancel": compose_cancel,
|
||||
"delete": compose_delete,
|
||||
"details": compose_details,
|
||||
"metadata": compose_metadata,
|
||||
"results": compose_results,
|
||||
"logs": compose_logs,
|
||||
"image": compose_image,
|
||||
}
|
||||
if opts.args[1] not in cmd_map:
|
||||
log.error("Unknown compose command: %s", opts.args[1])
|
||||
return 1
|
||||
|
||||
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json, opts.testmode)
|
||||
|
||||
def compose_status(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Return the status of all known composes
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
This doesn't map directly to an API command, it combines the results from queue, finished,
|
||||
and failed so raw JSON output is not available.
|
||||
"""
|
||||
def get_status(compose):
|
||||
return {"id": compose["id"],
|
||||
"blueprint": compose["blueprint"],
|
||||
"version": compose["version"],
|
||||
"compose_type": compose["compose_type"],
|
||||
"image_size": compose["image_size"],
|
||||
"status": compose["queue_status"]}
|
||||
|
||||
# Sort the status in a specific order
|
||||
def sort_status(a):
|
||||
order = ["RUNNING", "WAITING", "FINISHED", "FAILED"]
|
||||
return (order.index(a["status"]), a["blueprint"], a["version"], a["compose_type"])
|
||||
|
||||
status = []
|
||||
|
||||
# Get the composes currently in the queue
|
||||
api_route = client.api_url(api_version, "/compose/queue")
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
status.extend(map(get_status, result["run"] + result["new"]))
|
||||
|
||||
# Get the list of finished composes
|
||||
api_route = client.api_url(api_version, "/compose/finished")
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
status.extend(map(get_status, result["finished"]))
|
||||
|
||||
# Get the list of failed composes
|
||||
api_route = client.api_url(api_version, "/compose/failed")
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
status.extend(map(get_status, result["failed"]))
|
||||
|
||||
# Sort them by status (running, waiting, finished, failed) and then by name and version.
|
||||
status.sort(key=sort_status)
|
||||
|
||||
if show_json:
|
||||
print(json.dumps(status, indent=4))
|
||||
return 0
|
||||
|
||||
# Print them as UUID blueprint STATUS
|
||||
for c in status:
|
||||
if c["image_size"] > 0:
|
||||
image_size = str(c["image_size"])
|
||||
else:
|
||||
image_size = ""
|
||||
|
||||
print("%s %-8s %-15s %s %-16s %s" % (c["id"], c["status"], c["blueprint"], c["version"], c["compose_type"],
|
||||
image_size))
|
||||
|
||||
|
||||
def compose_types(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Return information about the supported compose types
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
Add additional details to types that are known to composer-cli. Raw JSON output does not
|
||||
include this extra information.
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/compose/types")
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
print("Compose Types: " + ", ".join([t["name"] for t in result["types"]]))
|
||||
|
||||
def compose_start(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Start a new compose using the selected blueprint and type
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: Set to 1 to simulate a failed compose, set to 2 to simulate a finished one.
|
||||
:type testmode: int
|
||||
|
||||
compose start <blueprint-name> <compose-type>
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("start is missing the blueprint name and output type")
|
||||
return 1
|
||||
if len(args) == 1:
|
||||
log.error("start is missing the output type")
|
||||
return 1
|
||||
|
||||
config = {
|
||||
"blueprint_name": args[0],
|
||||
"compose_type": args[1],
|
||||
"branch": "master"
|
||||
}
|
||||
if testmode:
|
||||
test_url = "?test=%d" % testmode
|
||||
else:
|
||||
test_url = ""
|
||||
api_route = client.api_url(api_version, "/compose" + test_url)
|
||||
result = client.post_url_json(socket_path, api_route, json.dumps(config))
|
||||
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
for err in result.get("errors", []):
|
||||
log.error(err)
|
||||
|
||||
if result["status"] == False or result.get("errors", False):
|
||||
return 1
|
||||
|
||||
print("Compose %s added to the queue" % result["build_id"])
|
||||
return 0
|
||||
|
||||
def compose_log(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Show the last part of the compose log
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose log <uuid> [<size>kB]
|
||||
|
||||
This will display the last 1kB of the compose's log file. Can be used to follow progress
|
||||
during the build.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("log is missing the compose build id")
|
||||
return 1
|
||||
if len(args) == 2:
|
||||
try:
|
||||
log_size = int(args[1])
|
||||
except ValueError:
|
||||
log.error("Log size must be an integer.")
|
||||
return 1
|
||||
else:
|
||||
log_size = 1024
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/log/%s?size=%d" % (args[0], log_size))
|
||||
try:
|
||||
result = client.get_url_raw(socket_path, api_route)
|
||||
except RuntimeError as e:
|
||||
print(str(e))
|
||||
return 1
|
||||
|
||||
print(result)
|
||||
return 0
|
||||
|
||||
def compose_cancel(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Cancel a running compose
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose cancel <uuid>
|
||||
|
||||
This will cancel a running compose. It does nothing if the compose has finished.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("cancel is missing the compose build id")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/cancel/%s" % args[0])
|
||||
result = client.delete_url_json(socket_path, api_route)
|
||||
return handle_api_result(result, show_json)
|
||||
|
||||
def compose_delete(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Delete a finished compose's results
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose delete <uuid,...>
|
||||
|
||||
Delete the listed compose results. It will only delete results for composes that have finished
|
||||
or failed, not a running compose.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("delete is missing the compose build id")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/delete/%s" % (",".join(argify(args))))
|
||||
result = client.delete_url_json(socket_path, api_route)
|
||||
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
# Print any errors
|
||||
for err in result.get("errors", []):
|
||||
log.error(err)
|
||||
|
||||
if result.get("errors", []):
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def compose_details(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Return detailed information about the compose
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose details <uuid>
|
||||
|
||||
This returns information about the compose, including the blueprint and the dependencies.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("details is missing the compose build id")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/info/%s" % args[0])
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
for err in result.get("errors", []):
|
||||
log.error(err)
|
||||
|
||||
if result.get("errors", []):
|
||||
return 1
|
||||
|
||||
if result["image_size"] > 0:
|
||||
image_size = str(result["image_size"])
|
||||
else:
|
||||
image_size = ""
|
||||
|
||||
|
||||
print("%s %-8s %-15s %s %-16s %s" % (result["id"],
|
||||
result["queue_status"],
|
||||
result["blueprint"]["name"],
|
||||
result["blueprint"]["version"],
|
||||
result["compose_type"],
|
||||
image_size))
|
||||
print("Packages:")
|
||||
for p in result["blueprint"]["packages"]:
|
||||
print(" %s-%s" % (p["name"], p["version"]))
|
||||
|
||||
print("Modules:")
|
||||
for m in result["blueprint"]["modules"]:
|
||||
print(" %s-%s" % (m["name"], m["version"]))
|
||||
|
||||
print("Dependencies:")
|
||||
for d in result["deps"]["packages"]:
|
||||
print(" " + packageNEVRA(d))
|
||||
|
||||
def compose_metadata(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Download a tar file of the compose's metadata
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose metadata <uuid>
|
||||
|
||||
Saves the metadata as uuid-metadata.tar
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("metadata is missing the compose build id")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/metadata/%s" % args[0])
|
||||
return client.download_file(socket_path, api_route)
|
||||
|
||||
def compose_results(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Download a tar file of the compose's results
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose results <uuid>
|
||||
|
||||
The results includes the metadata, output image, and logs.
|
||||
It is saved as uuid.tar
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("results is missing the compose build id")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/results/%s" % args[0])
|
||||
return client.download_file(socket_path, api_route, sys.stdout.isatty())
|
||||
|
||||
def compose_logs(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Download a tar of the compose's logs
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose logs <uuid>
|
||||
|
||||
Saves the logs as uuid-logs.tar
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("logs is missing the compose build id")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/logs/%s" % args[0])
|
||||
return client.download_file(socket_path, api_route, sys.stdout.isatty())
|
||||
|
||||
def compose_image(socket_path, api_version, args, show_json=False, testmode=0):
|
||||
"""Download the compose's output image
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
:param testmode: unused in this function
|
||||
:type testmode: int
|
||||
|
||||
compose image <uuid>
|
||||
|
||||
This downloads only the result image, saving it as the image name, which depends on the type
|
||||
of compose that was selected.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("logs is missing the compose build id")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/compose/image/%s" % args[0])
|
||||
return client.download_file(socket_path, api_route, sys.stdout.isatty())
|
44
src/composer/cli/modules.py
Normal file
44
src/composer/cli/modules.py
Normal file
@ -0,0 +1,44 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import json
|
||||
|
||||
from composer import http_client as client
|
||||
|
||||
def modules_cmd(opts):
|
||||
"""Process modules commands
|
||||
|
||||
:param opts: Cmdline arguments
|
||||
:type opts: argparse.Namespace
|
||||
:returns: Value to return from sys.exit()
|
||||
:rtype: int
|
||||
"""
|
||||
if opts.args[1] != "list":
|
||||
log.error("Unknown modules command: %s", opts.args[1])
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(opts.api_version, "/modules/list")
|
||||
result = client.get_url_json(opts.socket, api_route)
|
||||
if opts.json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
print("Modules:\n" + "\n".join([" "+r["name"] for r in result["modules"]]))
|
||||
|
||||
return 0
|
106
src/composer/cli/projects.py
Normal file
106
src/composer/cli/projects.py
Normal file
@ -0,0 +1,106 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import json
|
||||
import textwrap
|
||||
|
||||
from composer import http_client as client
|
||||
|
||||
def projects_cmd(opts):
|
||||
"""Process projects commands
|
||||
|
||||
:param opts: Cmdline arguments
|
||||
:type opts: argparse.Namespace
|
||||
:returns: Value to return from sys.exit()
|
||||
:rtype: int
|
||||
"""
|
||||
cmd_map = {
|
||||
"list": projects_list,
|
||||
"info": projects_info,
|
||||
}
|
||||
if opts.args[1] not in cmd_map:
|
||||
log.error("Unknown projects command: %s", opts.args[1])
|
||||
return 1
|
||||
|
||||
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json)
|
||||
|
||||
def projects_list(socket_path, api_version, args, show_json=False):
|
||||
"""Output the list of available projects
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
projects list
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/projects/list")
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
for proj in result["projects"]:
|
||||
for k in ["name", "summary", "homepage", "description"]:
|
||||
print("%s: %s" % (k.title(), textwrap.fill(proj[k], subsequent_indent=" " * (len(k)+2))))
|
||||
print("\n\n")
|
||||
|
||||
return 0
|
||||
|
||||
def projects_info(socket_path, api_version, args, show_json=False):
|
||||
"""Output info on a list of projects
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
projects info <project,...>
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("projects info is missing the packages")
|
||||
return 1
|
||||
|
||||
api_route = client.api_url(api_version, "/projects/info/%s" % ",".join(args))
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
for proj in result["projects"]:
|
||||
for k in ["name", "summary", "homepage", "description"]:
|
||||
print("%s: %s" % (k.title(), textwrap.fill(proj[k], subsequent_indent=" " * (len(k)+2))))
|
||||
print("Builds: ")
|
||||
for build in proj["builds"]:
|
||||
print(" %s%s-%s.%s at %s for %s" % ("" if not build["epoch"] else build["epoch"] + ":",
|
||||
build["source"]["version"],
|
||||
build["release"],
|
||||
build["arch"],
|
||||
build["build_time"],
|
||||
build["changelog"]))
|
||||
print("")
|
||||
return 0
|
143
src/composer/cli/sources.py
Normal file
143
src/composer/cli/sources.py
Normal file
@ -0,0 +1,143 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
from composer import http_client as client
|
||||
from composer.cli.utilities import argify, handle_api_result
|
||||
|
||||
def sources_cmd(opts):
|
||||
"""Process sources commands
|
||||
|
||||
:param opts: Cmdline arguments
|
||||
:type opts: argparse.Namespace
|
||||
:returns: Value to return from sys.exit()
|
||||
:rtype: int
|
||||
"""
|
||||
cmd_map = {
|
||||
"list": sources_list,
|
||||
"info": sources_info,
|
||||
"add": sources_add,
|
||||
"change": sources_add,
|
||||
"delete": sources_delete,
|
||||
}
|
||||
if opts.args[1] not in cmd_map:
|
||||
log.error("Unknown sources command: %s", opts.args[1])
|
||||
return 1
|
||||
|
||||
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json)
|
||||
|
||||
def sources_list(socket_path, api_version, args, show_json=False):
|
||||
"""Output the list of available sources
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
sources list
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/projects/source/list")
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
|
||||
print("Sources: %s" % ", ".join(result["sources"]))
|
||||
return 0
|
||||
|
||||
def sources_info(socket_path, api_version, args, show_json=False):
|
||||
"""Output info on a list of projects
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
sources info <source-name>
|
||||
"""
|
||||
if len(args) == 0:
|
||||
log.error("sources info is missing the name of the source")
|
||||
return 1
|
||||
|
||||
if show_json:
|
||||
api_route = client.api_url(api_version, "/projects/source/info/%s" % ",".join(args))
|
||||
result = client.get_url_json(socket_path, api_route)
|
||||
print(json.dumps(result, indent=4))
|
||||
return 0
|
||||
else:
|
||||
api_route = client.api_url(api_version, "/projects/source/info/%s?format=toml" % ",".join(args))
|
||||
result = client.get_url_raw(socket_path, api_route)
|
||||
print(result)
|
||||
return 0
|
||||
|
||||
def sources_add(socket_path, api_version, args, show_json=False):
|
||||
"""Add or change a source
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
sources add <source.toml>
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/projects/source/new")
|
||||
rval = 0
|
||||
for source in argify(args):
|
||||
if not os.path.exists(source):
|
||||
log.error("Missing source file: %s", source)
|
||||
continue
|
||||
source_toml = open(source, "r").read()
|
||||
|
||||
result = client.post_url_toml(socket_path, api_route, source_toml)
|
||||
if handle_api_result(result, show_json):
|
||||
rval = 1
|
||||
return rval
|
||||
|
||||
def sources_delete(socket_path, api_version, args, show_json=False):
|
||||
"""Delete a source
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param api_version: Version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param args: List of remaining arguments from the cmdline
|
||||
:type args: list of str
|
||||
:param show_json: Set to True to show the JSON output instead of the human readable output
|
||||
:type show_json: bool
|
||||
|
||||
sources delete <source-name>
|
||||
"""
|
||||
api_route = client.api_url(api_version, "/projects/source/delete/%s" % args[0])
|
||||
result = client.delete_url_json(socket_path, api_route)
|
||||
|
||||
return handle_api_result(result, show_json)
|
84
src/composer/cli/utilities.py
Normal file
84
src/composer/cli/utilities.py
Normal file
@ -0,0 +1,84 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import json
|
||||
|
||||
def argify(args):
|
||||
"""Take a list of human args and return a list with each item
|
||||
|
||||
:param args: list of strings with possible commas and spaces
|
||||
:type args: list of str
|
||||
:returns: List of all the items
|
||||
:rtype: list of str
|
||||
|
||||
Examples:
|
||||
|
||||
["one,two", "three", ",four", ",five,"] returns ["one", "two", "three", "four", "five"]
|
||||
"""
|
||||
return filter(lambda i: i, [arg for entry in args for arg in entry.split(",")])
|
||||
|
||||
def toml_filename(blueprint_name):
|
||||
"""Convert a blueprint name into a filename.toml
|
||||
|
||||
:param blueprint_name: The blueprint's name
|
||||
:type blueprint_name: str
|
||||
:returns: The blueprint name with ' ' converted to - and .toml appended
|
||||
:rtype: str
|
||||
"""
|
||||
return blueprint_name.replace(" ", "-") + ".toml"
|
||||
|
||||
def frozen_toml_filename(blueprint_name):
|
||||
"""Convert a blueprint name into a filename.toml
|
||||
|
||||
:param blueprint_name: The blueprint's name
|
||||
:type blueprint_name: str
|
||||
:returns: The blueprint name with ' ' converted to - and .toml appended
|
||||
:rtype: str
|
||||
"""
|
||||
return blueprint_name.replace(" ", "-") + ".frozen.toml"
|
||||
|
||||
def handle_api_result(result, show_json=False):
|
||||
"""Log any errors, return the correct value
|
||||
|
||||
:param result: JSON result from the http query
|
||||
:type result: dict
|
||||
"""
|
||||
if show_json:
|
||||
print(json.dumps(result, indent=4))
|
||||
|
||||
for err in result.get("errors", []):
|
||||
log.error(err)
|
||||
|
||||
if result["status"] == True:
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
|
||||
def packageNEVRA(pkg):
|
||||
"""Return the package info as a NEVRA
|
||||
|
||||
:param pkg: The package details
|
||||
:type pkg: dict
|
||||
:returns: name-[epoch:]version-release-arch
|
||||
:rtype: str
|
||||
"""
|
||||
if pkg["epoch"]:
|
||||
return "%s-%s:%s-%s.%s" % (pkg["name"], pkg["epoch"], pkg["version"], pkg["release"], pkg["arch"])
|
||||
else:
|
||||
return "%s-%s-%s.%s" % (pkg["name"], pkg["version"], pkg["release"], pkg["arch"])
|
201
src/composer/http_client.py
Normal file
201
src/composer/http_client.py
Normal file
@ -0,0 +1,201 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import logging
|
||||
log = logging.getLogger("composer-cli")
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
|
||||
from composer.unix_socket import UnixHTTPConnectionPool
|
||||
|
||||
def api_url(api_version, url):
|
||||
"""Return the versioned path to the API route
|
||||
|
||||
:param api_version: The version of the API to talk to. eg. "0"
|
||||
:type api_version: str
|
||||
:param url: The API route to talk to
|
||||
:type url: str
|
||||
:returns: The full url to use for the route and API version
|
||||
:rtype: str
|
||||
"""
|
||||
return os.path.normpath("/api/v%s/%s" % (api_version, url))
|
||||
|
||||
def get_url_raw(socket_path, url):
|
||||
"""Return the raw results of a GET request
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param url: URL to request
|
||||
:type url: str
|
||||
:returns: The raw response from the server
|
||||
:rtype: str
|
||||
"""
|
||||
http = UnixHTTPConnectionPool(socket_path)
|
||||
r = http.request("GET", url)
|
||||
if r.status == 400:
|
||||
err = json.loads(r.data.decode("utf-8"))
|
||||
if "status" in err and err["status"] == False:
|
||||
raise RuntimeError(", ".join(err["errors"]))
|
||||
|
||||
return r.data.decode('utf-8')
|
||||
|
||||
def get_url_json(socket_path, url):
|
||||
"""Return the JSON results of a GET request
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param url: URL to request
|
||||
:type url: str
|
||||
:returns: The json response from the server
|
||||
:rtype: dict
|
||||
"""
|
||||
http = UnixHTTPConnectionPool(socket_path)
|
||||
r = http.request("GET", url)
|
||||
return json.loads(r.data.decode('utf-8'))
|
||||
|
||||
def delete_url_json(socket_path, url):
|
||||
"""Send a DELETE request to the url and return JSON response
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param url: URL to send DELETE to
|
||||
:type url: str
|
||||
:returns: The json response from the server
|
||||
:rtype: dict
|
||||
"""
|
||||
http = UnixHTTPConnectionPool(socket_path)
|
||||
r = http.request("DELETE", url)
|
||||
return json.loads(r.data.decode("utf-8"))
|
||||
|
||||
def post_url(socket_path, url, body):
|
||||
"""POST raw data to the URL
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param url: URL to send POST to
|
||||
:type url: str
|
||||
:param body: The data for the body of the POST
|
||||
:type body: str
|
||||
:returns: The json response from the server
|
||||
:rtype: dict
|
||||
"""
|
||||
http = UnixHTTPConnectionPool(socket_path)
|
||||
r = http.request("POST", url,
|
||||
body=body.encode("utf-8"))
|
||||
return json.loads(r.data.decode("utf-8"))
|
||||
|
||||
def post_url_toml(socket_path, url, body):
|
||||
"""POST a TOML string to the URL
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param url: URL to send POST to
|
||||
:type url: str
|
||||
:param body: The data for the body of the POST
|
||||
:type body: str
|
||||
:returns: The json response from the server
|
||||
:rtype: dict
|
||||
"""
|
||||
http = UnixHTTPConnectionPool(socket_path)
|
||||
r = http.request("POST", url,
|
||||
body=body.encode("utf-8"),
|
||||
headers={"Content-Type": "text/x-toml"})
|
||||
return json.loads(r.data.decode("utf-8"))
|
||||
|
||||
def post_url_json(socket_path, url, body):
|
||||
"""POST some JSON data to the URL
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param url: URL to send POST to
|
||||
:type url: str
|
||||
:param body: The data for the body of the POST
|
||||
:type body: str
|
||||
:returns: The json response from the server
|
||||
:rtype: dict
|
||||
"""
|
||||
http = UnixHTTPConnectionPool(socket_path)
|
||||
r = http.request("POST", url,
|
||||
body=body.encode("utf-8"),
|
||||
headers={"Content-Type": "application/json"})
|
||||
return json.loads(r.data.decode("utf-8"))
|
||||
|
||||
def get_filename(headers):
|
||||
"""Get the filename from the response header
|
||||
|
||||
:param response: The urllib3 response object
|
||||
:type response: Response
|
||||
:raises: RuntimeError if it cannot find a filename in the header
|
||||
:returns: Filename from content-disposition header
|
||||
:rtype: str
|
||||
"""
|
||||
log.debug("Headers = %s", headers)
|
||||
if "content-disposition" not in headers:
|
||||
raise RuntimeError("No Content-Disposition header; cannot get filename")
|
||||
|
||||
try:
|
||||
k, _, v = headers["content-disposition"].split(";")[1].strip().partition("=")
|
||||
if k != "filename":
|
||||
raise RuntimeError("No filename= found in content-disposition header")
|
||||
except RuntimeError:
|
||||
raise
|
||||
except Exception as e:
|
||||
raise RuntimeError("Error parsing filename from content-disposition header: %s" % str(e))
|
||||
|
||||
return os.path.basename(v)
|
||||
|
||||
def download_file(socket_path, url, progress=True):
|
||||
"""Download a file, saving it to the CWD with the included filename
|
||||
|
||||
:param socket_path: Path to the Unix socket to use for API communication
|
||||
:type socket_path: str
|
||||
:param url: URL to send POST to
|
||||
:type url: str
|
||||
"""
|
||||
http = UnixHTTPConnectionPool(socket_path)
|
||||
r = http.request("GET", url, preload_content=False)
|
||||
if r.status == 400:
|
||||
err = json.loads(r.data.decode("utf-8"))
|
||||
if not err["status"]:
|
||||
raise RuntimeError(", ".join(err["errors"]))
|
||||
|
||||
filename = get_filename(r.headers)
|
||||
if os.path.exists(filename):
|
||||
msg = "%s exists, skipping download" % filename
|
||||
log.error(msg)
|
||||
raise RuntimeError(msg)
|
||||
|
||||
with open(filename, "wb") as f:
|
||||
while True:
|
||||
data = r.read(10 * 1024**2)
|
||||
if not data:
|
||||
break
|
||||
f.write(data)
|
||||
|
||||
if progress:
|
||||
data_written = f.tell()
|
||||
if data_written > 5 * 1024**2:
|
||||
sys.stdout.write("%s: %0.2f MB \r" % (filename, data_written / 1024**2))
|
||||
else:
|
||||
sys.stdout.write("%s: %0.2f kB\r" % (filename, data_written / 1024))
|
||||
sys.stdout.flush()
|
||||
|
||||
print("")
|
||||
r.release_conn()
|
||||
|
||||
return 0
|
61
src/composer/unix_socket.py
Normal file
61
src/composer/unix_socket.py
Normal file
@ -0,0 +1,61 @@
|
||||
#
|
||||
# Copyright (C) 2018 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import httplib
|
||||
import socket
|
||||
import urllib3
|
||||
|
||||
|
||||
# These 2 classes were adapted and simplified for use with just urllib3.
|
||||
# Originally from https://github.com/msabramo/requests-unixsocket/blob/master/requests_unixsocket/adapters.py
|
||||
|
||||
# The following was adapted from some code from docker-py
|
||||
# https://github.com/docker/docker-py/blob/master/docker/transport/unixconn.py
|
||||
class UnixHTTPConnection(httplib.HTTPConnection, object):
|
||||
|
||||
def __init__(self, socket_path, timeout=60):
|
||||
"""Create an HTTP connection to a unix domain socket
|
||||
|
||||
:param socket_path: The path to the Unix domain socket
|
||||
:param timeout: Number of seconds to timeout the connection
|
||||
"""
|
||||
super(UnixHTTPConnection, self).__init__('localhost', timeout=timeout)
|
||||
self.socket_path = socket_path
|
||||
self.sock = None
|
||||
|
||||
def __del__(self): # base class does not have d'tor
|
||||
if self.sock:
|
||||
self.sock.close()
|
||||
|
||||
def connect(self):
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sock.settimeout(self.timeout)
|
||||
sock.connect(self.socket_path)
|
||||
self.sock = sock
|
||||
|
||||
class UnixHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
|
||||
|
||||
def __init__(self, socket_path, timeout=60):
|
||||
"""Create a connection pool using a Unix domain socket
|
||||
|
||||
:param socket_path: The path to the Unix domain socket
|
||||
:param timeout: Number of seconds to timeout the connection
|
||||
"""
|
||||
super(UnixHTTPConnectionPool, self).__init__('localhost', timeout=timeout)
|
||||
self.socket_path = socket_path
|
||||
|
||||
def _new_conn(self):
|
||||
return UnixHTTPConnection(self.socket_path, self.timeout)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user