Skip to content

Commit 324e4c6

Browse files
committed
Merge remote-tracking branch 'origin/development'
2 parents eb73a30 + d926b20 commit 324e4c6

File tree

108 files changed

+6351
-1758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+6351
-1758
lines changed

.circleci/config.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
jobs:
2+
build_centos7:
3+
docker:
4+
- image: centos:7
5+
6+
working_directory: ~/warewulf3
7+
8+
steps:
9+
- checkout
10+
- run:
11+
name: Install Build Dependencies
12+
command: |
13+
set -o xtrace
14+
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
15+
rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*
16+
yum -y --exclude=systemtap --exclude=subversion install @development binutils-aarch64-linux-gnu device-mapper-devel gcc-aarch64-linux-gnu libacl-devel libattr-devel libuuid-devel openssl-devel perl-CGI perl-Compress-Raw-Bzip2 perl-Compress-Raw-Zlib perl-DBD-MySQL perl-DBI perl-Digest perl-Digest-MD5 perl-IO-Compress perl-Net-Daemon perl-PlRPC perl-Sys-Syslog perl-Test-Simple xz-devel
17+
- run:
18+
name: Build Common
19+
command: |
20+
set -o xtrace
21+
set -o nounset
22+
cd common
23+
./autogen.sh
24+
make test
25+
make dist-gzip
26+
rpmbuild -D "_sourcedir $PWD" -ba ./warewulf-common.spec
27+
- run:
28+
name: Install warewulf-common
29+
command: |
30+
set -o xtrace
31+
set -o nounset
32+
GITVERSION=$(git show -s --pretty=format:%h)
33+
DIST=$(rpm --eval '%{dist}')
34+
yum -y install ~/rpmbuild/RPMS/noarch/warewulf-common-3.8-0.${GITVERSION}${DIST}.noarch.rpm
35+
- run:
36+
name: Build Cluster
37+
command: |
38+
set -o xtrace
39+
set -o nounset
40+
cd cluster
41+
./autogen.sh
42+
make dist-gzip
43+
rpmbuild -D "_sourcedir $PWD" -ba ./warewulf-cluster.spec
44+
- run:
45+
name: Build IPMI
46+
command: |
47+
set -o xtrace
48+
set -o nounset
49+
cd ipmi
50+
./autogen.sh
51+
make dist-gzip
52+
rpmbuild -D "_sourcedir $PWD" -ba ./warewulf-ipmi.spec
53+
- run:
54+
name: Build Provision
55+
command: |
56+
set -o xtrace
57+
set -o nounset
58+
cd provision
59+
./autogen.sh
60+
make dist-gzip
61+
rpmbuild -D "_sourcedir $PWD" -D "cross_compile 1" -D "mflags -j$(/usr/bin/getconf _NPROCESSORS_ONLN)" -ba ./warewulf-provision.spec
62+
- run:
63+
name: Build VNFS
64+
command: |
65+
set -o xtrace
66+
set -o nounset
67+
cd vnfs
68+
./autogen.sh
69+
make dist-gzip
70+
rpmbuild -D "_sourcedir $PWD" -ba ./warewulf-vnfs.spec
71+
72+
- store_artifacts:
73+
path: ~/rpmbuild/RPMS
74+
destination: RPMS
75+
- store_artifacts:
76+
path: ~/rpmbuild/SRPMS
77+
destination: SRPMS
78+
79+
workflows:
80+
version: 2
81+
build:
82+
jobs:
83+
- build_centos7

cluster/README.node

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ CONFIGURATION VARIABLES (wwfirstboot.conf):
138138
FILESYSTEMS declaration for use during bootstrap:
139139

140140
PART_1="2048:swap"
141-
PART_2="fill:ext3:/tmp:1777"
141+
PART_2="fill:ext4:/tmp:1777"
142142

143143
The layout of the variable values is:
144144

@@ -189,7 +189,7 @@ DISK=hdb
189189
# seen. If you want to use up the rest of the disk, then
190190
# define it as the last partiton
191191
PART_1="2048:swap"
192-
PART_2="114280:ext3:/scratch:1777"
192+
PART_2="114280:ext4:/scratch:1777"
193193
PART_3="fill:ext4:/storage:0755"
194194
#
195195
# 99-michost

cluster/bin/cluster-env

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fi
1717
if [ ! -f "$HOME/.ssh/config" -a ! -f "$HOME/.ssh/cluster" ]; then
1818
echo "Configuring SSH for cluster access"
1919
install -d -m 700 $HOME/.ssh
20-
ssh-keygen -t dsa -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" > /dev/null 2>&1
20+
ssh-keygen -t rsa -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" > /dev/null 2>&1
2121
cat $HOME/.ssh/cluster.pub >> $HOME/.ssh/authorized_keys
2222
chmod 0600 $HOME/.ssh/authorized_keys
2323

cluster/configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AC_PREREQ(2.59)
2-
AC_INIT(warewulf-cluster, 3.7, [email protected])
2+
AC_INIT(warewulf-cluster, 3.8, [email protected])
33
AC_CONFIG_SRCDIR([.])
44

55
AC_PROG_INSTALL

cluster/libexec/wwinit/20-ipxe.init

-27
This file was deleted.

cluster/libexec/wwinit/50-ssh_keys.init

+14-15
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fi
3232
wwprint "Checking ssh keys for root"
3333
if ! wwtest test -f "$HOME/.ssh/cluster"; then
3434
wwprint "Generating ssh keypairs for local cluster access:\n"
35-
if ! wwrun ssh-keygen -t dsa -f $HOME/.ssh/cluster -N ''; then
35+
if ! wwrun ssh-keygen -t rsa -f $HOME/.ssh/cluster -N ''; then
3636
exit 255
3737
fi
3838
wwprint "Updating authorized keys"
@@ -46,8 +46,8 @@ wwprint "Checking root's ssh config"
4646
if ! wwtest test -f "$HOME/.ssh/config"; then
4747
wwprint "Creating ssh configuration for root"
4848
echo "Host *" >> $HOME/.ssh/config
49-
echo " IdentityFile ~/.ssh/identity" >> $HOME/.ssh/config
5049
echo " IdentityFile ~/.ssh/id_rsa" >> $HOME/.ssh/config
50+
echo " IdentityFile ~/.ssh/id_ed25519" >> $HOME/.ssh/config
5151
echo " IdentityFile ~/.ssh/id_dsa" >> $HOME/.ssh/config
5252
echo " IdentityFile ~/.ssh/cluster" >> $HOME/.ssh/config
5353
echo " StrictHostKeyChecking=no" >> $HOME/.ssh/config
@@ -57,19 +57,6 @@ if ! wwtest test -f "$HOME/.ssh/config"; then
5757
fi
5858

5959

60-
wwprint "Checking for default RSA1 host key for nodes"
61-
if ! wwtest test -f "$WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh/ssh_host_key"; then
62-
install -d -m 700 $WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh
63-
wwprint "Creating default node ssh_host_key:\n"
64-
if ! ssh-keygen -q -t rsa1 -f $WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh/ssh_host_key -C '' -N '' 2>/dev/null; then
65-
wwprint "RSA1 key is not supported on your system" yellow
66-
reply_warn
67-
else
68-
reply_ok
69-
fi
70-
RETVAL=0
71-
fi
72-
7360
wwprint "Checking for default RSA host key for nodes"
7461
if ! wwtest test -f "$WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh/ssh_host_rsa_key"; then
7562
install -d -m 700 $WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh
@@ -103,5 +90,17 @@ if ! wwtest test -f "$WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh/ssh_host_ecdsa_key";
10390
RETVAL=0
10491
fi
10592

93+
wwprint "Checking for default Ed25519 host key for nodes"
94+
if ! wwtest test -f "$WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh/ssh_host_ed25519_key"; then
95+
install -d -m 700 $WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh
96+
wwprint "Creating default node ssh_host_ed25519_key:\n"
97+
if ! ssh-keygen -q -t ed25519 -f $WAREWULF_SYSCONFDIR/warewulf/vnfs/ssh/ssh_host_ed25519_key -C '' -N '' 2>/dev/null; then
98+
wwprint "Ed25519 key is not supported on your system" yellow
99+
reply_warn
100+
else
101+
reply_ok
102+
fi
103+
RETVAL=0
104+
fi
106105

107106
exit $RETVAL

cluster/libexec/wwinit/50-tftp.init

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121
wwreqroot
2222

2323
if wwpackage_check tftp-server tftpd tftpd-hpa; then
24-
if wwservice_activate tftpd tftp tftpd-hpa; then
24+
if wwservice_activate tftp.socket tftpd tftp tftpd-hpa; then
2525
exit 0
2626
fi
2727
fi

cluster/libexec/wwinit/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
wwinitdir = $(libexecdir)/warewulf/wwinit
22

3-
dist_wwinit_SCRIPTS = 20-ipxe.init 30-domain.init 40-authfiles.init 50-dhcp.init 50-nfsd.init 50-ntpd.init 50-ssh_keys.init 50-tftp.init 60-hostfile.init 90-bootstrap.init 91-vnfs.init
3+
dist_wwinit_SCRIPTS = 30-domain.init 40-authfiles.init 50-dhcp.init 50-nfsd.init 50-ntpd.init 50-ssh_keys.init 50-tftp.init 60-hostfile.init 90-bootstrap.init 91-vnfs.init
44

55
MAINTAINERCLEANFILES = Makefile.in
66

common/bin/wwconfig

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl -Tw
22
#
33
# Copyright (c) 2001-2003 Gregory M. Kurtzer
4-
#
4+
#
55
# Copyright (c) 2003-2011, The Regents of the University of California,
66
# through Lawrence Berkeley National Laboratory (subject to receipt of any
77
# required approvals from the U.S. Dept. of Energy). All rights reserved.
@@ -62,6 +62,11 @@ if ($opt_help) {
6262
exit;
6363
}
6464

65+
# Use of -e/--exp implies -s/--sh:
66+
if ($opt_exp) {
67+
$opt_sh = 1;
68+
}
69+
6570
foreach my $key (@VARS) {
6671
my $val;
6772

common/configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AC_PREREQ(2.59)
2-
AC_INIT(warewulf-common, 3.7, [email protected])
2+
AC_INIT(warewulf-common, 3.8, [email protected])
33
AC_CONFIG_SRCDIR([.])
44

55
AC_PROG_INSTALL

common/etc/functions

+44-23
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ reply_error() {
102102
}
103103

104104
wwprint() {
105-
MSG=$1
105+
MSG="$1"
106106
COLOR=$GRAY
107-
COMMAND=`basename $0 | sed -e 's/^[0-9]*-\?//' | sed -e 's/\.init$//'`
107+
COMMAND=`basename -- $0 | sed -e 's/^[0-9]*-\?//' | sed -e 's/\.init$//'`
108108

109109
case $2 in
110110
white|WHITE) COLOR=$WHITE ;;
@@ -117,6 +117,26 @@ wwprint() {
117117
echo -ne "$WHITE$COMMAND$NORMAL:\\033[14G $COLOR$MSG$NORMAL"
118118
}
119119

120+
wwprintf() {
121+
FMT="$1"
122+
shift
123+
124+
COLOR=$GRAY
125+
COMMAND=`basename -- $0 | sed -e 's/^[0-9]*-\?//' | sed -e 's/\.init$//'`
126+
127+
case $1 in
128+
white|WHITE) COLOR=$WHITE; shift ;;
129+
gray|GRAY|grey|GREY) COLOR=$GRAY; shift ;;
130+
red|RED|error) COLOR=$RED; shift ;;
131+
yellow|YELLOW|warn) COLOR=$YELLOW; shift ;;
132+
blue|BLUE) COLOR=$BLUE; shift ;;
133+
esac
134+
135+
echo -ne "$WHITE$COMMAND$NORMAL:\\033[14G $COLOR"
136+
printf "$FMT" "$@"
137+
echo -ne "$NORMAL"
138+
}
139+
120140
wwaction() {
121141
TMPFILE=`mktemp`
122142
"$@" >$TMPFILE 2>&1
@@ -127,7 +147,7 @@ wwaction() {
127147
reply_error
128148
wwprint "+ $*\n" RED
129149
cat $TMPFILE | while read i; do
130-
wwprint "$i\n" YELLOW
150+
wwprintf "%s\n" YELLOW "$i"
131151
done
132152
fi
133153
rm -f $TMPFILE
@@ -155,7 +175,7 @@ wwrun() {
155175
else
156176
reply_error
157177
cat $TMPFILE | while read i; do
158-
wwprint "$i\n" YELLOW
178+
wwprintf "%s\n" YELLOW "$i"
159179
done
160180
fi
161181
rm -f $TMPFILE
@@ -212,16 +232,19 @@ wwpackage_check() {
212232
# that have different service names for the same service (e.g. ntp and
213233
# ntpd).
214234
wwservice_activate() {
215-
if test -x "/bin/initctl" || test -x "/usr/sbin/update-rc.d" ; then
216-
# We need to add entries for initctl and update-rc.d below! HELP!
217-
wwprint "You will need to manually enable and (re)start: $@\n" warn
218-
fi
219235
for SERVICE in "$@"; do
220-
if [ -e "/etc/xinetd.d/$SERVICE" ]; then
221-
wwprint "Activating xinetd service: $1\n"
222-
wwrun sed -ie 's@\(disable\s*=\s*\)\S*@\1no@' /etc/xinetd.d/$SERVICE
223-
wwservice_activate xinetd
224-
return 0
236+
if [ -x "/bin/systemctl" ]; then
237+
if ! echo $SERVICE | egrep -q '\.service$|\.socket$'; then
238+
SERVICE="${SERVICE}.service"
239+
fi
240+
if systemctl list-unit-files --type=service,socket | egrep -q "^$SERVICE"; then
241+
wwprint "Activating Systemd unit: $1\n"
242+
if wwrun /bin/systemctl -q enable $SERVICE; then
243+
if wwrun /bin/systemctl -q restart $SERVICE; then
244+
return 0
245+
fi
246+
fi
247+
fi
225248
elif [ -x "/etc/rc.d/init.d/$SERVICE" ]; then
226249
wwprint "Activating system service: $1\n"
227250
if [ -x "/sbin/chkconfig" ]; then
@@ -235,13 +258,11 @@ wwservice_activate() {
235258
if wwrun /etc/init.d/$SERVICE restart; then
236259
return 0
237260
fi
238-
elif test -x "/bin/systemctl" && systemctl list-unit-files --type=service | egrep -q "^$SERVICE.service"; then
239-
wwprint "Activating Systemd service: $1\n"
240-
if wwrun /bin/systemctl -q enable $SERVICE.service; then
241-
if wwrun /bin/systemctl -q restart $SERVICE.service; then
242-
return 0
243-
fi
244-
fi
261+
elif [ -e "/etc/xinetd.d/$SERVICE" ]; then
262+
wwprint "Activating xinetd service: $1\n"
263+
wwrun sed -ie 's@\(disable\s*=\s*\)\S*@\1no@' /etc/xinetd.d/$SERVICE
264+
wwservice_activate xinetd
265+
return 0
245266
fi
246267
done
247268

@@ -251,17 +272,17 @@ wwservice_activate() {
251272

252273

253274
service_findname() {
254-
wwprint "service_findname() has been depricated" warn
275+
wwprint "service_findname() has been deprecated" warn
255276
return 0
256277
}
257278

258279
service_enable() {
259-
wwprint "service_enable() has been depricated" warn
280+
wwprint "service_enable() has been deprecated" warn
260281
return 0
261282
}
262283

263284
service_restart() {
264-
wwprint "service_restart() has been depricated" warn
285+
wwprint "service_restart() has been deprecated" warn
265286
return 0
266287
}
267288

0 commit comments

Comments
 (0)