[ext2fs] automated persistence set up for Debian Live & Ubuntu

* Only UEFI boot for now (GRUB) & requires a post 2019.07.26 ISO for Ubuntu.
* This adds the relevant persistence/persistent kernel option to the conf file, sets the
  expected volume label and creates a /persistence.conf file where needed.
* Also improve token parsing by ensuring a token is followed by at least one white space.
This commit is contained in:
Pete Batard 2019-08-02 17:57:10 +01:00
parent 307e2f7075
commit fcb15ab6e9
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
11 changed files with 331 additions and 23 deletions

View file

@ -1090,7 +1090,7 @@ char* replace_in_token_data(const char* filename, const char* token, const char*
wchar_t *wtoken = NULL, *wfilename = NULL, *wtmpname = NULL, *wsrc = NULL, *wrep = NULL, bom = 0;
wchar_t buf[1024], *torep;
FILE *fd_in = NULL, *fd_out = NULL;
size_t i, size;
size_t i, ns, size;
int mode = 0;
char *ret = NULL, tmp[2];
@ -1180,8 +1180,11 @@ char* replace_in_token_data(const char* filename, const char* token, const char*
// Token was found, move past token
i += wcslen(wtoken);
// Skip spaces
i += wcsspn(&buf[i], wspace);
// Skip whitespaces after token (while making sure there's at least one)
ns = wcsspn(&buf[i], wspace);
if (ns == 0)
continue;
i += ns;
torep = wcsstr(&buf[i], wsrc);
if (torep == NULL) {