Also enables support for Alpine post-upgrade script with warning
if it's necessary to run update-conf to apply new version of files
in /etc:
```
...
Executing one-context-6.1.80-r0.20210809gitbcd3c5b.post-upgrade
WARNING: Run update-conf to process any updated one-context files in /etc!
Executing busybox-1.33.1-r2.trigger
Executing eudev-3.2.10-r0.trigger
OK: 148 MiB in 118 packages
$ update-conf -l
//etc/one-context.d/loc-09-timezone
//etc/one-context.d/loc-30-console
//etc/one-context.d/loc-10-network
//etc/one-context.d/loc-16-gen-env
```
Closes#163
- Use one script loc-10-network for all systems
- Deduplicate and cleanup the code
- Create a source file with functions
- Remove usage of global variables while using shared functions
- Add support for different network configuration via new context
parameter: CONTEXT_NETCFG_TYPE
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
The default 'awk' _alternative_ on the Debian is an old mawk of version
1.3.3 with plenty of bugs and problems. One of them is the lack of
support for POSIX regex character classes which old mawk does not know
despite the fact that it does advertise a support for extended regex (as
egrep for example).
This was reported and fixed in 2009 with version of 1.3.4 but Debian is
still using the old unfixed version 1.3.3:
https://bugs.launchpad.net/ubuntu/+source/mawk/+bug/69724
This commit workaround this issue by simple test and possible abort if
the usage of an incompatible awk implementation is unreasonable - user
choice.
Note: Currently just only two optional (non-default) tests are skipped
due to this issue.
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
Because MOUNT_DIR can be different than real MOUNT_DIR,
so we would need to pass it to realpath. Which is not on
some legacy systems like RHEL 6 or Ubuntu 14.04.
- In case the CD-ROM is not mounted "glabel status | grep CONTEXT | awk '{print $3}'"
will have a null string which will eventually assign the value "/dev/" to "dev_context"
variable. In later occasions while existence of "dev_context" is checked it will
always return true and no elif conditions will be executed. Add additional glabel check
for BSD.
- In case the CD-ROM is not mounted and used there is nothing to unmount and eventually
trying to unmount will throw error. So add an additional check to see if "MOUNT_DIR" is
used as any mount points or not.
Add new context variable 'GROW_FS' which can contain list of directories
(mount-points) separated by spaces.
If GROW_ROOTFS is set to 'YES' then the rootfs will be added in the case
when GROW_FS does not contain '/'.
NOTE: The image has to have the disk name(s) - the underlying device(s)
which are mounted - to follow the simple scheme <name>[<part>] where
name cannot contain any numeric and the part must be only a numeric,
e.g.: /dev/sda1
(Arbitrary disk names are not supported, e.g.: /dev/mapper/luks-1234)
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
Introduce new OpenNebula directory /var/lib/one-context where a new tmp
directory is located. This new one will not be mounted with noexec
option on any system by default.
Add cleanup handler on the script exit and ensure the correct return
code for the init scripts (if one or more fail then return non-zero).
Update onesysprep and set its version by generate.sh script.
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
ifupdown2 is an alternative to classic ifupdown
https://github.com/CumulusNetworks/ifupdown2
It's allow to reload online network configuration with dependencies
and 100% compatible with classic ifupdown1 config.
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
+ fix error when CONTEXT_FILE is empty (not likely)
+ fix other warning/error messages shown in the log
+ make the script compliant with shellshock
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #83: Add route metric support
- BSD has no support for metrics:
https://redmine.pfsense.org/issues/1521
Signed-off-by: Petr Ospalý <pospaly@opennebula.systems>
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #83: Remove unsupported ipv6 metric
- distro's network scripts have no support for ipv6 metrics - no reason
then to provide ipv6 specific METRIC6 variable
- fix whitespace
Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
* F #159: Support ALT Linux
* F #159: Support ALT Linux
* F #159: Support ALT Linux
* F #159: add support for alias context
Co-authored-by: Alejandro Huertas <ahuertas@opennebula.io>