From de47eb59bb829423b1d0f47ba13099073999b3cb Mon Sep 17 00:00:00 2001 From: Nicolas Planel Date: Wed, 29 Oct 2003 16:07:11 +0000 Subject: Corporate Server 2.1.1 release --- make_boot_img | 268 ++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 204 insertions(+), 64 deletions(-) (limited to 'make_boot_img') diff --git a/make_boot_img b/make_boot_img index 269be0e5a..61586e7e6 100755 --- a/make_boot_img +++ b/make_boot_img @@ -1,6 +1,6 @@ #!/usr/bin/perl -@ARGV >= 2 or die "usage: $0 all|other|cdrom|hd|network|usb|blank|pcmcia|live|tftp|tftprd\n"; +@ARGV >= 2 or die "usage: $0 all|cdrom|hd|hdcdrom_usb|network|network_gigabit_usb|network_gigabit|network_usb|blank|pcmcia|live|tftp|tftprd\n"; use Config; use MDK::Common; @@ -14,7 +14,9 @@ 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_append = "ramdisk_size=128000 root=/dev/ram3"; +# full acpi support for amd64, enough acpi support for x86 ht, no acpi for others +$default_acpi = ($arch =~ /i.86/ ? "acpi=ht" : ($arch =~ /x86_64/ ? "acpi=off" : "acpi=off")); $default_vga = "vga=788"; $instdir = "mdk-stage1"; @@ -34,16 +36,18 @@ _ "$sudo mkdir ${mnt}2" unless -e "${mnt}2"; $install = $ {{ all => "stage1-full", - other => "stage1-full", blank => "stage1-full", live => "stage1-full", tftp => "stage1-full", tftprd => "stage1-full", pcmcia => "stage1-full", network => "stage1-network", - usb => "stage1-usb", + network_gigabit => "stage1-network", + network_usb => "stage1-network-usb", + network_gigabit_usb => "stage1-network-usb", cdrom => "stage1-cdrom", hd => "stage1-disk", + hdcdrom_usb => "stage1-medias-usb", live64 => "stage1-full", tftp64 => "stage1-full", tftprd64 => "stage1-full", @@ -56,7 +60,7 @@ $install = $ {{ mkdir "images"; chomp($main = `cat kernel/all.kernels/.main`); -if ($img =~ /blank|other|pcmcia/) { +if ($img =~ /blank|pcmcia/) { @kernels = $main; } else { @kernels = map { m|kernel/all.kernels/(.*)| } glob('kernel/all.kernels/*'); @@ -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"); - if ($type eq "network" || $type eq "usb" || $type eq "all" || $type eq "other" || $type eq "blank") { + if (member($type, qw(network network_gigabit_usb all blank))) { 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"; @@ -121,8 +130,10 @@ sub initrd { } my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)"; $modz = "kernel/all.modules$I/$ext"; - _ "$sudo cp -f $modz/${ltype}_modules.mar $mnt/modules/modules$I.mar" if $type !~ /blank/; - _ "$sudo cp -f $modz/modules.dep $mnt/modules/"; + if ($type !~ /blank/) { + _ "$sudo cp -f $modz/${ltype}_modules.mar $mnt/modules/modules$I.mar" ; + _ "$sudo cp -f $modz/modules.dep $mnt/modules/"; + } _ "$sudo umount $mnt"; @@ -152,9 +163,10 @@ sub entries_append { rescue => "rescue rw", ); my @entries = ( - (map { $_->[0] => "$automatic $_->[1]" } group_by2(@simple_entries)), - if_(member($type, "cdrom", "all"), oem => "automatic=method:cdrom $default_vga rescue oem rw"), - if_($type eq "all", all => "pcmcia $default_vga"), + (map { $_->[0] => "$automatic $default_acpi $_->[1]" } group_by2(@simple_entries)), + acpi => "$automatic $default_vga", + if_(member($type, "cdrom", "all"), oem => "automatic=method:cdrom $default_vga $default_acpi rescue oem rw",), + if_($type eq "all", all => "pcmcia $default_vga $default_acpi"), ); map { [ $_->[0], "$default_append $_->[1]" ] } @@ -182,9 +194,10 @@ sub boot_img_i386 { my $rdz = $img; $rdz =~ s/\.img/.rdz/; initrd("${mnt}2", $rdz) if !-e $rdz; - eval { _ "cp -f $rdz $mnt/$type.rdz" }; + my $short_type = substr($type, 0, 8); + eval { _ "cp -f $rdz $mnt/$short_type.rdz" }; if ($@) { - unlink "$mnt/$type.rdz"; + unlink "$mnt/$short_type.rdz"; my $avail = (split ' ', `df $mnt`)[-3]; my $s = int((-s $rdz) / 1024); die sprintf("not enough room for $rdz: need %dKB (available %dKB < needed %dKB)\n", $s - $avail, $avail, $s); @@ -203,13 +216,16 @@ F3 boot.msg my $args = $args_callback ? $args_callback->($_->[1]) : $_->[1]; "label $_->[0] kernel vmlinuz - append initrd=$type.rdz $args + append initrd=$short_type.rdz $args " } entries_append($type)); _ "sync"; _ "df $mnt"; } +# alias to x86 variant, slightly bigger with images though +sub boot_img_x86_64 { &boot_img_i386 } + sub boot_img_alpha { my ($mnt, $img) = @_; @@ -303,44 +319,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=128000 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=128000 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=128000 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=128000 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=128000 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=128000 root=/dev/ram3\" image[sun4u]=/$boot/vmlinux64 label=text initrd=/$boot/live64.rdz - append=\"ramdisk_size=32000 text root=/dev/ram3\" + append=\"ramdisk_size=128000 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=128000 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=128000 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=128000 rescue rw root=/dev/ram3\" "); output("$dir/$boot/README", " @@ -388,7 +404,7 @@ message=/boot.msg image=/vmlinux$I.gz label=linux initrd=/$type.rdz - append=\"ramdisk_size=32000 $ltype root=/dev/ram3\" + append=\"ramdisk_size=128000 $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"; @@ -402,83 +418,204 @@ image=/vmlinux$I.gz } sub boot_img_ppc { - my ($mnt, $img, $kern, $modz) = @_; - my $dir = "/export"; - my $boot = "boot"; #- non-absolute pathname only! - my ($extension) = $modz =~ /.*\/([^\/]+)/; - _ "mkdir -p $dir/$boot"; - _ "cp -f $kern $dir/$boot/vmlinux"; - _ "cp -f images/all.rdz$extension $dir/boot/all.gz"; - _ "cp -f tools/ppc/yaboot $dir/boot/yaboot"; + my (@kernels) = @_; + #- hack to produce directly into /export the needed file for cdrom boot. + my $dir = "/export"; + my $boot = "boot"; #- non-absolute pathname only! + _ "rm -rf $dir/$boot"; mkdir "$dir/$boot", 0777; + foreach (glob("kernel/all.kernels/*")) { + my $ext = basename($_); + if ($ext =~ /2.4/) { + _ "cp $_/boot/vmlinux $dir/$boot/vmlinux"; + _ "cp images/all.rdz-$ext $dir/$boot/all.gz"; + } + if ($ext =~ /2.2/) { + _ "cp $_/boot/vmlinux $dir/$boot/vmlinux-2.2"; + _ "cp images/all.rdz-$ext $dir/$boot/all-2.2.gz"; + } + } + _ "cp -f /usr/lib/yaboot/yaboot $dir/$boot/yaboot"; + output("$dir/$boot/ofboot.b", " + +MacRISC + + +Mandrake Linux PPC bootloader + + +\" screen\" output +dev screen +\" \"(0000000000aa00aa0000aaaaaa0000aa00aaaa5500aaaaaa)\" drop 0 8 set-colors +\" \"(5555555555ff55ff5555ffffff5555ff55ffffff55ffffff)\" drop 8 8 set-colors +device-end +3 to foreground-color +0 to background-color +\" \"(0C)\" fb8-write drop +\" Booting Mandrake Linux PPC...\" fb8-write drop 100 ms +boot cd:2,\\\\yaboot + + +1010 +000000000000F8FEACF6000000000000 +0000000000F5FFFFFEFEF50000000000 +00000000002BFAFEFAFCF70000000000 +0000000000F65D5857812B0000000000 +0000000000F5350B2F88560000000000 +0000000000F6335708F8FE0000000000 +00000000005600F600F5FD8100000000 +00000000F9F8000000F5FAFFF8000000 +000000008100F5F50000F6FEFE000000 +000000F8F700F500F50000FCFFF70000 +00000088F70000F50000F5FCFF2B0000 +0000002F582A00F5000008ADE02C0000 +00090B0A35A62B0000002D3B350A0000 +000A0A0B0B3BF60000505E0B0A0B0A00 +002E350B0B2F87FAFCF45F0B2E090000 +00000007335FF82BF72B575907000000 +000000000000ACFFFF81000000000000 +000000000081FFFFFFFF810000000000 +0000000000FBFFFFFFFFAC0000000000 +000000000081DFDFDFFFFB0000000000 +000000000081DD5F83FFFD0000000000 +000000000081DDDF5EACFF0000000000 +0000000000FDF981F981FFFF00000000 +00000000FFACF9F9F981FFFFAC000000 +00000000FFF98181F9F981FFFF000000 +000000ACACF981F981F9F9FFFFAC0000 +000000FFACF9F981F9F981FFFFFB0000 +00000083DFFBF981F9F95EFFFFFC0000 +005F5F5FDDFFFBF9F9F983DDDD5F0000 +005F5F5F5FDD81F9F9E7DF5F5F5F5F00 +0083DD5F5F83FFFFFFFFDF5F835F0000 +000000FBDDDFACFBACFBDFDFFB000000 +000000000000FFFFFFFF000000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFFFF00000000 +00000000FFFFFFFFFFFFFFFFFF000000 +00000000FFFFFFFFFFFFFFFFFF000000 +000000FFFFFFFFFFFFFFFFFFFFFF0000 +000000FFFFFFFFFFFFFFFFFFFFFF0000 +000000FFFFFFFFFFFFFFFFFFFFFF0000 +00FFFFFFFFFFFFFFFFFFFFFFFFFF0000 +00FFFFFFFFFFFFFFFFFFFFFFFFFFFF00 +00FFFFFFFFFFFFFFFFFFFFFFFFFF0000 +000000FFFFFFFFFFFFFFFFFFFF000000 + + +"); + output("$dir/$boot/yaboot.conf", " init-message = \"\\nWelcome to Mandrake Linux PPC!\\nHit for boot options.\\n\\n\" timeout = 150 -default = install-novideo +default = install-gui +message=cd:,\\\\\\\\yaboot.msg image = cd:,\\\\\\\\vmlinux - label = install-novideo + label = install-gui root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 - append = \" video=ofonly\" - -image = cd:,\\\\\\\\vmlinux - label = install-atyfb + initrd-size = 34000 + +image = cd:,\\\\\\\\vmlinux-2.2 + label = install-gui-2.2 root = /dev/ram3 - initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 - append = \" video=atyfb:vmode:17\" - + initrd = cd:,\\\\\\\\all-2.2.gz + initrd-size = 34000 + image = cd:,\\\\\\\\vmlinux - label = install-aty128fb + label = install-text root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 - append = \" video=aty128fb:vmode:17\" + initrd-size = 34000 + append = \" text video=ofonly\" + +image = cd:,\\\\\\\\vmlinux-2.2 + label = install-text-2.2 + root = /dev/ram3 + initrd = cd:,\\\\\\\\all-2.2.gz + initrd-size = 34000 + append = \" text video=ofonly\" image = cd:,\\\\\\\\vmlinux - label = install-text + label = install-gui-old root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 - append = \" text video=ofonly\" + initrd-size = 34000 + append = \" gui-old video=ofonly\" + +image = cd:,\\\\\\\\vmlinux-2.2 + label = install-gui-old-2.2 + root = /dev/ram3 + initrd = cd:,\\\\\\\\all-2.2.gz + initrd-size = 34000 + append = \" gui-old video=ofonly\" image = enet:0,vmlinux label = install-net root = /dev/ram3 initrd = enet:0,all.gz - initrd-size = 32000 + initrd-size = 34000 append = \" video=ofonly\" +image = enet:0,vmlinux-2.2 + label = install-net-2.2 + root = /dev/ram3 + initrd = enet:0,all-2.2.gz + initrd-size = 34000 + append = \" video=ofonly\" + image = enet:0,vmlinux label = install-net-text root = /dev/ram3 initrd = enet:0,all.gz - initrd-size = 32000 + initrd-size = 34000 append = \" text video=ofonly\" +image = enet:0,vmlinux-2.2 + label = install-net-text-2.2 + root = /dev/ram3 + initrd = enet:0,all-2.2.gz + initrd-size = 34000 + append = \" text video=ofonly\" + image = cd:,\\\\\\\\vmlinux label = rescue root = /dev/ram3 initrd = cd:,\\\\\\\\all.gz - initrd-size = 32000 + initrd-size = 34000 append = \" rescue video=ofonly\" image = enet:0,vmlinux label = rescue-net root = /dev/ram3 initrd = enet:0,all.gz - initrd-size = 32000 + initrd-size = 34000 append = \" rescue video=ofonly\" "); - #- seem to need 2 yaboot.conf, one in the root, and one in boot - _ "cp -f $dir/boot/yaboot.conf $dir/yaboot.conf"; - output("$dir/$boot/README", " -To Build a Bootable CD-ROM, do: -cd /tools/ppc -./mkINSTALLCD /export ppc-cd.img + output("$dir/$boot/yaboot.msg", " +Thanks for choosing Mandrake Linux PPC. The following is a short +explanation of the various options for booting the install CD. + +All options ending with \"2.2\" will use the 2.2.20-9mdkBOOT kernel. +The default syntax with no suffix uses the 2.4.18-4mdkBOOT kernel. +The default if you just hit enter is \"install-gui\". + +install-gui: uses XFree86 fbdev mode +install-text: text based install +install-gui-old: old Xpmac gui +install-net: allows you to use a minimal boot CD, + pulling the rest of the install from + a network server +install-net-text: text mode network install +rescue: boots the rescue image +rescue-net: boots the rescue image from a network server + "); } @@ -497,7 +634,10 @@ sub isolinux { } if (-e "isolinux-graphic.bmp") { #- change here for newer picture isolinux-graphic.bmp and newer parameters. - _ "lilo-bmp2mdk mode:0x103 progress:425,173,16,8,64+2 clear:600,800,64+2 pos:0,0 isolinux/boot.msg"; + #- for old style pictures (9.1 and previous) + _ "lilo-bmp2mdk mode:0x103 progress:425,173,16,7,64+21 clear:600,800,64+59 pos:0,0 isolinux/boot.msg"; + #- for current 9.2 pictures. + #_ "lilo-bmp2mdk mode:0x103 progress:371,144,4,8,64+60 clear:600,800,64+127 pos:0,0 isolinux/boot.msg"; } _ "cp /usr/lib/syslinux/isolinux.bin isolinux/isolinux.bin"; output "isolinux/isolinux.cfg", " @@ -516,7 +656,7 @@ F2 advanced.msg . join('', map_index { "label alt$::i kernel alt$::i/vmlinuz - append initrd=alt$::i/all.rdz $default_append $default_vga + append initrd=alt$::i/all.rdz $default_append $default_acpi $default_vga " } @kernels); output "isolinux/help.msg", (-e "isolinux/boot.msg" && pack "C*", 0x0E, 0x80, 0x03, 0x00) . -- cgit v1.2.1