Clayton Craft
bcced6bc10
fix lint issues from staticcheck
...
Specifically this fixes failures: ST1005, S1028, S1011
See #6
2021-09-04 22:43:55 -07:00
Clayton Craft
9b4b1c3320
createInitfsRootDirs: remove unused function
2021-09-04 22:33:11 -07:00
Clayton Craft
adec7cfe07
main: replace os.exit with return
...
See: #6
2021-09-03 22:47:03 -07:00
Clayton Craft
5b6cf42e10
main: add context for fatal errors
...
See: #6
2021-09-03 22:47:03 -07:00
Clayton Craft
001baa29bf
main/stripExts: simplify implementation
...
See: #6
2021-09-03 22:47:03 -07:00
Clayton Craft
4293c887f8
Deviceinfo: replace toml lib, improve struct member names
...
See: #6
2021-09-03 22:47:02 -07:00
Clayton Craft
4538e7d46b
Fix copyright text in Go source files
...
Apparently the space after is important or Go will consider the
copyright comments as package documentation.
See: #6
2021-09-03 22:42:30 -07:00
Clayton Craft
155a7bc17f
stripExts: don't use a cutset when removing extension
...
I misread what strings.Trim does, the 2nd param is a _cut set_, so this
was removing any occurance any characters in the 2nd param. Since the
file extension is always a suffix, this uses TrimSuffix.
Fixes a bug where 'virtio_blk.ko' was being trimmed to 'virtio_bl'
2021-09-01 11:03:38 -07:00
Clayton Craft
ad2ffc4191
getModule: handle cases where module name may have an underscore/hyphen
...
the characters - and _ are indistinguishable for module names, to the
kernel. But obviously are different when it comes to filenames/paths...
so this fixes an issue where the module was previously not found if it
was specified in config with the opposite - or _ than what the real
filename for the module had.
2021-08-18 21:55:26 -07:00
Clayton Craft
666abc323e
main: add call to boot-deploy after archives are generated
2021-08-17 23:10:56 -07:00
Clayton Craft
5256e4848a
add function for calling boot-deploy to finalize/install boot files
...
boot-deploy will handle post-processing steps for initramfs/kernel, and
installation into /boot.
Also see: https://gitlab.com/postmarketOS/boot-deploy
2021-08-17 23:08:17 -07:00
Clayton Craft
d3829af9e4
main: use a temporary work dir for writing archives into
...
post-processing/installation will be handled by an external app, so
use a temp work dir for the external app to work out of when it is
invoked
2021-08-17 23:05:16 -07:00
Clayton Craft
0643ae37b2
main: tweak some log messages to user
2021-08-17 23:04:15 -07:00
Clayton Craft
1b9f0744b3
main: return 0 if deviceinfo is missing
...
It might be missing if the device package is installed after mkinitfs is
being called, so don't cause apk triggers to error out by returning
failure.
2021-08-16 22:32:32 -07:00
Clayton Craft
321cebff76
main: drop generating init.sh
...
This file is no longer a template since pmOS is only supporting 1
installed kernel at a time
2021-08-12 15:05:22 -07:00
Clayton Craft
d77de3b91a
main: remove support for generating initfs with kernel 'flavor' in name
...
pmOS will only support 1 kernel:
https://gitlab.com/postmarketOS/pmaports/-/issues/660
2021-08-12 14:50:04 -07:00
Clayton Craft
206020c3f1
main: drop ununsed functions
2021-08-10 18:10:16 -07:00
Clayton Craft
40ae9e83dd
main: remove checksumFile
...
This was left over from when I was trying to use the 'crc' cpio format,
that allows checksumming files in the cpio for checking integrity.
The 'crc' format isn't actually supported by the kernel... See:
https://lore.kernel.org/linux-doc/20210721115153.28620-2-ddiss@suse.de/
2021-08-10 18:10:16 -07:00
Clayton Craft
fda793fdb4
main/generateInitfs: create init.sh in a temp dir
2021-08-10 17:34:17 -07:00
Clayton Craft
a381516e53
rename project to postmarketos-mkinitfs
...
To help prevent any confusion about which distro this 'mkinitfs' is
intended for
2021-08-10 14:03:34 -07:00
Clayton Craft
7a92fb1608
main: add log msgs for writing initfs archives
2021-08-10 13:02:01 -07:00
Clayton Craft
64195a5f83
initial commit
2021-08-09 15:23:39 -07:00