Add architecture argument for the buildroot chroot (#832)
* Add architecture argument for the buildroot chroot, defaults to device architecture * Output pmbootstrap log file after failure to debug Travis failure * Travis: disable timestamp based rebuilds
This commit is contained in:
parent
a3c1e22dd9
commit
9c1ef821b3
|
@ -11,10 +11,13 @@ install: "pip install flake8 pytest-cov python-coveralls"
|
||||||
script:
|
script:
|
||||||
- test/static_code_analysis.sh
|
- test/static_code_analysis.sh
|
||||||
- yes "" | ./pmbootstrap.py init
|
- yes "" | ./pmbootstrap.py init
|
||||||
|
- ./pmbootstrap.py config timestamp_based_rebuild False
|
||||||
- ./pmbootstrap.py kconfig_check
|
- ./pmbootstrap.py kconfig_check
|
||||||
- test/testcases_fast.sh
|
- test/testcases_fast.sh
|
||||||
- test/check_checksums.py
|
- test/check_checksums.py
|
||||||
after_success:
|
after_success:
|
||||||
- coveralls
|
- coveralls
|
||||||
|
after_failure:
|
||||||
|
- cat ~/.local/var/pmbootstrap/log.txt
|
||||||
notifications:
|
notifications:
|
||||||
- email: false
|
- email: false
|
||||||
|
|
|
@ -68,7 +68,10 @@ def _parse_suffix(args):
|
||||||
if "rootfs" in args and args.rootfs:
|
if "rootfs" in args and args.rootfs:
|
||||||
return "rootfs_" + args.device
|
return "rootfs_" + args.device
|
||||||
elif args.buildroot:
|
elif args.buildroot:
|
||||||
|
if args.buildroot == "device":
|
||||||
return "buildroot_" + args.deviceinfo["arch"]
|
return "buildroot_" + args.deviceinfo["arch"]
|
||||||
|
else:
|
||||||
|
return "buildroot_" + args.buildroot
|
||||||
elif args.suffix:
|
elif args.suffix:
|
||||||
return args.suffix
|
return args.suffix
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -192,8 +192,9 @@ def arguments():
|
||||||
if action == chroot:
|
if action == chroot:
|
||||||
suffix.add_argument("-r", "--rootfs", action="store_true",
|
suffix.add_argument("-r", "--rootfs", action="store_true",
|
||||||
help="Chroot for the device root file system")
|
help="Chroot for the device root file system")
|
||||||
suffix.add_argument("-b", "--buildroot", action="store_true",
|
suffix.add_argument("-b", "--buildroot", nargs="?", const="device",
|
||||||
help="Chroot for building packages for the device "
|
choices={"device"} | arch_choices,
|
||||||
|
help="Chroot for building packages, defaults to device "
|
||||||
"architecture")
|
"architecture")
|
||||||
suffix.add_argument("-s", "--suffix", default=None,
|
suffix.add_argument("-s", "--suffix", default=None,
|
||||||
help="Specify any chroot suffix, defaults to"
|
help="Specify any chroot suffix, defaults to"
|
||||||
|
|
|
@ -30,3 +30,21 @@ def test_chroot_interactive_shell():
|
||||||
input="echo hello_world\n", universal_newlines=True,
|
input="echo hello_world\n", universal_newlines=True,
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
assert ret == "hello_world\n"
|
assert ret == "hello_world\n"
|
||||||
|
|
||||||
|
|
||||||
|
def test_chroot_arguments():
|
||||||
|
"""
|
||||||
|
Open a shell with 'pmbootstrap chroot' for every architecture, pass 'uname -m\n'
|
||||||
|
as stdin and check the output
|
||||||
|
"""
|
||||||
|
pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||||
|
os.chdir(pmb_src)
|
||||||
|
|
||||||
|
for arch in ["armhf", "aarch64", "x86_64"]:
|
||||||
|
ret = subprocess.check_output(["./pmbootstrap.py", "-q", "chroot", "-b", arch],
|
||||||
|
timeout=300, input="uname -m\n",
|
||||||
|
universal_newlines=True, stderr=subprocess.STDOUT)
|
||||||
|
if arch == "armhf":
|
||||||
|
assert ret == "armv7l\n"
|
||||||
|
else:
|
||||||
|
assert ret == arch + "\n"
|
||||||
|
|
Loading…
Reference in New Issue