Running binaries on 11.4 using iBCS

I gave an app that runs (rather old school) binaries using ibcs. Up and until 11.0 everything was fine, but on subsequent versions I cannot get iBCS to run:
On 11.0 the /usr/lib/ibcs/coff directory contains:

nnnnnnn:/usr/lib/ibcs/coff # l
total 168
drwxr-xr-x  2 stef users  4096 Sep 20 07:24 ./
drwxr-xr-x 17 root root   4096 Sep 20 07:24 ../
-rw-r--r--  1 root root  23561 Sep 20 07:24 .binfmt-coff.o.cmd
-rw-r--r--  1 root root    178 Sep 20 07:24 .binfmt_coff.ko.cmd
-rw-r--r--  1 root root  15494 Sep 20 07:24 .binfmt_coff.mod.o.cmd
-rw-r--r--  1 root root    130 Sep 20 07:24 .binfmt_coff.o.cmd
-rw-r--r--  1 stef users    86 Mar 14  2008 Makefile
-rw-r--r--  1 stef users 22596 Jul 26  2008 binfmt-coff.c
-rw-r--r--  1 root root   9308 Sep 20 07:24 binfmt-coff.o
-rw-r--r--  1 root root  28896 Sep 20 07:24 binfmt_coff.ko
-rw-r--r--  1 root root   1664 Sep 20 07:24 binfmt_coff.mod.c
-rw-r--r--  1 root root  20192 Sep 20 07:24 binfmt_coff.mod.o
-rw-r--r--  1 root root   9305 Sep 20 07:24 binfmt_coff.o
-rw-r--r--  1 root root     41 Sep 20 07:24 modules.order

On 11.4 it contains:

nnnnnnn:/usr/lib/ibcs/coff # l
total 48
drwxr-xr-x  2 assist users  4096 Sep 20 09:03 ./
drwxr-xr-x 17 root   root   4096 Sep 20 09:03 ../
-rw-r--r--  1 root   root   7330 Sep 20 09:03 .binfmt-coff.o.d
-rw-r--r--  1 assist users    86 Mar 14  2008 Makefile
-rw-r--r--  1 assist users 22596 Jul 26  2008 binfmt-coff.c
-rw-r--r--  1 root   root     41 Nov  3  2008 modules.order

So what has changed? Why is coff not linked during rebuild? Tried to copy binfmt-coff.ko from 11.0 to 11.4 but it gives:

invalid module format

Note for the band-aid people: :slight_smile:

  • I know it is outdated - but it works.
  • No, I do not want to port/convert the binaries. (300+). New versions are released from time to time.
  • No, I cannot/wantnot use another emulator: New versions install with iBCS

Hi
The module (ko) wasn’t rebuilt how/what do you do to compile? See any
errors? Are you running the latest version of iBCS?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 7 days 14:43, 3 users, load average: 0.24, 0.13, 0.18
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Hi, when I make /usr/lib/ibcs I get the following error:
nnnnnnn:/usr/lib/ibcs # make

make -C /lib/modules/2.6.37.1-1.2-desktop/build M=/usr/lib/ibcs modules
make[1]: Entering directory `/usr/src/linux-2.6.37.1-1.2'
  CC [M]  /usr/lib/ibcs/coff/binfmt-coff.o
/usr/lib/ibcs/coff/binfmt-coff.c: In function 'coff_load_object':
/usr/lib/ibcs/coff/binfmt-coff.c:326:7: error: 'struct task_struct' has no member named 'cap_effective'
/usr/lib/ibcs/coff/binfmt-coff.c:602:14: error: 'struct mm_struct' has no member named 'rss'
/usr/lib/ibcs/coff/binfmt-coff.c:626:3: error: implicit declaration of function 'compute_creds'
/usr/lib/ibcs/coff/binfmt-coff.c:679:3: error: 'struct task_struct' has no member named 'cap_effective'
/usr/lib/ibcs/coff/binfmt-coff.c:683:11: error: 'struct task_struct' has no member named 'cap_effective'
/usr/lib/ibcs/coff/binfmt-coff.c:693:4: error: 'struct task_struct' has no member named 'cap_effective'
/usr/lib/ibcs/coff/binfmt-coff.c:698:12: error: 'struct task_struct' has no member named 'cap_effective'
/usr/lib/ibcs/coff/binfmt-coff.c:716:3: error: 'struct task_struct' has no member named 'cap_effective'
/usr/lib/ibcs/coff/binfmt-coff.c:724:11: error: 'struct task_struct' has no member named 'cap_effective'
make[3]: *** [/usr/lib/ibcs/coff/binfmt-coff.o] Error 1
make[2]: *** [/usr/lib/ibcs/coff] Error 2
make[1]: *** [_module_/usr/lib/ibcs] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.1-1.2'
make: *** [all] Error 2

The file /usr/lib/ibcs/coff/binfmt-coff.c:

         * committed to being defined or a segmentation violation will occur.
         */

        if (binary) {
                COFF_SCNHDR     *sect_ptr2 = sect_bufr;
                u_long          personality = PER_SVR3;
                int             i;

                if ((status = flush_old_exec(bprm)))
                        goto out_free_file;

                /*
                 * Look for clues as to the system this binary was compiled
                 * on in the comments section(s).
                 *
                 * Only look at the main binary, not the shared libraries
                 * (or would it be better to prefer shared libraries over
                 * binaries?  Or could they be different???)
                 */
                for (i = 0; i < sections; i++) {
                        long    sect_flags = COFF_LONG(sect_ptr2->s_flags);

                        if (sect_flags == COFF_STYP_INFO &&
                           (status = coff_parse_comments(bprm->file,
                                                sect_ptr2, &personality)) > 0)
                                goto found;

                        sect_ptr2 = (COFF_SCNHDR *) &((char *)sect_ptr2)[COFF_SC
NHSZ];
                }

                /*
                 * If no .comments section was found there is no way to
                 * figure out the personality. Odds on it is SCO though...
                 */
                personality = PER_SCOSVR3;

found:
                if (lPers) personality = lPers;
                if ( (personality & 0xFF) == (current->personality & 0xFF) ) set
_personality(0);
                set_personality(personality);

#if defined(CONFIG_ABI_TRACE)
        abi_trace(ABI_TRACE_UNIMPL,"Personality %08lX assigned
",personality);
#endif
#ifdef CONFIG_64BIT
                set_thread_flag(TIF_IA32);
                clear_thread_flag(TIF_ABI_PENDING);
#endif
                current->mm->start_data = 0;
                current->mm->end_data = 0;
                current->mm->end_code = 0;
                current->mm->mmap = NULL;
                current->flags &= ~PF_FORKNOEXEC;
#ifdef set_mm_counter
#if _KSL > 14
                set_mm_counter(current->mm, file_rss, 0);
#else
                set_mm_counter(current->mm, rss, 0);
#endif
#else
                current->mm->rss = 0;
#endif
                /*
                 * Construct the parameter and environment
                 * string table entries.
                 */
#if _KSL > 10
                if ((status = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT))
 < 0)
#else
                if ((status = setup_arg_pages(bprm, EXSTACK_DEFAULT)) < 0)
#endif
                        goto sigsegv;

                p = (u_long)coff_mktables((char *)bprm->p,
                                bprm->argc, bprm->envc);

                current->mm->end_code = text.size +
                    (current->mm->start_code = text.vaddr);
                current->mm->end_data = data.size +
                    (current->mm->start_data = data.vaddr);
                current->mm->brk = bss.size +
                    (current->mm->start_brk = bss.vaddr);

                current->mm->start_stack = p;
                compute_creds(bprm);
#if _KSL < 15
#ifdef CONFIG_64BIT
                __asm__ volatile (
                "movl %0,%%fs; movl %0,%%es; movl %0,%%ds"
                : :"r" (0));
                __asm__ volatile (
                "pushf; cli; swapgs; movl %0,%%gs; mfence; swapgs; popf"
                : :"r" (0));
                write_pda(oldrsp,p);
                _FLG(regs) = 0x200;
#else
                __asm__ volatile (
                "movl %0,%%fs ; movl %0,%%gs"
                : :"r" (0));
                _DS(regs) = _ES(regs) = __USER_DS;
#endif
                _SS(regs) = __USER_DS;
                _SP(regs) = p;
                _CS(regs) = __USER_CS;
                _IP(regs) = start_addr;
                set_fs(USER_DS);
#else
                start_thread(regs, start_addr, p);
#endif

#ifdef CONFIG_64BIT
        __asm__ volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS));
        _SS(regs) = __USER32_DS;
        _CS(regs) = __USER32_CS;
#endif
        }

        old_fs = get_fs();
        set_fs(get_ds());

        if (!pageable) {
                /*
                 * Read the file from disk...
                 *
                 * XXX: untested.
                 */
                loff_t pos = data.scnptr;
                status = do_brk(text.vaddr, text.size);
                bprm->file->f_op->read(bprm->file,
                                (char *)data.vaddr, data.scnptr, &pos);
                status = do_brk(data.vaddr, data.size);
                bprm->file->f_op->read(bprm->file,
                                (char *)text.vaddr, text.scnptr, &pos);
                status = 0;
        } else {
                /* map the text pages...*/
                cap_raise(current->cap_effective,CAP_SYS_RAWIO);
                m_addr = map_coff(bprm->file, &text, PROT_READ | PROT_EXEC,
                        MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE
,
                        text.scnptr & PAGE_MASK);
                if(!ce) cap_lower(current->cap_effective,CAP_SYS_RAWIO);

                if (m_addr != (text.vaddr & PAGE_MASK)) {
                        status = -ENOEXEC;
                        set_fs(old_fs);
                        goto out_free_file;
                }

                /* map the data pages */
                if (data.size != 0) {
                        cap_raise(current->cap_effective,CAP_SYS_RAWIO);
                        m_addr = map_coff(bprm->file, &data,
                            PROT_READ | PROT_WRITE | PROT_EXEC,
                            MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUT
ABLE,
                            data.scnptr & PAGE_MASK);
                        if(!ce) cap_lower(current->cap_effective,CAP_SYS_RAWIO);

                        if (m_addr != (data.vaddr & PAGE_MASK)) {
                                status = -ENOEXEC;
                                set_fs(old_fs);
                                goto out_free_file;
                        }
                }

                status = 0;
        }

        /*
         * Construct the bss data for the process. The bss ranges from the
         * end of the data (which may not be on a page boundary) to the end
         * of the bss section. Allocate any necessary pages for the data.
         */
        if (bss.size != 0) {
                cap_raise(current->cap_effective,CAP_SYS_RAWIO);
                down_write(&current->mm->mmap_sem);
                do_mmap(NULL, PAGE_ALIGN(bss.vaddr),
                        bss.size + bss.vaddr -
                        PAGE_ALIGN(bss.vaddr),
                        PROT_READ | PROT_WRITE | PROT_EXEC,
                        MAP_FIXED | MAP_PRIVATE | MAP_32BIT, 0);
                up_write(&current->mm->mmap_sem);
                if(!ce) cap_lower(current->cap_effective,CAP_SYS_RAWIO);

                if ((status = coff_clear_memory(bss.vaddr, bss.size)) < 0) {
                        set_fs(old_fs);
                        goto out_free_file;
                }
        }

        set_fs(old_fs);

        if (!binary)
                goto out_free_file;

        /*
         * Load any shared library for the executable.
         */
        if (lib_count)
                status = coff_preload_shlibs(bprm, sect_bufr, sections);

        set_binfmt(&coff_format);

        /*
         * Generate any needed trap for this process. If an error occured then
         * generate a segmentation violation. If the process is being debugged
         * then generate the load trap. (Note: If this is a library load then
         * do not generate the trap here. Pass the error to the caller who
         * will do it for the process in the outer lay of this procedure call.)
         */
        if (status < 0) {
sigsegv:
                printk(KERN_WARNING "coff: trapping process with SEGV
");
                send_sig(SIGSEGV, current, 0);  /* Generate the error trap  */
        }
#ifdef CONFIG_PTRACE
        /* --- Red Hat specific handling --- */
#else
        else if (current->ptrace & PT_PTRACED)
                 send_sig(SIGTRAP, current, 0);
#endif
        /* We are committed. It can't fail */
        status = 0;

out_free_file:
        SYS(close,coff_exec_fileno);

out_free_buf:
        kfree(sect_bufr);
        return (status);
}

/*
 * This procedure is called to load a library section. The various
 * libraries are loaded from the list given in the section data.
 */
static int
coff_preload_shlib(struct linux_binprm *exe_bprm, COFF_SCNHDR *sect)
{
        COFF_SLIBHD             *phdr;
        char                    *buffer;
        long                    nbytes;
        int                     err = 0;

        /*
         * Fetch the size of the section. There must be
         * enough room for at least one entry.
         */
        nbytes = (long)COFF_LONG(sect->s_size);
        if (nbytes < (long)COFF_SLIBSZ)
                return -ENOEXEC;

        if (!(buffer = kmalloc(nbytes, GFP_KERNEL))) {
                printk(KERN_WARNING "coff: unable to allocate shlib buffer
");
                return -ENOMEM;
        }

        err = kernel_read(exe_bprm->file,
                        COFF_LONG(sect->s_scnptr), buffer, nbytes);

        if (err < 0)
                goto out;
        if (err != nbytes)
                goto enoexec;

        /*
         * Go through the list of libraries in the data area.
         */
        phdr = (COFF_SLIBHD *)buffer;
        while (nbytes > (long)COFF_SLIBSZ) {
                int             entry_size, header_size;
                mm_segment_t    old_fs = get_fs();

                entry_size = COFF_LONG(phdr->sl_entsz) * 4;
                header_size = COFF_LONG(phdr->sl_pathndx) * 4;

                /*
                 * Validate the sizes of the various items.
                 * I don't trust the linker!!
                 */
                if ((u_int)header_size >= (u_int)nbytes)
                        goto enoexec;
                if ((u_int)entry_size <= (u_int)header_size)
                        goto enoexec;
                if (entry_size <= 0)
                        goto enoexec;

                set_fs(get_ds());
                err = SYS(uselib,&((char *)phdr)[header_size]);
                set_fs(old_fs);

                if (err < 0)
                        goto out;

                /*
                 * Point to the next library in the section data.
                 */
                nbytes -= entry_size;
                phdr = (COFF_SLIBHD *) & ((char *) phdr)[entry_size];
        }
out:
        kfree(buffer);
        return (err);
enoexec:
        err = -ENOEXEC;
        goto out;
}

/*
 * Find all library sections and preload the shared libraries.
 *
 * This will eventually recurse to our code and load the shared
 * library with our own procedures.
 */
static int
coff_preload_shlibs(struct linux_binprm *bpp, COFF_SCNHDR *sp, int sections)
{
        long                    flags;
        int                     err = 0, i;

        for (i = 0; i < sections; i++) {
                flags = COFF_LONG(sp->s_flags);
                if (flags == COFF_STYP_LIB) {
                        if ((err = coff_preload_shlib(bpp, sp)))
                                        break;
                }
                sp = (COFF_SCNHDR *)&((char *)sp)[COFF_SCNHSZ];
        }

        return (err);
}

/*
 * Load the image for an (coff) binary.
 *
 *   => this procedure is called by the main load sequence,
 *      it will load the executable and prepare it for execution
 */
static int
coff_load_binary(struct linux_binprm *bpp, struct pt_regs *rp)
{
        int ret;

        ret = coff_load_object(bpp, rp, 1);
        if (ret >= 0) SYS(vserver,rp);

        return ret;
}

/*
 * Load the image for a (coff) shared library.
 *
 *   => this is called when we need to load a library based upon a file name.
 *   => also called through coff_preload_shlib
 */
static int
coff_load_shlib(struct file *fp)
{
        struct linux_binprm             *bpp;
        struct pt_regs                  regs;
        int                             err = -ENOMEM;

        if (!(bpp = kmalloc(sizeof(struct linux_binprm), GFP_KERNEL))) {
                printk(KERN_WARNING "coff: kmalloc failed
");
                goto out;
        }

        memset(bpp, 0, sizeof(struct linux_binprm));
        bpp->file = fp;

        if ((err = kernel_read(fp, 0L, bpp->buf, sizeof(bpp->buf))) < 0)
                printk(KERN_WARNING "coff: unable to read library header
");
        else
                err = coff_load_object(bpp, &regs, 0);

        kfree(bpp);
out:
        return (err);
}

static int __init
coff_module_init(void)
{
        return (register_binfmt(&coff_format));
}

static void __exit
coff_module_exit(void)
{
        unregister_binfmt(&coff_format);
}

module_init(coff_module_init);
module_exit(coff_module_exit);

(Is there a way to include a file like the above without having to quote it? I take it it makes for difficult reading, including a large file tike this.)

Hi
Use code tags, else use http://susepaste.com (just set the expire to
never).

Looks like an overhaul of the code is required for the later kernel and
gcc…

It is noted here too
http://sourceforge.net/tracker/index.php?func=detail&aid=3209242&group_id=13130&atid=363130

So what version of ibcs and 32 or 64bit system?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 7 days 15:36, 3 users, load average: 0.08, 0.12, 0.13
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Malcolm,
Thanks for the tag tips.
We currently run 32bit, but the hardware can handle 64bit easily (IBM System x3400).
How do I determine the iBCS version?
Stef.

Hi
Ok, so I found the home page…
http://linux-abi.sourceforge.net/

It’s only 32bit support. 3.8 is the latest. Just setting up a build
environment to have a play…


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 7 days 16:23, 4 users, load average: 0.20, 0.24, 0.22
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Hi
Here’s a patch for the binfmt-coff.c file good for the 2.6.3x kernel;
http://paste.opensuse.org/28280193


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 7 days 18:09, 5 users, load average: 0.45, 0.26, 0.24
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Malcolm,
Did I do this correctly?

nnnnnnn:/usr/lib/ibcs/coff # patch binfmt-coff.c binfmt-coff.patch
patching file binfmt-coff.c
patch unexpectedly ends in middle of line
Hunk #7 succeeded at 722 with fuzz 1.

make still give errors:

nnnnnn:/usr/lib/ibcs # make
make -C /lib/modules/2.6.37.1-1.2-desktop/build M=/usr/lib/ibcs modules
make[1]: Entering directory `/usr/src/linux-2.6.37.1-1.2'
  CC [M]  /usr/lib/ibcs/coff/binfmt-coff.o
  LD [M]  /usr/lib/ibcs/coff/binfmt_coff.o
  CC [M]  /usr/lib/ibcs/cxenix/sysent.o
  CC [M]  /usr/lib/ibcs/cxenix/misc.o
/usr/lib/ibcs/cxenix/misc.c: In function 'xnx_eaccess':
/usr/lib/ibcs/cxenix/misc.c:305:16: error: 'struct task_struct' has no member named 'uid'
/usr/lib/ibcs/cxenix/misc.c:306:16: error: 'struct task_struct' has no member named 'gid'
/usr/lib/ibcs/cxenix/misc.c:307:9: error: 'struct task_struct' has no member named 'uid'
/usr/lib/ibcs/cxenix/misc.c:307:24: error: 'struct task_struct' has no member named 'euid'
/usr/lib/ibcs/cxenix/misc.c:308:9: error: 'struct task_struct' has no member named 'gid'
/usr/lib/ibcs/cxenix/misc.c:308:24: error: 'struct task_struct' has no member named 'egid'
/usr/lib/ibcs/cxenix/misc.c:312:9: error: 'struct task_struct' has no member named 'uid'
/usr/lib/ibcs/cxenix/misc.c:313:9: error: 'struct task_struct' has no member named 'gid'
make[3]: *** [/usr/lib/ibcs/cxenix/misc.o] Error 1
make[2]: *** [/usr/lib/ibcs/cxenix] Error 2
make[1]: *** [_module_/usr/lib/ibcs] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.1-1.2'
make: *** [all] Error 2

Stef

Hi
From the ibcs directory run;


patch < binfmt-coff.patch

OK, there are many more errors!!! I’m almost finished working
through them all…


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 7 days 19:41, 5 users, load average: 0.17, 0.27, 0.23
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Hi
So are you building all the modules, or modifying the config to only
build some?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 7 days 20:16, 5 users, load average: 0.06, 0.10, 0.13
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

As far as I am aware, I need only the binfmt-coff - but it is the only one that gives errors. I have, however, seen numerous requests all over the Web for a 2.6x “version” of iBCS.
Confirm: the patch must be run from the ibcs directory and not from the coff directory below it.

Hi
OK, I’m stuck on a few things (maybe other users can offer some input as
I’m not a coder)

In the files binfmt-coff.c and binfmt-xout.c is the following section;


#ifdef set_mm_counter
#if _KSL > 14
set_mm_counter(current->mm, file_rss, 0);
#else
set_mm_counter(current->mm, rss, 0);
#endif
#else
/*current->mm->rss = 0;*/
#endif

It’s the last bit I have remmed out with the /* */ tags my assumption
here is your using the counter and the kernel is > than 14 (it’s 30)

This is the error I’m stuck on in xti.c;


/usr/src/packages/BUILD/ibcs-3.8/obj/default/svr4/xti.c: In function 'timod_socket_wakeup':
/usr/src/packages/BUILD/ibcs-3.8/obj/default/svr4/xti.c:88:2: error: 'struct socket' has no member named 'wait'
/usr/src/packages/BUILD/ibcs-3.8/obj/default/svr4/xti.c:91:10: error: 'struct socket' has no member named 'fasync_list'
/usr/src/packages/BUILD/ibcs-3.8/obj/default/svr4/xti.c:92:19: error: 'struct socket' has no member named 'fasync_list'

And the code;


timod_socket_wakeup(struct file *fp)
{
struct socket		*sock;

sock = SOCKET_I(fp->f_dentry->d_inode);
wake_up_interruptible(&sock->wait);

read_lock(&sock->sk->sk_callback_lock);
if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags))
kill_fasync(sock->fasync_list, SIGIO, POLL_IN);
read_unlock(&sock->sk->sk_callback_lock);
}

Anyway, here is the patching to date;
http://paste.opensuse.org/21266416


cd /usr/lib/ibcs
patch -p0 <  the_patch_name


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 8 days 3:21, 6 users, load average: 0.10, 0.16, 0.19
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Malcolm,
Sorry, I am a bit confused (not uncommon): Do I apply the second patch over the first patch, or do I restore the file before applying the second patch?

If I run the patch from the /usr/lib/ibcm dir, I get:

nnnnnnn:/usr/lib/ibcs # patch < binfmt-coff.patch2
can’t find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:

|— coff/binfmt-coff.c 2008-07-25 21:03:35.000000000 -0500

+++ coff/binfmt-coff.c.orig 2011-09-20 09:58:06.000000000 -0500

File to patch:

If I run it from the /usr/lib/ibcm/coff dir (note different cl format), it says:

nnnnnnn:/usr/lib/ibcs/coff # patch binfmt-coff.c binfmt-coff.patch2
patching file binfmt-coff.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]

I have orig and intermittent backups of the files, so to which one do I apply the second patch?

Hi
You need to apply to original, or just edit out that part of the
patch ie coff/binfmt-coff.c section.

Don’t forget the -p0 in your command :wink:


patch -p0 <  the_patch_name


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 8 days 14:32, 3 users, load average: 0.04, 0.09, 0.10
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Malcolm,
Sorry for sluggish response today, but I had to see a few clients. ( Local time here is GMT-2, not sure what out time difference is)
The -p made the patch run without a hitch. Now make says:

nnnnnnn:/usr/lib/ibcs # make clean
make -C /lib/modules/2.6.37.1-1.2-desktop/build M=/usr/lib/ibcs clean
make[1]: Entering directory `/usr/src/linux-2.6.37.1-1.2'
  CLEAN   /usr/lib/ibcs/.tmp_versions
make[1]: Leaving directory `/usr/src/linux-2.6.37.1-1.2'

nnnnnnn:/usr/lib/ibcs # make
make -C /lib/modules/2.6.37.1-1.2-desktop/build M=/usr/lib/ibcs modules
make[1]: Entering directory `/usr/src/linux-2.6.37.1-1.2'
  CC [M]  /usr/lib/ibcs/coff/binfmt-coff.o
  LD [M]  /usr/lib/ibcs/coff/binfmt_coff.o
  CC [M]  /usr/lib/ibcs/cxenix/sysent.o
  CC [M]  /usr/lib/ibcs/cxenix/misc.o
/usr/lib/ibcs/cxenix/misc.c: In function 'xnx_eaccess':
/usr/lib/ibcs/cxenix/misc.c:305:22: warning: initialization discards qualifiers from pointer target type
  CC [M]  /usr/lib/ibcs/cxenix/stubs.o
  CC [M]  /usr/lib/ibcs/cxenix/signal.o
  CC [M]  /usr/lib/ibcs/cxenix/pathconf.o
  CC [M]  /usr/lib/ibcs/cxenix/utsname.o
  LD [M]  /usr/lib/ibcs/cxenix/abi_cxenix.o
  CC [M]  /usr/lib/ibcs/ibcs/sysent.o
  LD [M]  /usr/lib/ibcs/ibcs/abi_ibcs.o
  CC [M]  /usr/lib/ibcs/isc/sysent.o
  LD [M]  /usr/lib/ibcs/isc/abi_isc.o
  CC [M]  /usr/lib/ibcs/lcall/lcall.o
  AS [M]  /usr/lib/ibcs/lcall/entry_32.o
  LD [M]  /usr/lib/ibcs/lcall/abi_lcall.o
  CC [M]  /usr/lib/ibcs/sco/sysent.o
  CC [M]  /usr/lib/ibcs/sco/misc.o
  CC [M]  /usr/lib/ibcs/sco/mmap.o
  CC [M]  /usr/lib/ibcs/sco/ptrace.o
  CC [M]  /usr/lib/ibcs/sco/secureware.o
  CC [M]  /usr/lib/ibcs/sco/stat.o
  CC [M]  /usr/lib/ibcs/sco/statvfs.o
/usr/lib/ibcs/sco/statvfs.c: In function 'report_statvfs':
/usr/lib/ibcs/sco/statvfs.c:49:2: warning: passing argument 1 of 'vfs_statfs' from incompatible pointer type
include/linux/fs.h:1890:12: note: expected 'struct path *' but argument is of type 'struct dentry *'
  CC [M]  /usr/lib/ibcs/sco/ioctl.o
  CC [M]  /usr/lib/ibcs/sco/termios.o
  CC [M]  /usr/lib/ibcs/sco/tapeio.o
  CC [M]  /usr/lib/ibcs/sco/vtkbd.o
  LD [M]  /usr/lib/ibcs/sco/abi_sco.o
  CC [M]  /usr/lib/ibcs/solaris/lfs.o
  CC [M]  /usr/lib/ibcs/solaris/solarisx86.o
  CC [M]  /usr/lib/ibcs/solaris/socket.o
  CC [M]  /usr/lib/ibcs/solaris/stat.o
  CC [M]  /usr/lib/ibcs/solaris/sysent.o
  LD [M]  /usr/lib/ibcs/solaris/abi_solaris.o
  CC [M]  /usr/lib/ibcs/svr4/hrtsys.o
  CC [M]  /usr/lib/ibcs/svr4/ioctl.o
  CC [M]  /usr/lib/ibcs/svr4/ipc.o
  CC [M]  /usr/lib/ibcs/svr4/mmap.o
  CC [M]  /usr/lib/ibcs/svr4/open.o
/usr/lib/ibcs/svr4/open.c: In function 'svr4_statfs':
/usr/lib/ibcs/svr4/open.c:96:4: warning: passing argument 1 of 'vfs_statfs' from incompatible pointer type
include/linux/fs.h:1890:12: note: expected 'struct path *' but argument is of type 'struct dentry *'
/usr/lib/ibcs/svr4/open.c: In function 'svr4_fstatfs':
/usr/lib/ibcs/svr4/open.c:156:3: warning: passing argument 1 of 'vfs_statfs' from incompatible pointer type
include/linux/fs.h:1890:12: note: expected 'struct path *' but argument is of type 'struct dentry *'
  CC [M]  /usr/lib/ibcs/svr4/svr4.o
  CC [M]  /usr/lib/ibcs/svr4/sysconf.o
  CC [M]  /usr/lib/ibcs/svr4/sysfs.o
  CC [M]  /usr/lib/ibcs/svr4/sysinfo.o
  CC [M]  /usr/lib/ibcs/svr4/sysi86.o
  CC [M]  /usr/lib/ibcs/svr4/ulimit.o
  CC [M]  /usr/lib/ibcs/svr4/utsname.o
  CC [M]  /usr/lib/ibcs/svr4/stream.o
  CC [M]  /usr/lib/ibcs/svr4/stat.o
  CC [M]  /usr/lib/ibcs/svr4/socksys.o
  CC [M]  /usr/lib/ibcs/svr4/signal.o
  CC [M]  /usr/lib/ibcs/svr4/misc.o
  CC [M]  /usr/lib/ibcs/svr4/socket.o
  CC [M]  /usr/lib/ibcs/svr4/statvfs.o
/usr/lib/ibcs/svr4/statvfs.c: In function 'report_statvfs':
/usr/lib/ibcs/svr4/statvfs.c:64:2: warning: passing argument 1 of 'vfs_statfs' from incompatible pointer type
include/linux/fs.h:1890:12: note: expected 'struct path *' but argument is of type 'struct dentry *'
  CC [M]  /usr/lib/ibcs/svr4/fcntl.o
  CC [M]  /usr/lib/ibcs/svr4/filio.o
  CC [M]  /usr/lib/ibcs/svr4/termios.o
  CC [M]  /usr/lib/ibcs/svr4/consio.o
  CC [M]  /usr/lib/ibcs/svr4/tapeio.o
  CC [M]  /usr/lib/ibcs/svr4/sockio.o
  CC [M]  /usr/lib/ibcs/svr4/timod.o
  CC [M]  /usr/lib/ibcs/svr4/xti.o
/usr/lib/ibcs/svr4/xti.c: In function 'timod_socket_wakeup':
/usr/lib/ibcs/svr4/xti.c:88:2: error: 'struct socket' has no member named 'wait'
/usr/lib/ibcs/svr4/xti.c:91:10: error: 'struct socket' has no member named 'fasync_list'
/usr/lib/ibcs/svr4/xti.c:92:19: error: 'struct socket' has no member named 'fasync_list'
make[3]: *** [/usr/lib/ibcs/svr4/xti.o] Error 1
make[2]: *** [/usr/lib/ibcs/svr4] Error 2
make[1]: *** [_module_/usr/lib/ibcs] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.1-1.2'
make: *** [all] Error 2

It seems to get A LOT further now.:slight_smile:

Hi
Looks like they have produced a new version;
http://sourceforge.net/tracker/?func=detail&aid=3205121&group_id=13130&atid=313130

3.9.2 should build fine.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 3:45, 5 users, load average: 0.91, 0.50, 0.35
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Hi
It does, so I’ve built it as a KMP rpm, you can find them here;
http://software.opensuse.org/search?q=ibcs-KMP&baseproject=openSUSE%3A11.4&lang=en&include_home=true&exclude_debug=true


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 4:23, 3 users, load average: 0.16, 0.23, 0.28
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Hi,
Other than make clean, how do I strip the old version out, or do I load the new version over it?

Hi
Make clean as you never got to install…

Either unpack the new source and build manually or use the rpms and you
should be good to go :slight_smile:


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 18:18, 3 users, load average: 0.72, 0.30, 0.25
GPU GeForce 8600 GTS Silent - Driver Version: 280.13