anykernel.sh: Add a simple substring matching function

Based on the discussion here: http://stackoverflow.com/a/8811800.
This commit is contained in:
D. Andrei Măceș committed 2016-03-09 12:01:03 -05:00
1 parent f0bc44a8db
commit 756479498b
1 file changed
+5
+5
View File
@@ -50,6 +50,11 @@ dump_boot() {
cp -af /tmp/anykernel/rdtmp/* $ramdisk;
}
# contains <string> <substring>
contains() {
if test "${1#*$2}" != "$1"; then return 0; else return 1; fi;
}
# repack ramdisk then build and write image
write_boot() {
cd $split_img;