Commit Graph

123 Commits

Author SHA1 Message Date
Clayton Craft
fb52066d8f filelist/modules: remove postmarketos- from config dir name 2023-02-21 00:45:15 -08:00
Clayton Craft
b7f520cba4 filelist/modules: drop "required modules"
Breaking change. These should be provided in /*/modules/* lists
2023-02-21 00:45:15 -08:00
Clayton Craft
31bf38f663 cmd/mkinitfs: don't hardcode splash images
No longer supported/used on pmOS since pbsplash was merged.
2023-02-21 00:45:15 -08:00
Clayton Craft
71d8131bb0 cmd/mkinitfs: don't hardcode required directories
Another breaking change, these directories should be specified via
hook files
2023-02-21 00:45:15 -08:00
Clayton Craft
8b99b5f45b cmd/mkinitfs: don't hardcode binaries/files for including in archives
Obvious breaking change... These files should be provided by "hook file"
lists instead.
2023-02-21 00:45:15 -08:00
Clayton Craft
e8854ff88d cmd/mkinitfs: drop getHookFiles 2023-02-21 00:45:15 -08:00
Clayton Craft
1eb35cf8ef cmd/mkinitfs: drop getHookScripts 2023-02-21 00:45:14 -08:00
Clayton Craft
696633629a cmd/mkinitfs: drop getFiles + friends
moved to misc package
2023-02-21 00:45:14 -08:00
Clayton Craft
d9b68843a3 cmd/mkinitfs: use misc.GetFiles 2023-02-21 00:45:14 -08:00
Clayton Craft
93005527e0 cmd/mkinitfs: drop getKernelVersion and getKernelReleaseFile 2023-02-21 00:45:14 -08:00
Clayton Craft
1c5f16762f cmd/mkinitfs: use misc.GetKernelVersion 2023-02-21 00:45:14 -08:00
Clayton Craft
af97d4654f cmd/mkinitfs: use filelist/hookfiles 2023-02-21 00:45:14 -08:00
Clayton Craft
b25c9bd390 filelist/hookfiles: add new implementation 2023-02-21 00:45:13 -08:00
Clayton Craft
1a0d00e39f cmd/mkinitfs: use filelist/hookscripts 2023-02-21 00:45:13 -08:00
Clayton Craft
af3c47c784 filelist/hookscripts: add new implementation 2023-02-21 00:45:13 -08:00
Clayton Craft
e7bbd1cadf cmd/mkinitfs: use filelist/modules 2023-02-21 00:45:13 -08:00
Clayton Craft
1531d7e790 filelist/modules: add new implementation 2023-02-21 00:45:13 -08:00
Clayton Craft
6d77b7a2d1 cmd/mkinitfs: drop osksdl-related stuff 2023-02-21 00:45:13 -08:00
Clayton Craft
2dd83da480 cmd/mkinitfs: use filelist/osksdl 2023-02-21 00:45:12 -08:00
Clayton Craft
e00e5faf6e filelist/osksdl: just use fmt.Errorf to create an error 2023-02-21 00:45:12 -08:00
Clayton Craft
5e07b63084 filelist/osksdl: add new implementation 2023-02-21 00:45:12 -08:00
Clayton Craft
95582ee034 misc: add GetFiles and supporting functions 2023-02-18 11:22:26 -08:00
Clayton Craft
94584050ee cmd/mkinitfs: use misc.Exists, drop exists() 2023-02-18 11:22:25 -08:00
Clayton Craft
e0977b4ac1 misc: add Exists() 2023-02-18 11:22:25 -08:00
Clayton Craft
4176a8a661 misc: add GetKernelVersion()
Allows re-using across different packages
2023-02-18 11:22:25 -08:00
Clayton Craft
73fd85f68c filelist: add FileLister interface 2023-02-18 11:22:25 -08:00
Clayton Craft
7e80107bbe misc: add TimeFunc()
This allows it to be re-used easily when things are broken up into
more packages later.
2023-02-17 14:21:14 -08:00
Clayton Craft
f714f110a1 cmd/mkinitfs: rename binary and move
This moves the main package to cmd/mkinitfs, and configures the compiled
binary to be named 'mkinitfs'. calling the full name
'postmarketos-mkinitfs' was unlikely to be used by anyone...

This move makes the project source layout more consistent with other Go
projects, and allows for adding more cmd/* things with their own main
packages later if we want
2023-02-17 14:21:14 -08:00
Clayton Craft
690d008643 internal/{archive,misc}: move from pkgs
These should be internal-only to this project
2023-02-09 13:34:06 -08:00
Clayton Craft
731a805a9e getBinaryDeps: properly handle circular lib dependencies
This moves the recursive bit outside of getBinaryDeps and properly
handles circular dependencies.
1.6.1
2023-02-09 12:42:06 -08:00
Clayton Craft
b90624d7dd getBinaryDeps: move recursive bit to new function 2023-02-09 12:41:34 -08:00
Oliver Smith
2a75cf9b4e getInitfsExtraFiles: add scripts from hooks-extra (MR 27)
Put scripts from /etc/postmarketos-mkinitfs/hooks-extra into the extra
initramfs instead of the regular one, similar to how it is possible with
files listed in /etc/postmarketos-mkinitfs/files-extra.

This way we will be able to launch hooks not only very early in the
initramfs as it's currently the case. But also later on after the
initramfs-extra was extracted, and more files are available. ondev2 will
make use of this feature.
1.6
2023-01-17 08:12:03 +01:00
Oliver Smith
d52cc16c88 getBinaryDeps: search in /usr/lib/expect* (MR 28)
Instead of only searching for shared libraries in /usr/lib and /lib,
also search in /usr/lib/expect* (currently the expect binary links
against /usr/lib/expect5.45.4/libexpect5.45.4.so).

I've also considered searching /usr/lib recursively, but that would be a
major performance hit.

Expect gets added to the initramfs-extra in a script that runs the
ondev2 testsuite inside qemu.
2023-01-16 22:55:36 -08:00
Oliver Smith
112b572dc2 getFile: print exact error from os.Stat (MR 28)
Pass the exact error message down and make formatting of the message
consistent.
2023-01-16 22:55:30 -08:00
Oliver Smith
0c0a85f3bb getHookFiles: print exact error from getFiles (MR 28)
Instead of assuming that the error is "unable to find file", print the
actual error from getFiles. I just had a situation where the file
exists, but a dependency couldn't be found.

Before:
  generateInitfsExtra: getHookFiles: unable to find file "/usr/bin/expect" required by "/etc/postmarketos-mkinitfs/files-extra/ondev2-test.files"

After:
  generateInitfsExtra: getHookFiles: unable to add file "/usr/bin/expect" required by "/etc/postmarketos-mkinitfs/files-extra/ondev2-test.files": getBinaryDeps: unable to locate dependency for "/usr/bin/expect": libexpect5.45.4.so
2023-01-16 22:55:18 -08:00
Clayton Craft
2761535e12 getInitfsFiles: fix path to kpartx
This changed in a multipath update.

Fixes #16
1.5.1
2022-11-03 12:00:18 -07:00
Clayton Craft
1a72589f6f getHookFiles: print path of each hook file as it is processed
This may be useful during debug later on
2022-09-17 21:31:37 -07:00
Clayton Craft
df0b5d66d7 getHookFiles: wrap errors returned by this function 2022-09-17 21:29:16 -07:00
Clayton Craft
c5f1cffca5 main: handle glob errors in getFile (MR 22)
ignoring this was proooobably fine, but just in case...
1.5
2022-09-16 09:40:18 -07:00
Clayton Craft
7eed20e35f main: fix linting issue (staticcheck ST1005) (MR 22) 2022-09-16 09:40:13 -07:00
Clayton Craft
e71cab485d misc: drop StringSet type (MR 22)
no longer used
2022-09-16 09:40:10 -07:00
Clayton Craft
568fe7f717 archive: refactor to use archive "items" instead of StringSet (MR 22)
This adds a couple of new types, an archiveItem and what is effectively
a set of archiveItems. Items in the set are kept sorted.

fixes #10
2022-09-16 09:40:06 -07:00
Clayton Craft
d78c6d5a62 archive: wrap errors from Write() (MR 22) 2022-09-16 09:40:02 -07:00
Clayton Craft
c774b610d4 getInitfsModules: wrap errors that are returned (MR 22) 2022-09-16 09:39:53 -07:00
Clayton Craft
1e00f8f1cc getBinaryDeps: wrap errors that are returned (MR 22) 2022-09-16 09:39:47 -07:00
Clayton Craft
28eed4fd12 main: replace misc.StringSet with []string (MR 22)
This is a big refactoring that aims to simplify things a bit by no
longer passing around a StringSet and instead having everything
generate/return a []string.
2022-09-16 09:39:42 -07:00
Clayton Craft
c9ac9d9dd6 getModule: wrap errors, and don't panic (MR 22) 2022-09-16 09:39:37 -07:00
Clayton Craft
a4927a8915 getHookFiles: return error instead of panicking (MR 22) 2022-09-16 09:39:32 -07:00
Clayton Craft
029bdd849d getHookFiles: use getFiles instead of getFile (MR 22)
Everything else uses getFiles, and this will make refactoring later a
tad easier
2022-09-16 09:39:27 -07:00
Clayton Craft
8d21ae79c0 getFdeFiles: wrap errors that are returned (MR 22)
this adds some context around the errors that this function can return
2022-09-16 09:39:19 -07:00