-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
image-erofs: introduce basic support for erofs #247
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2024 Sebastian Muxel <[email protected]>, Entner Electronics | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <confuse.h> | ||
#include "genimage.h" | ||
|
||
static int erofs_generate(struct image *image) | ||
{ | ||
int ret; | ||
char *extraargs = cfg_getstr(image->imagesec, "extraargs"); | ||
|
||
|
||
ret = systemp(image, "%s %s '%s' '%s'", | ||
get_opt("mkfserofs"), | ||
extraargs, | ||
imageoutfile(image), | ||
mountpath(image) | ||
); | ||
|
||
return ret; | ||
} | ||
|
||
static cfg_opt_t erofs_opts[] = { | ||
CFG_STR("extraargs", "", CFGF_NONE), | ||
CFG_END() | ||
}; | ||
|
||
struct image_handler erofs_handler = { | ||
.type = "erofs", | ||
.generate = erofs_generate, | ||
.opts = erofs_opts, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
image test.erofs { | ||
erofs { | ||
} | ||
size = 4M | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,14 @@ test_expect_success dd,mkdosfs,mcopy "vfat" " | |
check_filelist | ||
" | ||
|
||
exec_test_set_prereq mkfs.erofs | ||
exec_test_set_prereq fsck.erofs | ||
test_expect_success mkfs_erofs,fsck_erofs "erofs" " | ||
run_genimage_root erofs.config test.erofs && | ||
fsck.erofs -p images/test.erofs | tee erofs.log && | ||
test_must_fail grep -q 'Filesystem was changed' erofs.log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like something to see that the content actually reached the filesystem.
That will not check everything, but that contains the file count and the dir listing of the toplevel dir. Tip: I insert a "cp dump ${testdir}/erofs.dump" so save the expected output on the first try and remove the line again afterwards. |
||
" | ||
|
||
test_done | ||
|
||
# vim: syntax=sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set the filesystem uuid here with extraargs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should i just hardcode the UUID to a specific value? I tried checking the other occurances of uuid's in tests and they mostly seem to revolve around the partition table uuid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's also the possibility of adding a dedicated uuid parameter as the commit introduces new public API anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for a dedicated parameter. We don't have it anywhere else either. Just put a random uuid here to make the output of dump.erofs more predictable.