diff options
| -rwxr-xr-x | draklive | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -438,6 +438,17 @@ sub create_media_initrd { $live->{copy_initrd}) if $live->{copy_initrd}; } +sub inst_initrd_file { + my ($root, $initrd_tree, $file) = @_; + if ($file =~ m|/s?bin/|) { + inst_initrd_bin($root, $initrd_tree, $file); + } else { + mkdir_p($initrd_tree . dirname($file)); + inst_initrd_dso_deps($root, $initrd_tree, $file) if $file =~ m|/lib[^/]*/|; + cp_f($root . $file, $initrd_tree . $file) or die "unable to copy $file from system chroot\n"; + } +} + sub inst_initrd_dso_deps { my ($root, $initrd_tree, $dso) = @_; foreach my $file (`chroot $root ldd $dso | awk '/\\// {if(\$2 == "=>") {print \$3} else {print \$1}}'`) { @@ -479,6 +490,10 @@ sub create_initrd_for_media { inst_initrd_bin(get_system_root($live), $initrd_tree, '/usr/bin/strace') if $live->{debug}; + foreach (chomp_(run_program::rooted_get_stdout(get_system_root($live), "/usr/sbin/splashy_find_files"))) { + inst_initrd_file(get_system_root($live), $initrd_tree, $_); + } + #- busybox is required to: #- detect usb-storage process (we need sh/while/ps/grep) #- mount loopbacks read-only with losetup (useful over NFS) @@ -506,6 +521,7 @@ sub create_initrd_for_media { qw(console initrd null ram systty), (map { "tty$_" } 0..8), (map { "loop$_" } 0 .. $loop_nb); + syscall_('mknod', $initrd_tree . "/dev/fb0", c::S_IFCHR(), makedev(29, 0)) or die "mknod failed (dev $_): $!"; #- pre-create devfsd compatibility loop devices (since busybox is still built with devfsd support) mkdir_p($initrd_tree . "/dev/loop"); cp_af($initrd_tree . "/dev/loop$_", $initrd_tree . "/dev/loop/$_") foreach 0 .. $loop_nb; @@ -588,6 +604,8 @@ sub create_initrd_scriptlet { "nash-mount -t proc /proc /proc", #- required for cdrom labels "nash-mount -t sysfs /sys /sys", + "splashy_chvt 8", + "splashy boot", (map { join(" ", "probe-modules", list_modules::filename2modname($_), grep { $_ } $live->{system}{module_options}{$_}) } @modules), "probe-modules --$media->{storage}", if_($rrpt_dev, @@ -601,6 +619,7 @@ sub create_initrd_scriptlet { (map { $loop{$_->{type}}{mount}->($live, $_) } @$mount_first, @$mount_last), ($live->{mount}{overlay} ? $overlay{$live->{mount}{overlay}}{mount}->($live) : ()), if_($live->{system}{initrd_pre_pivot}, deref_array($live->{system}{initrd_pre_pivot})), + qq(splashy_update "chroot $target"), "echo 0x0100 > /proc/sys/kernel/real-root-dev", "umount /sys", "sh -c 'umount /proc/bus/usb 2>/dev/null'", @@ -622,6 +641,7 @@ sub compress_initrd_tree { my $size = chomp_(run_program::get_stdout("du -ks $initrd_tree | awk '{print \$1}'")); my $inodes = chomp_(run_program::get_stdout("find $initrd_tree | wc -l")) + 100; my $initrd_size = $size + 350 + int($inodes / 10); #- 10 inodes needs 1K + $initrd_size += 600; # splashy my $initrd = get_builddir($live) . $live->{prefix}{build}{boot} . get_initrd_path($media); $initrd =~ s/.gz$//; |
