Compare commits
4 Commits
456847efa7
...
31caabdeef
Author | SHA1 | Date |
---|---|---|
Andrius Štikonas | 31caabdeef | |
Andrius Štikonas | 135a38556e | |
Bastian Bittorf | 7e69dcc926 | |
Andrius Štikonas | 3ddf5d096a |
25
rootfs.py
25
rootfs.py
|
@ -8,11 +8,13 @@ you can run bootstap inside chroot.
|
||||||
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
||||||
|
# SPDX-FileCopyrightText: 2021 Bastian Bittorf <bb@npl.de>
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
|
||||||
from sysa import SysA
|
from sysa import SysA
|
||||||
from lib.utils import run
|
from lib.utils import run
|
||||||
|
@ -72,7 +74,7 @@ def make_initramfs(tmp_dir, initramfs_path):
|
||||||
|
|
||||||
with open(initramfs_path, "w") as initramfs:
|
with open(initramfs_path, "w") as initramfs:
|
||||||
cpio = subprocess.Popen(["cpio", "--format", "newc", "--create", "--directory", tmp_dir],
|
cpio = subprocess.Popen(["cpio", "--format", "newc", "--create", "--directory", tmp_dir],
|
||||||
stdin=subprocess.PIPE, stdout=initramfs)
|
stdin=subprocess.PIPE, stdout=initramfs)
|
||||||
cpio.communicate(input='\n'.join(file_list).encode())
|
cpio.communicate(input='\n'.join(file_list).encode())
|
||||||
|
|
||||||
def bootstrap(args, tmp_dir, initramfs_path):
|
def bootstrap(args, tmp_dir, initramfs_path):
|
||||||
|
@ -84,10 +86,23 @@ def bootstrap(args, tmp_dir, initramfs_path):
|
||||||
return
|
return
|
||||||
|
|
||||||
if args.minikernel:
|
if args.minikernel:
|
||||||
run('git', 'clone', '--depth', '1', '--branch', 'v0.4',
|
if os.path.isdir('kritis-linux'):
|
||||||
|
shutil.rmtree('kritis-linux')
|
||||||
|
|
||||||
|
run('git', 'clone',
|
||||||
|
'--depth', '1', '--branch', 'v0.7',
|
||||||
'https://github.com/bittorf/kritis-linux.git')
|
'https://github.com/bittorf/kritis-linux.git')
|
||||||
run('kritis-linux/ci_helper.sh', '--arch', 'x86_64', '--ramsize',
|
run('kritis-linux/ci_helper.sh',
|
||||||
'-m', str(args.qemu_ram) + 'M', '--kernel', '5.10.8', '--initrd', initramfs_path)
|
'--private',
|
||||||
|
'--multi', '1',
|
||||||
|
'--repeat', '1',
|
||||||
|
'--arch', args.arch,
|
||||||
|
'--qemucpu', '486',
|
||||||
|
'--kernel', '3.18.140',
|
||||||
|
'--features', 'kflock,highrestimers',
|
||||||
|
'--ramsize', str(args.qemu_ram) + 'M',
|
||||||
|
'--initrd', initramfs_path,
|
||||||
|
'--log', '/tmp/bootstrap.log')
|
||||||
return
|
return
|
||||||
|
|
||||||
run(args.qemu_cmd,
|
run(args.qemu_cmd,
|
||||||
|
@ -99,5 +114,5 @@ def bootstrap(args, tmp_dir, initramfs_path):
|
||||||
'-initrd', initramfs_path,
|
'-initrd', initramfs_path,
|
||||||
'-append', "console=ttyS0")
|
'-append', "console=ttyS0")
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -119,7 +119,7 @@ src_configure() {
|
||||||
--disable-64-bit-bfd \
|
--disable-64-bit-bfd \
|
||||||
--prefix="${PREFIX}" \
|
--prefix="${PREFIX}" \
|
||||||
--libdir="${PREFIX}/lib/musl" \
|
--libdir="${PREFIX}/lib/musl" \
|
||||||
--srcdir=.
|
--srcdir=.
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -127,12 +127,12 @@ src_configure() {
|
||||||
src_compile() {
|
src_compile() {
|
||||||
make -C bfd headers
|
make -C bfd headers
|
||||||
for dir in libiberty bfd opcodes binutils gas gprof ld; do
|
for dir in libiberty bfd opcodes binutils gas gprof ld; do
|
||||||
make -C $dir MAKEINFO=true
|
make -C $dir MAKEINFO=true
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
for dir in libiberty bfd opcodes binutils gas gprof ld; do
|
for dir in libiberty bfd opcodes binutils gas gprof ld; do
|
||||||
make -C $dir install MAKEINFO=true DESTDIR="${DESTDIR}"
|
make -C $dir install MAKEINFO=true DESTDIR="${DESTDIR}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue