Clayton Craft
790cf47060
cmd/mkinitfs: allow installing modules in the initramfs-extra archive (MR 32)
...
fixes: https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/issues/20
2023-02-24 09:06:29 -08:00
Clayton Craft
4074eada55
modules: remove TODOs
...
The builtin one was moved to a new issue:
https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/issues/18
The "more extensions" one was not moved to a new issue, it should be
obvious if we do need to support more extensions.
2023-02-21 12:41:18 -08:00
Clayton Craft
a7c4fe83ce
archive: remove TODO about adding debug mode
...
moved to an issue: https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/issues/17
2023-02-21 12:41:18 -08:00
Clayton Craft
06f86aadc9
misc.Exists: bubble up any unexpected errors
...
Fixes https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/issues/6
2023-02-21 12:41:18 -08:00
Clayton Craft
d87a33a751
bootdeploy: remove dependency on misc.Exists
...
Checking for the app is unnecessary, since the cmd.Run later will fail
if it doesn't exist. This allows dropping the dependency on misc.Exists.
There's also no reason to print that the command failed, just return the
error.
2023-02-21 12:41:18 -08:00
Clayton Craft
d1e150242d
cmd/mkinitfs: fix boot-deploy error message
...
naming the app is more useful than some internal function/object
2023-02-21 12:41:18 -08:00
Clayton Craft
5968622f60
cmd/mkinitfs: simplify the "deviceinfo not found" message
...
The old message is too specific to pmOS.
2023-02-21 12:41:18 -08:00
Clayton Craft
0179a0ca5c
misc: remove functions now in osutils, update references in project
2023-02-21 12:41:17 -08:00
Clayton Craft
33c61b3c94
internal/osutil: new package
...
This is a collection of things from internal/misc that should have been
separated from misc.
2023-02-21 12:41:17 -08:00
Clayton Craft
e4fb6cef70
README: update description and usage sections to match recent changes
2023-02-21 12:41:17 -08:00
Clayton Craft
4ae678d8ce
cmd/mkinitfs: add -no-bootdeploy option to disable boot-deploy
2023-02-21 12:41:17 -08:00
Clayton Craft
71c2a87d56
cmd/mkinitfs: fix running deferred functions from main on error
...
This new style is a little more verbose (having to manually set return
code on error..), but at least it offers a chance to improve the
printing of errors a little more.
2023-02-21 00:47:05 -08:00
Clayton Craft
9bb326be91
bootdeploy: describe copyUbootFiles
2023-02-21 00:47:05 -08:00
Clayton Craft
0545d68b1d
bootdeploy: return errors from writing copy
2023-02-21 00:47:05 -08:00
Clayton Craft
c6e79551f4
cmd/mkinitfs: show time spent generating each archive
2023-02-21 00:47:04 -08:00
Clayton Craft
a9f4281fbd
cmd/mkinitfs: show time spent running boot-deploy
2023-02-21 00:47:04 -08:00
Clayton Craft
bb50041257
cmd/mkinitfs: move printing "== Generating.." message to generateArchive
2023-02-21 00:47:04 -08:00
Clayton Craft
09c897e737
cmd/mkinitfs: use a BootDeploy type for running boot-deploy
2023-02-21 00:47:04 -08:00
Clayton Craft
a8bb10ce9c
bootdeploy: copy implementation from cmd/mkinitfs
2023-02-21 00:47:04 -08:00
Clayton Craft
5e65ace958
internal/bootdeploy: add new package
...
As a stub, but will be implemented soon...
2023-02-21 00:47:04 -08:00
Clayton Craft
cbcd4408e3
doc/mkinitfs.1: Fill in DEVICEINFO section
2023-02-21 00:47:03 -08:00
Clayton Craft
ad560591e1
deviceinfo: parse only required variables
...
This greatly reduces the chance accidentally adding dependencies to the
other (currently unused) variables later on. Getting away from depending
on deviceinfo has a lot of benefits, but mainly it helps offload
device-specific boot configuration to boot-deploy. Handling those
complexities in a shell script is often nicer.
Also, reducing the need to handle variables that contain lists means
that this app doesn't have to worry about how to merge/handle multiple
versions of those. That might be useful later if mkinitfs has to read
deviceinfo config from multiple deviceinfo files.
For example, trying to figure out how to merge these two things is...
ehhh...
a_modules_initfs="abc bar banana bazz"
b_modules_initfs="foo bar bazz bar2 guava"
2023-02-21 00:47:03 -08:00
Clayton Craft
89f1e067da
cmd/mkinitfs: add --version option
2023-02-21 00:47:03 -08:00
Clayton Craft
4259478755
doc/mkinitfs.1: add manpage
2023-02-21 00:47:03 -08:00
Clayton Craft
347668caa3
cmd/mkinitfs: use filelist/hookdirs when creating initramfs
2023-02-21 00:47:03 -08:00
Clayton Craft
b0e28b4215
filelist/hookdirs: add new FileLister implementation for creating dirs
2023-02-21 00:47:03 -08:00
Clayton Craft
c1d96f699c
filelist/hookscripts: don't fail if directory not found
2023-02-21 00:47:02 -08:00
Clayton Craft
25c3c03e24
filelist/osksdl: fix crash when osk-sdl isn't found
...
Should have returned an empty FileList in this case
2023-02-21 00:47:02 -08:00
Clayton Craft
07c8c711c7
filelist/hookfiles: don't error out if dir is not found
...
Just print a message that it wasn't found, instead of sending an error
that may stop the entire app.
2023-02-21 00:47:02 -08:00
Clayton Craft
e772fe0c87
filelist/hookfiles: support specifying src:dest in .files
2023-02-21 00:47:02 -08:00
Clayton Craft
6f05222018
filelist/modules: add support for directories in .modules files
...
This is kinda janky, passing both a list of modules and a directory path
is just because we support modules in deviceinfo and in directory file
lists... Maybe one day we can move away from having modules in the
deviceinfo...
2023-02-21 00:45:58 -08:00
Clayton Craft
c23af8b541
cmd/mkinitfs: simplify archive creation by using filelisters/features
...
I'm going to rename "filelist" to "feature" soon...
2023-02-21 00:45:58 -08:00
Clayton Craft
bd09de9232
archive: accept a FileLister in the AddItems method
2023-02-21 00:45:58 -08:00
Clayton Craft
22692e48d2
filelist/initramfs: add new type for slurping up file listers
2023-02-21 00:45:58 -08:00
Clayton Craft
6c2f7b972b
filelist/*: implement FileLister in existing types
2023-02-21 00:45:57 -08:00
Clayton Craft
e5002f5750
filelist/FileList: add Import method
2023-02-21 00:45:16 -08:00
Clayton Craft
662f559286
filelist: Add FileList type
...
This adds a new type, FileList, to manage another new type (File). File
contains the mapping of source --> dest for a file or directory.
2023-02-21 00:45:16 -08:00
Clayton Craft
a4be663e13
filelist/*.List(): print to stdout when starting to generate FileList
2023-02-21 00:45:16 -08:00
Clayton Craft
14873015c0
cmd/mkinitfs: move getInitfsFiles into generateInitfs
...
Prep for simplifying things a bit...
2023-02-21 00:45:16 -08:00
Clayton Craft
6fdc8937b5
internal/archive: make archiveItem.add private
2023-02-21 00:45:16 -08:00
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