aboutsummaryrefslogtreecommitdiffstats
path: root/README.Mageia.md
blob: 6d352bd55013589ff3c0bfd9b9c952e59103aa01 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Mageia's Init Scripts

This is a fork of the Fedora Init Script package which currently lives over at
[Fedora-SysV on GitHub](https://github.com/fedora-sysv/initscripts.git).

----
## History

This repository was recreated from the original Mandriva initscripts by Mageia (and formerly Mandriva) contributor Colin Guthrie to help better manage merging of upstream Fedora changes.

Many of the changes made relate to translations which are now hideously out of date, and various networking tweaks and various things to improve boot speed (aka SpeedBoot) from before the times of [systemd](http://www.freedesktop.org/wiki/Software/systemd/). Several of these changes have now been removed again as they are obsolete.

The repository does not contain full history (although that was an original intention) as the benefits of this vs. the effort involved are somewhat questionable.

### Known todo list (issues)

- [x] Reduce divergence of mandrake/po/Makefile and upstreams po/Makefile. The mandrake/po/Makefile seems to be based of the po/Makefile from commit 5a6dbf7d3da8e5bdda3facb7c8aff2d2b9566ee6 (upstream initscripts).: Done except for the po-mageia/Makefile
- [x] Remove usage of /etc/locale; no need as systemd already ensures /usr is available
- [ ] Upstreams service script had a lot of fixes. Our version deviates heavily. The fixes need to be investigated. Possibly be closer to upstream
- [ ] Upstream gives a deprecation notice for the network scripts. Need to raise with dev mailing list
- [ ] Investigate moving some of our things to /usr/libexec, similar to: netconsole, import-state, loadmodules, readonly-root
- [ ] Commit 59928ce72da10f1c45a0aa08c9dd3a439fdd74a0 cleaned up the lang.{csh,sh} files before removing them. These cleanups need to be investigated. Also need to check any possible changes made in setup package
- [x] Check if our customizations rely on the (removed) shvar program: Nope, see comment in next section
- [ ] Upstream implemented alternatives system for ifup and ifdown. Need to align with NetworkManager.
- [x] Upstream switched from using awk to using tr in commit beeec3c4050e2986f514725c92d1cb1d65005926. Check if our scripts rely on that. Finding: this was only changed in a few lines. It still heavily relies on awk. No similar changes needed for our bits.

Low priority:
- [ ] Use gprintify.py from spec-helper. This fork carries an outdated slightly modified copy of gprintify.py. The current version of gprintify has been ported to Perl and can be found in spec-helper. The modifications to gprintify.py seem to be based off b83c14a5a82de64992144f24d819b8421cc417cf in spec-helper.
- [ ] Figure out if upstream commit 4e2400798397ae2567a8cfd824c14ccd41983b08 solved one of our Mageia customizations (grep for "We need to wait for duplicate address detection to complete before running dhclient -6")
- [x] Rename mandrake directory to mageia
- [ ] Look at po-mageia/Makefile

### Stuff upstream removed

- [ ] cgroup support (use systemd!)
- [ ] /etc/rwtab.d & /etc/statetab.d (empty) folders to 'filesystem' package: Moved as per filesystem-2.1.9-34. Cannot upload, asked sysadmins to fix.
- [x] nis-domainname.service moved to the hostname package (https://src.fedoraproject.org/rpms/hostname/pull-request/1): As this was a different name, moved this in hostname-3.23-2
- [ ] netreport functionality
- [x] /etc/networks moved into 'setup' package: Moved in setup 2.7.25. Also aligned setup to be more like Fedora. The setup repository still has quite some deviations with Fedora.
- [x] lang.{sh,csh} moved into setup package: Kept in our fork for now.
- [x] sushell was removed: Investigated this, any reference to this still handled the lack of sushell. Plus systemd has its own (better) thing.
- [x] shvar was removed: Not used in our fork. Usage removed upstream in 2000. No use in my installation (checked /etc, /usr)
- [x] po/xgettext_sh was removed: Also not used by us
- [x] sys-unconfig was removed. It was a shell script to reconfigure the system upon next boot: Probably never used.
- [x] etc/adjtime and /etc/sysconfig/clock moved into 'util-linux' package: /etc/adjtime moved. /etc/sysconfig/clock was just the documentation; file has not been in use. /etc/sysconfig/clock usage found in drakx-net, drakx, filed bug 27012

Low priority:
- [ ] /etc/rc.d/rc.local (for local changes by a sysadmin): systemd has a reference to this; but probably no need to have it as ghost in initscripts

### Stuff deprecrated

- [ ] consoletype: affects our lang.{csh,sh} forks
- [ ] genhostid

----
## How to Use

In order to use this repository usefully in Mageia, you have to follow a few rules for cloning that are somewhat non standard due to this being a "fork".

### Cloning

To clone, you should first clone from upstream Fedora first:

    $ git clone https://github.com/fedora-sysv/initscripts

Once it's cloned, you need to then add a remote for *our* fork:

    $ cd initscripts
    $ git remote add mga ssh://git@git.mageia.org/software/forks/initscripts
    $ git remote update mga

And once you have that updated, you should setup a local tracking branch for our main development branch which is named simple *distro/mga*:

    $ git checkout -t mga/distro/mga

* Note 1: The branches for stable distro releases are named *distro/mga1*, *distro/mga2* etc.
* Note 2: It is strongly recommended to install the *git-prompt* package to see which branch you are currently using.

### Merging with upstream

When upstream release a new version, we will periodically merge in their changes. Due to the deviations over the years this is sometimes a rather complex task and not for the faint hearted! That said, some of our modifications really are out of date now and could, in all honesty, be dropped in favour of the upstream version - probably worth keeping this in mind when doing a complex merge and perhaps discussing with others on the Cauldron mailing list.

#### Updating upstream

You need to update from upstream so you can do:

    $ git checkout master
    $ git pull

This should bring in new code from fedora.

You can then push this to us quite happily:

    $ git push mga master
    $ git push mga --tags

* **Important Note**: Keep in mind that our master branch should just be a mirror of Fedora's. We should not put any of our own changes on this branch.

#### Merging

Before doing a merge, it's good to minimize the changes with upstream. For example, if the fork is based upon 9.78, first check for the changes. Use:

  $ git diff 9.78...mga/distro/mga ':!man/' ':!mandriva/ChangeLog' ':!*.po' ':!mandriva/po'

In above command git is instructed to hide certain directories. Make sure to run the command from the main directory for this to work.

We try to stick to merging only upstream tags. To do this we would simply do:

    $ git checkout distro/mga
    $ git merge 9.78

You then have the fun job of fixing the (no doubt) numerous conflicts!

When you are ready to commit, please just use the default commit message git generates automatically for a merge commit. It will automatically list any files that had merge conflicts.

If you have decided to revert a file to the upstream version in your commit, please mention this in the commit message at the end.

### Packaging changes

#### Super patch
Periodically, we will generate a **super patch** containing all our changes. This patch is generated from the upstream tag of the tarball we are using and our current HEAD. It is generated via a command similar to:

    $ git diff 9.78..mga/distro/mga | xz >initscripts-mgaconf.patch.xz

* Note that the *upstream* branch for *distro/mga* is used (as it's prefixed with the remote name *mga/*). This is because you should be careful to only generate the super patch from changes you **have already pushed**. If you do not do this other contributors may not be able to verify your patch and some commits may even be lost. You have been warned!

Once you have generated the super patch you should note the sha1 of the the current head and include it as a comment in the initscripts.spec file.

#### Incremental patches

In order to cut down on the number of times we regenerate the super patch we will usually package incremental patches to fix issues as they occur. These patches should be committed to the distro/mgaN branch and pushed. Once they have been pushed they should not be edited and any further changes should be made as new patches.

To generate the incremental patches take the sha1 sum as noted in the initscripts.spec and run the following command:

    $ git format-patch --start-number 100 SHA1..mga/distro/mga

* Note: that I've used the full remote branch name here too which means changes have to be pushed first, but if you are creating a package for testing you can of course just use your local branch.

### Pushing changes

When you are happy with your changes you should push them. To do this type:

    $ git push mga distro/mga

You can adjust this accordingly to match various git config settings as you see fit.