aboutsummaryrefslogtreecommitdiffstats
path: root/README
blob: d15f6d517dfee6738020ab9e0e5278b9033b7d67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
===========
dfly-update
===========

Copyright (c) 2017-2018 Aaron LI <aly@aaronly.me>
MIT License

https://github.com/liweitianux/dfly-update

A simple tool to update a DragonFly BSD system using binary releases or
snapshot builds.

Tests, issue reports, and pull requests welcome :)

Introduction
------------
The officially supported method to update a DFly system is building and
installing from sources.  However, it's time-consuming, hard or even
impossible to build sources on a small or low-end VPS, and it's also not
easy to transfer the built "/usr/obj" (which is rather big) to a remote
VPS for an update.

Therefore, a smiple tool to update a DragonFly BSD system directly from
the officially built release or snapshot images is very useful and
necessary.

This tool refers to the installation procedures and the official source
upgrade processes to implement the update task, which mainly includes
the following steps:

1. check local and remote available versions;
2. download the latest release/master system image (.img.bz2);
3. decompress and mount the image;
4. backup the current kernel and world (including /etc);
5. install the kernel and world using cpdup (similar to the installer);
6. identify the new/changed /etc files, rename the conflicting ones with
   suffix ".__new__" and then copy over;
7. get obsolete files from Makefile_upgrade.inc and remove them;
8. umount, remove image file, show the "*.__new__" files need manual
   merge.

Usage
-----
dfly# git clone https://github.com/liweitianux/dfly-update
dfly# cd dfly-update

* One-step update:
  dfly# ./dfly-update fly

* Step-by-step update:
  1. check local and remote status:
     dfly# ./dfly-update status
  2. use the above printed remote filename and md5 to download it:
     dfly# ./dfly-update <filename> <md5>
  3. mount the downloaded image:
     dfly# ./dfly-update /var/tmp/dfly-update/<filename>
  4. backup the current kernel and world (including /etc):
     dfly# ./dfly-update backup
  5. install the new kernel, world, and /etc files:
     dfly# ./dfly-update upgrade
  6. remove obsolete files, umount, and remove the downloaded image:
     dfly# ./dfly-update cleanup

NOTE:
After this, you still need to merge the listed config files with suffix
".__new__", and also upgrade the packages.

Versions
--------
* 0.1.4 (2018-12-20)
  - Install "/rescue" directory
  - Improve mtree(8) usage
* 0.1.3 (2018-04-16)
  - Fix the issue that the old Makefile_upgrade been used
  - Make the upgrade messages more concise
* 0.1.2 (2018-03-11)
  - First usable version for broader testing

Tests
-----
* 4.8.0-RELEASE -> 5.0.2-RELEASE
* 5.0.0-RELEASE -> 5.0.2-RELEASE
* 5.0.2-RELEASE -> 5.1.0.1010.gf2063-DEVELOPMENT
  (set "UPDATE_BRANCH=master")
* 5.1.0.884.g8095c-DEVELOPMENT -> v5.3.0.110.g8296de-DEVELOPMENT

Examples
--------
Example output for updating DragonFly BSD using this tool can be found
in the "examples" directory.

TODO
----
* Merge new users/groups
* Interactively merge updated /etc files
  (borrow OpenBSD's sysmerge(8) or improve/simplify mergemaster(8))
* Update databases such as user/password, login, locate, man page, etc.
* rcs(1) controlled /etc upgrade