1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-15 11:22:43 +03:00

63 Commits

Author SHA1 Message Date
Jake Buchholz Göktürk
3894cd9f8d Support "local-hostname" 3.0.0_rc0 2023-04-30 23:23:54 +00:00
Jake Buchholz Göktürk
fb2d658d93 Move cloud libs deeper. 2023-04-30 14:55:51 -07:00
Jake Buchholz Göktürk
81869cefcc Consolidate init functionality in /sbin/tiny-cloud 2023-04-30 03:37:11 +00:00
Jake Buchholz Göktürk
762fe36bb8 Move OpenRC Init Scripts 2023-04-29 14:14:20 -07:00
Jake Buchholz Göktürk
83e8677481 Move Tiny Cloud configs into /etc 2023-04-29 20:54:45 +00:00
Jake Buchholz Göktürk
cdae70909c document the deprecation of ebs-nvme-symlinks 2023-04-29 20:30:43 +00:00
Natanael Copa
43bedda17f Adjust when tiny-cloud-early should start 2023-04-14 21:21:07 +00:00
Natanael Copa
fa01b4ea9a tests: add tests for init-final 2023-04-06 22:27:42 +02:00
Natanael Copa
e51051c7ca tests: refactor fake userdata for nocloud
- move it so it can be shared
- remove mentions of #cloud-config to avoid confusion
2023-04-06 22:07:58 +02:00
Natanael Copa
7ea8f69a06 Fix user-data decompression on all shells
yash[1] and zsh does not handle 8-bit bytes in strings good. Work around it
by using printf ... | cmp ... to compare the header. This should be 100%
posix compatible.

Also fix some of the compression header magic bytes:

- unxz: Use octal aas the string '\3757zXZ\000' was misinterpreted by some
  shells.
- lzma: the third byte represents compression mode[2], and we want
  support all compression modes not only '8', so we only check the first
  three bytes instead of 4.

[1]: Upstream report: https://osdn.net/projects/yash/ticket/47772
[2]: https://github.com/frizb/FirmwareReverseEngineering/blob/master/IdentifyingCompressionAlgorithms.md#lzma
2023-04-06 17:19:40 +02:00
Natanael Copa
bbb0c19ae6 Fix detection of lz4 header magic number 2023-04-06 17:19:40 +02:00
Natanael Copa
ab46d7223f tests: add test for save_userdata
Test that compressed user-data gets properly detected
2023-04-06 17:19:40 +02:00
Natanael Copa
12bc6af2ce Fix quoting when reading subshells
This is needed for yash.
2023-04-06 17:19:40 +02:00
Natanael Copa
a67cbd37b0 Add test for ssh-keys in nocloud yaml 2023-04-06 17:19:40 +02:00
Natanael Copa
0f53f14399 tests: add initial tests for init-main 2023-04-06 17:19:36 +02:00
Jake Buchholz Göktürk
fda9a350a1 imds-net-sync should only work with secondary ipv4s on an interface 2.2.2 2023-03-24 16:41:37 -07:00
Jake Buchholz Göktürk
ed67197e7b restore "source /lib/tiny-cloud/common" in imds-net-sync 2.2.1 2023-03-23 19:14:43 +00:00
Jake Buchholz Göktürk
520b72b8d6 Fix imds-net-sync with multiple interfaces
* all IPv4s of non-eth0 interfaces should be associated with route table
* also add "to" rules for non-eth0 interfaces (symmetry with the "from" rules)
2.2.0
2023-03-23 10:33:52 -07:00
Natanael Copa
33257650c8 Fix function detecion
Different shells has slightly different output of `type`:

    $ yash -c "f(){ :; }; type f"
    f: a function

    $ dash -c "f(){ :; }; type f"
    f is a shell function

    $ zsh -c "f(){ :; }; type f"
    f is a shell function from zsh

Lets only look for the word "function" which seems to be the only common
thing.
2023-03-09 17:18:48 +01:00
Natanael Copa
e9b4350617 Fix source of cloud-specific mdev functions
We need to source it with '.'

fixes commit c335944911d6 (Add kyua testsuite and make code more portable)
2023-03-09 13:01:36 +01:00
Natanael Copa
c055e974f0 init-early: use posix printf instead of echo -n 2023-03-09 11:47:34 +01:00
Natanael Copa
38cbdee6a2 Return failure if any of install_modules fails
Add test to verify that install_modules can be skipped and that
install_modules returns failure if it fails to update mdev.conf.
2023-03-09 11:47:34 +01:00
Natanael Copa
4ba3ce17bc Refactor skip_action
micro optimization. No forks used

readability improved by avoiding regex.
2023-03-09 11:47:34 +01:00
Natanael Copa
091af053c5 Use printf for skip_action
printf is posix compatible and works with all shell. echo -n does not
work with yash and is not posix compatible.

Add test for skipping expand_root
2023-03-09 11:47:34 +01:00
Natanael Copa
a626e694c6 Refactor expand_root
Simplify it a bit.
- use awk /proc/mounts instead of busybox mountpoint
- use sysfs to find partition and volume. This is more robust
- add tests for it
2023-03-09 11:47:34 +01:00
Natanael Copa
d0f352b276 Fix detection of cloud-specific mdev functions 2023-03-09 02:28:04 +00:00
Natanael Copa
b9156a7f43 Add tests for imds aws 2023-03-09 02:22:11 +00:00
Natanael Copa
c335944911 Add kyua testsuite and make code more portable 2023-03-08 03:39:39 +00:00
Jake Buchholz Göktürk
39670c091c Add Missing Trailing Newlines 2022-11-03 20:13:03 +00:00
Valery Ushakov
feada28f10 nvme-ebs-links: quote readlink output, it may be empty 2022-11-03 00:37:16 +00:00
Jake Buchholz Göktürk
4d85faffea Fix user-data Decompression 2.1.2 2022-10-20 23:52:52 +00:00
Jake Buchholz Göktürk
4e37eb815c Minor Improvements & Typo Fixen
* save `user-data` during main `tiny-cloud` init script instead of `tiny-cloud-final`
* allow manual setting of bootstrap state with...
  * `service tiny-cloud complete`
  * `service tiny-cloud incomplete`
* use `${VAR:=default}` idiom instead of `VAR=${VAR:-default}`
* fix inconsequential typo in `imds-net-sync`
2.1.1
2022-10-16 21:48:05 +00:00
Stefan Reimer
1e49b7f212 fix: remove extra ']', removes of /] after first boot. 2022-09-27 15:03:21 +00:00
Jake Buchholz Göktürk
d15ac6bed3 Compressed User-Data / Initial NoCloud Support 2.1.0 2022-08-02 01:24:53 +00:00
Jake Buchholz Göktürk
ed8bdc8c8b use defaults if /etc/conf.d/tiny-cloud is missing 2.0.0 2.0.0_rc3 2022-01-29 16:25:45 -08:00
Jake Buchholz Göktürk
ce23a951ad fix sed installing configs for cloud providers 2022-01-29 16:05:57 -08:00
Jake Buchholz Göktürk
713161f2f0 ensure /etc/conf.d exists 2.0.0_rc2 2022-01-29 14:40:07 -08:00
Jake Buchholz Göktürk
8ffdca9786 Introducing Tiny Cloud! 2022-01-29 22:27:34 +00:00
Mike Crute
0bfdd16977 Fix root account locking
Fixes #22
release-1.4.4
2021-01-26 18:07:38 +00:00
tomalok
60233942e2
Merge pull request #21 from mcrute/fix/do-not-lock-EC2_USER
only lock root, not EC2_USER
release-1.4.3
2021-01-08 19:42:24 -08:00
Jake Buchholz
e54b913fa4 only lock root, not EC2_USER 2021-01-08 19:36:14 -08:00
tomalok
a866c27e06
Merge pull request #19 from mcrute/pr-password
Also lock account when changing password
2021-01-08 18:48:04 -08:00
Mike Crute
11d5b810a7 Also lock account when changing password
The Amazon marketplace image verifier expects the root account to be
locked, not just cleared. Otherwise images that use the bootstrap can't
be pushed to the AWS marketplace.
2021-01-09 00:57:46 +00:00
tomalok
6946395ed8
Merge pull request #17 from mcrute/fix/ensure-busybox-mountpoint
Make sure busybox's mountpoint is used
release-1.4.1
2020-11-21 18:25:28 -08:00
Jake Buchholz
9feefd2a9f Make sure busybox's mountpoint is used
util-linux's busybox does not support -n which prevents root partition expansion.
2020-11-21 18:21:26 -08:00
Jake Buchholz
c1d9d27785 Expand root to all available volume space when it's a partition release-1.4.0 2020-11-15 20:13:45 -08:00
Tomas Volf
7838c22ea6 Report exit code from user-data instead of from tee release-1.3.3 2020-05-20 11:03:14 -07:00
Mike Crute
1f4f4fccb8 Change whitespace from spaces to tabs 2020-05-19 15:50:11 +00:00
Tomas Volf
834cac92da Add indentation related options to the modeline 2020-05-19 08:44:21 -07:00
Tomas Volf
bea0e57425 Use correct ft in vim modeline
Alpine machines does not have to have bash install (and even if they did, I'm
not really sure openrc would use it). So ft should be just sh.
2020-05-19 08:44:21 -07:00