1
0
mirror of synced 2026-02-20 13:55:16 +00:00

Compare commits

..

127 Commits

Author SHA1 Message Date
Axel Beckert
a39f24e754 Release as 4.9.1 and upload to Debian unstable as 4.9.1-1 2021-10-24 05:39:12 +02:00
Axel Beckert
8a623b30ba Also create an .orig.tar.xz signature upon "make release" 2021-10-24 05:36:26 +02:00
Axel Beckert
5730250725 Declare compliance with Debian Policy 4.6.0
No other changes were needed.
2021-10-24 05:24:56 +02:00
Axel Beckert
ac04bed0f2 This seems closer to the original semantics 2021-10-24 05:09:08 +02:00
Axel Beckert
cf693d9e64 Travis CI: stop testing again Perl "dev"
It no more seems to exist.
2021-10-24 02:26:05 +02:00
Axel Beckert
fc7c09596a Make test xt/gitignore.t work with git releases ≥ 2.32.0 2021-10-24 02:23:47 +02:00
Axel Beckert
7ebb0f41a4 Fix missing "|" in regex in Debian's 20-setup-apt
Closes: #997668
2021-10-24 02:23:35 +02:00
Axel Beckert
00527f64b2 Release as 4.9 and upload to Debian Unstable as 4.9-1 2020-12-29 12:23:16 +01:00
Axel Beckert
83c37b476a Start all Debian releases since Stretch (9) with pygrub by default 2020-12-29 12:05:39 +01:00
Axel Beckert
af6ceacc4c Fix typo in current changelog entry 2020-12-28 05:08:18 +01:00
Axel Beckert
6cdd1eb63f Add debian/changelog and NEWS.md entry for GL MR !1 2020-12-28 02:22:37 +01:00
Wolfgang Karall
97dd8fafc8 Use 'defaults' and not the IO-bottleneck of the decade 'sync' in the options for the root filesystem. 2020-12-28 02:19:20 +01:00
Axel Beckert
58899daffe Add debian/changelog and NEWS.md entry for GH #57 2020-12-27 17:13:41 +01:00
Axel Beckert
239f1e4c88 Merge branch 'cli-fix' of https://github.com/frootmig/xen-tools 2020-12-27 17:09:24 +01:00
Axel Beckert
1a27e59df7 This will become a feature release, too: Update version and NEWS.md 2020-12-27 17:02:04 +01:00
Axel Beckert
b7486d427c Add debian/changelog entry for GH #58 and reformat its comments a bit 2020-12-27 16:58:06 +01:00
Axel Beckert
6aeb8d9d11 Merge branch 'netplan-p2p-support' of https://github.com/frootmig/xen-tools 2020-12-27 16:40:55 +01:00
Axel Beckert
f5dc8cbf37 Add debian/changelog entry for GH #62 2020-12-27 15:56:23 +01:00
Axel Beckert
4aa9428e3b Merge branch 'arm64-debian' of https://github.com/ianmclinden/xen-tools 2020-12-27 15:50:56 +01:00
Axel Beckert
a58cc83c80 Adapt distributions.conf defaults to Ubuntu keyrings of 2018
As of now, Debian's ubuntu-keyring package hasn't been updated for
more than two years. See https://bugs.debian.org/978438
2020-12-27 15:22:03 +01:00
Axel Beckert
965839812c Bump recommended debootstrap version to 1.0.117 2020-12-27 14:34:13 +01:00
Axel Beckert
a9593dabf0 Update list of supported distributions in README and debian/control 2020-12-21 00:35:56 +01:00
Axel Beckert
ea95b1ef03 t/hook-apt.t: Special case for Perl 5.10
File::Copy in Perl 5.10 does not copy permissions, so let's fix it
there and check for it elsewhere.

This reverts the two commits 06b3faa1bf
and 68c20b4e4e which did not help to fix
this issue as the initially suspected noexec mount wasn't really
there. Hopefully this finally resolves the test failures with Perl
5.10 in the new t/hook-apt.t.
2020-12-20 22:40:57 +01:00
Axel Beckert
68c20b4e4e Travis CI: Make sure shell scripts in .travis.yml also work with bash, not just dash and zsh 2020-12-20 20:48:17 +01:00
Axel Beckert
06b3faa1bf Travis CI before_install: Make sure we can execute scripts in /tmp/
Those build failures with Perl 5.10 seem to neither be related to
xen-tools nor to Perl but to how the git repo is unpacked on Travis CI
as executable bits are either missing or /tmp/ is mounted with
"noexec".

So add some code to before_install to 1) output some debug information
on that issue and 2) abort early if executing scripts in /tmp/ fails.
2020-12-20 19:54:11 +01:00
Axel Beckert
0da2ed1365 Fix test suite failures in a Sid chroot
Problem was that the commented variant only was a new, $dist-security
one, but is also written if the security repo is disabled with other
distributions than sid/unstable.
2020-12-20 08:47:31 +01:00
Axel Beckert
285d2c80b9 Use regexp to check for $dist/updates vs $dist-security
If the security repo will be  enabled or not currently depends on the
host's sources.list. So the resulting files differ depending on the
host where the test is run. Add a TODO item to break with that
"feature".

Also mention in the TODO list that a repo on archive.debian.org should
be used instead security.debian.org if the release is EoL. Currently
the security mirror is hardcoded into the hook.
2020-12-20 08:33:47 +01:00
Axel Beckert
ed497ab39c Some 5.0 TODOs around the security APT repo 2020-12-20 08:13:56 +01:00
Axel Beckert
85c0583819 Add test for $dist/updates vs $dist-security
Uses Test::File::Contents, add it to .travis.yml and the according
package as build-dependency in debian/control.
2020-12-20 06:44:12 +01:00
Axel Beckert
c0cb19eefc Add debian/changelog entry for previous commit 2020-12-19 08:25:42 +01:00
Axel Beckert
67603c2d74 Merge pull request #40 from blbradley/grub-silent-failure-fix
fix update-grub chroot silent failure

While it probably would be nicer to mount it at the beginning and umount it at the end, we have too many hooks already doing this and changing this seems a bigger task.
2020-12-19 08:21:05 +01:00
Axel Beckert
a816cc81ae Declare compliance with Debian Policy 4.5.1
No other changes were required.
2020-12-19 08:13:20 +01:00
Axel Beckert
01d7628770 Bump debhelper compatibility level to 13
Build-depend on "debhelper-compat (= 13)" to replace debian/compat.
2020-12-19 08:08:53 +01:00
Axel Beckert
1150835a89 Bump debian/watch version from 3 to 4
Thanks Lintian!
2020-12-19 08:07:11 +01:00
Axel Beckert
17025182eb Bump version in Makefile and all scripts 2020-12-19 08:06:48 +01:00
Axel Beckert
e7b2f1a3e7 Add debian/changelog entry for previous commit 2020-12-19 07:54:18 +01:00
Andreas Sundstrom
fe4a18edef Fix support for lvm_thin
Closes: #942244
2020-12-19 07:52:31 +01:00
Axel Beckert
eab2940bf6 Reimplement $dist/updates vs $dist-security more backwards-compatible
This reverts most code, but not the implemented functionality of
commit 2fba5cb90e.

Requiring a config file change to still be able to install old
distributions would make a bump of the major version necessary
according to Semantic Versioning. Let's avoid that:

The list of distributions with the old path scheme is finite and will
never change again. Hence it's ok and especially backwards compatible
to hardcode this list in hooks/debian/20-setup-apt.

It's also less and more obvious (but not necessarily easier to read)
code. But it's all in one place and not scattered over three files.
And it's just one line instead like a dozen or two dozens.

Closes: #972749 (kinda again)
2020-12-19 07:38:37 +01:00
Axel Beckert
e8897649b7 Fix mostly trailing whitespace in generated sources.list 2020-12-19 06:49:29 +01:00
Axel Beckert
2fba5cb90e Debian DomUs: Distinguish between $dist/updates and $dist-security
From Debian 11 Bullseye onwards, debian uses $dist-security instead of
$dist/updates as distribution part in /etc/apt/sources.list.

Mark those distributions with the old-style subdirectory path with
"security-subdir" in distributions.conf.

Thanks to Paul Wise for the bug report (and hence reminding me of
this) and for the suggestions on how to implement this (even if I
didn't follow them for the sake of simplicity and no additional
dependencies).

Closes: #972749
2020-12-19 06:49:29 +01:00
Axel Beckert
19399ecc70 Add preliminary support for Debian 13 Trixie 2020-11-15 00:33:10 +01:00
Axel Beckert
6f291cebe7 Full code name of Ubuntu 21.04 is now known 2020-10-30 19:40:21 +01:00
Axel Beckert
54d93cf3ed Travis CI: Use https://travis-perl.github.io/init 2020-10-23 18:47:55 +02:00
Axel Beckert
b40759e8d8 Travis CI: Test more Perl versions
Enable fast finish and allow "bleed" to fail.
2020-10-23 14:44:13 +02:00
Axel Beckert
f5e7a2d441 Fix no-tabs.t failing on Travis CI: Replace all_perl_files_ok() 2020-10-23 14:42:24 +02:00
Axel Beckert
79650b9d70 Add preliminary support for Ubuntu 21.04 Hirsute H… 2020-10-23 13:03:09 +02:00
Axel Beckert
8c7d398001 Drop "dont-test" flag from bullseye 2020-10-23 08:01:33 +02:00
Axel Beckert
f6c6c35b40 Support running tests verbosely with Make target "test-verbose" 2020-10-23 08:00:14 +02:00
Axel Beckert
d7b794bc2c Makefile: Actually install xen-resize-guest tool
Thanks lintian for the spare-manual-page warning!
2020-10-11 02:09:07 +02:00
Axel Beckert
d278bdc89e Mark Debian 8 Jessie as EoL
Reasoning:

Debian 8 Jessie has still (external) ELTS until 2022. But
debian-internal LTS has ended and it will likely vanish from the
normal mirrors soon. And it is already available in the archive. (And
some architectures are already only available in the archive.)

Also mention marking Debian 7 Wheezy as EoL in NEWS.markdown. (Was
already mentioned in debian/changelog.)
2020-10-11 01:59:42 +02:00
Axel Beckert
284657f8bc distributions.conf: Fix typo in release name of future Debian release
Debian 12 will be called bookworm, not bookwork.
2020-10-11 01:58:09 +02:00
Axel Beckert
4ac4ae5987 Update list of Ubuntu releases up to Groovy Gorilla 2020-10-11 01:53:43 +02:00
Axel Beckert
61ac300e43 Fix four-letter day of week abbrev. in old debian/changelog entries
See discussions in https://bugs.debian.org/971974 and
https://bugs.debian.org/971975
2020-10-11 01:34:33 +02:00
Ian McLinden
967bdcfaa9 Add debian install rules for arm64 2020-05-14 12:16:09 -05:00
voja
7fbad420c9 Added p2p support for Ubuntu netplan networking 2019-04-17 20:01:48 +02:00
voja
94514a3604 Fix storage commandline options not overriding xen-tools.conf settings
Was already fixed in xen-create-image, but neither in
xen-delete-image nor in xen-update-image. Use the same code as in
xen-create-image in those two tools, too.
2019-04-17 19:50:47 +02:00
Axel Beckert
7c8d466a53 Recommend deboootstrap ≥ 1.0.110~
At least debootstrap 1.0.110 (Buster/Sid) or 1.0.110~bpo9+1
(Stretch-Backports) is required for:

* working bootstrapping of Ubuntu 6.06 Dapper and 6.10 Edgy (see
  #659360).

* Support of Ubuntu 17.10 Artful, 18.04 LTS Bionic, 18.10 Cosmic, and
  19.04 Disco.
2019-04-16 13:30:37 +02:00
Axel Beckert
7dbb76941d Mark Debian 7 Wheezy as EoL 2019-04-16 13:23:55 +02:00
Axel Beckert
a11c9bf126 Travis CI: Also test against Perl 5.26 and 5.28 2019-04-02 17:38:14 +02:00
Axel Beckert
2a9fdc71e7 Release as 4.8 and upload to unstable as 4.8-1 2019-02-09 01:57:46 +01:00
Axel Beckert
89795d71dc Add a DEP-12 debian/upstream/metadata file 2019-02-09 01:00:38 +01:00
Axel Beckert
2a3c3cebfb Add link to upstream changelog to README 2019-02-09 00:49:31 +01:00
Axel Beckert
2275c8f293 Clarification 2019-02-09 00:47:12 +01:00
Axel Beckert
449cc9a0bf Whitespace between footnote markers 2019-02-09 00:44:10 +01:00
Axel Beckert
baee245fbd Mark those Debian/Ubuntu releases which might fail inside chroot w/o vsyscall=emulate 2019-02-09 00:41:36 +01:00
Axel Beckert
ac55fba904 Mention netplan.io also in NEWS.markdown 2019-02-08 22:23:40 +01:00
Axel Beckert
2a476d1037 More Markdown formatting 2019-02-08 17:42:40 +01:00
Axel Beckert
19f30610a5 Proper Markdown formatting 2019-02-08 17:40:27 +01:00
Axel Beckert
a8df6e002f distributions.conf now supports arbitrary keyring files
Any tag ending in ".gpg" will be considered to be the according
keyring file in /usr/share/keyrings/. This is at least needed for some
Ubuntu releases which were eol'ed in the past few years, especially
because Ubuntu split up their keyrings much more finegrained than just
"archive" and "archive-removed-keys".
2019-02-08 17:37:11 +01:00
Axel Beckert
0d9a7cb12e Reenable release-testing of edgy and dapper since #659360 in debootstrap is now fixed 2019-02-08 17:11:05 +01:00
Axel Beckert
b05087b1cb Whitespace fix 2019-02-08 16:45:19 +01:00
Axel Beckert
58af2790a1 Add an explaining link under ASLR 2019-02-08 16:44:22 +01:00
Axel Beckert
1cda58c756 Make the footnotes compact description list
Hopefully, this is still recognised by modern browsers.
2019-02-08 16:41:30 +01:00
Axel Beckert
c66e5427ed File name and line numbers are not necessary for this warning → add \n 2019-02-08 16:40:08 +01:00
Axel Beckert
ad013d7b86 Try to make a footnote for the #659360 reference, as it's less important now 2019-02-08 16:39:07 +01:00
Axel Beckert
a6389c48df While officially being EoL, Ubuntu 17.10 Artful is still on the normal mirrors
So remove to eol tag again for now.
2019-02-08 15:13:58 +01:00
Axel Beckert
8d07785c3b More README fine-tuning 2019-02-08 14:51:39 +01:00
Axel Beckert
ead18c819a Fix wrong URL in README 2019-02-08 14:51:16 +01:00
Axel Beckert
e3ab23b55d README fine-tuning 2019-02-08 00:27:21 +01:00
Axel Beckert
82ecd4c6d2 Document potential need for the vsyscall=emulate kernel commandline option 2019-02-08 00:27:06 +01:00
Axel Beckert
f50d1e37a2 Only run xen-toolstack helper script if both, xm and xl are present
Avoids warning about deprecated helper script.
2019-02-07 16:26:06 +01:00
Axel Beckert
c774f81e80 More unconfusing of Emacs' syntax highlighting 2019-02-07 16:16:54 +01:00
Axel Beckert
c8316b0076 Unconfuse Emacs' syntax highlighting 2019-02-07 16:10:31 +01:00
Axel Beckert
d5c4589519 Fix copy and paste "typo" 2019-02-07 15:51:11 +01:00
Axel Beckert
17d868d38d Fix output redirection in release-testing script 2019-02-07 15:48:19 +01:00
Axel Beckert
42e7dca4bf Mark Ubuntu's devel alias as dont-test as debootstrap doesn't know about it 2019-02-07 15:35:12 +01:00
Axel Beckert
4872d18989 Many improvements for the release-testing script
* Don't abort on first failure, but log it and print a summary at the
  end.
* Allow to choose which distributions to test via environment variable
  $DISTRIBUTIONS.
* Don't overwrite log files from previous runs. Add a time stamp to
  the log file name instead.
2019-02-07 13:21:07 +01:00
Axel Beckert
1a5fd541cd Drop pygrub path detection from xm.tmpl
Xen prefers a path-less bootloader='pygrub'.
2019-02-07 03:28:54 +01:00
Axel Beckert
9817ff95c3 Suggest grub-xen-host
Support for pvgrub2 is not yet there, but it can be used already by
tweaking configuration files.
2019-02-07 02:54:11 +01:00
Axel Beckert
26427c9dc8 Set Ubuntu fallback suite to the latest LTS, i.e. 18.04 Bionic 2019-02-07 02:52:29 +01:00
Axel Beckert
5c76eb1a7d Migrate httpredir.debian.org → deb.debian.org 2019-02-07 02:50:20 +01:00
Axel Beckert
8723db0880 Fix copy & paste error in 9ee1f637 which prevented netplan to work 2019-02-07 02:48:17 +01:00
Axel Beckert
76221f5999 Add changelog items for previous commit 2019-02-04 02:04:21 +01:00
Pietro Stäheli
58306b9281 Add support for really random MAC addresses
Closes: #855703
2019-02-04 01:58:40 +01:00
Axel Beckert
7ce42e9781 Use ubuntu-keyring instead of now transitional ubuntu-archive-keyring
Keep the latter as alternative to allow one to install the xen-tools
package also on older Debian or Ubuntu releases.
2019-02-04 01:35:20 +01:00
Axel Beckert
3daa69256b Add changelog items for previous commit 2019-02-04 01:25:19 +01:00
Nico Boehr
5587dc796a Add support for LVM thin provisioning
This adds a parameter '--lvm_thin' to xen-create-image that allows you
to specify the thin pool where the thin logical volumes will be
created.

If '--lvm_thin' is not specified, nothing will change and thick
provisioned volumes will be created.

[Committer's note: Code logic taken from
https://github.com/youknow0/xen-tools-thin-provisioning/commit/a6f267ef
and adapted to current code. Needed more than just a rebase. All
trailing whitespace has been removed, too.]

Fixes xen-tools/xen-tools#47.
2019-02-04 01:14:57 +01:00
Axel Beckert
9ee1f63705 Create hooks/artful with new 40-setup-networking-deb-netplan
Since Ubuntu 17.10 Artful, Ubuntu has decided to use netplan instead
of ifupdown.

40-setup-networking-deb-netplan has been contributed by Arno and Peter.
(see https://github.com/xen-tools/xen-tools/issues/51#issuecomment-412019510)

Closes xen-tools/xen-tools#51.

Since we have to make a variant of hooks/karmic/ as hook/artful/,
rename hooks/karmic/80-install-kernel (which previously was unique to
hooks/karmic/) to hooks/common/80-install-kernel-ubuntu and add
symlinks to it from hooks/karmic/ and hook/artful/.
2019-02-03 23:30:45 +01:00
Axel Beckert
cfd4406a93 Add preliminary support for future Debian and recent Ubuntu releases
Partially addresses GH #51
2019-02-03 22:50:36 +01:00
Axel Beckert
647efb0e12 Check $DEB_BUILD_OPTIONS and $DEB_BUILD_PROFILES in override_dh_auto_test
Fixes lintian warning
override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS.
2019-02-03 19:42:03 +01:00
Axel Beckert
0a351b4dfb Separate upstream and packaging changelog items 2019-02-03 19:37:26 +01:00
Axel Beckert
dccf78c65e Set "Rules-Requires-Root: no" 2019-02-03 19:34:57 +01:00
Axel Beckert
3a15c11a7e Declare compliance with Debian Policy 4.3.0
No other changes were required.
2019-02-03 19:34:57 +01:00
Axel Beckert
19e117b9f3 Bump debhelper compatibility level to 10
Update versioned debhelper build-dependency accordingly.

Only using dh compat level 10 allows one to still build the package on
Debian 9 Stretch without backports (debhelper 10.x), on Ubuntu 18.04
LTS (debehlper 11.x) and on Ubuntu 16.04 LTS with backports (debhelper
10.x).
2019-02-03 19:34:50 +01:00
Axel Beckert
f1052fcdaa Add changelog and NEWS entries for Yuri's pull-request #42 2019-02-03 17:41:09 +01:00
Axel Beckert
b9e0284a43 Drop --quiet from installDebianPackageAndRecommends
See https://github.com/xen-tools/xen-tools/pull/42#issuecomment-212903567
2019-02-03 17:38:22 +01:00
Axel Beckert
26a698bbd6 Merge branch 'no-progress-in-logs' of https://github.com/YSakhno/xen-tools into YSakhno-no-progress-in-logs 2019-02-03 17:35:52 +01:00
Axel Beckert
1ad05c0d66 Mention ZFS support in changelog and NEWS, bump version to 4.8 (unreleased) 2019-02-03 17:32:29 +01:00
Axel Beckert
8f527122c5 Merge branch 'zfs-volume' of https://github.com/brigriffin/xen-tools into brigriffin-zfs-volume 2019-02-03 17:25:08 +01:00
Axel Beckert
c3b8d7fda5 Add some more details to previous changelog item 2019-02-03 17:20:51 +01:00
Jelmer Vernooij
53800af963 Trim trailing whitespace.
Fixes lintian: file-contains-trailing-whitespace
See https://lintian.debian.org/tags/file-contains-trailing-whitespace.html for more details.
2019-02-03 17:20:22 +01:00
Axel Beckert
a78388dd1e Bump version number to 4.7.1 (yet unreleased) 2019-02-03 17:12:35 +01:00
Axel Beckert
07e56db75c Merge branch 'debian' 2019-02-03 17:09:10 +01:00
Marc
1634fe5e80 Remove tabs 2018-05-06 00:01:16 +02:00
Marc
f1083cfa55 Add support for ZFS volumes 2018-05-05 23:14:00 +02:00
Axel Beckert
6485f686b7 Prefer btrfs-progs over now transitional package btrfs-tools
Closes: #878910
2018-01-22 23:29:15 +01:00
Axel Beckert
207c73c7bb Recommend e2fsprogs
Closes: #887236
2018-01-22 23:27:43 +01:00
Axel Beckert
fff2eccbe3 Switch "activate" trigger to "activate-noawait" 2018-01-22 23:24:09 +01:00
Axel Beckert
e6ffe50bb6 debian/control: Drop "Testsuite: autopkgtest" header, no more needed 2018-01-22 23:21:46 +01:00
Axel Beckert
76a35e28d1 Use "$(MAKE)" instead of "make" in debian/rules 2018-01-22 23:19:37 +01:00
Axel Beckert
de1eea7fa2 Declare compliance with Debian Policy 4.1.3
Change Priority from extra to optional.
2018-01-22 23:18:16 +01:00
Axel Beckert
422f682b37 Fix comments wrt. /etc/xen-tools/skel/ 2017-08-04 00:45:11 +02:00
Axel Beckert
326bd72ebb Also fix wrong bug number for #849867 in upstream changelog 2017-01-23 01:39:23 +01:00
Axel Beckert
52c39a7c09 Debian: Fix wrong bug number for #849867 in previous changelog entry 2017-01-23 01:39:04 +01:00
Yuri Sakhno
230167d84a Small fix due to some messages being written to stderr rather than stdout 2016-04-20 14:24:08 +03:00
Yuri Sakhno
87dd127cf8 Eliminate progress reporting which is useless in logs 2016-04-20 11:45:39 +03:00
Brandon Bradley
f065541445 fix update-grub chroot silent failure 2016-02-17 15:55:14 -06:00
61 changed files with 1201 additions and 171 deletions

View File

@@ -1,5 +1,9 @@
language: perl
perl:
- "5.32"
- "5.30"
- "5.28"
- "5.26"
- "5.24"
- "5.22"
- "5.20"
@@ -8,17 +12,26 @@ perl:
- "5.14"
- "5.12"
- "5.10"
- "blead"
matrix:
fast_finish: true
allow_failures:
- perl: blead
before_install:
- sudo apt-get update
- sudo apt-get install devscripts dpkg-dev lsb-release
- eval $(curl https://travis-perl.github.io/init)
- build-perl
- perl -V
install:
- yes '' | cpanm --verbose --notest --skip-satisfied Data::Validate::Domain Data::Validate::IP Data::Validate::URI File::Slurp File::Which Log::Message Term::UI Test::NoTabs Test::Pod::Coverage Test::Pod Text::Template Devel::Cover::Report::Coveralls Sort::Versions
- yes '' | cpanm --verbose --notest --skip-satisfied Data::Validate::Domain Data::Validate::IP Data::Validate::URI File::Slurp File::Which Log::Message Term::UI Test::NoTabs Test::Pod::Coverage Test::Pod Text::Template Devel::Cover::Report::Coveralls Sort::Versions Test::File::Contents
- export RELEASE_TESTING=1 AUTOMATED_TESTING=1 AUTHOR_TESTING=1 HARNESS_OPTIONS=j10:c HARNESS_TIMER=1 PATH=bin:${PERLBREW_PATH}:${PATH}
script:
- make test
- make test-verbose
after_success:
- prove --exec 'env PERL5OPT=-MDevel::Cover=-ignore_re,^(t/|/usr) perl' t/*.t

View File

@@ -14,7 +14,7 @@
#
TMPDIR ?= /tmp
DIST_PREFIX = ${TMPDIR}
VERSION = 4.7
VERSION = 4.9.1
DEBVERSION = $(shell echo $(VERSION)|sed 's/\(rc\|pre\|beta\|alpha\)/~\1/')
BASE = xen-tools
VCS = git
@@ -132,6 +132,7 @@ install-bin:
cp bin/xen-delete-image ${prefix}/usr/bin
cp bin/xen-list-images ${prefix}/usr/bin
cp bin/xen-update-image ${prefix}/usr/bin
cp bin/xen-resize-guest ${prefix}/usr/bin
cp bin/xt-guess-suite-and-mirror ${prefix}/usr/bin
chmod 755 ${prefix}/usr/bin/xen-create-image
chmod 755 ${prefix}/usr/bin/xen-create-nfs
@@ -183,6 +184,8 @@ install-hooks:
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d stretch.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d buster.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d bullseye.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d bookworm.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d trixie.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d sid.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d unstable.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s debian.d testing.d
@@ -218,7 +221,16 @@ install-hooks:
-cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d xenial.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d yakkety.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d zesty.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s karmic.d devel.d
mkdir -p ${prefix}/usr/share/xen-tools/artful.d/
cp -R hooks/artful/*-* ${prefix}/usr/share/xen-tools/artful.d/
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d bionic.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d cosmic.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d disco.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d eoan.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d focal.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d groovy.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d hirsute.d
-cd ${prefix}/usr/share/xen-tools/ && ln -s artful.d devel.d
cp hooks/common.sh ${prefix}/usr/share/xen-tools
cp -r hooks/common ${prefix}/usr/share/xen-tools
@@ -258,6 +270,7 @@ manpages:
#
release: orig-tar-gz
gpg --armour --detach-sign ../$(BASE)-$(VERSION).tar.gz
cp -p ../$(BASE)-$(VERSION).tar.gz.asc ../$(BASE)_$(DEBVERSION).orig.tar.gz.asc
git tag -s -m "Release as $(VERSION)" "release-$(VERSION)"
tarball: test tidy fixup-perms update-version update-modules clean changelog
@@ -282,13 +295,15 @@ orig-tar-gz: tarball
#
# Run the test suite.
#
test-verbose : VERBOSE = -v
test-verbose: test
test: non-author-test author-test
non-author-test: update-modules
prove --shuffle t/
prove $(VERBOSE) --shuffle t/
author-test:
prove xt/
prove $(VERBOSE) xt/
#

View File

@@ -1,3 +1,109 @@
xen-tools 4.9 (released 29 Dec 2020)
====================================
New Features
------------
* Add Debian install rules for arm64. (GH #62; PR by Ian McLinden
@ianmclinden)
* Add netplan p2p support for Ubuntu. (GH #58; PR by Volker Janzen
@frootmig)
Bug Fixes
---------
* Fix typo in release name of the future Debian 12 release.
* Makefile: Actually install xen-resize-guest tool. (Thanks to
Debian's Lintian tool reporting that there is a man-page without
binary installed!)
* Distinguish between those Debian releases using `$dist/updates` for
security updates and those who use `$dist-security`. Thanks to Paul
Wise for the bug report. (Closes Debian bug report #972749.)
* Fix support for `lvm_thin`. Thanks to Andreas Sundstrom for the bug
report and patch! (Closes Debian bug report #942244.)
* Mount `/proc` and `/dev` before calling update-grub. Thanks to
Brandon Bradley for the bug report and patch. (Closes Debian bug
report #815021.)
* Fix storage commandline options not overriding `xen-tools.conf`
settings also in `xen-update-image` and `xen-delete-image`. (GH #57;
patch by Volker Janzen @frootmig)
Distribution Releases Changes
-----------------------------
* Support for
+ Ubuntu 19.10 Eoan Ermine (EoL)
+ Ubuntu 20.04 Focal Fossa (LTS)
+ Ubuntu 20.10 Groovy Gorilla
* Preliminary support for
+ Debian 13 Trixie
+ Ubuntu 21.04 Hirsute Hippo
* Declare the following releases as EoL:
+ Ubuntu 17.10 Artful Aardvark (Was missing in previous release
despite mentioned in this file.)
+ Ubuntu 18.10 Cosmic Cuttlefish
+ Ubuntu 19.04 Disco Dingo
+ Debian 7 Wheezy
+ Debian 8 Jessie
* Start all Debian releases since Stretch (9) with pygrub by default.
Other Changes
-------------
* Support running tests verbosely with Make target "test-verbose".
* Drop "dont-test" flag from bullseye.
* partitions/sample-server: Change options=sync to
options=defaults. (GL MR !1; patch by Wolfgang Karall)
xen-tools 4.8 (released 9 Feb 2019)
===================================
New Features
------------
* Support for ZFS volumes (by Marc Bigler, GH #50)
* Support for LVM thin provisioning (by Nico Boehr, GH #47)
* Support for really random MAC addresses upon every `xen-create-image`
invocation by using the new option `--randommac`. (by Pietro Stäheli,
closes Debian bug report #855703)
* `distributions.conf` now supports arbitrary keyring files in
`/usr/share/keyrings/`. (Needed for some EoL Ubuntu releases.)
* Support for netplan.io network configuration as used in recent
Ubuntu releases. (Hook by Arno and Peter, GH #51)
Bug Fixes
---------
* Minor documentation fixes.
* Eliminate progress reporting which is useless in logs. (Yuri Sakhno,
GH #42)
* Drop `pygrub` path detection from `xm.tmpl`, Xen prefers a path-less
`bootloader='pygrub'`.
Distribution Releases Changes
-----------------------------
* Support for
+ Ubuntu 17.10 Artful Aardvark
+ Ubuntu 18.04 Bionic Beaver (LTS) (GH #51)
+ Ubuntu 18.10 Cosmic Cuttlefish
* Preliminary support for Ubuntu 19.04 Disco Dingo
* Knows about code name for Debian 12 (Bookworm).
* Considers Ubuntu Yakkety, Zesty and Artful being EoL.
* Set Ubuntu fallback suite to the latest LTS, i.e. 18.04 Bionic.
Other Changes
-------------
* Change all occurrences of `httpredir.debian.org` to
`deb.debian.org` except those for the `debian-archive`. The latter
now point to `archive.debian.org` directly.
* Many improvements for the `release-testing` script.
* Only run `xen-toolstack` helper script if both, `xm` and `xl` are
present. Avoids warning about deprecated helper script.
xen-tools 4.7 (released 23 Jan 2017)
====================================
@@ -43,7 +149,7 @@ Other Changes
* Risen default values for RAM sizes in /etc/xen-tools/xen-tools.cfg
to cope with risen resource consumption and availability. (Closes
Debian bug report #776487)
Debian bug report #849867)
* Default file system is now ext4 (instead of ext3).
Test Suite

View File

@@ -4,6 +4,7 @@ xen-tools
[![Travis CI Build Status](https://api.travis-ci.org/xen-tools/xen-tools.svg)](https://travis-ci.org/xen-tools/xen-tools)
* [Homepage](https://www.xen-tools.org/software/xen-tools)
* [Change Log](https://github.com/xen-tools/xen-tools/blob/master/NEWS.markdown)
* Official Git Repositories:
* [at GitHub](https://github.com/xen-tools/xen-tools) (primary, includes [Issue Tracker](https://github.com/xen-tools/xen-tools/issues))
* [at GitLab](https://gitlab.com/xen-tools/xen-tools) (secondary, doesn't support the `git://` protocol.)
@@ -31,34 +32,36 @@ known to work reliably, i.e.:
### Debian
* Sarge 3.1 (i386 and DomU only)
* Etch 4.0 (Dom0 no more tested)
* Lenny 5.0 (Dom0 no more tested)
* Squeeze 6.0 (Dom0 no more tested)
* Wheezy 7
* Sarge 3.1 (i386 and DomU only) [¹](#1)
* Etch 4.0 (Dom0 no more tested) [¹](#1)
* Lenny 5.0 (Dom0 no more tested) [¹](#1)
* Squeeze 6.0 (Dom0 no more tested) [¹](#1)
* Wheezy 7 (Dom0 no more tested) [¹](#1)
* Jessie 8
* Stretch 9 (under development)
* Buster 10 (knows about this future release name)
* Bullseye 11 (knows about this future release name)
* Stretch 9
* Buster 10
* Bullseye 11 (under development)
* Bookworm 12 (knows about this future release name)
* Trixie 13 (knows about this future release name)
* Sid (always under development; works at least at the moment of writing :-)
### Ubuntu
(only DomUs tested)
* Dapper Drake 6.06 (LTS, needs editing of `/usr/share/debootstrap/scripts/dapper` since at least debootstrap version 1.0.37, see [#659360][1])
* Edgy Eft 6.10 (needs editing of `/usr/share/debootstrap/scripts/edgy` since at least debootstrap version 1.0.37, see [#659360][1])
* Feisty Fawn 7.04
* Gutsy Gibbon 7.10
* Hardy Heron 8.04 (LTS, see [Installing Ubuntu 8.04 as DomU][2])
* Interpid Ibex 8.10
* Jaunty Jackaplope 9.04
* Karmic Koala 9.10
* Lucid Lynx 10.04 (LTS)
* Maverick Meerkat 10.10
* Natty Narwhal 11.04
* Oneiric Ocelot 11.10
* Precise Pangolin 12.04 (LTS)
* Dapper Drake 6.06 (LTS) [¹](#1) [²](#2)
* Edgy Eft 6.10 [¹](#1) [²](#2)
* Feisty Fawn 7.04 [¹](#1)
* Gutsy Gibbon 7.10 [¹](#1)
* Hardy Heron 8.04 (LTS, see [Installing Ubuntu 8.04 as DomU][2]) [¹](#1)
* Interpid Ibex 8.10 [¹](#1)
* Jaunty Jackaplope 9.04 [¹](#1)
* Karmic Koala 9.10 [¹](#1)
* Lucid Lynx 10.04 (LTS) [¹](#1)
* Maverick Meerkat 10.10 [¹](#1)
* Natty Narwhal 11.04 [¹](#1)
* Oneiric Ocelot 11.10 [¹](#1)
* Precise Pangolin 12.04 (LTS) [¹](#1)
* Quantal Quetzal 12.10
* Raring Ringtail 13.04
* Saucy Salamander 13.10
@@ -68,7 +71,33 @@ known to work reliably, i.e.:
* Wily Werewolf 15.10
* Xenial Xerus 16.04 (LTS)
* Yakkety Yak 16.10
* Zesty Zapus 17.04 (under development)
* Zesty Zapus 17.04
* Artful Aardvark 17.10
* Bionic Beaver 18.04 (LTS)
* Cosmic Cuttlefish 18.10
* Disco Dingo 19.04
* Eoan Ermine 19.10
* Focal Fossa 20.04 (LTS)
* Groovy Gorilla 20.10
* Hirsute Hippo 21.04 (under development)
### Footnotes
<dl compact="compact">
<dt><a id="1" name="1">¹</a></dt><dd>
Installation with `xen-create-image` and updating with
`xen-update-image` might fail with newer kernels/distributions as Dom0
without `vsyscall=emulate` on the kernel commandline.
</dd><dt><a id="2" name="2">²</a></dt><dd>
At least between debootstrap version 1.0.37
and 1.0.93 (including) these distributions needs editing of
`/usr/share/debootstrap/scripts/edgy`, see [#659360][1].
</dd></dl>
[1]: https://bugs.debian.org/659360
"debootstrap in Wheezy can no more build Ubuntu Edgy or earlier"
@@ -113,7 +142,7 @@ To use these tools you'll need the following software:
* [File::Which](https://metacpan.org/release/File-Which)
([Debian Package libfile-which-perl](https://packages.debian.org/libfile-which-perl))
* and some more modules which are part of the Perl core and hence do not need to be installed separately.
* Make, if you are not installing through a package manager
* "Make", if you are not installing through a package manager.
You can try to install RPM-based distributions such as CentOS, or
Fedora Core, but you will need a correctly installed and configured
@@ -125,6 +154,22 @@ users via a login shell you can have a look at the (currently
unmaintained) [xen-shell](https://xen-tools.org/software/xen-shell/)
project.
### Caveats
For security reasons (avoid risk to circumvent [ASLR][3]), recent kernels
have disabled the `vsyscall` mapping. Unfortunately older
distributions don't run and hence can't be bootstrapped without it.
To enable trapping and enabling emulate calls into the fixed
vsyscall address mapping and hence to run and bootstrap older Linux
distributions in a chroot (as xen-tools does), you need to add
`vsyscall=emulate` to the kernel commandline, e.g. by adding it to
`GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`, then running
`update-grub` afterwards and finally reboot.
[3]: https://en.wikipedia.org/wiki/Address_space_layout_randomization
"Address Space Layout Randomization"
Installation
------------
@@ -242,11 +287,15 @@ test case would be a useful bonus.
### Known/Open Issues
* [xen-tools Issue Tracker at GitHub](https://github.com/xen-tools/xen-tools/issues/new)
You can check the following ressources for known or open issues:
* [xen-tools Issue Tracker at GitHub](https://github.com/xen-tools/xen-tools/issues)
(primary upstream bug tracker)
* [Mailing list archives of the xen-tools mailing lists](https://xen-tools.org/software/xen-tools/lists.html)
(might contain, loose, non-formal bug reports)
* [TODO file in the source code](https://github.com/xen-tools/xen-tools/blob/master/TODO.markdown)
* [xen-tools in the Debian Bug Tracking System](https://bugs.debian.org/xen-tools)
* [xen-tools in Ubuntu's Launchpad](https://bugs.launchpad.net/ubuntu/+source/xen-tools)
--
The Xen-Tools Developer Team

View File

@@ -55,6 +55,16 @@ Bugs to fix and features to add for 5.0
`xen-create-image` first. Which probably both would be a good
idea.
* Maybe check for `vsyscall=emulate` in `GRUB_CMDLINE_LINUX_DEFAULT`
in `/etc/default/grub` if trying to install an affected Linux
distribution.
* Drop checking the host's sources.list to decide upon including the
security repo or not.
* Make a difference wrt. to the security repo for EoL releases.
Stuff from Steve's TODO list / Generic TODOs
--------------------------------------------

View File

@@ -245,12 +245,12 @@ and EVMS EXAMPLE.
--mirror=url Setup the mirror to use when installing via
debootstrap. (Default value: mirror used in
/etc/apt/sources.list or for Debian
"http://httpredir.debian.org/debian/" and for Ubuntu
"http://deb.debian.org/debian/" and for Ubuntu
"http://archive.ubuntu.com/ubuntu/")
The above mentioned Debian mirror hostname
automatically tries to choose a more or less close
Debian mirror. See http://httpredir.debian.org/ for
Debian mirror. See http://deb.debian.org/ for
details.
--apt_proxy=protocol://hostname:port/
@@ -296,6 +296,8 @@ and EVMS EXAMPLE.
flags, but the specific MAC address will only be used
for the first interface.)
--randommac Creates a random MAC address.
--netmask=123.456.789.ABC
Setup the netmask for the new instance.
@@ -321,14 +323,14 @@ and EVMS EXAMPLE.
Subdirectories will be created for each guest.
If you do not wish to use loopback images specify
--lvm or --evms. (These three options are mutually
exclusive.)
--lvm, --evms or --zpool. (These four options are
mutually exclusive.)
--evms=lvm2/container
Specify the container to save images within,
i.e. '--evms lvm2/mycontainer'. If you do not wish to
use EVMS specify --dir or --lvm. (These three options
are mutually exclusive.)
use EVMS specify --dir, --lvm or --zpool. (These four
options are mutually exclusive.)
--hostname=host.example.org
Set the hostname of the new guest system. Ideally
@@ -337,9 +339,20 @@ and EVMS EXAMPLE.
out of it for various purposes.
--lvm=vg Specify the volume group to save images within.
If you do not wish to use LVM specify --dir or --evms.
(These three options are mutually exclusive.)
If you do not wish to use LVM specify --dir, --evms or
--zpool. (These three options are mutually exclusive.)
--lvm_thin=thin pool
Specify the thin pool name on which thin LVM volumes
are created.
This enables thin provisioned LVM volumes. Note that
you need a LVM version which supports this.
--zpool=pool Specify the ZFS pool to save images within. A new ZFS
volume will be created for each guest.
If you do not wish to use ZFS specify --dir, --evms or
--lvm. (These four options are mutually exclusive.)
=head1 NOTES
@@ -859,7 +872,7 @@ my $MOUNT_POINT = undef;
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
#
@@ -1004,7 +1017,8 @@ if ( !@PARTITIONS )
populatePartitionsData()
if ( ( $CONFIG{ 'dir' } ) ||
( $CONFIG{ 'evms' } ) ||
( $CONFIG{ 'lvm' } ) );
( $CONFIG{ 'lvm' } ) ||
( $CONFIG{ 'zpool' } ) );
}
@@ -1056,12 +1070,20 @@ elsif ( $CONFIG{ 'image-dev' } )
#
usePhysicalDevice();
}
elsif ( $CONFIG{ 'zpool' } )
{
#
# Create our ZFS volumes
#
createZFSBits();
}
else
{
# Can't happen we didn't get an installation type.
logprint( "Error: No recognised installation type.\n".
"Please specify a directory, lvm, or evms volume to use.\n" );
"Please specify a directory, lvm, zpool, or evms volume to use.\n" );
$CONFIG{'FAIL'} = 1;
exit 127;
}
@@ -1292,9 +1314,13 @@ sub setupDefaultOptions
$CONFIG{ 'mirror_'.$debdist } = $MIRROR{$dist.'_archive'} or
die $dist.'_archive not defined in /etc/xen-tools/mirrors.conf';
my $removed_keys = "/usr/share/keyrings/$dist-archive-removed-keys.gpg";
if ($debdistinfo !~ /default-keyring/ and -s $removed_keys) {
if ($debdistinfo =~ /(\S*\.gpg)($|\s)/ and -s "/usr/share/keyrings/${1}") {
$CONFIG{ 'keyring_'.$debdist } = "/usr/share/keyrings/${1}";
} elsif ($debdistinfo !~ /default-keyring/ and -s $removed_keys) {
$CONFIG{ 'keyring_'.$debdist } = $removed_keys;
}
} elsif ($debdistinfo =~ /(\S*\.gpg)($|\s)/ and -s "/usr/share/keyrings/${1}") {
$CONFIG{ 'keyring_'.$debdist } = "/usr/share/keyrings/${1}";
} else {
$CONFIG{ 'mirror_'.$debdist } = $MIRROR{$dist} or
die $dist.' not defined in /etc/xen-tools/mirrors.conf';
@@ -1560,6 +1586,7 @@ sub parseCommandLineArguments
$install{ 'dir' } = undef;
$install{ 'lvm' } = undef;
$install{ 'image-dev' } = undef;
$install{ 'zpool' } = undef;
#
# Parse options.
@@ -1589,6 +1616,7 @@ sub parseCommandLineArguments
"apt_proxy=s", \&checkOption,
"modules=s", \&checkOption,
"lvm=s", \$install{ 'lvm' },
"zpool=s", \$install{ 'zpool' },
"image-dev=s", \$install{ 'image-dev' },
"swap-dev=s", \$install{ 'swap-dev' },
"serial_device=s", \&checkOption,
@@ -1608,6 +1636,7 @@ sub parseCommandLineArguments
"hostname=s", \&checkOption,
"ip=s@", \&checkOption,
"mac=s", \&checkOption,
"randommac", \$CONFIG{ 'randommac' },
"netmask=s", \&checkOption,
"broadcast=s", \&checkOption,
"nameserver=s", \&checkOption,
@@ -1655,6 +1684,7 @@ sub parseCommandLineArguments
"output=s", \&checkOption,
"extension:s", \&checkOption,
"dontformat", \&checkOption,
"lvm_thin=s", \$CONFIG{ 'lvm_thin' },
# Help options
"debug!", \$CONFIG{ 'debug' },
@@ -1687,7 +1717,7 @@ sub parseCommandLineArguments
#
# Now make ensure that the command line setting of '--lvm', '--evms'
# Now make ensure that the command line setting of '--lvm', '--evms', '--zpool'
# and '--dir=x' override anything specified in the configuration file.
#
if ( $install{ 'dir' } )
@@ -1696,6 +1726,7 @@ sub parseCommandLineArguments
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'image-dev' } = undef;
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'evms' } )
{
@@ -1703,6 +1734,7 @@ sub parseCommandLineArguments
$CONFIG{ 'evms' } = $install{ 'evms' };
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'image-dev' } = undef;
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'lvm' } )
{
@@ -1710,6 +1742,15 @@ sub parseCommandLineArguments
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = $install{ 'lvm' };
$CONFIG{ 'image-dev' } = undef;
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'zpool' } )
{
$CONFIG{ 'dir' } = undef;
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'image-dev' } = undef;
$CONFIG{ 'zpool' } = $install{ 'zpool' };
}
if ( $install{ 'image-dev' } )
{
@@ -1717,6 +1758,7 @@ sub parseCommandLineArguments
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'image-dev' } = $install{ 'image-dev' };
$CONFIG{ 'zpool' } = undef;
$CONFIG{ 'size' } = undef;
$CONFIG{ 'swap' } = undef;
@@ -1745,13 +1787,13 @@ sub testRootUser
{
if ( $EFFECTIVE_USER_ID != 0 )
{
my $err = <<E_O_ROOT;
my $err = <<EOROOT;
In order to use this script you must be running with root privileges.
(This is necessary to mount the disk images which are created.)
E_O_ROOT
EOROOT
logprint($err);
$CONFIG{'FAIL'} = 1;
@@ -2082,10 +2124,18 @@ EOF
#
# If we don't have a MAC address specified then generate one.
# If randommac is specified, generate random MAC.
#
if ( !$CONFIG{ 'mac' } )
{
$CONFIG{ 'mac' } = generateMACAddress();
if ( $CONFIG{ 'randommac' } )
{
$CONFIG{ 'mac' } = generateRandomMACAddress();
}
else
{
$CONFIG{ 'mac' } = generateMACAddress();
}
}
#
@@ -2134,7 +2184,7 @@ EOF
=begin doc
Generate a 'random' MAC address.
Generate a pseudo-random MAC address.
The MAC address is constructed based upon :
@@ -2192,6 +2242,36 @@ sub generateMACAddress
=begin doc
Generate a MAC address based on the Xen prefix and a really random local part.
=end doc
=cut
sub generateRandomMACAddress
{
#
# Start with the xen prefix
#
my $mac = '00:16:3E';
#
# Generate random local part and append to $mac
#
for ( my $count=0; $count < 3; $count++ )
{
$mac = $mac . ":" . sprintf("%02X", int(rand(255)));
}
return ( $mac );
}
=begin doc
Make sure we have a log directory, and create an empty logfile
@@ -2328,6 +2408,26 @@ sub checkBinariesPresent
}
}
}
elsif (defined( $CONFIG{ 'zpool' } ) )
{
# ZFS-specific binaries.
my @zfs = qw ( zfs );
foreach my $file (@zfs)
{
if ( !defined( which($file) ) )
{
logprint("The following binary is required to run this tool\n");
logprint("\t$file\n");
logprint(
"(This is only required for ZFS volumes, which you've selected)\n"
);
$CONFIG{'FAIL'} = 1;
exit 127;
}
}
}
}
@@ -3124,9 +3224,12 @@ sub createLVMBits
# The commands to create the volume.
#
my $disk_cmd =
"lvcreate $CONFIG{'lvm'} ".
($lvm_needs_yes ? '--yes' : '').
" -L $partition->{'size'} -n $disk";
"lvcreate ".
($lvm_needs_yes ? '--yes ' : '').
($CONFIG{ 'lvm_thin' } ?
"-T $CONFIG{'lvm'}/$CONFIG{'lvm_thin'} -V" :
"$CONFIG{'lvm'} -L").
" $partition->{'size'} -n $disk";
#
# Create the volume
@@ -3163,6 +3266,112 @@ sub createLVMBits
=begin doc
This function is responsible for creating two new ZFS volumes within
a given ZFS pool.
=end doc
=cut
sub createZFSBits
{
#
# Check whether the ZFS volume exists already, and if so abort
# unless '--force' is specified.
#
foreach my $partition (@PARTITIONS)
{
my $disk = $CONFIG{ 'hostname' } . '-' . $partition->{ 'name' };
my $zfs_disk = "/dev/$CONFIG{'zpool'}/$disk";
my $zfs_vol = "$CONFIG{'zpool'}/$disk";
if ( -e $zfs_disk )
{
# Delete if forcing
if ( $CONFIG{ 'force' } )
{
unless ( xenRunning($CONFIG{ 'hostname' }, \%CONFIG)) {
logprint(
"Removing $zfs_disk - since we're forcing the install\n");
runCommand("zfs destroy $zfs_vol", \%CONFIG);
runCommand("sync", \%CONFIG);
logprint(
"Sleeping a few seconds to avoid ZFS race conditions...\n");
sleep(3);
} else {
fail("ERROR: Xen guest $CONFIG{'hostname'} appears to be running.\nAborting.\n");
}
}
else
{
logprint("The ZFS volume already exists. Aborting.\n");
logprint("Specify '--force' to delete and recreate\n");
$CONFIG{'FAIL'} = 2;
exit 127;
}
}
}
foreach my $partition (@PARTITIONS)
{
my $disk = $CONFIG{ 'hostname' } . '-' . $partition->{ 'name' };
my $zfs_disk = "/dev/$CONFIG{'zpool'}/$disk";
my $zfs_vol = "$CONFIG{'zpool'}/$disk";
#
# Save the image path to the partitions array
#
$partition->{ 'imagetype' } = 'phy:';
$partition->{ 'image' } = $zfs_disk;
#
# The commands to create the volume.
#
my $disk_cmd =
"zfs create ".
($CONFIG{'image'} eq 'sparse' ? '-s' : '').
" -V $partition->{'size'} $zfs_vol";
#
# Create the volume
#
runCommand($disk_cmd, \%CONFIG);
sleep(2);
#
# Make sure that worked.
#
if ( !-e "$zfs_disk" )
{
logprint(
"The ZFS volume creation failed to create $zfs_disk.\n"
);
logprint("aborting\n");
$CONFIG{'FAIL'} = 1;
exit 127;
}
#
# Finally create the filesystem / swap
#
if ( $partition->{ 'type' } eq 'swap' )
{
createSwap($zfs_disk);
}
else
{
createFilesystem( $zfs_disk, $partition->{ 'type' } );
}
}
}
=begin doc
This function is responsible for creating two new logical volumes within
@@ -3422,6 +3631,10 @@ sub mountImage
{
$mount_cmd = "mount $mount_type $image $mountpoint";
}
elsif ( $CONFIG{ 'zpool' } )
{
$mount_cmd = "mount $mount_type $image $mountpoint";
}
else
{
$mount_cmd = "mount $mount_type -o loop $image $mountpoint";
@@ -4282,12 +4495,15 @@ END
$option = "--evms=$CONFIG{'evms'}"
} elsif ($CONFIG{ 'dir' }) {
$option = "--dir=$CONFIG{'dir'}"
} elsif ($CONFIG{ 'zpool' }) {
$option = "--zpool=$CONFIG{'zpool'}"
}
if ($option) {
runCommand("xen-delete-image $option --hostname=$CONFIG{'hostname'}", \%CONFIG);
} else {
die "Assertion that either --dir, --lvm, or --dir are given".
die "Assertion that either --dir, --lvm, --dir or --zpool are given".
" failed.\nThis is probably a bug, please report it.";
}
}

View File

@@ -121,7 +121,7 @@ $CONFIG{ 'template' } = '/etc/xen-tools/xm-nfs.tmpl';
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
# store version number away.

View File

@@ -24,6 +24,7 @@ xen-delete-image - Delete previously created Xen instances.
--dir Specify the output directory where images were previously saved.
--evms Specify the EVMS container to use.
--lvm Specify the LVM volume to use.
--zpool Specify the ZFS pool to use.
Specifying hosts:
--hostname Specify the image name to delete.
@@ -51,6 +52,9 @@ Specify the hostname to delete.
=item B<--lvm>
Specify the LVM volume group where images were previously saved.
=item B<--zpool>
Specify the ZFS pool where images were previously saved.
=item B<--manual>
Read the manual for this script.
@@ -163,7 +167,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
#
@@ -204,12 +208,12 @@ checkArguments();
#
if ( ( !$CONFIG{ 'test' } ) && ( $EFFECTIVE_USER_ID != 0 ) )
{
print <<E_O_ROOT;
print <<EOROOT;
This script is not running with root privileges, so the configuration
file(s) beneath /etc/xen will not be removed.
E_O_ROOT
EOROOT
exit 127;
}
@@ -265,12 +269,25 @@ sub parseCommandLineArguments
my $VERSION = 0;
$CONFIG{ 'dry-run' } = 0;
#
# We record the installation method here because we want
# to ensure that we allow the method supplied upon the command line
# to overwrite the one we might have ready read from the configuration
# file.
#
my %install;
$install{ 'evms' } = undef;
$install{ 'dir' } = undef;
$install{ 'lvm' } = undef;
$install{ 'zpool' } = undef;
# Parse options.
#
GetOptions( "dir=s", \$CONFIG{ 'dir' },
GetOptions( "dir=s", \$install{ 'dir' },
"dry-run", \$CONFIG{ 'dry-run' },
"lvm=s", \$CONFIG{ 'lvm' },
"evms=s", \$CONFIG{ 'evms' },
"lvm=s", \$install{ 'lvm' },
"evms=s", \$install{ 'evms' },
"zpool=s", \$install{ 'zpool' },
"extension:s", \$CONFIG{ 'extension' },
"hostname=s@", \$CONFIG{ 'hostname' },
"test", \$CONFIG{ 'test' },
@@ -281,6 +298,39 @@ sub parseCommandLineArguments
"version", \$VERSION
);
#
# Now make ensure that the command line setting of '--lvm', '--evms', '--zpool'
# and '--dir=x' override anything specified in the configuration file.
#
if ( $install{ 'dir' } )
{
$CONFIG{ 'dir' } = $install{ 'dir' };
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'evms' } )
{
$CONFIG{ 'dir' } = undef;
$CONFIG{ 'evms' } = $install{ 'evms' };
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'lvm' } )
{
$CONFIG{ 'dir' } = undef;
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = $install{ 'lvm' };
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'zpool' } )
{
$CONFIG{ 'dir' } = undef;
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'zpool' } = $install{ 'zpool' };
}
pod2usage(1) if $HELP;
pod2usage( -verbose => 2 ) if $MANUAL;
@@ -309,7 +359,7 @@ sub checkArguments
#
# When testing we only care about loopback images, not disk images.
#
if ( $CONFIG{ 'test' } and ( $CONFIG{ 'lvm' } or $CONFIG{ 'evms' } ))
if ( $CONFIG{ 'test' } and ( $CONFIG{ 'lvm' } or $CONFIG{ 'evms' } or $CONFIG{ 'zpool' } ))
{
print "Error: --test only works with --dir.\n";
exit 1;
@@ -319,7 +369,7 @@ sub checkArguments
# Make sure we got one and only one installation method.
#
my $count = 0;
foreach my $type (qw/dir lvm evms/)
foreach my $type (qw/dir lvm evms zpool/)
{
$count += 1 if defined( $CONFIG{ $type } );
}
@@ -334,6 +384,7 @@ sub checkArguments
print " --dir\n";
print " --evms\n";
print " --lvm\n";
print " --zpool\n";
exit 2;
}
}
@@ -478,6 +529,37 @@ sub deleteXenImage
}
}
}
elsif ( defined( $CONFIG{ 'zpool' } ) )
{
#
# ZFS volumes
#
#
# TODO: Check we're not mounted.
#
if ( -e "/dev/$CONFIG{'zpool'}/$hostname-swap" )
{
if ($CONFIG{ 'dry-run' }) {
print "Would remove ZFS swap volume /dev/$CONFIG{'zpool'}/$hostname-swap\n";
} else {
print "Removing swap volume\n";
runCommand("zfs destroy -R $CONFIG{'zpool'}/$hostname-swap", \%PER_HOST_CONFIG);
}
}
if ( -e "/dev/$CONFIG{'zpool'}/$hostname-disk" )
{
if ($CONFIG{ 'dry-run' }) {
print "Would remove ZFS disk volume /dev/$CONFIG{'zpool'}/$hostname-disk\n";
} else {
print "Removing ZFS disk volume\n";
runCommand("zfs destroy -R $CONFIG{'zpool'}/$hostname-disk", \%PER_HOST_CONFIG);
}
}
}
else
{

View File

@@ -106,7 +106,7 @@ $CONFIG{ 'extension' } = '.cfg';
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';

View File

@@ -111,7 +111,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
#

View File

@@ -113,7 +113,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
#
@@ -149,13 +149,13 @@ checkArguments();
#
if ( $EFFECTIVE_USER_ID != 0 )
{
print <<E_O_ROOT;
print <<EOROOT;
This script is not running with root privileges.
root privileges are required to successfully mount the disk image(s).
E_O_ROOT
EOROOT
exit;
}
@@ -344,15 +344,52 @@ sub parseCommandLineArguments
my $MANUAL = 0;
my $VERSION = 0;
#
# We record the installation method here because we want
# to ensure that we allow the method supplied upon the command line
# to overwrite the one we might have ready read from the configuration
# file.
#
my %install;
$install{ 'evms' } = undef;
$install{ 'dir' } = undef;
$install{ 'lvm' } = undef;
# Parse options.
#
GetOptions( "dir=s", \$CONFIG{ 'dir' },
"lvm=s", \$CONFIG{ 'lvm' },
"evms=s", \$CONFIG{ 'evms' },
GetOptions( "dir=s", \$install{ 'dir' },
"lvm=s", \$install{ 'lvm' },
"evms=s", \$install{ 'evms' },
"help", \$HELP,
"manual", \$MANUAL,
"version", \$VERSION );
#
# Now make ensure that the command line setting of '--lvm', '--evms', '--zpool'
# and '--dir=x' override anything specified in the configuration file.
#
if ( $install{ 'dir' } )
{
$CONFIG{ 'dir' } = $install{ 'dir' };
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'evms' } )
{
$CONFIG{ 'dir' } = undef;
$CONFIG{ 'evms' } = $install{ 'evms' };
$CONFIG{ 'lvm' } = undef;
$CONFIG{ 'zpool' } = undef;
}
if ( $install{ 'lvm' } )
{
$CONFIG{ 'dir' } = undef;
$CONFIG{ 'evms' } = undef;
$CONFIG{ 'lvm' } = $install{ 'lvm' };
$CONFIG{ 'zpool' } = undef;
}
pod2usage(1) if $HELP;
pod2usage( -verbose => 2 ) if $MANUAL;

View File

@@ -148,7 +148,7 @@ $CONFIG{ 'extension' } = '.cfg';
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';

View File

@@ -100,7 +100,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
@@ -221,7 +221,7 @@ sub checkArguments
if ( !-d $dir )
{
print <<E_OR;
print <<EOR;
We\'re trying to configure an installation of $CONFIG{'dist'} in
$CONFIG{'location'} - but there is no hook directory for us to use.
@@ -231,7 +231,7 @@ sub checkArguments
We\'d expect the hook directory to be : $dir
Aborting.
E_OR
EOR
exit 1;
}

View File

@@ -52,9 +52,9 @@ full text of the license.
# Fallback to Debian or Ubuntu in case we can't find anything
my $fallback = 'Debian';
# Which mirrors to use if everything else fails (httpredir.debian.org
# Which mirrors to use if everything else fails (deb.debian.org
# redirects to a working mirror nearby)
my %fallback_mirror = ( Debian => 'http://httpredir.debian.org/debian/',
my %fallback_mirror = ( Debian => 'http://deb.debian.org/debian/',
Ubuntu => 'http://archive.ubuntu.com/ubuntu/' );
# Which suite to use if everything else fails. For Debian "stable"
@@ -62,7 +62,7 @@ my %fallback_mirror = ( Debian => 'http://httpredir.debian.org/debian/',
# have aliases like stable or testing, so we take the nearest LTS
# release which is 10.04 at the time of writing.
my %fallback_suite = ( Debian => 'stable',
Ubuntu => 'lucid' );
Ubuntu => 'bionic' );
# Where to look for the sources.list to parse
my @sources_list_files = ( '/etc/apt/sources.list',
@@ -79,7 +79,7 @@ use strict;
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
# Init
my $mirror = '';

View File

@@ -113,7 +113,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.7';
my $RELEASE = '4.9.1';
#
@@ -414,7 +414,7 @@ sub checkArguments
if ( !-d $dir )
{
print <<E_OR;
print <<EOR;
We are trying to configure an installation of $CONFIG{'dist'} in
$CONFIG{'location'} - but there is no hook directory for us to use.
@@ -424,7 +424,7 @@ sub checkArguments
We would expect the hook directory to be $dir.
Aborting.
E_OR
EOR
exit 1;
}

15
debian/NEWS vendored
View File

@@ -1,3 +1,18 @@
xen-tools (4.8-1) unstable; urgency=medium
For security reasons (avoid risk to circumvent ASLR), recent
kernels have disabled the vsyscall mapping. Unfortunately older
distributions don't run and hence can't be bootstrapped without it.
To enable trapping and enabling emulate calls into the fixed
vsyscall address mapping and hence to run and bootstrap older Linux
distributions in a chroot (as xen-tools does), you need to add
"vsyscall=emulate" to the kernel commandline, e.g. by adding it to
GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, then running
"update-grub" afterwards and finally reboot.
-- Axel Beckert <abe@debian.org> Thu, 07 Feb 2019 17:40:03 +0100
xen-tools (4.4~beta1-1) unstable; urgency=low
* Exported environment variables no more contain dashes ("-"). Dashes in

128
debian/changelog vendored
View File

@@ -1,3 +1,124 @@
xen-tools (4.9.1-1) unstable; urgency=medium
* New upstream bugfix release.
+ Fix missing "|" in regex in Debian's 20-setup-apt. (Closes: #997668)
+ Make test xt/gitignore.t work with git releases ≥ 2.32.0.
+ Travis CI: stop testing again Perl "dev". It no more seems to exist.
+ Also create an .orig.tar.xz signature upon "make release".
* Declare compliance with Debian Policy 4.6.0. (No changes needed.)
-- Axel Beckert <abe@debian.org> Sun, 24 Oct 2021 05:38:40 +0200
xen-tools (4.9-1) unstable; urgency=medium
* New upstream bugfix and minor feature release.
+ Mark Debian 7 Wheezy and 8 Jessie as EoL.
+ Update list of Ubuntu and Debian releases.
+ distributions.conf: Fix typo in release name of future Debian 12
release (bookwork → bookworm).
+ Actually install xen-resize-guest tool. (Thanks lintian for the
spare-manual-page warning!)
+ Distinguish between those Debian releases using $dist/updates for
security updates and those who use $dist-security. Thanks Paul Wise!
(Closes: #972749)
- Add test for this; needs libtest-file-contents-perl as build-dep.
+ Fix support for lvm_thin. Thanks to Andreas Sundstrom for the bug
report and patch! (Closes: #942244)
+ Mount /proc and /dev before calling update-grub. Thanks to Brandon
Bradley for the bug report and patch. (Closes: #815021)
+ Add Debian install rules for arm64. (GH #62; patch by Ian McLinden)
+ Add netplan p2p support for Ubuntu. (GH #58; patch by Volker Janzen)
+ Fix storage commandline options not overriding xen-tools.conf
settings also in xen-update-image and xen-delete-image. (GH #57;
patch by Volker Janzen)
+ partitions/sample-server: Change options=sync to
options=defaults. (GL MR !1; patch by Wolfgang Karall)
+ Start all Debian releases since Stretch (9) with pygrub by default.
* Recommend deboootstrap ≥ 1.0.117~ for working bootstrapping of Ubuntu
6.06 Dapper and 6.10 Edgy (see #659360) and for support of Ubuntu
17.10 Artful, 18.04 LTS Bionic, 18.10 Cosmic, 19.04 Disco, 19.10 Eoan,
and 20.04 Focal.
* Fix non-RFC-conforming four-letter day of week abbreviations in
ancient debian/changelog entries.
* Bump debian/watch version from 3 to 4. Thanks Lintian!
* Bump debhelper compatibility level to 13.
+ Build-depend on "debhelper-compat (= 13)" to replace debian/compat.
* Declare compliance with Debian Policy 4.5.1. (No changes required.)
* Adapt distributions.conf defaults to the fact that Debian Unstable
still ships Ubuntu keyrings as of 2018, see #978438.
-- Axel Beckert <abe@debian.org> Tue, 29 Dec 2020 12:19:51 +0100
xen-tools (4.8-1) unstable; urgency=medium
* New upstream release.
[ Marc Bigler ]
+ Add support for ZFS volumes. (GH #50)
[ Yuri Sakhno ]
+ Eliminate progress reporting which is useless in logs. (GH #42)
[ Axel Beckert ]
+ Add preliminary support for future Debian 12 Bookworm release.
+ Add support for Ubuntu releases from 17.10 Artful to 19.04 Disco.
- Create hooks/artful with new 40-setup-networking-deb-netplan by
Arno Bakker and Peter. (Fixes xen-tools/xen-tools#51)
- Rename hooks/karmic/80-install-kernel to
hooks/common/80-install-kernel-ubu and add according symlinks.
+ Change all occurrences of httpredir.debian.org to deb.debian.org
except those for the debian-archive. The latter now point to
archive.debian.org directly.
+ Set Ubuntu fallback suite to the latest LTS, i.e. 18.04 Bionic.
+ Drop pygrub path detection from xm.tmpl, Xen prefers a path-less
bootloader='pygrub'.
+ Many improvements for the release-testing script.
+ Only run xen-toolstack helper script if both, xm and xl are
present. Avoids warning about deprecated helper script.
+ distributions.conf now supports arbitrary keyring files in
/usr/share/keyrings/. (Needed for some EoL Ubuntu releases.)
[ Nico Boehr ]
+ Add support for LVM thin provisioning.
[ Pietro Stäheli ]
+ Add support for option --randommac for really random MAC addresses
upon every xen-create-image invocation. (Closes: #855703)
[ Axel Beckert ]
* Fix wrong bug number for #849867 in previous changelog entry.
* Declare compliance with Debian Policy 4.1.3.
+ Change Priority from extra to optional.
* Use "$(MAKE)" instead of "make" in debian/rules.
* debian/control: Drop "Testsuite: autopkgtest" header, no more needed.
* Switch "activate" trigger to "activate-noawait".
* Recommend e2fsprogs. (Closes: #887236)
* Prefer btrfs-progs over now transitional package btrfs-tools. (Closes:
#878910)
* Bump debhelper compatibility level to 10.
+ Update versioned debhelper build-dependency accordingly.
+ Only using dh compat level 10 allows one to still build the package
on Debian 9 Stretch without backports, on Ubuntu 18.04 LTS and on
Ubuntu 16.04 LTS with backports.
* Declare compliance with Debian Policy 4.3.0. (No changes needed.)
* Set "Rules-Requires-Root: no".
* Check $DEB_BUILD_OPTIONS and $DEB_BUILD_PROFILES in
override_dh_auto_test. Fixes according lintian warning.
* Use ubuntu-keyring instead of now transitional ubuntu-archive-keyring,
but keep the latter as alternative to allow one to install the
xen-tools package also on older Debian or Ubuntu releases.
* Suggest grub-xen-host despite the proper support for it is not
finished.
* Add a note about "vsyscall=emulate" and older Linux distributions to
debian/NEWS. Thanks to James Clarke and Jason Crain for the hint!
* Add a DEP-12 debian/upstream/metadata file.
[ Jelmer Vernooij ]
* Trim trailing whitespace from debian/changelog. (GH #54)
-- Axel Beckert <abe@debian.org> Sat, 09 Feb 2019 01:56:51 +0100
xen-tools (4.7-1) unstable; urgency=medium
* New upstream release
@@ -11,7 +132,7 @@ xen-tools (4.7-1) unstable; urgency=medium
+ Knows about Ubuntu's "devel" alias.
+ Risen default values for RAM sizes in /etc/xen-tools/xen-tools.cfg
to cope with risen resource consumption and availability.
(Closes: #776487)
(Closes: #849867)
+ Default file system is now ext4 (instead of ext3).
+ Fixes inconsistent/non-functional handling of --nopygrub
parameter. Thanks Daniel Reichelt for the bug report and patch!
@@ -920,7 +1041,7 @@ xen-tools (2.1-2) unstable; urgency=high
- Fixed several typos in the configuration file, and scripts.
(Closes: #375382)
-- Steve Kemp <skx@debian.org> Thur, 29 Jun 2006 10:31:23 +0000
-- Steve Kemp <skx@debian.org> Thu, 29 Jun 2006 10:31:23 +0000
xen-tools (2.1-1) unstable; urgency=high
@@ -934,7 +1055,7 @@ xen-tools (2.1-1) unstable; urgency=high
* Urgency set to high primarily because of the failure to create
swap devices.
-- Steve Kemp <skx@debian.org> Thur, 23 Jun 2006 10:08:32 +0000
-- Steve Kemp <skx@debian.org> Thu, 23 Jun 2006 10:08:32 +0000
xen-tools (2.0-1) unstable; urgency=low
@@ -1065,4 +1186,3 @@ xen-tools (0.4-1) unstable; urgency=low
* Initial release (Closes: #344081)
-- Radu Spineanu <radu@debian.org> Tue, 20 Dec 2005 02:21:05 +0200

1
debian/compat vendored
View File

@@ -1 +0,0 @@
9

34
debian/control vendored
View File

@@ -1,8 +1,8 @@
Source: xen-tools
Section: utils
Priority: extra
Priority: optional
Maintainer: Axel Beckert <abe@debian.org>
Build-Depends: debhelper (>= 9~),
Build-Depends: debhelper-compat (= 13),
devscripts,
git,
libdata-validate-domain-perl,
@@ -13,15 +13,16 @@ Build-Depends: debhelper (>= 9~),
liblog-message-perl | perl (<< 5.17.0),
libterm-ui-perl | perl (<< 5.17.0),
libsort-versions-perl,
libtest-file-contents-perl,
libtest-notabs-perl,
libtest-pod-coverage-perl,
libtest-pod-perl,
libtext-template-perl
Standards-Version: 3.9.8
Standards-Version: 4.6.0
Homepage: https://xen-tools.org/software/xen-tools
Vcs-Browser: https://github.com/xen-tools/xen-tools
Vcs-Git: https://github.com/xen-tools/xen-tools.git
Testsuite: autopkgtest
Rules-Requires-Root: no
Package: xen-tools
Architecture: all
@@ -40,14 +41,17 @@ Depends: debootstrap | cdebootstrap,
${misc:Depends},
${perl:Depends}
Recommends: debian-archive-keyring,
debootstrap (>= 1.0.117~),
e2fsprogs,
libexpect-perl,
lvm2,
rinse (>= 1.9.1-1),
ubuntu-archive-keyring,
ubuntu-keyring | ubuntu-archive-keyring,
xen-hypervisor,
xen-utils
Suggests: btrfs-tools,
Suggests: btrfs-progs | btrfs-tools,
cfengine2,
grub-xen-host,
reiserfsprogs,
xfsprogs
Description: Tools to manage Xen virtual servers
@@ -64,9 +68,11 @@ Description: Tools to manage Xen virtual servers
* Debian 6.0 Squeeze
* Debian 7 Wheezy
* Debian 8 Jessie
* Debian 9 Stretch (under development)
* Debian 10 Buster (future release name)
* Debian 11 Bullseye (future release name)
* Debian 9 Stretch
* Debian 10 Buster
* Debian 11 Bullseye (under development)
* Debian 12 Bookworm (knows about this future release name)
* Debian 13 Trixie (knows about this future release name)
* Debian Sid (Unstable)
* Ubuntu 6.06 Dapper Drake (LTS)
* Ubuntu 6.10 Edgy Eft
@@ -90,6 +96,14 @@ Description: Tools to manage Xen virtual servers
* Ubuntu 15.10 Wily Werewolf
* Ubuntu 16.04 Xenial Xerus (LTS)
* Ubuntu 16.10 Yakkety Yak
* Ubuntu 17.04 Zesty Zapus (preliminary support, under development)
* Ubuntu 17.04 Zesty Zapus
* Ubuntu 17.10 Artful Aardvark
* Ubuntu 18.04 Bionic Beaver (LTS)
* Ubuntu 18.10 Cosmic Cuttlefish
* Ubuntu 19.04 Disco Dingo
* Ubuntu 19.10 Eoan Ermine
* Ubuntu 20.04 Focal Fossa (LTS)
* Ubuntu 20.10 Groovy Gorilla
* Ubuntu 21.04 Hirsute Hippo (preliminary support, under development)
* CentOS 5
* CentOS 6

4
debian/rules vendored
View File

@@ -6,7 +6,9 @@
dh $@
override_dh_auto_test:
make non-author-test
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
$(MAKE) non-author-test
endif
override_dh_installchangelogs:
dh_installchangelogs NEWS.markdown

2
debian/triggers vendored
View File

@@ -1 +1 @@
activate update-initramfs
activate-noawait update-initramfs

12
debian/upstream/metadata vendored Normal file
View File

@@ -0,0 +1,12 @@
%YAML 1.1
---
# https://wiki.debian.org/UpstreamMetadata
Bug-Database: https://github.com/xen-tools/xen-tools/issues
Bug-Submit: https://github.com/xen-tools/xen-tools/issues/new
Changelog: https://github.com/xen-tools/xen-tools/blob/master/NEWS.markdown
Contact: mailto:xen-tools-discuss@xen-tools.org
Security-Contact: mailto:abe@debian.org
Name: Xen-Tools
Homepage: https://xen-tools.org/
Repository: https://github.com/xen-tools/xen-tools.git
Repository-Browse: https://github.com/xen-tools/xen-tools

2
debian/watch vendored
View File

@@ -4,7 +4,7 @@
#
# uscan version number - not the version of the software.
#
version=3
version=4
#

View File

@@ -6,28 +6,32 @@
#
# Known distributions: debian, ubuntu
# Known keywords: eol, pygrub, default-keyring, dont-test
# Known generic keywords: *.gpg (uses the according /usr/share/keyrings/….gpg file)
#
sarge = debian eol
etch = debian eol
lenny = debian eol
squeeze = debian eol default-keyring
wheezy = debian
jessie = debian
stretch = debian
buster = debian dont-test
bullseye = debian dont-test
sid = debian
wheezy = debian eol
jessie = debian eol
stretch = debian pygrub
buster = debian pygrub
bullseye = debian pygrub
bookworm = debian pygrub dont-test
trixie = debian pygrub dont-test
sid = debian pygrub
testing = debian
testing = debian pygrub
oldoldstable = debian dont-test
oldstable = debian
stable = debian
unstable = debian
oldstable = debian pygrub
stable = debian pygrub
unstable = debian pygrub
# dapper and edgy currently need manual adjustments in debootstrap's
# configuration, see #659360
dapper = ubuntu eol dont-test
edgy = ubuntu eol dont-test
# Between at least debootstrap 1.0.37 and 1.0.93 (including), dapper
# and edgy may need manual adjustments in debootstrap's configuration,
# see https://bugs.debian.org/659360
dapper = ubuntu eol
edgy = ubuntu eol
feisty = ubuntu eol
gutsy = ubuntu eol
hardy = ubuntu eol
@@ -38,7 +42,7 @@ lucid = ubuntu eol pygrub
maverick = ubuntu eol pygrub
natty = ubuntu eol pygrub
oneiric = ubuntu eol pygrub
precise = ubuntu pygrub
precise = ubuntu pygrub ubuntu-archive-removed-keys.gpg
quantal = ubuntu eol pygrub
raring = ubuntu eol pygrub
saucy = ubuntu eol pygrub
@@ -47,7 +51,15 @@ utopic = ubuntu eol pygrub
vivid = ubuntu eol pygrub
wily = ubuntu eol pygrub
xenial = ubuntu pygrub
yakkety = ubuntu pygrub
zesty = ubuntu pygrub
yakkety = ubuntu eol pygrub
zesty = ubuntu eol pygrub ubuntu-keyring-2012-archive.gpg
artful = ubuntu eol pygrub ubuntu-archive-keyring.gpg
bionic = ubuntu pygrub
cosmic = ubuntu eol pygrub ubuntu-archive-keyring.gpg
disco = ubuntu eol pygrub ubuntu-archive-keyring.gpg
eoan = ubuntu eol pygrub ubuntu-archive-keyring.gpg
focal = ubuntu pygrub
groovy = ubuntu pygrub
hirsute = ubuntu pygrub
devel = ubuntu pygrub
devel = ubuntu pygrub dont-test

View File

@@ -1,7 +1,7 @@
# xen-tools default mirror configuration file
debian = http://httpredir.debian.org/debian
debian_archive = http://httpredir.debian.org/debian-archive/debian
debian = http://deb.debian.org/debian
debian_archive = http://archive.debian.org/debian
ubuntu = http://archive.ubuntu.com/ubuntu
ubuntu_archive = http://old-releases.ubuntu.com/ubuntu

View File

@@ -54,6 +54,14 @@
##
# lvm = vg0
#
##
#
# If you have ZFS available and wish to use it then you may specify a
# ZFS pool name here instead
#
##
# zpool = xenpool0
#
##

View File

@@ -20,20 +20,7 @@
{
if ( $pygrub )
{
my $pygrub_bin = '';
foreach my $pygrub_path (reverse glob('/usr/lib/xen-default/bin/pygrub
/usr/lib/xen-*/bin/pygrub
/usr/*bin/pygrub
/usr/local/bin/pygrub')) {
if (-x $pygrub_path) {
$pygrub_bin = $pygrub_path;
last;
}
}
die "pygrub not found" unless $pygrub_bin;
$OUT .= "bootloader = '$pygrub_bin'\n";
$OUT .= "bootloader = 'pygrub'\n";
}
}
vcpus = '{$vcpus}'

View File

@@ -1,10 +1,13 @@
#!/bin/sh
#!/bin/bash
set -e
exec 2>&1 | tee xen-tools-release-testing.log
exec 2>&1
exec > >( tee xen-tools-release-testing-$(date -Iseconds).log )
DISTRIBUTIONS=$(awk '!/^#|^$|dont-test/ {print $1}' /etc/xen-tools/distributions.conf)
if [ -z "$DISTRIBUTIONS" ]; then
DISTRIBUTIONS=$(awk '!/^#|^$|dont-test/ {print $1}' /etc/xen-tools/distributions.conf)
fi
echo Deleting old release-testing artefacts
for dist in $DISTRIBUTIONS; do
@@ -18,7 +21,30 @@ seconds=10
printf "Sleeping for %i seconds to avoid LVM race conditions: " $seconds
for i in $(seq 1 $seconds); do sleep 1; printf "%i " $i; done; printf '\n';
SUCCEEDED=''
FAILED=''
# From now on we just want to log failures, not abort.
set +e
for dist in $DISTRIBUTIONS; do
echo "*** Creating xen-tools-release-testing-$dist..."
xen-create-image --verbose --hostname "xen-tools-release-testing-$dist" --dist $dist --force "$@"
if [ "$?" -eq '0' ]; then
SUCCEEDED="$dist $SUCCEEDED"
else
FAILED="$dist $FAILED"
fi
done
echo ''
echo '======================================================================'
if [ -z "$FAILED" ]; then
echo '*** All tests succeeded! ***'
elif [ -z "$SUCCEEDED" ]; then
echo '*** All tests failed! ***'
else
echo "*** These distributions succeeded: $SUCCEEDED ***"
echo "*** These distributions failed: $FAILED ***"
fi

View File

@@ -0,0 +1 @@
../common/01-disable-daemons

View File

@@ -0,0 +1 @@
../common/05-shadowconfig-on

View File

@@ -0,0 +1 @@
../common/15-disable-hwclock

1
hooks/artful/20-setup-apt Symbolic link
View File

@@ -0,0 +1 @@
../common/20-setup-apt

View File

@@ -0,0 +1 @@
../common/25-generate-locale

View File

@@ -0,0 +1 @@
../common/30-disable-gettys

1
hooks/artful/35-setup-users Symbolic link
View File

@@ -0,0 +1 @@
../common/35-setup-users

View File

@@ -0,0 +1,147 @@
#!/bin/sh
#
# This script sets up the /etc/netplan/interface file for the new
# image.
#
# Steve
# --
# https://steve.fi/
prefix=$1
#
# Source our common functions
#
if [ -e /usr/share/xen-tools/common.sh ]; then
. /usr/share/xen-tools/common.sh
else
. ./hooks/common.sh
fi
# From: https://serverfault.com/questions/54981/linux-command-line-tool-to-work-with-netmasks-cidr-notation
mask2cdr ()
{
# Assumes there's no "255." after a non-255 byte in the mask
local x=${1##*255.}
set -- 0^^^128^192^224^240^248^252^254^ $(( (${#1} - ${#x})*2 )) ${x%%.*}
x=${1%%$3*}
echo $(( $2 + (${#x}/4) ))
}
#
# Log our start
#
logMessage Script $0 starting
#
# Make sure we have an /etc/netplan directory.
#
mkdir -p ${prefix}/etc/netplan
#
# A function to setup DHCP for our new image.
#
setupDynamicNetworking ()
{
#
# The host is using DHCP.
#
cat <<E_O_DHCP > ${prefix}/etc/netplan/01-netcfg.yaml
# Arno: Configure VM interface eth0 via DHCP
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
E_O_DHCP
}
#
# A function to setup static IP addresses for our new image.
#
setupStaticNetworking ()
{
# Arno
cidr='24';
if [ -n "${netmask}" ]; then
cidr="$(mask2cdr ${netmask})"
fi
# p2p code by Volker Janzen
gate=" gateway4: ${gateway}";
point='';
if [ -n "${p2p}" ]; then
# For a p2p setup the gateway4 keyword is replaced by the
# following on-link default route, when it matches the
# gateway4.
if [ "${p2p}" = "${gateway}" ]; then
gate=" routes:
- to: 0.0.0.0/0
via: ${p2p}
on-link: true"
else
gate="${gate}
routes:
- to: ${p2p}
on-link: true"
fi
fi
#
# We have a static IP address
#
cat <<E_O_STATIC >${prefix}/etc/netplan/01-netcfg.yaml
# Arno: Set static IP for VM interface eth0
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses: [${ip1}/${cidr}]
${gate}
nameservers:
addresses: [${nameserver}]
E_O_STATIC
# Arno: no support for multiple interfaces
#
# Hooks are run chrooted, hence the resolv.conf is moved
# temporarily to /etc/resolv.conf.old. Use that file, it
# will be restored after hooks are run.
#
if [ '' != "$nameserver" ]; then
rm -f ${prefix}/etc/resolv.conf.old
for ns in $nameserver; do
echo "nameserver $ns" >>${prefix}/etc/resolv.conf.old
done
else
cp /etc/resolv.conf ${prefix}/etc/resolv.conf.old
fi
}
#
# Call the relevant function
#
if [ -z "${dhcp}" ]; then
logMessage "Setting up static networking"
setupStaticNetworking
else
logMessage "Setting up DHCP networking"
setupDynamicNetworking
fi
#
# Log our finish
#
logMessage Script $0 finished

View File

@@ -0,0 +1 @@
../common/50-setup-hostname-deb

View File

@@ -0,0 +1 @@
../common/60-copy-host-files

View File

@@ -0,0 +1 @@
../common/65-copy-user-files

1
hooks/artful/70-install-ssh Symbolic link
View File

@@ -0,0 +1 @@
../common/70-install-ssh-deb

View File

@@ -0,0 +1 @@
../common/75-fixup-securetty

View File

@@ -0,0 +1 @@
../common/80-install-kernel-ubuntu

View File

@@ -0,0 +1 @@
../common/80-install-modules-deb

View File

@@ -0,0 +1 @@
../common/81-install-modules-init-tools

View File

@@ -0,0 +1 @@
../common/82-install-grub-legacy

1
hooks/artful/90-make-fstab Symbolic link
View File

@@ -0,0 +1 @@
../common/90-make-fstab

1
hooks/artful/99-clean-image Symbolic link
View File

@@ -0,0 +1 @@
../common/99-clean-image-deb

View File

@@ -0,0 +1 @@
../common/99-enable-daemons

View File

@@ -96,7 +96,7 @@ installDebianPackageAndRecommends ()
#
# Install the packages
#
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes install "$@"
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes install "$@" 2>&1 | sed --expression="s/\rExtracting templates from packages: [0-9]\+%//g;s/(Reading database ... \([0-9]\+%\)\?\r//g"
#
# Remove the policy-rc.d script.

View File

@@ -1,7 +1,6 @@
#!/bin/sh
#
# Copy files from a 'skel' directory, if present, into the
# new images
# Copy some specific files from host nachine into the new images
#

View File

@@ -38,7 +38,7 @@ if [ -d /etc/xen-tools/skel ]; then
else
logMessage skel directory, /etc/xen-tools/skell, not present ignoring.
logMessage skel directory, /etc/xen-tools/skel, not present ignoring.
fi

View File

@@ -40,7 +40,11 @@ fi
if [ ! -e ${prefix}/boot/grub/default ]; then
echo default > ${prefix}/boot/grub/default
fi
mount -o bind /proc ${prefix}/proc
mount -o bind /dev ${prefix}/dev
chroot ${prefix} /usr/sbin/update-grub
umount ${prefix}/proc
umount ${prefix}/dev
else
logMessage "pygrub not set, skipping grub-legacy installation"

View File

@@ -66,23 +66,51 @@ if ( test "${dist}" "!=" "sid" && test "${dist}" "!=" "unstable" && \
test -e /etc/apt/sources.list && \
grep ^deb.*security -r /etc/apt/sources.list /etc/apt/sources.list.d >/dev/null 2>/dev/null ) ; then
cat <<E_O_APT >> ${prefix}/etc/apt/sources.list
#
# Security updates
#
if echo "${dist}" | egrep -q '\b(sarge|etch|lenny|squeeze|wheezy|jessie|stretch|buster)\b'; then
cat <<E_O_APT >> ${prefix}/etc/apt/sources.list
#
# Security updates
#
deb http://security.debian.org/ ${dist}/updates main contrib non-free
deb-src http://security.debian.org/ ${dist}/updates main contrib non-free
E_O_APT
else
cat <<E_O_APT >> ${prefix}/etc/apt/sources.list
#
# Security updates
#
deb http://security.debian.org/ ${dist}-security main contrib non-free
deb-src http://security.debian.org/ ${dist}-security main contrib non-free
E_O_APT
fi
else
cat <<E_O_APT >> ${prefix}/etc/apt/sources.list
#
# Security updates - Uncomment to enable.
#
if echo "${dist}" | egrep -q '\b(sarge|etch|lenny|squeeze|wheezyjessie|stretch|buster)\b'; then
cat <<E_O_APT >> ${prefix}/etc/apt/sources.list
#
# Security updates - Uncomment to enable.
#
# deb http://security.debian.org/ ${dist}/updates main contrib non-free
# deb-src http://security.debian.org/ ${dist}/updates main contrib non-free
E_O_APT
else
cat <<E_O_APT >> ${prefix}/etc/apt/sources.list
#
# Security updates - Uncomment to enable.
#
# deb http://security.debian.org/ ${dist}-security main contrib non-free
# deb-src http://security.debian.org/ ${dist}-security main contrib non-free
E_O_APT
fi
fi
#

View File

@@ -36,12 +36,16 @@ if [ "${arch}" = "i386" ]; then
XEN_ARCH="686"
elif [ "${arch}" = "amd64" ]; then
XEN_ARCH="amd64"
elif [ "${arch}" = "arm64" ]; then
XEN_ARCH="arm64"
elif [ -z "${arch}" ]; then
UNAME_ARCH=`uname -m`
if [ "${UNAME_ARCH}" = "i686" ]; then
XEN_ARCH="686"
elif [ "${UNAME_ARCH}" = "x86_64" ]; then
XEN_ARCH="amd64"
elif [ "${UNAME_ARCH}" = "aarch64" ]; then
XEN_ARCH="arm64"
else
logMessage Unknown kernel architecture ${UNAME_ARCH}.
logMessage Please report this as bug to xen-tools-dev@xen-tools.org.

View File

@@ -0,0 +1 @@
../common/80-install-kernel-ubuntu

View File

@@ -129,7 +129,7 @@ sub xenRunning ($$)
my $running = 0;
unless ($CONFIG->{'xm'}) {
warn "Couldn't determine Xen toolstack, skipping check for running DomUs."
warn "Couldn't determine Xen toolstack, skipping check for running DomUs.\n"
unless $ENV{AS_INSTALLED_TESTING};
return 0;
}
@@ -161,18 +161,19 @@ sub findXenToolstack
{
my $helper = '/usr/lib/xen-common/bin/xen-toolstack';
if (-x $helper) {
my $xm = which('xm');
my $xl = which('xl');
if ($xm and $xl and -x $helper) {
my $toolstack = `$helper`;
chomp($toolstack);
return $toolstack if $toolstack;
}
my $xm = which('xm');
if ($xm and system("$xm list >/dev/null 2>/dev/null") == 0) {
return $xm;
}
my $xl = which('xl');
if ($xl and system("$xl list >/dev/null 2>/dev/null") == 0) {
return $xl;
}

View File

@@ -2,7 +2,7 @@
size=1G
type=ext3
mountpoint=/
options=sync,errors=remount-ro
options=defaults,errors=remount-ro
[swap]
size=2G

95
t/hook-apt.t Executable file
View File

@@ -0,0 +1,95 @@
#!perl -w
#
# Test that the /etc/inittab file is modified as we expect.
#
# Steve
# --
#
use strict;
use Test::More;
use Test::File::Contents;
use File::Temp;
use File::Copy;
use File::Path qw(make_path);
my $hook_dir = $ENV{AS_INSTALLED_TESTING} ? '/usr/share/xen-tools' : 'hooks';
foreach my $dist (qw(stretch buster bullseye bookworm sid)) {
testHook( $dist );
}
done_testing();
sub testHook
{
my ( $dist ) = ( @_ );
my $ea = 'etc/apt';
my $easl = "$ea/sources.list";
my $hook = "$hook_dir/" .
(
$ENV{AS_INSTALLED_TESTING} ?
$dist :
'debian'
) . '/20-setup-apt';
#
# Create a temporary directory to use as prefix
#
my $dir = File::Temp::tempdir( CLEANUP => 1 );
make_path( "$dir/$ea/apt.conf.d", { chmod => 0755 });
make_path( "$dir/bin", { chmod => 0755 });
my $tmphook = "$dir/bin/20-setup-apt";
#
# Make sure that worked.
#
ok( -d $dir, "temporary directory created OK [$dist]" );
ok( -d "$dir/bin",
"bin inside temporary directory created OK [$dist]" );
ok( -d "$dir/$ea",
"$ea inside temporary directory created OK [$dist]" );
# Create a copy of the 20-setup-apt hook to be able to comment out
# the chroot + apt-get update call.
File::Copy::cp( $hook, $tmphook );
ok( -e "$tmphook", "hook exists in temporary directory [$dist]" );
# File::Copy in Perl 5.10 does not copy permissions, so let's fix
# it there and check for it elsewhere.
if ($] < 5.011) {
chmod(0755, $tmphook);
} else {
ok( -x "$tmphook", "hook is executable in temporary directory [$dist]" );
}
no warnings qw(qw);
is(system(qw(sed -e s/chroot/#chroot/ -i), $tmphook) >> 8, 0,
"chroot call in hook could be deactivated [$dist]");
use warnings qw(qw);
#
# Set up some variables expected by the hook
#
$ENV{dist} = $dist;
$ENV{mirror} = 'http://deb.debian.org/debian';
#
# Call the hook
#
is(system($tmphook, $dir) >> 8, 0,
"hook for $dist exited with zero return code");
ok( -e "$dir/$easl", "A sources.list file has been created. [$dist]" );
if ($dist =~ /stretch|buster/) {
file_contents_like( "$dir/$easl", qr(\b${dist}/updates\b),
"sources.list contains $dist/updates");
file_contents_unlike( "$dir/$easl", qr(\b${dist}-security\b),
"sources.list doesn't contain $dist-security");
} else {
file_contents_like( "$dir/$easl", qr(\b${dist}-security\b),
"sources.list contains $dist-security");
file_contents_unlike( "$dir/$easl", qr(\b${dist}/updates\b),
"sources.list doesn't contain $dist/updates");
}
}

View File

@@ -23,7 +23,7 @@ if (which('git') and -d '.git') {
use_ok( 'Git' );
# First, check that no tracked files are ignored
my $cmd = Git::command_output_pipe('ls-files', '--ignored', '--exclude-standard');
my $cmd = Git::command_output_pipe('ls-files', '--cached', '--ignored', '--exclude-standard');
my $output;
while (<$cmd>) { $output .= "--> $_" }
close $cmd;

View File

@@ -9,11 +9,9 @@
use strict;
use File::Find;
use Test::More;
use Test::NoTabs;
# Check all Perl files
all_perl_files_ok();
#
# Find all the files beneath the current directory,
# and call 'checkFile' with the name.
@@ -54,25 +52,36 @@ sub checkFile
my $isShell = 0;
my $isPerl = 0;
# Read the file.
open( INPUT, "<", $file );
foreach my $line ( <INPUT> )
{
if ( ( $line =~ /\/bin\/sh/ ) ||
( $line =~ /\/bin\/bash/ ) )
if ( $file =~ /\.sh$/ ) {
$isShell = 1;
} elsif ( $file =~ /\.(pl|pm|t)$/ ) {
$isPerl = 1;
} else {
# Read the file.
open( INPUT, "<", $file );
foreach my $line ( <INPUT> )
{
$isShell = 1;
last;
}
if ( $line =~ /\/usr\/bin\/perl/ )
{
last;
if ( ( $line =~ /^#! *\/bin\/sh/ ) ||
( $line =~ /^#! *\/bin\/bash/ ) )
{
$isShell = 1;
last;
}
if ( $line =~ /^#!.*\bperl\b/ )
{
$isPerl = 1;
last;
}
}
close( INPUT );
}
close( INPUT );
#
# Run check if it is a shell file.
#
notabs_ok( $file ) if $isShell;
notabs_ok( $file ) if $isShell or $isPerl;
}
done_testing();