From 3f5d21d90abbd16f16ab69aec1e1a1853a93fd18 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Tue, 6 May 2003 13:11:49 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'R9_0-AMD64'. --- make_boot_img | 98 +++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 26 deletions(-) (limited to 'make_boot_img') diff --git a/make_boot_img b/make_boot_img index 269be0e5a..6978b6382 100755 --- a/make_boot_img +++ b/make_boot_img @@ -14,7 +14,11 @@ my ($arch) = $Config{archname} =~ /(.*?)-/; rename 'all.kernels', 'kernel/all.kernels'; rename 'all.modules', 'kernel/all.modules'; -$default_append = "ramdisk_size=32000 root=/dev/ram3"; +# default ramdisk size +$ramdisk_size = ($arch =~ /ia64/ ? 120000 : + ($arch =~ /x86_64/ ? 48000 : 32000)); + +$default_append = "ramdisk_size=$ramdisk_size root=/dev/ram3"; $default_vga = "vga=788"; $instdir = "mdk-stage1"; @@ -72,13 +76,17 @@ foreach (@kernels) { rename("$img-$main", "$img"); } } +if ($arch =~ /x86_64/ && $img =~ /all/) { + # isolinux is supposed to work on all those new hardware + isolinux($main, @kernels); +} if ($arch =~ /i.86/ && $img =~ /all/) { isolinux($main, @kernels); my ($img, $img_sav) = ("images/cdrom.img-$main", 'images/cdrom.img-sav'); rename($img, $img_sav); $type = 'cdrom'; - boot_img_i386($mnt, $img, "kernel/all.kernels/$main/boot/vmlinu*", sub { $_[0] =~ s/\bautomatic=\S+\b//; "$_[0] changedisk" }); + $::{"boot_img_$arch"}->($mnt, $img, "kernel/all.kernels/$main/boot/vmlinu*", sub { $_[0] =~ s/\bautomatic=\S+\b//; "$_[0] changedisk" }); rename($img, 'images/cdrom-changedisk.img'); rename($img_sav, $img); } @@ -102,10 +110,11 @@ sub initrd { _ "$sudo mount -t ext2 $tmp $mnt -o loop"; _ "$sudo tar xjC $mnt -f $tar"; + symlinkf "/tmp/stage2/lib64", "$mnt/lib64" if ($arch =~ /x86_64/); install_stripped("$instdir/init", "$mnt/sbin"); - install_stripped("$instdir/$install", "$mnt/sbin/stage1"); + install_stripped("$instdir/$install", "$mnt/sbin/stage1"); - if ($type eq "network" || $type eq "usb" || $type eq "all" || $type eq "other" || $type eq "blank") { + if (member($type, qw(network usb all other blank)) && $arch !~ /x86_64/) { install_stripped("$instdir/ppp/pppd-bin", "$mnt/sbin/pppd"); install_stripped("$instdir/rp-pppoe/pppoe-bin", "$mnt/sbin/pppoe"); _ "$sudo mknod $mnt/dev/ppp c 108 0"; @@ -113,7 +122,7 @@ sub initrd { _ "$sudo mknod $mnt/dev/ttyp0 c 3 0"; } - if (member($type, qw(pcmcia all network)) && $arch !~ /ppc/ && $arch !~ /ia64/) { + if (member($type, qw(pcmcia all network)) && $arch !~ /ppc|ia64|x86_64/) { _ "$sudo cp -a /etc/pcmcia $mnt/etc"; _ "cp $mnt/etc/pcmcia/config /tmp/pcmcia_config_tmp"; _ "tools/patch_pcmcia_config.pl /tmp/pcmcia_config_tmp kernel/all.modules/$main/modules.dep"; @@ -210,6 +219,43 @@ F3 boot.msg _ "df $mnt"; } +sub boot_img_x86_64 { + my ($mnt, $img, $kernel) = @_; + + __ "$sudo umount $mnt 2>/dev/null"; + + _ "dd if=/dev/zero of=$img bs=1k count=1440"; + _ "/sbin/mkfs.vfat $img"; + _ "$sudo syslinux -s $img"; + _ "$sudo mount -t vfat -o umask=0 $img $mnt -o loop"; + + _ "cat $kernel > $mnt/vmlinuz"; + my $rdz = $img; $rdz =~ s/\.img/.rdz/; + initrd "${mnt}2", $rdz if ! -e $rdz; + eval { _ "cp -f $rdz $mnt/$type.rdz" }; + if ($@) { + unlink "$mnt/$type.rdz"; + my $avail = (split ' ', `df $mnt`)[-3]; + my $s = int((-s $rdz) / 1024); + die sprintf("not enough room for $rdz: need %d KB (available %d KB < needed %d KB)\n", $s - $avail, $avail, $s); + } + + my $timeout = 72; + output "$mnt/syslinux.cfg", +"default linux +prompt 1 +timeout $timeout +" . join('', map { +"label $_->[0] + kernel vmlinuz + append initrd=$type.rdz $_->[1] +" +} entries_append($type)); + + _ "sync"; + _ "df $mnt"; +} + sub boot_img_alpha { my ($mnt, $img) = @_; @@ -249,14 +295,14 @@ image=vmlinux label=linux root=/dev/ram3 initrd=$type.rdz - append=\" ramdisk_size=120000\" + append=\" ramdisk_size=$ramdisk_size\" read-only image=vmlinux label=rescue root=/dev/ram3 initrd=$type.rdz - append=\" rescue ramdisk_size=120000\" + append=\" rescue ramdisk_size=$ramdisk_size\" "); _ "sync"; _ "df $mnt"; @@ -303,44 +349,44 @@ image[sun4c,sun4d,sun4m]=/$boot/vmlinux label=linux alias=install initrd=/$boot/live.rdz - append=\"ramdisk_size=32000 root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size root=/dev/ram3\" image[sun4c,sun4d,sun4m]=/$boot/vmlinux label=text initrd=/$boot/live.rdz - append=\"ramdisk_size=32000 text root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size text root=/dev/ram3\" image[sun4c,sun4d,sun4m]=/$boot/vmlinux label=expert initrd=/$boot/live.rdz - append=\"ramdisk_size=32000 expert root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size expert root=/dev/ram3\" image[sun4c,sun4d,sun4m]=/$boot/vmlinux label=ks initrd=/$boot/live.rdz - append=\"ramdisk_size=32000 ks root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size ks root=/dev/ram3\" image[sun4c,sun4d,sun4m]=/$boot/vmlinux label=rescue initrd=/$boot/live.rdz - append=\"ramdisk_size=32000 rescue rw root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size rescue rw root=/dev/ram3\" image[sun4u]=/$boot/vmlinux64 label=linux alias=install initrd=/$boot/live64.rdz - append=\"ramdisk_size=32000 root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size root=/dev/ram3\" image[sun4u]=/$boot/vmlinux64 label=text initrd=/$boot/live64.rdz - append=\"ramdisk_size=32000 text root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size text root=/dev/ram3\" image[sun4u]=/$boot/vmlinux64 label=expert initrd=/$boot/live64.rdz - append=\"ramdisk_size=32000 expert root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size expert root=/dev/ram3\" image[sun4u]=/$boot/vmlinux64 label=ks initrd=/$boot/live64.rdz - append=\"ramdisk_size=32000 ks root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size ks root=/dev/ram3\" image[sun4u]=/$boot/vmlinux64 label=rescue initrd=/$boot/live64.rdz - append=\"ramdisk_size=32000 rescue rw root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size rescue rw root=/dev/ram3\" "); output("$dir/$boot/README", " @@ -388,7 +434,7 @@ message=/boot.msg image=/vmlinux$I.gz label=linux initrd=/$type.rdz - append=\"ramdisk_size=32000 $ltype root=/dev/ram3\" + append=\"ramdisk_size=$ramdisk_size $ltype root=/dev/ram3\" "); _ "genromfs -d $dir -f /dev/ram -A 2048,/.. -a 512 -V \'DrakX boot disk\'"; _ "$sudo mount -t romfs /dev/ram $mnt"; @@ -420,56 +466,56 @@ image = cd:,\\\\\\\\vmlinux label = install-novideo root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" video=ofonly\" image = cd:,\\\\\\\\vmlinux label = install-atyfb root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" video=atyfb:vmode:17\" image = cd:,\\\\\\\\vmlinux label = install-aty128fb root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" video=aty128fb:vmode:17\" image = cd:,\\\\\\\\vmlinux label = install-text root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" text video=ofonly\" image = enet:0,vmlinux label = install-net root = /dev/ram3 initrd = enet:0,all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" video=ofonly\" image = enet:0,vmlinux label = install-net-text root = /dev/ram3 initrd = enet:0,all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" text video=ofonly\" image = cd:,\\\\\\\\vmlinux label = rescue root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" rescue video=ofonly\" image = enet:0,vmlinux label = rescue-net root = /dev/ram3 initrd = enet:0,all.gz - initrd-size = 32000 + initrd-size = $ramdisk_size append = \" rescue video=ofonly\" "); #- seem to need 2 yaboot.conf, one in the root, and one in boot -- cgit v1.2.1