From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- sys-boot/milo/Manifest | 15 ++ sys-boot/milo/files/README-gentoo | 98 ++++++++ sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff | 123 ++++++++++ sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff | 174 ++++++++++++++ sys-boot/milo/files/mkserial_no.c | 45 ++++ sys-boot/milo/files/objstrip.c | 282 +++++++++++++++++++++++ sys-boot/milo/metadata.xml | 17 ++ sys-boot/milo/milo-2.4.18.ebuild | 231 +++++++++++++++++++ 8 files changed, 985 insertions(+) create mode 100644 sys-boot/milo/Manifest create mode 100644 sys-boot/milo/files/README-gentoo create mode 100644 sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff create mode 100644 sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff create mode 100644 sys-boot/milo/files/mkserial_no.c create mode 100644 sys-boot/milo/files/objstrip.c create mode 100644 sys-boot/milo/metadata.xml create mode 100644 sys-boot/milo/milo-2.4.18.ebuild (limited to 'sys-boot/milo') diff --git a/sys-boot/milo/Manifest b/sys-boot/milo/Manifest new file mode 100644 index 000000000000..9022f088be01 --- /dev/null +++ b/sys-boot/milo/Manifest @@ -0,0 +1,15 @@ +AUX README-gentoo 3390 SHA256 5ea6da5520997956c2eea4a4f5101a31e4220cd601babdb2984a22cdb9002f6d SHA512 ffe7c3202f6d65b892d5ef641e0e83a00f13a264f208e90fdaa20a392e4abc869c5513f10d481831b45e4b4e1cfaa7c79e2b89fcb541c0be186374f0e6a1d33c WHIRLPOOL afe91679b51749ec0fc7c8e796e746dccfbc8cd25b5a64724830e469eed31e704e9833d14686de23f8eba9b7a9b61c383b03cdf44285c800be7c4b6c429173e0 +AUX linux-2.2.25-gcc3-milo.diff 3542 SHA256 a6a342920de6919af0ee269a9c3d05be656e755dc145a47923a4f6c433552da3 SHA512 d709fbc5340a0cf01e6d23cc9080ca6afa585d4b4764de97f57c0c533015841ea4df557a68274f3406c323c781d73cca8ab2dd06f7a1a96cfaf0db118330d30e WHIRLPOOL bb723be2299bc2640b4bc5536778be075172ec17e7e0279897afe32682af74c550249e317b99f62f3531636786ff46c03a7c321cf38cc2d0ef40708efd3b72fc +AUX milo-2.2-18-gcc3-gentoo.diff 5619 SHA256 573545ca2269f0296336c91ba4fc6901aec534752de9a521cd6bae3197f7a38d SHA512 1c265c007fd1f9f67d2df0533c2acbdf15ca5fedf503583675c102226bfb3a4c8c281dd5e424b92186461a59964009c6162a85e502a1951cc05c0fab878eaf46 WHIRLPOOL b688a6e469ada99a52ec7ac053d5879f1bc6fc32231d4e7d97f1698634fefb79c7c690e0cfe84610ba866ae25f6968f6208a7b8133eb284f43088bbdd0d7dadf +AUX mkserial_no.c 1264 SHA256 4a9714e0a3a1aa9fa1cca410cf02c8559035bb67ed2cb12351efa24e3748f303 SHA512 29dffb49bff13f2961756747ef708f949d8a5ea064c9e0bf72cab46a9ae21054bb6d9f1d338ad4cc8efd073040f8e9ff940da1d94bcd8827d3aea44718bca2b4 WHIRLPOOL 36139f089404f47250bdd252adf14e6f4299c17ac51bd7c6a3285b2d074d9e410fee8e6ee408280c2704d264a25a0596dd0910985cc50c4069635a5fa621d1e6 +AUX objstrip.c 6126 SHA256 21be9424bfbfe238e402aecb55f9ff53bf042dbd287405f53f76bb148c1fe327 SHA512 04c8e26c8dd143a1de9feb3b3cd66f3eb70720bf297dc151b18840ec1ed827df6209b0c57553a2fef2a29caeb7d5c7ce090800ac9a05931769f32ef54972955f WHIRLPOOL 800c9946c00ee6ae33e5fda950ff67b3c0b47fa5e9f513571f118f057e690fe5d46122c6fd06f1db02406bfb45f85cd74820f180bfad6a78ccdfa2f111010ebe +DIST MILO-HOWTO 52455 SHA256 d94f5d75d647f47f11fb691df3da450dc794dd9287464df71168d03d8bbcd4e3 SHA512 81e0fdc12a1e56af14af4a4167ccc9d6ffefa265fad3328c27b7640b51b07012870c0e57497d83084d1ff9c3681ceb617a4ff25f87e12d109c34df062a0c1432 WHIRLPOOL 154f7c527a43f18104fc5e67e03db593cf8b764b3beac7b2a31f8e87bced10e5582085ae41e6b2272bec2e758a3ed5cbe0ed96d3a060005b16ce7e5790b85f2a +DIST ldmilo-patched-20010430 18944 SHA256 282745f24bc472871b5a4eda7a634847a874d04802056ffca360bf67883d753f SHA512 c02ba8805b0d28516534d679fef7073e6c2adea30d41a8bf9e40c48c57a889e5122f475970c6afe9ddd894970dfc2504ea89c276d920a1fbd88c3abc3eaa1e01 WHIRLPOOL 50c31440ee6edc199bb052de5b05f75ef8284f41fa653100b9ff6525742525fc7078f0c5c616d70861f50d55e56dd33deac798c106133ce8b964a59f08ba6507 +DIST linload.exe 7168 SHA256 15d1d8dcbefde7c94a1bbe4a243b13f9197c27cb19388f8de0d92d45a4be42e4 SHA512 604b1937d751b18a9204681a248ce9557912c10b2e2c68e5f9ce33030d5b0d8721f1afafaf22d6326bc4514a09a72696c4917d893a9e64ac44b61e563caac96c WHIRLPOOL 8013004d89ff724227de0a3b80f15440ed1c69260820fac4563132a1e1bfc5569368fd426e87fb5ea6ea397515789ec842342fef45306c35d9a00ebe40e8a760 +DIST linux-2.2.20-reiserfs-3.5.35.diff.bz2 154943 SHA256 a6aee45cf9814e45d9a3be05b35bda289c5f6d8672eaacc32fcec60527550e94 SHA512 b63d03d605d65cb7a15020ad38b80d77b810963edbdc0b5ccaf1706347de5026e390d8c2a5315f1d2734b793903c1a407b4db4129d11b7d5ff2ad9dc8f2137aa WHIRLPOOL 37fcde105083087f0afd62b6cd5102d769783f0c22efdb70cdee9f961aef4509df98f4bd1f67827b12835d664266a5fd4893c9572978d6ff4331ae9d95c5eff2 +DIST linux-2.2.25.tar.bz2 15791211 SHA256 cd15777cdb90af5136d40d13190def143ccf7a730722c7435e0daff48d0405d9 SHA512 63e83f4f184cdd09f39c24e2023fce3562ea550db7182ae94e36ce30c6b2415bac970306cd60c1d1a89a1a3b54ad957094629557a5782f181939efb219ad41bb WHIRLPOOL eb1680128c4a6c249ef71dd4668698a4d9f09ce2d7c8b6cf9366d129bbeb1f8bd0a37a2f43d8d50789b745373950b094e736b518b9d033dfd4d5567861462096 +DIST milo-2.2-18.tar.bz2 1074725 SHA256 b63e113d74eb40845ecdd111784d524c223694f236891279ae002b441a50258b SHA512 1ccc86c83d520d07040ba44d14e7e9353cf364bf5b83ba4df14b0560769643ce07f89feeab468144fe17b7bf482beb7480f5dad1a0e9b574e6e6150bb72aae93 WHIRLPOOL ac08d299f37fc7bbfd78cae8cb63c245f6a0828e93ec1c838a288889fc9390081e79450e98a0bf460a4a7d61fad555e7b1de63d3246cbc15ad1a82063f522984 +EBUILD milo-2.4.18.ebuild 7757 SHA256 7b59ed55aa14891be508522d0483b9092f515e42e46dc7678354a5b3d306f8e3 SHA512 f2a50d8c14494a3c3347391172c00dca536a45693136d60c73f785d3a4ad87117c8e13fd26519f75ab9ff363a8db24eb7d5b499af735b85860b0a61f2a29bd39 WHIRLPOOL 72cd85db923d99b4163f722b19ead9119b70774070b4740f3813b8cb40da811eb6186bdb578e32e316f7a77d4ad478a381f8fd8f91da8cb09cb5c524c085b009 +MISC ChangeLog 2580 SHA256 17cce35beb901ba12f32d5bb38d52a0ddecfb882be3d10d3d22de2a1344650b3 SHA512 345c58d12d0a853bfd655b9801e0f02533bc985ac887cb53cc3a2de07c182f04f67f08ba9ab3ccbe930ecb8b277da55a2c309ca75bb0d14fd89081ea1eaccc06 WHIRLPOOL e71e583fe4f2e6865c5eafcc1b89629e52a35a6625a0b409824733ffee7e0a1f15b01321c3c2c50c423db039153008a83baf8effd8665b23f28b87c3aeed145e +MISC ChangeLog-2015 1939 SHA256 f719335c4a5eccb1e051e9ee39a9fd156997418164ea71c10e047b416e108bb7 SHA512 75c9516eab19211328b6116c73d414dfc69ad19b52516b17aad3622b87bca9567014e7b1818ee0925bd6c2c361ffc57040a8f9286db91d45c5d91b692fb1f660 WHIRLPOOL 59c3b6ec9901b5541728e43e2d3345d81a7328b366a435776817dd996096d25232cf9f5d860dd6518979a9100e3db47cd57dcaa4d0df8be7dd5d2e6283677473 +MISC metadata.xml 790 SHA256 76e0638d5ac18dc331a6ef706b1bad19371456780b694d8920c8b438494ae864 SHA512 513614f6b5be1bdca2676a618b1f1c6b70506ced43da83fe92b75876f88b7439e1a13b83e3a0252cffc1b1de09914f67276ea0cc239ee3c2efca108fb2a1b700 WHIRLPOOL 7a09e705be56988548b4e60b6a4247fd31416f07b3e18f6971d791f9692e4933d3cfc35b79698564a68df359550a31eb972e428225f116279debde08186b25ca diff --git a/sys-boot/milo/files/README-gentoo b/sys-boot/milo/files/README-gentoo new file mode 100644 index 000000000000..5ad8c753ba09 --- /dev/null +++ b/sys-boot/milo/files/README-gentoo @@ -0,0 +1,98 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# +############################################## +# Gentoo Linux MILO images. +#################################################### +# +# What is MILO? +# +### + +MILO is an AlphaLinux bootloader, which is usually used to load the Linux +Operating System on Alpha machines that dont have SRM. + +There are two families of firmware on Alpha, ARC and SRM. ARC was developed +for use with Windows NT, and cannot support Linux. Some Alpha's were +distributed with only ARC firmware, for use specifically with Windows NT, +these machines would not be able to run any OS except for Windows NT without +MILO. + +If you do have SRM, or the option of using SRM, you should be using the aboot +bootloader, unless you really know what you are doing. + +NOTE: if you have srm, but would like to dual boot with Windows NT, or use ARC + firmware, you might find MILO more useful than aboot. There are other + reasons also, booting a kernel from a reiserfs partition, for example. + +NOTE: The Gentoo MILO images are slightly different to the standard + MILO images, they have been patched to compile with gcc3 and + work with the latest linux-2.2 kernel and drivers. You can + also optimise your MILO image, to maximise the performance of the + MILO pager! woooo! + +FIXME: will there be a boot speed improvement from optimising MILO? +FIXME: what about performance of the call_pal routines (or at least the + overhead of calling them, as they are hand coded asm), will + that improve system performance? + +##################################################### +# +# How do i use these images to boot? +# +#### + +NOTE: Read the MILO-HOWTO in this directory now! + There is an explanation and description of all the ways you can + start MILO, including SRM, Floppy, Flash and Debug Monitor. + +In this directory you will find the MILO images, you can use these to +make MILO boot floppies, or install them to a FAT partition. + +There are instructions below for making a MILO boot floppy. + + +1. insert the disk you would like to make a MILO floppy. + +2. fdformat /dev/fd0 + + Obviously, if the disk is already formatted you can skip + this step. + +3. mformat a: + + this will create a MSDOS file system (FAT) on the floppy. + +4. mcopy milo-2.4.18-gentoo- a:\milo + + install the milo image for your machine onto the new floppy. + +5. mcopy linload.exe a:\linload.exe + _OR_ if you have a Ruffian machine: + mcopy ldmilo.exe a:\ldmilo.exe + + install the milo loader, note that ruffians dont use ldlinux.exe + by default, if your system expects ldlinux.exe, just copy that file + instead. the ldmilo included in this ebuild contains the fixes by Jay + Eastabrook, sometimes called "Jay's Hacked Version". + +6. echo -ne '\125\252' | dd of=/dev/fd0 bs=1 seek=510 count=2 conv=notrunc + + this might not be nescessary on all machines, but some ARCs expect the + floppy to be marked bootable, this fakes the magic. + +7. reboot, and set ARCs to boot your shiny new MILO floppy! + +##################################################### +# +# BUGS +# +#### + +These MILO images are not extensively tested, if you use one +PLEASE, PLEASE, PLEASE tell me! i need to know which systems +it works on and which ones it doesnt. + +if you dont want to enter a bug in http://bugs.gentoo.org/ + +you can just email me a quick note to taviso@gentoo.org diff --git a/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff b/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff new file mode 100644 index 000000000000..d99769f91c9f --- /dev/null +++ b/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff @@ -0,0 +1,123 @@ +diff -ru --minimal linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c +--- linux/arch/alpha/kernel/process.c 2001-03-25 17:37:29.000000000 +0100 ++++ linux/arch/alpha/kernel/process.c 2003-06-02 20:20:19.000000000 +0100 +@@ -57,7 +57,7 @@ + static struct fs_struct init_fs = INIT_FS; + static struct files_struct init_files = INIT_FILES; + static struct signal_struct init_signals = INIT_SIGNALS; +-struct mm_struct init_mm = INIT_MM; ++struct mm_struct init_mm; + + union task_union init_task_union __attribute__((section("init_task"))) + = { task: INIT_TASK }; +diff -ru --minimal linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c +--- linux/drivers/char/tty_io.c 2002-05-21 00:32:34.000000000 +0100 ++++ linux/drivers/char/tty_io.c 2003-06-02 20:05:08.000000000 +0100 +@@ -756,15 +756,17 @@ + } + + /* Semaphore to protect creating and releasing a tty */ +-static struct semaphore tty_sem = MUTEX; ++static struct semaphore tty_sem; + + static void down_tty_sem(int index) + { ++ tty_sem = MUTEX; + down(&tty_sem); + } + + static void up_tty_sem(int index) + { ++ tty_sem = MUTEX; + up(&tty_sem); + } + +@@ -785,6 +787,7 @@ + int retval=0; + int idx; + ++ tty_sem = MUTEX; + driver = get_tty_driver(device); + if (!driver) + return -ENODEV; +diff -ru --minimal linux/fs/super.c linux/fs/super.c +--- linux/fs/super.c 2001-11-02 16:39:08.000000000 +0000 ++++ linux/fs/super.c 2003-06-02 20:13:53.000000000 +0100 +@@ -42,7 +42,7 @@ + * unmounting a filesystem and re-mounting it (or something + * else). + */ +-static struct semaphore mount_sem = MUTEX; ++static struct semaphore mount_sem; + + extern void wait_for_keypress(void); + extern struct file_operations * get_blkfops(unsigned int major); +@@ -730,6 +730,7 @@ + int retval; + struct inode * inode = get_empty_inode(); + ++ mount_sem = MUTEX; + retval = -ENOMEM; + if (!inode) + goto out; +@@ -859,6 +860,7 @@ + struct vfsmount *vfsmnt; + int error; + ++ mount_sem = MUTEX; + error = -EACCES; + if (!(flags & MS_RDONLY) && dev && is_read_only(dev)) + goto out; +diff -ru --minimal linux/kernel/sys.c linux/kernel/sys.c +--- linux/kernel/sys.c 2002-09-16 17:26:33.000000000 +0100 ++++ linux/kernel/sys.c 2003-06-02 20:00:20.000000000 +0100 +@@ -866,12 +866,13 @@ + * rather than a semaphore. Anybody want to implement + * one? + */ +-struct semaphore uts_sem = MUTEX; ++struct semaphore uts_sem; + + asmlinkage int sys_newuname(struct new_utsname * name) + { + int errno = 0; + ++ uts_sem = MUTEX; + down(&uts_sem); + if (copy_to_user(name,&system_utsname,sizeof *name)) + errno = -EFAULT; +@@ -883,6 +884,7 @@ + { + int errno; + ++ uts_sem = MUTEX; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (len < 0 || len > __NEW_UTS_LEN) +@@ -901,6 +903,7 @@ + { + int i, errno; + ++ uts_sem = MUTEX; + if (len < 0) + return -EINVAL; + down(&uts_sem); +@@ -922,6 +925,7 @@ + { + int errno; + ++ uts_sem = MUTEX; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (len < 0 || len > __NEW_UTS_LEN) +diff -ru --minimal linux/include/asm-alpha/errno.h linux/include/asm-alpha/errno.h +--- linux/include/asm-alpha/errno.h 2001-03-25 17:31:06.000000000 +0100 ++++ linux/include/asm-alpha/errno.h 2003-06-02 23:48:45.000000000 +0100 +@@ -134,6 +134,7 @@ + #define ELIBMAX 125 /* Attempting to link in too many shared libraries */ + #define ELIBEXEC 126 /* Cannot exec a shared library directly */ + #define ERESTART 127 /* Interrupted system call should be restarted */ ++#define EHASHCOLLISION 127 /* reiserfs hash collision */ + #define ESTRPIPE 128 /* Streams pipe error */ + + #define ENOMEDIUM 129 /* No medium found */ diff --git a/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff b/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff new file mode 100644 index 000000000000..2fa897df6e90 --- /dev/null +++ b/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff @@ -0,0 +1,174 @@ +diff -u -r --minimal milo-2.2-18.orig/config.in milo-2.2-18/config.in +--- milo-2.2-18.orig/config.in 2001-07-18 15:58:30.000000000 +0100 ++++ milo-2.2-18/config.in 2003-06-05 18:52:06.000000000 +0100 +@@ -5,7 +5,7 @@ + + comment 'Alpha Linux Miniloader setup' + # +-string 'Path to kernel sources' KSRC /usr/src/linux ++string 'Path to kernel sources' KSRC ${WORKDIR}/linux + choice 'Alpha system type' \ + "Alpha-XLT MINI_ALPHA_XLT \ + Alpha-XL MINI_ALPHA_XL \ +diff -u -r --minimal milo-2.2-18.orig/devices.c milo-2.2-18/devices.c +--- milo-2.2-18.orig/devices.c 2001-07-18 16:59:38.000000000 +0100 ++++ milo-2.2-18/devices.c 2003-06-05 18:52:06.000000000 +0100 +@@ -98,7 +98,7 @@ + struct fs_struct init_fs = INIT_FS; + struct files_struct init_files = INIT_FILES; + struct signal_struct init_signals = INIT_SIGNALS; +-struct mm_struct init_mm = INIT_MM; ++struct mm_struct init_mm; + + unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */ + +@@ -1213,7 +1213,7 @@ + } + + +-void __wake_up(struct wait_queue **p, unsigned int mode, unsigned int wq_mode) ++void __wake_up(struct wait_queue **p, unsigned int mode) + { + wake_up(p); + } +diff -u -r --minimal milo-2.2-18.orig/Documentation/defconfig.milo milo-2.2-18/Documentation/defconfig.milo +--- milo-2.2-18.orig/Documentation/defconfig.milo 2001-07-19 10:59:45.000000000 +0100 ++++ milo-2.2-18/Documentation/defconfig.milo 2003-06-05 18:52:06.000000000 +0100 +@@ -5,7 +5,7 @@ + # + # Alpha Linux Miniloader setup + # +-KSRC=/usr/src/linux ++KSRC=${WORKDIR}/linux + # MINI_ALPHA_XLT is not set + # MINI_ALPHA_XL is not set + # MINI_ALPHA_BOOK1 is not set +@@ -36,7 +36,7 @@ + # MINI_VGA_RAW2 is not set + MINI_TGA_CONSOLE=y + MINI_EXTERNAL_FONT=y +-MINI_FONT_FILE=/usr/lib/kbd/consolefonts/default8x16.gz ++MINI_FONT_FILE=/usr/share/consolefonts/default8x16.psfu.gz + MILO_CONFIG_EXT2FS=y + MILO_CONFIG_MSDOSFS=y + MILO_CONFIG_REISERFS=y +diff -u -r --minimal milo-2.2-18.orig/hwrpb.c milo-2.2-18/hwrpb.c +--- milo-2.2-18.orig/hwrpb.c 2001-07-18 14:38:38.000000000 +0100 ++++ milo-2.2-18/hwrpb.c 2003-06-05 18:52:06.000000000 +0100 +@@ -368,9 +368,17 @@ + percpu = + (struct percpu_struct *) (((char *) hwrpb) + + hwrpb->processor_offset); +- percpu->serial_no[0] = 0x73695f78756e694c; ++#ifndef MILO_SERIAL_NUMBER0 ++#define MILO_SERIAL_NUMBER0 0x73695f78756e694c ++#endif /* MILO_SERIAL_NUMBER0 */ ++ ++#ifndef MILO_SERIAL_NUMBER1 ++#define MILO_SERIAL_NUMBER1 0x002174616572475f; ++#endif /* MILO_SERIAL_NUMBER1 */ ++ ++ percpu->serial_no[0] = MILO_SERIAL_NUMBER0; + /* :-) */ +- percpu->serial_no[1] = 0x002174616572475f; ++ percpu->serial_no[1] = MILO_SERIAL_NUMBER1; + percpu->type = cpuid(); + + /* +diff -u -r --minimal milo-2.2-18.orig/Makefile milo-2.2-18/Makefile +--- milo-2.2-18.orig/Makefile 2001-07-18 17:15:31.000000000 +0100 ++++ milo-2.2-18/Makefile 2003-06-05 18:52:06.000000000 +0100 +@@ -54,8 +54,8 @@ + # + + LINKFLAGS = -non_shared -N -T milo.lds +-CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ +- -fno-strict-aliasing -mcpu=ev5 -pipe -mno-fp-regs \ ++CFLAGS += -Wall -Wstrict-prototypes -fomit-frame-pointer \ ++ -fno-strict-aliasing -pipe -mno-fp-regs \ + -ffixed-8 -Wa,-mev6 -D__KERNEL__ -D__linux__ \ + -I$(KSRC)/include + +diff -u -r --minimal milo-2.2-18.orig/milo.c milo-2.2-18/milo.c +--- milo-2.2-18.orig/milo.c 2001-07-18 14:38:38.000000000 +0100 ++++ milo-2.2-18/milo.c 2003-06-05 19:16:16.000000000 +0100 +@@ -1436,9 +1436,10 @@ + { + extern U64 milo_memory_size; + +- printk("MILO (%s):\n", alpha_mv.vector_name); +- printk(" Built against Linux " UTS_RELEASE "\n"); ++ printk("Gentoo MILO (%s):\n", alpha_mv.vector_name); ++ printk(" Built against Gentoo Linux Kernel " UTS_RELEASE "\n"); + printk(" Using compiler " LINUX_COMPILER "\n"); ++ printk("\nWelcome to the Gentoo Linux MIniLOader\n"); + + #if 0 + /* what sort of video do we have? */ +@@ -1792,7 +1793,7 @@ + /* parse commands forever */ + while (1) { + +- printk("MILO> "); ++ printk("MILO > "); + + kbd_gets(command_string, 256); + printk_rows = 0; +diff -u -r --minimal milo-2.2-18.orig/tools/scripts/allfiles milo-2.2-18/tools/scripts/allfiles +--- milo-2.2-18.orig/tools/scripts/allfiles 2001-07-11 18:27:02.000000000 +0100 ++++ milo-2.2-18/tools/scripts/allfiles 2003-06-05 18:52:06.000000000 +0100 +@@ -1,7 +1,7 @@ + #!/bin/bash + + LOC=kernel/objs +-KSRC=/usr/src/linux/ ++KSRC=${WORKDIR}/linux + + rm -rf $LOC + +diff -u -r --minimal milo-2.2-18.orig/tools/scripts/build milo-2.2-18/tools/scripts/build +--- milo-2.2-18.orig/tools/scripts/build 2001-07-18 16:58:29.000000000 +0100 ++++ milo-2.2-18/tools/scripts/build 2003-06-05 19:14:25.000000000 +0100 +@@ -1,29 +1,9 @@ + #!/bin/bash + set -e + +-RELEASE=2.2-17 ++RELEASE=2.2-18-Gentoo + +-for i in \ +- "Alpha-XLT XLT" \ +- "Alpha-XL XL" \ +- "AlphaBook1 BOOK1" \ +- "Avanti AVANTI" \ +- "Cabriolet CABRIOLET" \ +- "EB66 EB66" \ +- "EB66+ EB66P" \ +- "EB64+ EB64P" \ +- "EB164 EB164" \ +- "PC164 PC164" \ +- "LX164 LX164" \ +- "SX164 SX164" \ +- "Noname NONAME" \ +- "Takara TAKARA" \ +- "Mikasa MIKASA" \ +- "Alcor ALCOR" \ +- "Miata MIATA" \ +- "Ruffian RUFFIAN" \ +- "Platform2000 P2K" \ +- "UDB UDB" ++for i in __MILO_ARCHES__ + do + short=`echo $i | awk '{print $1}'` + long=`echo $i | awk '{print $2}'` +diff -u -r --minimal milo-2.2-18.orig/tools/scripts/buildkernels milo-2.2-18/tools/scripts/buildkernels +--- milo-2.2-18.orig/tools/scripts/buildkernels 1999-08-19 14:08:55.000000000 +0100 ++++ milo-2.2-18/tools/scripts/buildkernels 2003-06-05 18:52:06.000000000 +0100 +@@ -1,6 +1,6 @@ + #!/bin/bash + +-LINUX=/usr/src/linux ++LINUX=${WORKDIR}/linux + KOUT=$(dirname `pwd`)/linux + + set -e diff --git a/sys-boot/milo/files/mkserial_no.c b/sys-boot/milo/files/mkserial_no.c new file mode 100644 index 000000000000..b4650447584f --- /dev/null +++ b/sys-boot/milo/files/mkserial_no.c @@ -0,0 +1,45 @@ +#include + +/* some example serial numbers for the MILO bootloader */ +/* gcc -o mkserial_no mkserial_no.c */ +/* taviso@gentoo.org 2003 */ + +/* NOTE: remember you need a 0x00 (NULL terminator) at the end */ + +int main() +{ + long long serial_no[2]; + + /* 1) Linux_is_Great! */ + /* s i _ x u n i L */ + serial_no[0] = 0x73695f78756e694c; + /* ! t a e r G _ */ + serial_no[1] = 0x002174616572475f; + + /* 2) Gentoo Linux. */ + /* L o o t n e G */ + serial_no[0] = 0x4c206f6f746e6547; + /* . x u n i */ + serial_no[1] = 0x0000002e78756e69; + + /* 3) Gentoo/Alpha. */ + /* A / o o t n e G */ + serial_no[0] = 0x412f6f6f746e6547; + /* .a h p l */ + serial_no[1] = 0x0000002e6168706c; + + /* 4) Gentoo MILO. */ + /* M o o t n e G */ + serial_no[0] = 0x4d206f6f746e6547; + /* . O L I */ + serial_no[1] = 0x000000002e4f4c49; + + /* 5) |d|i|g|i|t|a|l| */ + /* i | g | i | d | */ + serial_no[0] = 0x697c677c697c647c; + /* | l | a | t | */ + serial_no[1] = 0x007c6c7c617c747c; + + printf ("serial number:\t%s\n", (char*) serial_no); + return (0); +} diff --git a/sys-boot/milo/files/objstrip.c b/sys-boot/milo/files/objstrip.c new file mode 100644 index 000000000000..bbda40330708 --- /dev/null +++ b/sys-boot/milo/files/objstrip.c @@ -0,0 +1,282 @@ +/* + * arch/alpha/boot/tools/objstrip.c + * + * Strip the object file headers/trailers from an executable (ELF or ECOFF). + * + * Copyright (C) 1996 David Mosberger-Tang. + */ +/* + * Converts an ECOFF or ELF object file into a bootable file. The + * object file must be a OMAGIC file (i.e., data and bss follow immediatly + * behind the text). See DEC "Assembly Language Programmer's Guide" + * documentation for details. The SRM boot process is documented in + * the Alpha AXP Architecture Reference Manual, Second Edition by + * Richard L. Sites and Richard T. Witek. + */ +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#ifdef __ELF__ +# include +# include +#endif + +/* bootfile size must be multiple of BLOCK_SIZE: */ +#define BLOCK_SIZE 512 + +const char * prog_name; + + +void +usage (void) +{ + fprintf(stderr, + "usage: %s [-v] -p file primary\n" + " %s [-vb] file [secondary]\n", prog_name, prog_name); + exit(1); +} + + +int +main (int argc, char *argv[]) +{ + size_t nwritten, tocopy, n, mem_size, fil_size, pad = 0; + int fd, ofd, i, j, verbose = 0, primary = 0; + char buf[8192], *inname; + struct exec * aout; /* includes file & aout header */ + long offset; +#ifdef __ELF__ + struct elfhdr *elf; + struct elf_phdr *elf_phdr; /* program header */ + unsigned long long e_entry; +#endif + + prog_name = argv[0]; + + for (i = 1; i < argc && argv[i][0] == '-'; ++i) { + for (j = 1; argv[i][j]; ++j) { + switch (argv[i][j]) { + case 'v': + verbose = ~verbose; + break; + + case 'b': + pad = BLOCK_SIZE; + break; + + case 'p': + primary = 1; /* make primary bootblock */ + break; + } + } + } + + if (i >= argc) { + usage(); + } + inname = argv[i++]; + + fd = open(inname, O_RDONLY); + if (fd == -1) { + perror("open"); + exit(1); + } + + ofd = 1; + if (i < argc) { + ofd = open(argv[i++], O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (fd == -1) { + perror("open"); + exit(1); + } + } + + if (primary) { + /* generate bootblock for primary loader */ + + unsigned long bb[64], sum = 0; + struct stat st; + off_t size; + int i; + + if (ofd == 1) { + usage(); + } + + if (fstat(fd, &st) == -1) { + perror("fstat"); + exit(1); + } + + size = (st.st_size + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1); + memset(bb, 0, sizeof(bb)); + strcpy((char *) bb, "Linux SRM bootblock"); + bb[60] = size / BLOCK_SIZE; /* count */ + bb[61] = 1; /* starting sector # */ + bb[62] = 0; /* flags---must be 0 */ + for (i = 0; i < 63; ++i) { + sum += bb[i]; + } + bb[63] = sum; + if (write(ofd, bb, sizeof(bb)) != sizeof(bb)) { + perror("boot-block write"); + exit(1); + } + printf("%lu\n", size); + return 0; + } + + /* read and inspect exec header: */ + + if (read(fd, buf, sizeof(buf)) < 0) { + perror("read"); + exit(1); + } + +#ifdef __ELF__ + elf = (struct elfhdr *) buf; + + if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) == 0) { + if (elf->e_type != ET_EXEC) { + fprintf(stderr, "%s: %s is not an ELF executable\n", + prog_name, inname); + exit(1); + } + if (!elf_check_arch(elf)) { + fprintf(stderr, "%s: is not for this processor (e_machine=%d)\n", + prog_name, elf->e_machine); + exit(1); + } + if (elf->e_phnum != 1) { + fprintf(stderr, + "%s: %d program headers (forgot to link with -N?)\n", + prog_name, elf->e_phnum); + } + + e_entry = elf->e_entry; + + lseek(fd, elf->e_phoff, SEEK_SET); + if (read(fd, buf, sizeof(*elf_phdr)) != sizeof(*elf_phdr)) { + perror("read"); + exit(1); + } + + elf_phdr = (struct elf_phdr *) buf; + offset = elf_phdr->p_offset; + mem_size = elf_phdr->p_memsz; + fil_size = elf_phdr->p_filesz; + + /* work around ELF bug: */ + if (elf_phdr->p_vaddr < e_entry) { + unsigned long delta = e_entry - elf_phdr->p_vaddr; + offset += delta; + mem_size -= delta; + fil_size -= delta; + elf_phdr->p_vaddr += delta; + } + + if (verbose) { + fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n", + prog_name, (long) elf_phdr->p_vaddr, + elf_phdr->p_vaddr + fil_size, offset); + } + } else +#endif + { + aout = (struct exec *) buf; + + if (!(aout->fh.f_flags & COFF_F_EXEC)) { + fprintf(stderr, "%s: %s is not in executable format\n", + prog_name, inname); + exit(1); + } + + if (aout->fh.f_opthdr != sizeof(aout->ah)) { + fprintf(stderr, "%s: %s has unexpected optional header size\n", + prog_name, inname); + exit(1); + } + + if (N_MAGIC(*aout) != OMAGIC) { + fprintf(stderr, "%s: %s is not an OMAGIC file\n", + prog_name, inname); + exit(1); + } + offset = N_TXTOFF(*aout); + fil_size = aout->ah.tsize + aout->ah.dsize; + mem_size = fil_size + aout->ah.bsize; + + if (verbose) { + fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n", + prog_name, aout->ah.text_start, + aout->ah.text_start + fil_size, offset); + } + } + + if (lseek(fd, offset, SEEK_SET) != offset) { + perror("lseek"); + exit(1); + } + + if (verbose) { + fprintf(stderr, "%s: copying %lu byte from %s\n", + prog_name, (unsigned long) fil_size, inname); + } + + tocopy = fil_size; + while (tocopy > 0) { + n = tocopy; + if (n > sizeof(buf)) { + n = sizeof(buf); + } + tocopy -= n; + if ((size_t) read(fd, buf, n) != n) { + perror("read"); + exit(1); + } + do { + nwritten = write(ofd, buf, n); + if ((ssize_t) nwritten == -1) { + perror("write"); + exit(1); + } + n -= nwritten; + } while (n > 0); + } + + if (pad) { + mem_size = ((mem_size + pad - 1) / pad) * pad; + } + + tocopy = mem_size - fil_size; + if (tocopy > 0) { + fprintf(stderr, + "%s: zero-filling bss and aligning to %lu with %lu bytes\n", + prog_name, pad, (unsigned long) tocopy); + + memset(buf, 0x00, sizeof(buf)); + do { + n = tocopy; + if (n > sizeof(buf)) { + n = sizeof(buf); + } + nwritten = write(ofd, buf, n); + if ((ssize_t) nwritten == -1) { + perror("write"); + exit(1); + } + tocopy -= nwritten; + } while (tocopy > 0); + } + return 0; +} diff --git a/sys-boot/milo/metadata.xml b/sys-boot/milo/metadata.xml new file mode 100644 index 000000000000..a9870c74849d --- /dev/null +++ b/sys-boot/milo/metadata.xml @@ -0,0 +1,17 @@ + + + + + alpha@gentoo.org + Gentoo Linux Alpha Development + + + On Intel based PC systems, the BIOS firmware sets up the system and + then loads the image to be run from the boot block of a DOS file + system. This is more or less what MILO does on an Alpha based system, + however there are several interesting differences between BIOS firmware + and MILO, not least of which is that MILO includes and uses standard + Linux device drivers unmodified. MILO is firmware, unlike LILO, which + relies on the BIOS firmware to get itself loaded. + + diff --git a/sys-boot/milo/milo-2.4.18.ebuild b/sys-boot/milo/milo-2.4.18.ebuild new file mode 100644 index 000000000000..9c58de22f09c --- /dev/null +++ b/sys-boot/milo/milo-2.4.18.ebuild @@ -0,0 +1,231 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit flag-o-matic eutils + +# Currently tested Systems: +# +# Ruffian: UX164, BX164 +# + +DESCRIPTION="The Alpha MIniLOader, for Alpha Machines without SRM" +HOMEPAGE="http://milo.core-systems.de/" + +# ive tested this, and it seems to make little difference +# which kernel version you use, so it makes sense to use the +# latest available 2.2 kernel with the latest bugfixes/drivers/etc. + +kernel_version="2.2.25" +milo_version="2.2-18" +ldmilo_patch="20010430" + +# milo-2.2-18.tar.bz2 :- latest milo sources +# linux-2.2.25.tar.bz2 :- latest linux 2.2 kernel sources +# ldmilo-patched-20010430 :- Ruffian ldmilo utility, with bugfixes by Jay Eastabrook +# linload.exe :- linload utility (ldmilo equivalent for non-ruffians). + +SRC_URI="http://www.suse.de/~stepan/source/milo-${milo_version}.tar.bz2 + mirror://kernel/linux/kernel/v2.2/linux-${kernel_version}.tar.bz2 + https://dev.gentoo.org/~taviso/milo/ldmilo-patched-${ldmilo_patch} + http://ftp.namesys.com/pub/reiserfs-for-2.2/linux-2.2.20-reiserfs-3.5.35.diff.bz2 + https://dev.gentoo.org/~taviso/milo/linload.exe + http://www.ibiblio.org/pub/Linux/docs/HOWTO/MILO-HOWTO" + +# +# milo license is dec palcode license, dec bios emulation license, and gpl-2 rolled +# into one big ugly package. +# +# the dec licenses say you can basically do anything you like, including modify +# and redistribute for profit or non-profit, as long as its for use with Alpha +# architecture. +# + +LICENSE="MILO" +SLOT="0" + +KEYWORDS="-* ~alpha" +IUSE="" + +DEPEND="sys-apps/kbd + >=sys-apps/sed-4" +RDEPEND="sys-fs/mtools" + +S=${WORKDIR}/milo-${milo_version} + +# You can change the default MILO serial +# number here, the MILO default is "Linux_is_Great!". +# There are some below that i have made you can +# use if you want, just uncomment the one you like. +# +# if you want to see how this works, to make your own +# look at mkserial_no.c in the filesdir. +# +##### Linux_is_Great! ################### +#milo_serial_number0=0x73695f78756e694c +#milo_serial_number1=0x002174616572475f +# +##### Gentoo Linux. ##################### +milo_serial_number0=0x4c206f6f746e6547 +milo_serial_number1=0x0000002e78756e69 +# +##### Gentoo/Alpha. ##################### +#milo_serial_number0=0x412f6f6f746e6547 +#milo_serial_number1=0x0000002e6168706c +# +##### Gentoo MILO. ###################### +#milo_serial_number0=0x4d206f6f746e6547 +#milo_serial_number1=0x000000002e4f4c49 +# +##### |d|i|g|i|t|a|l| ################### +#milo_serial_number0=0x697c677c697c647c +#milo_serial_number1=0x007c6c7c617c747c; +# + +src_unpack() { + # unpack everything the kernel and milo sources + unpack linux-${kernel_version}.tar.bz2 + unpack milo-${milo_version}.tar.bz2 + + # gcc3 fixes, and some tweaks to get a build, also + # reiserfs support for the kernel (and milo). + cd ${WORKDIR}/linux; epatch "${FILESDIR}"/linux-${kernel_version}-gcc3-milo.diff || die + cd ${WORKDIR}/linux; epatch "${DISTDIR}"/linux-2.2.20-reiserfs-3.5.35.diff.bz2 || die + cd ${S}; epatch "${FILESDIR}"/milo-${milo_version}-gcc3-gentoo.diff || die +} + +src_compile() { + unset MILO_ARCH + for arches in "Alpha-XLT XLT" \ + "Alpha-XL XL" \ + "AlphaBook1 BOOK1" \ + "Avanti AVANTI" \ + "Cabriolet CABRIOLET" \ + "EB66 EB66" \ + "EB66+ EB66P" \ + "EB64+ EB64P" \ + "EB164 EB164" \ + "PC164 PC164" \ + "LX164 LX164" \ + "SX164 SX164" \ + "Noname NONAME" \ + "Takara TAKARA" \ + "Mikasa MIKASA" \ + "Alcor ALCOR" \ + "Miata MIATA" \ + "Ruffian RUFFIAN" \ + "Platform2000 P2K" \ + "UDB UDB" + do + if [ -z "${MILO_IMAGE}" ]; then + MILO_ARCH="${MILO_ARCH} \"${arches}\"" + else + if echo ${arches} | grep -i ${MILO_IMAGE}; then + MILO_ARCH="\"${arches}\"" + fi + fi + done + + if [ -z "${MILO_ARCH}" ]; then + eerror "Sorry, but ${MILO_IMAGE} doesnt look valid to me" + eerror "Consult the Alpha installation guide, or the ebuild" + eerror "for a list of available Alphas." + die "${MILO_IMAGE} not supported, or not recognised." + fi + + sed -i "s!__MILO_ARCHES__!${MILO_ARCH}!g" ${S}/tools/scripts/build + + ewarn + ewarn "seriously, this is going to take a while, go get some coffee..." + ewarn + einfo "this ebuild will build the standard MILO images, similar to those" + einfo "distributed with some distributions, and the images provided with" + einfo "the official MILO sources." + einfo + einfo "of course, the beauty of MILO is it can support any device supported" + einfo "by the linux kernel, so if you need support for non-standard hardware" + einfo "set the path to the .config you want in \$custom_milo_kernel_config and" + einfo "i will use it instead of the default." + ewarn + + einfon "continuing in 10 seconds ..." + epause 10 + + # get kernel configured + cp ${custom_milo_kernel_config:-${S}/Documentation/config/linux-2.2.19-SuSE.config} \ + ${WORKDIR}/linux/.config + cd ${WORKDIR}/linux; yes n | make oldconfig || die "unable to configure kernel." + + # we're building a generic kernel that defaults to ev5, but theres no + # reason why we cant tweak the instruction set. + # im not sure if you can actually pull a system performance gain/faster + # boot from optimising milo, but at least you'll get a faster milo pager ;) + mcpu_flag="`get-flag mcpu`" + if [ ! -z "${mcpu_flag}" ]; then + sed -i "s/\(CFLAGS := \$(CFLAGS) \)-mcpu=ev5$/\1-mcpu=${mcpu_flag:-ev5}/g" \ + ${WORKDIR}/linux/arch/alpha/Makefile + fi + + # build the generic linux kernel, of course if you have + # hardware not supported by this generic kernel, you are free + # to hack it (or the .config used here). + einfo "building a generic kernel for use with milo..." + unset CC DISTCC_HOSTS; make dep vmlinux || die "unable to build generic kernel for milo." + cat ${FILESDIR}/objstrip.c > ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip.c + + # make the objstrip utility. + gcc ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip.c -o \ + ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip || die "couldnt build objstrip." + einfo "kernel build complete." + einfo "building milo images..." + + # we have a choice here, milo can set the serial number to just about + # anything we like, the milo author has chosen "Linux_is_Great!", which + # is a bit cheesy, but we will leave it as default if user hasnt chosen + # something else. + # see above for options. + + append-flags -DMILO_SERIAL_NUMBER0="${milo_serial_number0:-0x73695f78756e694c}" + append-flags -DMILO_SERIAL_NUMBER1="${milo_serial_number1:-0x002174616572475f}" + + # the Makefile missed this :-/ + cd ${S}/tools/common; make || die "couldnt make commonlib." + + # build all the milo images. + cd ${S}; tools/scripts/build || die "failed to build milo images." + + # put the ldmilo utility there. + cp ${DISTDIR}/ldmilo-patched-${ldmilo_patch} ${S}/binaries/ldmilo.exe + cp ${DISTDIR}/linload.exe ${S}/binaries/linload.exe + +} + +src_install() { + + cd ${S}; dodir /opt/milo + insinto /opt/milo + + einfo "Installing MILO images..." + for i in binaries/* + do + einfo " ${i}" + doins ${i} + done + + cd ${S}/Documentation + + dodoc ChangeLog filesystem Nikita.Todo README.milo Todo LICENSE README.BSD Stuff WhatIsMilo \ + ${FILESDIR}/README-gentoo ${FILESDIR}/mkserial_no.c ${DISTDIR}/MILO-HOWTO + +} + +pkg_postinst() { + einfo "The MILO images have been installed into /opt/milo." + einfo "There are instructions in /usr/share/doc/${P} for making MILO boot floppies." + einfo "Alternative methods, (flash, srm, debug monitor, etc) are described in the MILO-HOWTO." + einfo + einfo "The important docs to read are the README-gentoo and the MILO-HOWTO." + einfo + ewarn "PLEASE, PLEASE, PLEASE, let me know if this works or not, i need to know which systems" + ewarn "need tweaking, and which ones are good to go. You can email me at taviso@gentoo.org" + einfo +} -- cgit v1.2.3