Skip to content

Commit bbb96a5

Browse files
authored
Merge pull request #432 from Googulator/fiwix-filelist-must-die
Replace Fiwix filelist with parsing builder-hex0's FS structures
2 parents 5406885 + 5945bdc commit bbb96a5

File tree

7 files changed

+52
-260
lines changed

7 files changed

+52
-260
lines changed

lib/generator.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ def prepare(self, target, using_kernel=False, kernel_bootstrap=False, target_siz
8585

8686
self.distfiles()
8787

88-
self.create_fiwix_file_list()
89-
9088
if self.repo_path:
9189
repo_dir = os.path.join(self.external_dir, 'repo-preseeded')
9290
shutil.copytree(self.repo_path, repo_dir)
@@ -134,30 +132,6 @@ def seed(self):
134132
if os.path.isfile(os.path.join(seed_dir, entry)):
135133
shutil.copy2(os.path.join(seed_dir, entry), os.path.join(self.target_dir, entry))
136134

137-
@staticmethod
138-
def add_fiwix_files(file_list_path, dirpath):
139-
"""Add files to the list to populate Fiwix file system"""
140-
for root, _, filepaths in os.walk(dirpath):
141-
if 'stage0-posix' in root:
142-
continue
143-
with open(file_list_path, 'a', encoding="utf-8") as file_list:
144-
for filepath in filepaths:
145-
file_list.write(f"/{os.path.join(root, filepath)}\n")
146-
147-
def create_fiwix_file_list(self):
148-
"""Create a list of files to populate Fiwix file system"""
149-
file_list_path = os.path.join(self.target_dir, 'steps', 'lwext4-1.0.0-lb1',
150-
'files', 'fiwix-file-list.txt')
151-
shutil.copyfile(os.path.join(self.target_dir, 'steps', 'lwext4-1.0.0-lb1',
152-
'files', 'early-artifacts-needed-after-fiwix.txt'),
153-
file_list_path)
154-
155-
save_cwd = os.getcwd()
156-
os.chdir(self.target_dir)
157-
self.add_fiwix_files(file_list_path, 'steps')
158-
self.add_fiwix_files(file_list_path, 'distfiles')
159-
os.chdir(save_cwd)
160-
161135
def distfiles(self):
162136
"""Copy in distfiles"""
163137
def copy_no_network_distfiles(out, early):

seed/script-generator.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -412,30 +412,13 @@ Directive *interpreter(Directive *directives) {
412412
return directives;
413413
}
414414

415-
void add_to_fiwix_filelist(char *filename) {
416-
/* Add the filename to fiwix-file-list.txt */
417-
FILE *fiwix_list = fopen("/steps/lwext4-1.0.0-lb1/files/fiwix-file-list.txt", "r");
418-
fseek(fiwix_list, 0, SEEK_END);
419-
long size = ftell(fiwix_list);
420-
char *contents = calloc(size, sizeof(char));
421-
fseek(fiwix_list, 0, SEEK_SET);
422-
fread(contents, 1, size, fiwix_list);
423-
fclose(fiwix_list);
424-
fiwix_list = fopen("/steps/lwext4-1.0.0-lb1/files/fiwix-file-list.txt", "w");
425-
fwrite(contents, 1, size, fiwix_list);
426-
fputs(filename, fiwix_list);
427-
fputc('\n', fiwix_list);
428-
fclose(fiwix_list);
429-
}
430-
431415
/* Script generator. */
432416
FILE *start_script(int id, int bash_build) {
433417
/* Create the file /steps/$id.sh */
434418
char *filename = calloc(MAX_STRING, sizeof(char));
435419
strcpy(filename, "/steps/");
436420
strcat(filename, int2str(id, 10, 0));
437421
strcat(filename, ".sh");
438-
add_to_fiwix_filelist(filename);
439422

440423
FILE *out = fopen(filename, "w");
441424
if (out == NULL) {
@@ -608,12 +591,6 @@ void generate(Directive *directives) {
608591
output_call_script(out, "jump", directive->arg, bash_build, 1);
609592
fclose(out);
610593

611-
/*
612-
* This cannot go before here as builder-hex0 does not like having
613-
* multiple files open at once!
614-
*/
615-
add_to_fiwix_filelist(filename);
616-
617594
if (bash_build) {
618595
out = fopen(filename, "w");
619596
if (out == NULL) {

steps/jump/linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ set -e
1010

1111
# Perform the actual kexec
1212
if [ "${KERNEL_BOOTSTRAP}" = True ]; then
13+
mv "/High Level Prototypes" "/High_Level_Prototypes"
1314
sync
1415
# We don't use the gen_initramfs_list.sh script because it is so *SLOW*
1516
# This emulates the same thing it does
1617
find / -xdev -type d -printf "dir %p %m %U %G\n" >> /initramfs.list
1718
find / -xdev -type f -printf "file %p %p %m %U %G\n" >> /initramfs.list
1819
find / -xdev -type l -printf "slink %p %l %m %U %G\n" >> /initramfs.list
19-
kexec-linux "/dev/ram1" "/boot/linux-4.9.10" "!$(command -v gen_init_cpio) /initramfs.list"
20+
kexec-linux "/dev/ram1" "/boot/linux-4.9.10" "!gen_init_cpio /initramfs.list | gzip -c"
2021
else
2122
mkdir /etc
2223
# kexec time

steps/lwext4-1.0.0-lb1/files/early-artifacts-needed-after-fiwix.txt

Lines changed: 0 additions & 177 deletions
This file was deleted.

0 commit comments

Comments
 (0)