aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bundle-libraries.sh
Commit message (Expand)AuthorAgeFilesLines
* scripts: bundle-libraries.sh: fix broken SDK compilerPetr Štetiar2020-11-021-1/+18
* scripts: bundle-libraries.sh: retain preloaded librariesJo-Philipp Wich2020-09-101-1/+1
* scripts: bundle-libraries: fix logic flawJo-Philipp Wich2018-08-291-7/+6
* scripts: bundle-libraries: prevent loading host locales (FS#1803)Jo-Philipp Wich2018-08-271-5/+21
* scripts: bundle-libraries: fix build on OS X (FS#1493)Jo-Philipp Wich2018-04-261-0/+4
* build: bundle-libraries.sh: patch bundled ld.soJo-Philipp Wich2018-02-021-0/+13
* build: bundle-libraries.sh: do not override argv[0] in inner exec callsJo-Philipp Wich2017-07-241-1/+3
* build: fix invocation of bundled ld.so in SDK and ImagebuilderJo-Philipp Wich2017-07-211-15/+18
* build: rework library bundlingJo-Philipp Wich2017-01-101-27/+75
* treewide: replace jow@openwrt.org with jo@mein.ioJo-Philipp Wich2016-06-071-1/+1
* scripts/bundle-libraries: fall back to only copying binaries if ldd is unavai...Felix Fietkau2014-06-021-21/+20
* scripts: bundle-libraries.sh: support mixing 32bit and 64bit binariesJo-Philipp Wich2013-01-281-6/+7
* fix library bundling when host libraries reside in /lib/tls/ or similarJo-Philipp Wich2012-09-091-5/+1
* add a helper script to bundle required libraries for host utilitiesJo-Philipp Wich2012-08-151-0/+114
tring.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 *  Copyright (C) 2005 IBM Corporation
 *
 *  Authors:
 *  Reiner Sailer, <sailer@watson.ibm.com>
 *  Stefan Berger, <stefanb@watson.ibm.com>
 *
 *  Contributors:
 *  Michael LeMay, <mdlemay@epoch.ncsc.mil>
 *  George Coker, <gscoker@alpha.ncsc.mil>
 *  
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2,
 *  as published by the Free Software Foundation.
 *
 *
 *  This file contains the XSM policy init functions for Xen.
 *  This file is based on the ACM functions of the same name.
 *
 */

#include <xsm/xsm.h>
#include <xen/multiboot.h>

char *__initdata policy_buffer = NULL;
u32 __initdata policy_size = 0;

int xsm_policy_init(unsigned int *initrdidx, const multiboot_info_t *mbi,
                    void *(*bootstrap_map)(const module_t *))
{
    int i;
    module_t *mod = (module_t *)__va(mbi->mods_addr);
    int rc = 0;
    u32 *_policy_start;
    unsigned long _policy_len;

    /*
     * Try all modules and see whichever could be the binary policy.
     * Adjust the initrdidx if module[1] is the binary policy.
     */
    for ( i = mbi->mods_count-1; i >= 1; i-- )
    {
        _policy_start = bootstrap_map(mod + i);
        _policy_len   = mod[i].mod_end;

        if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
        {
            policy_buffer = (char *)_policy_start;
            policy_size = _policy_len;

            printk("Policy len  0x%lx, start at %p.\n",
                   _policy_len,_policy_start);

            if ( i == 1 )
                *initrdidx = (mbi->mods_count > 2) ? 2 : 0;
            break;

        }

        bootstrap_map(NULL);
    }

    return rc;
}