From b5dd85f8099879b701b3bbdb8e7e50ab415fe789 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 19 Oct 2013 20:28:31 +0100 Subject: images: Convert image generation to dracut. This converts the initrd generation from a home grown system to dracut. It uses the upstream modules where possible plus two specially written dracut modules: mgainstaller and mgakadeploy. The initrds are identical for all builds and there are lots of bits that are incomplete and unnecesary. e.g. copying the kernels to a folder and then not using them, and also the module-descriptions file is not included in the initrd itself which it should be. We can probably customise the initrd better for different use cases, e.g. perhaps network stuff is not needed for HD based installs? We may also need to install the mdraid and lvm modules for some HD support. This is the first attempt so I expect various bits need fixing --- images/make_boot_img | 59 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 18 deletions(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 35a00cc30..efd6a2fa2 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -62,10 +62,10 @@ foreach my $img (@images) { } elsif ($img =~ /boot.iso/) { boot_iso($img, \@kernels); } elsif ($extension eq 'rdz') { - initrd($type, $I, "$img-$_") foreach @kernels; + initrd($type, $I, "$img-$_", $_) foreach @kernels; } elsif ($extension eq 'img') { print STDERR "calling boot_img_$arch for $img\n"; - $::{"boot_img_$arch"}->($type, $I, "$img-$_", "all.kernels/$_/vmlinuz") foreach @kernels; + $::{"boot_img_$arch"}->($type, $I, "$img-$_", $_, "all.kernels/$_/vmlinuz") foreach @kernels; rename("$img-$kernels[0]", $img); } else { die "unknown image $img"; @@ -143,7 +143,30 @@ EOF $header . ($b_gfxboot ? $header_gfxboot : $header_non_gfxboot) . join('', @l); } +sub trim { + return $_[0] =~ s/^\s+|\s+$//rg; +} + sub initrd { + my ($type, $I, $img, $kernel) = @_; + my $stage1_binary = $ENV{USE_LOCAL_STAGE1} ? trim(`realpath ../mdk-stage1/stage1`) : ""; + my $init_binary = $ENV{USE_LOCAL_STAGE1} ? trim(`realpath ../mdk-stage1/init`) : ""; + my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)"; + my $modules = " network mgainstaller "; + + if ($ENV{DEBUGSTAGE1} || $ENV{BUILD_KA}) { + $modules="$modules busybox "; + } + $modules="$modules mgakadeploy " if ($ENV{BUILD_KA}); + + mkdir_p("build/dracut.conf.d"); + touch("build/dracut.conf"); + # TODO if --nofscks and --no-hostonly are switched, dracut gives an error - fix or report upstream + __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf ./build/dracut.conf --confdir ./build/dracut.conf.d --nofscks --no-hostonly --add ' $modules ' --omit ' dash modsign systemd plymouth btrfs crypt lvm cifs resume rootfs-block biosdevname shutdown ' '$img' '$kernel'" +} + + +sub initrdold { my ($type, $I, $img) = @_; my $stage1_root = $ENV{USE_LOCAL_STAGE1} ? "../mdk-stage1" : "/usr/$lib/drakx-installer-binaries"; my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)"; @@ -252,17 +275,17 @@ sub remove_ending_zero { } sub boot_img_i386 { - my ($type, $I, $img, $kernel) = @_; + my ($type, $I, $img, $kernel, $vmlinuz) = @_; _ "rm -rf $tmp_mnt"; mkdir $tmp_mnt; - _ "cat $kernel > $tmp_mnt/vmlinuz"; + _ "cat $vmlinuz > $tmp_mnt/vmlinuz"; output("$tmp_mnt/help.msg", syslinux_msg('help.msg.xml')); output("$tmp_mnt/advanced.msg", syslinux_msg('advanced.msg.xml')); (my $rdz = $img) =~ s/\.img/.rdz/; (my $initrd_type = $type) =~ s/-changedisk//; - initrd($initrd_type, $I, $rdz); + initrd($initrd_type, $I, $rdz, $kernel); my $short_type = substr($type, 0, 8); output("$tmp_mnt/syslinux.cfg", @@ -287,7 +310,7 @@ sub boot_img_i386 { sub boot_img_x86_64 { &boot_img_i386 } sub boot_img_alpha { - my ($type, $I, $img) = @_; + my ($type, $I, $img, $kernel, $_vmlinuz) = @_; __ "$sudo umount $tmp_mnt 2>/dev/null"; _ "dd if=/dev/zero of=$img bs=1k count=1440"; @@ -295,7 +318,7 @@ sub boot_img_alpha { _ "/sbin/e2writeboot $img /boot/bootlx"; _ "$sudo mount -t ext2 $img $tmp_mnt -o loop"; _ "cp -f vmlinux.gz $tmp_mnt"; - -f "$type.rdz" ? _ "cp -f $type.rdz $tmp_mnt" : initrd($type, $I, "$tmp_mnt/$type.rdz"); + -f "$type.rdz" ? _ "cp -f $type.rdz $tmp_mnt" : initrd($type, $I, "$tmp_mnt/$type.rdz", $kernel); mkdir "$tmp_mnt/etc", 0777; output("$tmp_mnt/etc/aboot.conf", @@ -307,14 +330,14 @@ sub boot_img_alpha { } sub boot_img_ia64 { - my ($type, $_I, $img, $kernel) = @_; + my ($type, $_I, $img, $kernel, $vmlinuz) = @_; my $rdz = $img; $rdz =~ s/\.img/.rdz/; __ "$sudo umount $tmp_mnt 2>/dev/null"; _ "dd if=/dev/zero of=$img bs=1k count=16384"; _ "mkdosfs $img"; _ "$sudo mount -t vfat $img $tmp_mnt -o loop,umask=000"; - _ "$sudo cp -f $kernel $tmp_mnt/vmlinux"; + _ "$sudo cp -f $vmlinuz $tmp_mnt/vmlinux"; _ "cp -f $rdz $tmp_mnt/$type.rdz"; _ "$sudo cp -f tools/ia64/elilo.efi $tmp_mnt"; output("$tmp_mnt/elilo.conf", qq( @@ -338,7 +361,7 @@ image=vmlinux } sub boot_img_sparc { - my ($type, $I, $_img) = @_; + my ($type, $I, $_img, $kernel, $_vmlinuz) = @_; if ($type =~ /^live(.*)/) { #- hack to produce directly into /export the needed file for cdrom boot. my $dir = "/export"; @@ -347,7 +370,7 @@ sub boot_img_sparc { _ "mkdir -p $dir/$boot"; _ "cp -f /boot/cd.b /boot/second.b $dir/$boot"; _ "cp -f vmlinux$1 $dir/$boot/vmlinux$1"; - -f "live$1.rdz" ? _ "cp -f live$1.rdz $dir/$boot" : initrd($type, $I, "$dir/$boot/live$1.rdz"); + -f "live$1.rdz" ? _ "cp -f live$1.rdz $dir/$boot" : initrd($type, $I, "$dir/$boot/live$1.rdz", $kernel); output("$dir/$boot/silo.conf", qq( partition=1 @@ -427,7 +450,7 @@ To Build a Bootable CD-ROM, try: my $setarch = $1 ? "sparc64" : "sparc32"; _ "mkdir -p $dir/$boot"; - -f "$type.rdz" or initrd($type, $I, "$type.rdz"); + -f "$type.rdz" or initrd($type, $I, "$type.rdz", $kernel); _ "cp -f vmlinux$1.aout $dir/$boot/$type.img"; _ "$setarch kernel$1/src/arch/sparc$1/boot/piggyback $dir/$boot/$type.img kernel$1/boot/System.map $type.rdz"; } elsif ($type =~ /^tftp(.*)/) { @@ -443,7 +466,7 @@ To Build a Bootable CD-ROM, try: _ "mkdir -p $dir"; _ "cp -f /boot/fd.b /boot/second.b $dir"; _ "cp -f vmlinuz$I $dir/vmlinux$I.gz"; - -f "$type.rdz" ? _ "cp -f $type.rdz $dir" : initrd($type, $I, "$dir/$type.rdz"); + -f "$type.rdz" ? _ "cp -f $type.rdz $dir" : initrd($type, $I, "$dir/$type.rdz", $kernel); output("$dir/boot.msg", " Welcome to Mageia $ENV{DISTRIB_VERSION} @@ -474,16 +497,16 @@ image=/vmlinux$I.gz } sub boot_img_ppc { - my ($_type, $I, $_img, $_kernel) = @_; + my ($_type, $I, $_img, $kernel, $_vmlinuz) = @_; foreach (glob("all.kernels/*")) { my $ext = basename($_); if ($ext =~ /legacy/) { - initrd("all", $I, "images/all.rdz-$ext"); + initrd("all", $I, "images/all.rdz-$ext", $kernel); _ "mv images/all.rdz-$ext images/all.rdz-legacy"; _ "cp $_/vmlinuz images/vmlinux-legacy"; } elsif ($ext =~ /2.6/) { - initrd("all", $I, "images/all.rdz-$ext"); + initrd("all", $I, "images/all.rdz-$ext", $kernel); _ "mv images/all.rdz-$ext images/all.rdz"; _ "cp $_/vmlinuz images/vmlinux"; } @@ -698,7 +721,7 @@ sub syslinux_all_files { each_index { mkdir "$dir/alt$::i", 0777; _ "cp all.kernels/$_/vmlinuz $dir/$arch"; - initrd('all', '', "images/all.rdz-$_"); + initrd('all', '', "images/all.rdz-$_", $_); rename("images/all.rdz-$_", "$dir/$arch/all.rdz"); } @$kernels; @@ -729,7 +752,7 @@ sub xbox_stage1() { eval { rm_rf($dir) }; mkdir_p($dir); _ "cp all.kernels/$xbox_kernel/vmlinuz $dir"; - initrd('all', '', "images/all.rdz-$xbox_kernel"); + initrd('all', '', "images/all.rdz-$xbox_kernel", $xbox_kernel); rename("images/all.rdz-$xbox_kernel", "$dir/initrd"); _ "cp /usr/share/cromwell/xromwell-installer.xbe $dir/default.xbe"; -- cgit v1.2.1 From ba8750f0f9f6c836bb5cf50a0a79cb0d645120b9 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 29 Oct 2013 23:21:03 +0000 Subject: images: Fix kernel+ramdisk folder creation --- images/make_boot_img | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index efd6a2fa2..b2dd793f6 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -719,7 +719,7 @@ sub syslinux_all_files { $default_vga =~ /788/ or die 'we rely on vga=788 for bootsplash'; each_index { - mkdir "$dir/alt$::i", 0777; + mkdir "$dir/$arch", 0777; _ "cp all.kernels/$_/vmlinuz $dir/$arch"; initrd('all', '', "images/all.rdz-$_", $_); rename("images/all.rdz-$_", "$dir/$arch/all.rdz"); -- cgit v1.2.1 From 3afd27c8728b52985ceb538512496990ade84197 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 29 Oct 2013 23:25:52 +0000 Subject: images: Fix isolinux.bin modules path and add needed modules --- images/make_boot_img | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index b2dd793f6..21cb435a0 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -738,9 +738,15 @@ sub isolinux { syslinux_all_files('isolinux', $kernels); - _ "cp $isolinux_bin ../isolinux/isolinux.bin"; - _ "cp /usr/lib/syslinux/gfxboot.c32 ../isolinux/gfxboot.c32"; - output("../isolinux/isolinux.cfg", syslinux_cfg_all('cdrom', 1)); + _ "cp $isolinux_bin isolinux/isolinux.bin"; + _ "cp /usr/lib/syslinux/ifcpu.c32 isolinux/ifcpu.c32"; + _ "cp /usr/lib/syslinux/ldlinux.c32 isolinux/ldlinux.c32"; + _ "cp /usr/lib/syslinux/libcom32.c32 isolinux/libcom32.c32"; + _ "cp /usr/lib/syslinux/libgpl.c32 isolinux/libgpl.c32"; + _ "cp /usr/lib/syslinux/libmenu.c32 isolinux/libmenu.c32"; + _ "cp /usr/lib/syslinux/libutil.c32 isolinux/libutil.c32"; + _ "cp /usr/lib/syslinux/gfxboot.c32 isolinux/gfxboot.c32"; + output("isolinux/isolinux.cfg", syslinux_cfg_all('cdrom', 1)); xbox_stage1() if arch() =~ /i.86/; } @@ -771,7 +777,13 @@ sub boot_iso { output('.boot_iso/VERSION', VERSION($kernels)); # for the boot iso, use standard isolinux - _ "cp /usr/lib/syslinux/isolinux.bin .boot_iso/isolinux/isolinux.bin"; + _ "cp $isolinux_bin .boot_iso/isolinux/isolinux.bin"; + _ "cp /usr/lib/syslinux/ifcpu.c32 .boot_iso/isolinux/ifcpu.c32"; + _ "cp /usr/lib/syslinux/ldlinux.c32 .boot_iso/isolinux/ldlinux.c32"; + _ "cp /usr/lib/syslinux/libcom32.c32 .boot_iso/isolinux/libcom32.c32"; + _ "cp /usr/lib/syslinux/libgpl.c32 .boot_iso/isolinux/libgpl.c32"; + _ "cp /usr/lib/syslinux/libmenu.c32 .boot_iso/isolinux/libmenu.c32"; + _ "cp /usr/lib/syslinux/libutil.c32 .boot_iso/isolinux/libutil.c32"; my $with_gfxboot = 0; _ "cp /usr/share/gfxboot/themes/Mageia/install/* .boot_iso/isolinux" if $with_gfxboot; -- cgit v1.2.1 From 4fcf71c999dc5970a7ecce93ea51a9a4f4058b4f Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Wed, 30 Oct 2013 20:36:51 +0000 Subject: images: Clear out some stuff that no longer used. Now that initrds are generated via dracut, there is no need to prepare kernel modules. This sadly removes support for passing in a kernel rpm file, but such is life. --- images/make_boot_img | 65 ---------------------------------------------------- 1 file changed, 65 deletions(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 21cb435a0..b096097aa 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -166,71 +166,6 @@ sub initrd { } -sub initrdold { - my ($type, $I, $img) = @_; - my $stage1_root = $ENV{USE_LOCAL_STAGE1} ? "../mdk-stage1" : "/usr/$lib/drakx-installer-binaries"; - my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)"; - - _ "rm -rf $tmp_initrd"; - mkdir_p("$tmp_initrd$_") foreach qw(/etc /firmware /lib /modules /sbin /tmp /var); - symlink "../modules", "$tmp_initrd/lib/modules"; - symlink "../firmware", "$tmp_initrd/lib/firmware"; - - symlink "/proc/mounts", "$tmp_initrd/etc/mtab"; - symlink "../tmp", "$tmp_initrd/var/run"; - _ "install -D /usr/share/terminfo/l/linux $tmp_initrd/usr/share/terminfo/l/linux"; - foreach ('pcitable', 'usbtable') { - _ "install -D /usr/share/ldetect-lst/$_.gz $tmp_initrd/usr/share/ldetect-lst/$_.gz"; - } - _ "install -D /usr/share/pci.ids $tmp_initrd/usr/share/pci.ids"; - foreach ("dkms-modules.alias", "fallback-modules.alias", "/lib/module-init-tools/ldetect-lst-modules.alias") { - my $file = m!^/! ? $_ : "/usr/share/ldetect-lst/$_"; - _ "install -D $file $tmp_initrd$file"; - } - foreach my $firm (glob_("all.kernels$I/$ext/firmware/*")) { - my $dest=$firm; - $dest =~ s|all.kernels$I/$ext/||; - _ "cp -a $firm $tmp_initrd/$dest"; - } - - _ "install $stage1_root/init $tmp_initrd/"; - _ "install $stage1_root/stage1 $tmp_initrd/sbin/"; - foreach ('pppd', 'pppoe') { - _ "install /usr/sbin/${_}-diet $tmp_initrd/sbin/$_"; - } - - if ($arch !~ /ppc|ia64/) { - mkdir_p("$tmp_initrd/etc/pcmcia"); - _ "cp -a /etc/pcmcia/config.opts $tmp_initrd/etc/pcmcia"; - } - { - my $modz = "all.kernels$I/$ext"; - mkdir_p("$tmp_initrd/modules/$ext"); - __ "tar xC $tmp_initrd/modules/$ext -f $modz/${type}_modules.tar"; - _ "cp -f $modz/modules.$_ $tmp_initrd/modules/$ext" foreach qw(order builtin); - substInFile { s,.*/,, } "$tmp_initrd/modules/$ext/modules.order"; - _ "depmod -b $tmp_initrd $ext"; - # depmod keeps only available modules in modules.alias, but we want them all - _ "cp -f $modz/modules.alias $modz/modules.description $tmp_initrd/modules/$ext"; - } - mkdir_p("$tmp_initrd/$_") foreach qw(dev proc sys var/tmp tmp/stage2); - # ka deploy need some files in all.rdz - if ($ENV{DEBUGSTAGE1} || $ENV{BUILD_KA}) { - symlink("/sbin", "$tmp_initrd/bin"); - cp_af("/bin/busybox.static", "$tmp_initrd/sbin/busybox"); - my @funct = map { /functions:/ .. /^$/ ? do { s/\s//g; split /,/ } : () } `busybox.static`; - shift @funct; - symlink('busybox', $tmp_initrd . "/sbin/$_") foreach @funct; - } - if ($ENV{BUILD_KA}) { - mkdir_p("$tmp_initrd/ka"); - cp_af("/usr/bin/ka-d-client", "$tmp_initrd/ka/ka-d-client"); - } - - _ "(cd $tmp_initrd; find . | cpio -o -c --quiet) | xz --check=crc32 --lzma2=dict=512KiB > $img"; - _ "rm -rf $tmp_initrd"; -} - sub entries_append { my ($type) = @_; -- cgit v1.2.1 From 74cc75140329a03e5ed6f952932f8ea937216209 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Wed, 30 Oct 2013 21:38:53 +0000 Subject: images: Use a generic, shared isolinux.cfg file. This then loads a x86_64 or i586 config depending on the detected arch. Anne asked for this kind of setup. --- images/make_boot_img | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index b096097aa..eb2146fa2 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -681,7 +681,8 @@ sub isolinux { _ "cp /usr/lib/syslinux/libmenu.c32 isolinux/libmenu.c32"; _ "cp /usr/lib/syslinux/libutil.c32 isolinux/libutil.c32"; _ "cp /usr/lib/syslinux/gfxboot.c32 isolinux/gfxboot.c32"; - output("isolinux/isolinux.cfg", syslinux_cfg_all('cdrom', 1)); + output("isolinux/$arch.cfg", syslinux_cfg_all('cdrom', 1)); + _ "cp isolinux.cfg isolinux/"; xbox_stage1() if arch() =~ /i.86/; } @@ -726,7 +727,8 @@ sub boot_iso { #_ "cp /home/teuf/mdv/src/mandriva-gfxboot-theme/inst/* .boot_iso/isolinux" if $with_gfxboot; _ "cp /usr/lib/syslinux/gfxboot.c32 .boot_iso/isolinux/gfxboot.c32" if $with_gfxboot; - output('.boot_iso/isolinux/isolinux.cfg', syslinux_cfg_all('', $with_gfxboot)); + output(".boot_iso/isolinux/$arch.cfg", syslinux_cfg_all('', $with_gfxboot)); + _ "cp isolinux.cfg .boot_iso/isolinux/"; _ "genisoimage -r -f -J -cache-inodes -V 'Mga Boot ISO' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $iso .boot_iso"; _ "isohybrid -o 1 $iso"; -- cgit v1.2.1 From 284ba5ab6fc742dd3f7a5a4705207f9b2d4de5be Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Fri, 1 Nov 2013 10:35:03 +0000 Subject: images/kernel: Ensure the previously hand-picked modules are included in the new dracut-based initrd. This removes functions no longer called and adds a new one which will simply list the desired modules and pass them on the dracut command line. This should mean we have the same modules as before (at least) which should mean less regressions. This does increase the size of the initrd back up quite a lot (as expected) so we may want to look at optimising other areas to bring it back down a bit again. --- images/make_boot_img | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index eb2146fa2..2be5bbde5 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -153,6 +153,7 @@ sub initrd { my $init_binary = $ENV{USE_LOCAL_STAGE1} ? trim(`realpath ../mdk-stage1/init`) : ""; my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)"; my $modules = " network mgainstaller "; + my $drivers = `perl ../kernel/modules.pl list_needed_modules $kernel | xargs`; if ($ENV{DEBUGSTAGE1} || $ENV{BUILD_KA}) { $modules="$modules busybox "; @@ -162,7 +163,7 @@ sub initrd { mkdir_p("build/dracut.conf.d"); touch("build/dracut.conf"); # TODO if --nofscks and --no-hostonly are switched, dracut gives an error - fix or report upstream - __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf ./build/dracut.conf --confdir ./build/dracut.conf.d --nofscks --no-hostonly --add ' $modules ' --omit ' dash modsign systemd plymouth btrfs crypt lvm cifs resume rootfs-block biosdevname shutdown ' '$img' '$kernel'" + __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf ./build/dracut.conf --confdir ./build/dracut.conf.d --nofscks --no-hostonly --add ' $modules ' --omit ' dash modsign systemd plymouth btrfs crypt lvm cifs resume rootfs-block biosdevname shutdown ' --add-drivers ' $drivers ' '$img' '$kernel'" } -- cgit v1.2.1 From bbbb6c5bf26b764dfff8a83c2cc0ed3769bfdd74 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 2 Nov 2013 10:11:01 +0000 Subject: images: Split dracut options out into a config file. Also ensure that the compression method is xz -9 for much better compression (was previously defaulting to gzip) --- images/make_boot_img | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 2be5bbde5..b0e3eec70 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -161,9 +161,8 @@ sub initrd { $modules="$modules mgakadeploy " if ($ENV{BUILD_KA}); mkdir_p("build/dracut.conf.d"); - touch("build/dracut.conf"); # TODO if --nofscks and --no-hostonly are switched, dracut gives an error - fix or report upstream - __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf ./build/dracut.conf --confdir ./build/dracut.conf.d --nofscks --no-hostonly --add ' $modules ' --omit ' dash modsign systemd plymouth btrfs crypt lvm cifs resume rootfs-block biosdevname shutdown ' --add-drivers ' $drivers ' '$img' '$kernel'" + __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf dracut.conf --confdir ./build/dracut.conf.d --add ' $modules ' --add-drivers ' $drivers ' '$img' '$kernel'" } -- cgit v1.2.1 From 2df68d93aa83b7d2165bb1df42b39523f80d8052 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 2 Nov 2013 11:45:34 +0000 Subject: images: Omit the dracut network module now that we include our own networking kernel modules --- images/make_boot_img | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index b0e3eec70..5325d2cf6 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -152,7 +152,7 @@ sub initrd { my $stage1_binary = $ENV{USE_LOCAL_STAGE1} ? trim(`realpath ../mdk-stage1/stage1`) : ""; my $init_binary = $ENV{USE_LOCAL_STAGE1} ? trim(`realpath ../mdk-stage1/init`) : ""; my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)"; - my $modules = " network mgainstaller "; + my $modules = " mgainstaller "; my $drivers = `perl ../kernel/modules.pl list_needed_modules $kernel | xargs`; if ($ENV{DEBUGSTAGE1} || $ENV{BUILD_KA}) { -- cgit v1.2.1 From 45f2ab87fb19afc8de91c47f2ad103721a20b24c Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 2 Nov 2013 15:31:03 +0000 Subject: images: Ensure initrd is created with 644 perms (normally 600 for security reasons) --- images/make_boot_img | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 5325d2cf6..ed4c5baec 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -162,7 +162,8 @@ sub initrd { mkdir_p("build/dracut.conf.d"); # TODO if --nofscks and --no-hostonly are switched, dracut gives an error - fix or report upstream - __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf dracut.conf --confdir ./build/dracut.conf.d --add ' $modules ' --add-drivers ' $drivers ' '$img' '$kernel'" + __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf dracut.conf --confdir ./build/dracut.conf.d --add ' $modules ' --add-drivers ' $drivers ' '$img' '$kernel'"; + chmod(0644, $img); } -- cgit v1.2.1 From c386a93997aa2f3e233a273f8c7157e2ab26d217 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 4 Nov 2013 14:06:00 +0000 Subject: Revert "images: Use a generic, shared isolinux.cfg file." This reverts commit 74cc75140329a03e5ed6f952932f8ea937216209. --- images/make_boot_img | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index ed4c5baec..b07776b27 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -682,8 +682,7 @@ sub isolinux { _ "cp /usr/lib/syslinux/libmenu.c32 isolinux/libmenu.c32"; _ "cp /usr/lib/syslinux/libutil.c32 isolinux/libutil.c32"; _ "cp /usr/lib/syslinux/gfxboot.c32 isolinux/gfxboot.c32"; - output("isolinux/$arch.cfg", syslinux_cfg_all('cdrom', 1)); - _ "cp isolinux.cfg isolinux/"; + output("isolinux/isolinux.cfg", syslinux_cfg_all('cdrom', 1)); xbox_stage1() if arch() =~ /i.86/; } @@ -728,8 +727,7 @@ sub boot_iso { #_ "cp /home/teuf/mdv/src/mandriva-gfxboot-theme/inst/* .boot_iso/isolinux" if $with_gfxboot; _ "cp /usr/lib/syslinux/gfxboot.c32 .boot_iso/isolinux/gfxboot.c32" if $with_gfxboot; - output(".boot_iso/isolinux/$arch.cfg", syslinux_cfg_all('', $with_gfxboot)); - _ "cp isolinux.cfg .boot_iso/isolinux/"; + output('.boot_iso/isolinux/isolinux.cfg', syslinux_cfg_all('', $with_gfxboot)); _ "genisoimage -r -f -J -cache-inodes -V 'Mga Boot ISO' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $iso .boot_iso"; _ "isohybrid -o 1 $iso"; -- cgit v1.2.1 From 9c8e358edad9ec6b7b0569113f5448b0f3a19faa Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Wed, 13 Nov 2013 11:39:34 +0100 Subject: images: Add a way to put an automatic method on boot.iso syslinux for testing --- images/make_boot_img | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index b07776b27..457572ca0 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -729,6 +729,10 @@ sub boot_iso { output('.boot_iso/isolinux/isolinux.cfg', syslinux_cfg_all('', $with_gfxboot)); + if ($ENV{BOOT_AUTOMATIC_METHOD}) { + _ "sed -i 's|splash quiet\$|splash quiet automatic=$ENV{BOOT_AUTOMATIC_METHOD}|' .boot_iso/isolinux/isolinux.cfg" + } + _ "genisoimage -r -f -J -cache-inodes -V 'Mga Boot ISO' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $iso .boot_iso"; _ "isohybrid -o 1 $iso"; rm_rf('.boot_iso'); -- cgit v1.2.1 From 79b08a48f3cff888454ebc4a71db4a3e92d992fd Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Wed, 13 Nov 2013 11:43:50 +0100 Subject: images/kernel: Pass the modules we need to be in modules.alias through to dracut. The installer needs to have the modules.alias information for more kernel modules than are actually included. In order to do this we need to use and environment variable as there is no sensible way to do this via dracut command line arguments. The mgainstaller dracut module will need updating accordingly. This should solve the problem where Sound Cards are shown as 'not configured' at the end of the install. --- images/make_boot_img | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 457572ca0..2ac8eb189 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -154,6 +154,7 @@ sub initrd { my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)"; my $modules = " mgainstaller "; my $drivers = `perl ../kernel/modules.pl list_needed_modules $kernel | xargs`; + my $fakedrivers = `perl ../kernel/modules.pl list_fake_modules $kernel | xargs`; if ($ENV{DEBUGSTAGE1} || $ENV{BUILD_KA}) { $modules="$modules busybox "; @@ -162,7 +163,7 @@ sub initrd { mkdir_p("build/dracut.conf.d"); # TODO if --nofscks and --no-hostonly are switched, dracut gives an error - fix or report upstream - __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf dracut.conf --confdir ./build/dracut.conf.d --add ' $modules ' --add-drivers ' $drivers ' '$img' '$kernel'"; + __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary DRAKX_FAKE_MODULES='$fakedrivers' dracut --conf dracut.conf --confdir ./build/dracut.conf.d --add ' $modules ' --add-drivers ' $drivers ' '$img' '$kernel'"; chmod(0644, $img); } -- cgit v1.2.1 From 073ec448d66a2fca506c9665ff1162fdd7356473 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 1 Dec 2013 22:21:08 +0000 Subject: images: Allow the BOOT_AUTOMATIC_METHOD env var to work in rescue mode too --- images/make_boot_img | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 2ac8eb189..48f106e85 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -731,7 +731,7 @@ sub boot_iso { output('.boot_iso/isolinux/isolinux.cfg', syslinux_cfg_all('', $with_gfxboot)); if ($ENV{BOOT_AUTOMATIC_METHOD}) { - _ "sed -i 's|splash quiet\$|splash quiet automatic=$ENV{BOOT_AUTOMATIC_METHOD}|' .boot_iso/isolinux/isolinux.cfg" + _ "sed -i 's#\\(append .*\\)\\(splash quiet\\|rescue\\)\$#\\1\\2 automatic=$ENV{BOOT_AUTOMATIC_METHOD}#' .boot_iso/isolinux/isolinux.cfg" } _ "genisoimage -r -f -J -cache-inodes -V 'Mga Boot ISO' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $iso .boot_iso"; -- cgit v1.2.1 From 8a1f22d9941f1e52d0fb46612ae181537aa29185 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 7 Dec 2013 18:10:29 +0000 Subject: images: Pass audit=0 to the rescue system. Now that systemd is used there, we can use systemd-nspawn to 'boot' systems as containers. Unfortunately the kernel's audit subsystem needs to be fixed otherwise logging in doesn't work... so lets turn it off. --- images/make_boot_img | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 48f106e85..1cf144a39 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -180,7 +180,7 @@ sub entries_append { vgahi => "vga=791", text => "text", # patch => "patch $default_vga", - rescue => "rescue", + rescue => "audit=0 rescue", ); my @entries = ( (map { $_->[0] => "$automatic$default_acpi $_->[1]" } group_by2(@simple_entries)), -- cgit v1.2.1 From bc8cf46f070ef8244e0018c91e41170a40528242 Mon Sep 17 00:00:00 2001 From: Anne Nicolas Date: Sun, 15 Dec 2013 21:46:30 +0100 Subject: remove buggy control caracters (#11602) --- images/make_boot_img | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index 1cf144a39..613affd9a 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -106,7 +106,7 @@ sub syslinux_msg { $tree->[0] eq 'document' or die "bad file $msg_xml_file\n"; my $text = xml_tree2syslinux('default', $tree->[1]); - pack("C*", 0x0E, 0x80, 0x03, 0x00) . " " + " " . $text . join('', @more_text) . "\n" . syslinux_color('red') . "[F1-Help] [F2-Advanced Help]" . syslinux_color('default') . "\n"; } -- cgit v1.2.1