Changeset bc73be3 in mainline for tools


Ignore:
Timestamp:
2019-06-27T08:51:20Z (6 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8add15e0
Parents:
ad40b74b (diff), aeba767 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

cpp: merge and resolve conflicts

Location:
tools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • tools/autocheck.awk

    rad40b74b rbc73be3  
    3333BEGIN {
    3434        filename = ARGV[1]
     35        output_lines = 0
    3536        print "// Generated file. Fix the included header if static assert fails."
    36         print "#include \"" filename "\""
     37        print "// Inlined \"" filename "\""
     38}
     39
     40{
     41        print $0
    3742}
    3843
     
    4449        }
    4550        macro_name = toupper(struct_name) "_SIZE"
    46         print "_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");"
     51        output[output_lines++] = "_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");"
    4752        struct_name = ""
    4853}
     
    5560
    5661                macro_name = toupper(struct_name) "_OFFSET_" toupper(member)
    57                 print "_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");"
     62                output[output_lines++] = "_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");"
    5863
    5964                macro_name = toupper(struct_name) "_SIZE_" toupper(member)
    60                 print "#ifdef " macro_name
    61                 print "_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");"
    62                 print "#endif"
     65                output[output_lines++] = "#ifdef " macro_name
     66                output[output_lines++] = "_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");"
     67                output[output_lines++] = "#endif"
    6368        }
    6469}
     
    6772        struct_name = $3
    6873}
     74
     75END {
     76        for ( i = 0; i < output_lines; i++ ) {
     77                print output[i]
     78        }
     79}
  • tools/autotool.py

    rad40b74b rbc73be3  
    1 #!/usr/bin/env python2
     1#!/usr/bin/env python
    22#
    33# Copyright (c) 2010 Martin Decky
     
    201201                target = "arm-helenos"
    202202
     203        if (config['PLATFORM'] == "arm64"):
     204                platform = config['PLATFORM']
     205                target = "aarch64-helenos"
     206
    203207        if (config['PLATFORM'] == "ia32"):
    204208                platform = config['PLATFORM']
     
    633637
    634638                # Platform-specific utilities
    635                 if ((config['BARCH'] == "amd64") or (config['BARCH'] == "ia32") or (config['BARCH'] == "ppc32") or (config['BARCH'] == "sparc64")):
     639                if (config['BARCH'] in ('amd64', 'arm64', 'ia32', 'ppc32', 'sparc64')):
    636640                        common['GENISOIMAGE'] = check_app_alternatives(["genisoimage", "mkisofs", "xorriso"], ["--version"], "ISO 9660 creation utility", "usually part of genisoimage")
    637641                        if common['GENISOIMAGE'] == 'xorriso':
  • tools/build-ccheck.sh

    rad40b74b rbc73be3  
    11#!/bin/bash
    22#
    3 # Copyright (c) 2018 Jiri Svoboda
     3# Copyright (c) 2019 Jiri Svoboda
    44# All rights reserved.
    55#
     
    2929
    3030SYCEK_GIT="https://github.com/jxsvoboda/sycek"
    31 SYCEK_REV="42fe0d77819f0ec05f17e40ea54c7b62073c8e97"
     31SYCEK_REV="4dc1760741efdd84506478ab6effd68812b4726a"
    3232
    3333if [ ! -d sycek ]; then
  • tools/config.py

    rad40b74b rbc73be3  
    4747PRESETS_DIR = 'defaults'
    4848
     49class BinaryOp:
     50        def __init__(self, operator, left, right):
     51                assert operator in ('&', '|', '=', '!=')
     52
     53                self._operator = operator
     54                self._left = left
     55                self._right = right
     56
     57        def evaluate(self, config):
     58                if self._operator == '&':
     59                        return self._left.evaluate(config) and \
     60                            self._right.evaluate(config)
     61                if self._operator == '|':
     62                        return self._left.evaluate(config) or \
     63                            self._right.evaluate(config)
     64
     65                # '=' or '!='
     66                if not self._left in config:
     67                        config_val = ''
     68                else:
     69                        config_val = config[self._left]
     70                        if config_val == '*':
     71                                config_val = 'y'
     72
     73                if self._operator == '=':
     74                        return self._right == config_val
     75                return self._right != config_val
     76
     77# Expression parser
     78class CondParser:
     79        TOKEN_EOE = 0
     80        TOKEN_SPECIAL = 1
     81        TOKEN_STRING = 2
     82
     83        def __init__(self, text):
     84                self._text = text
     85
     86        def parse(self):
     87                self._position = -1
     88                self._next_char()
     89                self._next_token()
     90
     91                res = self._parse_expr()
     92                if self._token_type != self.TOKEN_EOE:
     93                        self._error("Expected end of expression")
     94                return res
     95
     96        def _next_char(self):
     97                self._position += 1
     98                if self._position >= len(self._text):
     99                        self._char = None
     100                else:
     101                        self._char = self._text[self._position]
     102                self._is_special_char = self._char in \
     103                    ('&', '|', '=', '!', '(', ')')
     104
     105        def _error(self, msg):
     106                raise RuntimeError("Error parsing expression: %s:\n%s\n%s^" %
     107                    (msg, self._text, " " * self._token_position))
     108
     109        def _next_token(self):
     110                self._token_position = self._position
     111
     112                # End of expression
     113                if self._char == None:
     114                        self._token = None
     115                        self._token_type = self.TOKEN_EOE
     116                        return
     117
     118                # '&', '|', '=', '!=', '(', ')'
     119                if self._is_special_char:
     120                        self._token = self._char
     121                        self._next_char()
     122                        if self._token == '!':
     123                                if self._char != '=':
     124                                        self._error("Expected '='")
     125                                self._token += self._char
     126                                self._next_char()
     127                        self._token_type = self.TOKEN_SPECIAL
     128                        return
     129
     130                # <var> or <val>
     131                self._token = ''
     132                self._token_type = self.TOKEN_STRING
     133                while True:
     134                        self._token += self._char
     135                        self._next_char()
     136                        if self._is_special_char or self._char == None:
     137                                break
     138
     139        def _parse_expr(self):
     140                """ <expr> ::= <or_expr> ('&' <or_expr>)* """
     141
     142                left = self._parse_or_expr()
     143                while self._token == '&':
     144                        self._next_token()
     145                        left = BinaryOp('&', left, self._parse_or_expr())
     146                return left
     147
     148        def _parse_or_expr(self):
     149                """ <or_expr> ::= <factor> ('|' <factor>)* """
     150
     151                left = self._parse_factor()
     152                while self._token == '|':
     153                        self._next_token()
     154                        left = BinaryOp('|', left, self._parse_factor())
     155                return left
     156
     157        def _parse_factor(self):
     158                """ <factor> ::= <var> <cond> | '(' <expr> ')' """
     159
     160                if self._token == '(':
     161                        self._next_token()
     162                        res = self._parse_expr()
     163                        if self._token != ')':
     164                                self._error("Expected ')'")
     165                        self._next_token()
     166                        return res
     167
     168                if self._token_type == self.TOKEN_STRING:
     169                        var = self._token
     170                        self._next_token()
     171                        return self._parse_cond(var)
     172
     173                self._error("Expected '(' or <var>")
     174
     175        def _parse_cond(self, var):
     176                """ <cond> ::= '=' <val> | '!=' <val> """
     177
     178                if self._token not in ('=', '!='):
     179                        self._error("Expected '=' or '!='")
     180
     181                oper = self._token
     182                self._next_token()
     183
     184                if self._token_type != self.TOKEN_STRING:
     185                        self._error("Expected <val>")
     186
     187                val = self._token
     188                self._next_token()
     189
     190                return BinaryOp(oper, var, val)
     191
    49192def read_config(fname, config):
    50193        "Read saved values from last configuration run or a preset file"
     
    59202        inf.close()
    60203
    61 def check_condition(text, config, rules):
    62         "Check that the condition specified on input line is True (only CNF and DNF is supported)"
    63 
    64         ctype = 'cnf'
    65 
    66         if (')|' in text) or ('|(' in text):
    67                 ctype = 'dnf'
    68 
    69         if ctype == 'cnf':
    70                 conds = text.split('&')
    71         else:
    72                 conds = text.split('|')
    73 
    74         for cond in conds:
    75                 if cond.startswith('(') and cond.endswith(')'):
    76                         cond = cond[1:-1]
    77 
    78                 inside = check_inside(cond, config, ctype)
    79 
    80                 if (ctype == 'cnf') and (not inside):
    81                         return False
    82 
    83                 if (ctype == 'dnf') and inside:
    84                         return True
    85 
    86         if ctype == 'cnf':
    87                 return True
    88 
    89         return False
    90 
    91 def check_inside(text, config, ctype):
    92         "Check for condition"
    93 
    94         if ctype == 'cnf':
    95                 conds = text.split('|')
    96         else:
    97                 conds = text.split('&')
    98 
    99         for cond in conds:
    100                 res = re.match(r'^(.*?)(!?=)(.*)$', cond)
    101                 if not res:
    102                         raise RuntimeError("Invalid condition: %s" % cond)
    103 
    104                 condname = res.group(1)
    105                 oper = res.group(2)
    106                 condval = res.group(3)
    107 
    108                 if not condname in config:
    109                         varval = ''
    110                 else:
    111                         varval = config[condname]
    112                         if (varval == '*'):
    113                                 varval = 'y'
    114 
    115                 if ctype == 'cnf':
    116                         if (oper == '=') and (condval == varval):
    117                                 return True
    118 
    119                         if (oper == '!=') and (condval != varval):
    120                                 return True
    121                 else:
    122                         if (oper == '=') and (condval != varval):
    123                                 return False
    124 
    125                         if (oper == '!=') and (condval == varval):
    126                                 return False
    127 
    128         if ctype == 'cnf':
    129                 return False
    130 
    131         return True
    132 
    133204def parse_rules(fname, rules):
    134205        "Parse rules file"
     
    149220
    150221                        cond = res.group(1)
     222                        if cond:
     223                                cond = CondParser(cond).parse()
    151224                        varname = res.group(2)
    152225                        vartype = res.group(3)
     
    232305                varname, vartype, name, choices, cond = rule
    233306
    234                 if cond and (not check_condition(cond, config, rules)):
     307                if cond and not cond.evaluate(config):
    235308                        continue
    236309
     
    279352
    280353        # First check that this rule would make sense
    281         if cond:
    282                 if not check_condition(cond, config, rules):
    283                         return random_choices(config, rules, start_index + 1)
     354        if cond and not cond.evaluate(config):
     355                return random_choices(config, rules, start_index + 1)
    284356
    285357        # Remember previous choices for backtracking
     
    487559
    488560        for varname, vartype, name, choices, cond in rules:
    489                 if cond and (not check_condition(cond, config, rules)):
     561                if cond and not cond.evaluate(config):
    490562                        continue
    491563
     
    514586        outmk.write('TIMESTAMP_UNIX = %d\n' % timestamp_unix)
    515587        outmc.write('#define TIMESTAMP_UNIX %d\n' % timestamp_unix)
    516         defs += ' "-DTIMESTAMP_UNIX=%d"\n' % timestamp_unix
     588        defs += ' "-DTIMESTAMP_UNIX=%d"' % timestamp_unix
    517589
    518590        outmk.write('TIMESTAMP = %s\n' % timestamp)
    519591        outmc.write('#define TIMESTAMP %s\n' % timestamp)
    520         defs += ' "-DTIMESTAMP=%s"\n' % timestamp
    521 
    522         outmk.write(defs)
     592        defs += ' "-DTIMESTAMP=%s"' % timestamp
     593
     594        outmk.write('%s\n' % defs)
    523595
    524596        outmk.close()
     
    676748                                varname, vartype, name, choices, cond = rule
    677749
    678                                 if cond and (not check_condition(cond, config, rules)):
     750                                if cond and not cond.evaluate(config):
    679751                                        continue
    680752
  • tools/ew.py

    rad40b74b rbc73be3  
    5757
    5858def termemu_detect():
    59         for termemu in ['xfce4-terminal', 'xterm']:
     59        emus = ['gnome-terminal', 'xfce4-terminal', 'xterm']
     60        for termemu in emus:
    6061                try:
    6162                        subprocess.check_output('which ' + termemu, shell = True)
     
    6465                        pass
    6566
     67        print('Could not find any of the terminal emulators %s.'%(emus))
     68        sys.exit(1)
     69
    6670def run_in_console(cmd, title):
    67         ecmd = cmd.replace('"', '\\"')
    68         cmdline = termemu_detect() + ' -T ' + '"' + title + '"' + ' -e "' + ecmd + '"'
     71        temu = termemu_detect()
     72        if temu == 'gnome-terminal':
     73                cmdline = temu + ' -- ' + cmd
     74        else:
     75                ecmd = cmd.replace('"', '\\"')
     76                cmdline = temu + ' -T ' + '"' + title + '"' + ' -e "' + ecmd + '"'
     77
    6978        print(cmdline)
    7079        if not is_override('dryrun'):
     
    8796
    8897def malta_options():
    89         return '-cpu 4Kc'
     98        return '-cpu 4Kc -append "console=devices/\\hw\\pci0\\00:0a.0\\com1\\a"'
     99
     100def find_firmware(name, environ_var, default_paths, extra_info=None):
     101        """Find firmware image(s)."""
     102
     103        if environ_var in os.environ:
     104                return os.environ[environ_var]
     105
     106        for path in default_paths:
     107                if os.path.exists(path):
     108                        return path
     109
     110        sys.stderr.write("Cannot find %s binary image(s)!\n" % name)
     111        sys.stderr.write(
     112            "Either set %s environment variable accordingly or place the image(s) in one of the default locations: %s.\n" %
     113            (environ_var, ", ".join(default_paths)))
     114        if extra_info is not None:
     115                sys.stderr.write(extra_info)
     116        return None
    90117
    91118def platform_to_qemu_options(platform, machine, processor):
     
    94121        elif platform == 'arm32':
    95122                return 'system-arm', '-M integratorcp'
     123        elif platform == 'arm64':
     124                # Search for the EDK2 firmware image
     125                default_paths = (
     126                        '/usr/local/qemu-efi-aarch64/QEMU_EFI.fd', # Custom
     127                        '/usr/share/edk2/aarch64/QEMU_EFI.fd',     # Fedora
     128                        '/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', # Ubuntu
     129                )
     130                extra_info = ("Pre-compiled binary can be obtained from "
     131                    "http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC49/QEMU_EFI.fd.\n")
     132                efi_path = find_firmware(
     133                    "EDK2", 'EW_QEMU_EFI_AARCH64', default_paths, extra_info)
     134                if efi_path is None:
     135                        raise Exception
     136
     137                return 'system-aarch64', \
     138                    '-M virt -cpu cortex-a57 -m 1024 -bios %s' % efi_path
    96139        elif platform == 'ia32':
    97140                return 'system-i386', pc_options(32)
     
    108151                if processor == 'us':
    109152                        return 'system-sparc64', '-M sun4u --prom-env boot-args="console=devices/\\hw\\pci0\\01:01.0\\com1\\a"'
    110                 elif processor == 'sun4v':
    111                         default_path = '/usr/local/opensparc/image/'
    112                 try:
    113                         if os.path.exists(default_path):
    114                                 opensparc_bins = default_path
    115                         elif os.path.exists(os.environ['OPENSPARC_BINARIES']):
    116                                 opensparc_bins = os.environ['OPENSPARC_BINARIES']
    117                         else:
    118                                 raise Exception
    119                 except:
    120                         print("Cannot find OpenSPARC binary images!")
    121                         print("Either set OPENSPARC_BINARIES environment variable accordingly or place the images in %s." % (default_path))
     153
     154                # processor = 'sun4v'
     155                opensparc_bins = find_firmware(
     156                    "OpenSPARC", 'OPENSPARC_BINARIES',
     157                    ('/usr/local/opensparc/image/', ))
     158                if opensparc_bins is None:
    122159                        raise Exception
    123160
     
    135172        hdisk_mk()
    136173
    137         return ' -drive file=hdisk.img,index=0,media=disk,format=raw'
     174        hdd_options = ''
     175        if 'hdd' in overrides.keys():
     176                if 'ata' in overrides['hdd'].keys():
     177                        hdd_options += ''
     178                elif 'virtio-blk' in overrides['hdd'].keys():
     179                        hdd_options += ',if=virtio'
     180
     181        return ' -drive file=hdisk.img,index=0,media=disk,format=raw' + hdd_options
    138182
    139183def qemu_nic_ne2k_options():
     
    201245                cmdline += ' ' + options
    202246
    203         cmdline += qemu_bd_options()
    204 
     247        if (not 'hdd' in cfg.keys() or cfg['hdd']):
     248                cmdline += qemu_bd_options()
    205249        if (not 'net' in cfg.keys()) or cfg['net']:
    206250                cmdline += qemu_net_options()
     
    227271        if cfg['image'] == 'image.iso':
    228272                cmdline += ' -boot d -cdrom image.iso'
     273        elif cfg['image'] == 'image.iso@arm64':
     274                # Define image.iso cdrom backend.
     275                cmdline += ' -drive if=none,file=image.iso,id=cdrom,media=cdrom'
     276                # Define scsi bus.
     277                cmdline += ' -device virtio-scsi-device'
     278                # Define cdrom frontend connected to this scsi bus.
     279                cmdline += ' -device scsi-cd,drive=cdrom'
    229280        elif cfg['image'] == 'image.boot':
    230281                cmdline += ' -kernel image.boot'
     
    269320                        'xhci' : False,
    270321                        'tablet' : False
     322                }
     323        },
     324        'arm64' : {
     325                'virt' : {
     326                        'run' : qemu_run,
     327                        'image' : 'image.iso@arm64',
     328                        'audio' : False,
     329                        'console' : True,
     330                        'hdd' : False,
     331                        'net' : False,
     332                        'tablet' : False,
     333                        'usb' : False,
     334                        'xhci' : False
    271335                }
    272336        },
     
    336400def usage():
    337401        print("%s - emulator wrapper for running HelenOS\n" % os.path.basename(sys.argv[0]))
    338         print("%s [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" %
     402        print("%s [-d] [-h] [-net e1k|rtl8139|ne2k|virtio-net] [-hdd ata|virtio-blk] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb] [-noxhci] [-notablet]\n" %
    339403            os.path.basename(sys.argv[0]))
    340404        print("-d\tDry run: do not run the emulation, just print the command line.")
     
    357421def run():
    358422        expect_nic = False
     423        expect_hdd = False
    359424        expect_qemu = False
    360425
     
    378443                        continue
    379444
     445                if expect_hdd:
     446                        expect_hdd = False
     447                        if not 'hdd' in overrides.keys():
     448                                overrides['hdd'] = {}
     449                        if sys.argv[i] == 'ata':
     450                                overrides['hdd']['ata'] = True
     451                        elif sys.argv[i] == 'virtio-blk':
     452                                overrides['hdd']['virtio-blk'] = True
     453                        else:
     454                                usage()
     455                                exit()
     456                        continue
     457
    380458                if expect_qemu:
    381459                        expect_qemu = False
     
    389467                elif sys.argv[i] == '-net' and i < len(sys.argv) - 1:
    390468                        expect_nic = True
     469                elif sys.argv[i] == '-hdd' and i < len(sys.argv) - 1:
     470                        expect_hdd = True
    391471                elif sys.argv[i] == '-nohdd':
    392472                        overrides['nohdd'] = True
  • tools/grub/grub-update.sh

    rad40b74b rbc73be3  
    4040grub_rev="bc220962e366b1b46769ed6f9fa5be603ba58ab5"
    4141
     42build_ia32amd64_pc=false
     43build_ia32amd64_efi=false
     44build_arm64_efi=false
     45
    4246function grub_build()
    4347{
    44         target="$1"
    45         platform="$2"
     48        platform="$1"
     49        conf_target="$2"
     50        conf_platform="$3"
    4651
    47         ./configure --prefix="$builddir/$target-$platform" --target="$target" --with-platform="$platform" --disable-werror || exit 1
     52        ./configure --prefix="$builddir/$platform" --target="$conf_target" --with-platform="$conf_platform" --disable-werror || exit 1
    4853        make clean || exit 1
    4954        make install || exit 1
     
    5560        platform="$2"
    5661
    57         rm -rf "$helenosdir"/boot/"$gdir"/"$platform" || exit 1
    58         cp -R "$builddir"/"$platform"/lib64/grub/"$platform" "$helenosdir"/boot/"$gdir" || exit 1
    59         rm -f "$helenosdir"/boot/"$gdir"/"$platform"/*.image || exit 1
    60         rm -f "$helenosdir"/boot/"$gdir"/"$platform"/*.module || exit 1
    61         git add "$helenosdir"/boot/"$gdir"/"$platform" || exit 1
     62        echo "$grub_rev" > "$helenosdir"/boot/grub/"$gdir"/REVISION || exit 1
     63        rm -rf "$helenosdir"/boot/grub/"$gdir"/"$platform" || exit 1
     64        cp -R "$builddir"/"$platform"/lib*/grub/"$platform" "$helenosdir"/boot/grub/"$gdir" || exit 1
     65        rm -f "$helenosdir"/boot/grub/"$gdir"/"$platform"/*.image || exit 1
     66        rm -f "$helenosdir"/boot/grub/"$gdir"/"$platform"/*.module || exit 1
     67        git add "$helenosdir"/boot/grub/"$gdir"/"$platform" || exit 1
    6268}
     69
     70function show_usage()
     71{
     72        echo "Script to generate/update prebuild Grub2 in HelenOS source tree"
     73        echo
     74        echo "Syntax:"
     75        echo " $0 <target>"
     76        echo
     77        echo "Possible targets are:"
     78        echo " ia32+amd64-pc"
     79        echo " ia32+amd64-efi"
     80        echo " arm64-efi"
     81        echo " all             build all targets"
     82        echo
     83
     84        exit 3
     85}
     86
     87if [ "$#" -ne "1" ] ; then
     88        show_usage
     89fi
     90
     91case "$1" in
     92        ia32+amd64-pc)
     93                build_ia32amd64_pc=true
     94                ;;
     95        ia32+amd64-efi)
     96                build_ia32amd64_efi=true
     97                ;;
     98        arm64-efi)
     99                build_arm64_efi=true
     100                ;;
     101        all)
     102                build_ia32amd64_pc=true
     103                build_ia32amd64_efi=true
     104                build_arm64_efi=true
     105                ;;
     106        *)
     107                show_usage
     108                ;;
     109esac
    63110
    64111# Prepare a clone of Grub2 repo
     
    72119git reset --hard "$grub_rev" || exit 1
    73120
    74 echo "$grub_rev" >"$helenosdir"/boot/grub.pc/REVISION || exit 1
    75 echo "$grub_rev" > "$helenosdir"/boot/grub.efi/REVISION || exit 1
     121./autogen.sh || exit 1
    76122
    77 # Build each platform to a different directory
    78 ./autogen.sh || exit 1
    79 grub_build i386 pc
    80 grub_build i386 efi
    81 grub_build x86_64 efi
     123if $build_ia32amd64_pc ; then
     124        cd "$workdir" || exit 1
     125        grub_build i386-pc i386 pc
    82126
    83 # Extract El Torrito boot image for i386-pc
    84 cd "$helenosdir"/boot/grub.pc || exit 1
    85 rm -f pc.img || exit 1
    86 "$builddir"/i386-pc/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1
     127        # Extract El Torrito boot image for i386-pc
     128        cd "$helenosdir"/boot/grub/ia32-pc || exit 1
     129        rm -f pc.img || exit 1
     130        "$builddir"/i386-pc/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1
    87131
    88 # Extract El Torrito boot image for i386-efi
    89 cd "$helenosdir"/boot/grub.efi || exit 1
    90 rm -f efi.img.gz || exit 1
    91 "$builddir"/i386-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1
    92 mv efi.img i386-efi.img
     132        grub_files_update ia32-pc i386-pc
     133fi
    93134
    94 # Extract El Torrito boot image for x86_64-efi
    95 cd "$helenosdir"/boot/grub.efi || exit 1
    96 rm -f efi.img.gz || exit 1
    97 "$builddir"/x86_64-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1
     135if $build_ia32amd64_efi ; then
     136        cd "$workdir" || exit 1
    98137
    99 # Combine El Torrito boot images for x86_64-efi and i386-efi
    100 mkdir tmp || exit 1
    101 mcopy -ns -i i386-efi.img ::efi tmp || exit 1
    102 mcopy -s -i efi.img tmp/* :: || exit 1
    103 gzip efi.img || exit 1
    104 rm -rf tmp || exit 1
    105 rm -f i386-efi.img || exit 1
     138        # Build each platform to a different directory
     139        grub_build i386-efi i386 efi
     140        grub_build x86_64-efi x86_64 efi
    106141
    107 # Update Grub files for all platforms
    108 grub_files_update grub.pc i386-pc
    109 grub_files_update grub.efi i386-efi
    110 grub_files_update grub.efi x86_64-efi
     142        # Extract El Torrito boot image for i386-efi
     143        cd "$helenosdir"/boot/grub/ia32-efi || exit 1
     144        rm -f efi.img.gz || exit 1
     145        "$builddir"/i386-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1
     146        mv efi.img i386-efi.img
     147
     148        # Extract El Torrito boot image for x86_64-efi
     149        cd "$helenosdir"/boot/grub/ia32-efi || exit 1
     150        rm -f efi.img.gz || exit 1
     151        "$builddir"/x86_64-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1
     152
     153        # Combine El Torrito boot images for x86_64-efi and i386-efi
     154        mkdir tmp || exit 1
     155        mcopy -ns -i i386-efi.img ::efi tmp || exit 1
     156        mcopy -s -i efi.img tmp/* :: || exit 1
     157        gzip efi.img || exit 1
     158        rm -rf tmp || exit 1
     159        rm -f i386-efi.img || exit 1
     160
     161        # Update Grub files for all platforms
     162        grub_files_update ia32-efi i386-efi
     163        grub_files_update ia32-efi x86_64-efi
     164fi
     165
     166if $build_arm64_efi ; then
     167        cd "$workdir" || exit 1
     168
     169        # Check that the expected compiler is present on PATH
     170        if ! [ -x "$(command -v aarch64-linux-gnu-gcc)" ] ; then
     171                echo "Error: aarch64-linux-gnu-gcc is missing" >&2
     172                exit 1
     173        fi
     174
     175        grub_build arm64-efi aarch64-linux-gnu efi
     176
     177        # Extract El Torrito boot image for arm64-efi
     178        cd "$helenosdir"/boot/grub/arm64-efi || exit 1
     179        rm -f efi.img.gz || exit 1
     180        "$builddir"/arm64-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1
     181        gzip efi.img || exit 1
     182
     183        grub_files_update arm64-efi arm64-efi
     184fi
    111185
    112186echo "GRUB update successful."
  • tools/grub/mkimage.sh

    rad40b74b rbc73be3  
    3939orig_dir="$(cd "$(dirname "$0")" && pwd)"
    4040grub_tools_dir="$orig_dir/grub-build/i386-pc/bin"
    41 grub_mod_dir="$orig_dir/../../boot/grub.pc/i386-pc"
     41grub_mod_dir="$orig_dir/../../boot/grub/ia32-pc/i386-pc"
    4242
    4343"$grub_tools_dir"/grub-mkimage --directory "$grub_mod_dir" \
  • tools/toolchain.sh

    rad40b74b rbc73be3  
    6666        echo " amd64      AMD64 (x86-64, x64)"
    6767        echo " arm32      ARM 32b"
     68        echo " arm64      AArch64"
    6869        echo " ia32       IA-32 (x86, i386)"
    6970        echo " ia64       IA-64 (Itanium)"
     
    103104       
    104105        if [ -z "$1" ] || [ "$1" == "all" ] ; then
    105                 PLATFORMS=("amd64" "arm32" "ia32" "ia64" "mips32" "mips32eb" "ppc32" "riscv64" "sparc64")
     106                PLATFORMS=("amd64" "arm32" "arm64" "ia32" "ia64" "mips32" "mips32eb" "ppc32" "riscv64" "sparc64")
    106107        else
    107108                PLATFORMS=("$1")
     
    275276                "arm32")
    276277                        GNU_ARCH="arm"
     278                        ;;
     279                "arm64")
     280                        GNU_ARCH="aarch64"
    277281                        ;;
    278282                "ia32")
     
    497501                test_version
    498502                ;;
    499         amd64|arm32|ia32|ia64|mips32|mips32eb|ppc32|riscv64|sparc64)
     503        amd64|arm32|arm64|ia32|ia64|mips32|mips32eb|ppc32|riscv64|sparc64)
    500504                prepare
    501505                build_target "$1"
     
    505509                build_target "amd64"
    506510                build_target "arm32"
     511                build_target "arm64"
    507512                build_target "ia32"
    508513                build_target "ia64"
     
    517522                build_target "amd64"
    518523                build_target "arm32"
     524                build_target "arm64"
    519525                build_target "ia32"
    520526                build_target "ia64"
     
    528534                build_target "amd64" &
    529535                build_target "arm32" &
     536                build_target "arm64" &
    530537                build_target "ia32" &
    531538                build_target "ia64" &
     
    543550                wait
    544551
     552                build_target "arm64" &
    545553                build_target "ia32" &
     554                wait
     555
    546556                build_target "ia64" &
     557                build_target "mips32" &
    547558                wait
    548559
    549                 build_target "mips32" &
    550560                build_target "mips32eb" &
     561                build_target "ppc32" &
    551562                wait
    552563
    553                 build_target "ppc32" &
    554564                build_target "riscv64" &
    555                 wait
    556 
    557565                build_target "sparc64" &
    558566                wait
  • tools/travis.sh

    rad40b74b rbc73be3  
    5252arm32/integratorcp:arm-helenos:image.boot
    5353arm32/raspberrypi:arm-helenos:uImage.bin
     54arm64/virt:aarch64-helenos:image.iso
    5455ia32:i686-helenos:image.iso
    5556ia64/i460GX:ia64-helenos:image.boot
Note: See TracChangeset for help on using the changeset viewer.