1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-16 03:42:44 +03:00

30 Commits

Author SHA1 Message Date
Natanael Copa
a7600fb5ff Only try to expand root which is ext4
Root filesystem may be tmpfs or something else, in which case we should
not call resize2fs.
2023-05-05 03:41:55 +00:00
Jake Buchholz Göktürk
58ac2108cd Fixes for tiny-cloud Wrapper
* switch from phase functions to variables containing list of actions
* init actions prefixed with 'init__'
* refine output during init
* add syslog entries
* add --setup for putting init scripts in the right runlevel
2023-05-03 02:11:01 +00:00
Jake Buchholz Göktürk
3894cd9f8d Support "local-hostname" 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
83e8677481 Move Tiny Cloud configs into /etc 2023-04-29 20:54:45 +00:00
Natanael Copa
43bedda17f Adjust when tiny-cloud-early should start 2023-04-14 21:21:07 +00: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
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
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 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`
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 2022-08-02 01:24:53 +00:00
Jake Buchholz Göktürk
ed8bdc8c8b use defaults if /etc/conf.d/tiny-cloud is missing 2022-01-29 16:25:45 -08:00
Jake Buchholz Göktürk
8ffdca9786 Introducing Tiny Cloud! 2022-01-29 22:27:34 +00:00