summaryrefslogtreecommitdiffstats
path: root/make_boot_img
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-06-12 14:10:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-06-12 14:10:44 +0000
commit014a65964c200155ec01d633c8653c3840cec9c2 (patch)
tree2a0f56e94e232bb3be8563f3a80fe45bbeaf4c53 /make_boot_img
parent726052354a8a77b85e11c620e3c9fbe98522ff57 (diff)
downloaddrakx-backup-do-not-use-014a65964c200155ec01d633c8653c3840cec9c2.tar
drakx-backup-do-not-use-014a65964c200155ec01d633c8653c3840cec9c2.tar.gz
drakx-backup-do-not-use-014a65964c200155ec01d633c8653c3840cec9c2.tar.bz2
drakx-backup-do-not-use-014a65964c200155ec01d633c8653c3840cec9c2.tar.xz
drakx-backup-do-not-use-014a65964c200155ec01d633c8653c3840cec9c2.zip
merge with x86_64-branch
Diffstat (limited to 'make_boot_img')
-rwxr-xr-xmake_boot_img97
1 files changed, 71 insertions, 26 deletions
diff --git a/make_boot_img b/make_boot_img
index b26668e15..2bbca5ae6 100755
--- a/make_boot_img
+++ b/make_boot_img
@@ -14,7 +14,10 @@ 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 = 128000;
+
+$default_append = "ramdisk_size=$ramdisk_size root=/dev/ram3";
$default_vga = "vga=788";
$instdir = "mdk-stage1";
@@ -73,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);
}
@@ -110,10 +117,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";
@@ -121,7 +129,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";
@@ -219,6 +227,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) = @_;
@@ -258,14 +303,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";
@@ -312,44 +357,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", "
@@ -397,7 +442,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";
@@ -429,56 +474,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