DBG(MISC, ul_debugobj(cxt, "initialize paths"));
ul_path_init_debug();
+ /* / */
+ cxt->rootfs = NULL;
+ if (cxt->prefix) {
+ cxt->rootfs = ul_new_path("/");
+ if (!cxt->rootfs)
+ err(EXIT_FAILURE, _("failed to initialize rootfs handler"));
+ ul_path_set_prefix(cxt->rootfs, cxt->prefix);
+ }
+
/* /sys/devices/system/cpu */
cxt->syscpu = ul_new_path(_PATH_SYS_CPU);
if (!cxt->syscpu)
DBG(MISC, ul_debugobj(cxt, " de-initialize paths"));
ul_unref_path(cxt->syscpu);
ul_unref_path(cxt->procfs);
+ ul_unref_path(cxt->rootfs);
DBG(MISC, ul_debugobj(cxt, " freeing cpus"));
for (i = 0; i < cxt->npossibles; i++) {
if (ct && ct->addrsz)
add_summary_s(tb, sec, _("Address sizes:"), ct->addrsz);
- if (sysfs_get_byteorder(NULL) == SYSFS_BYTEORDER_LITTLE)
+ if (sysfs_get_byteorder(cxt->rootfs) == SYSFS_BYTEORDER_LITTLE)
add_summary_s(tb, sec, _("Byte Order:"), "Little Endian");
else
add_summary_s(tb, sec, _("Byte Order:"), "Big Endian");
struct path_cxt *syscpu; /* _PATH_SYS_CPU path handler */
struct path_cxt *procfs; /* /proc path handler */
+ struct path_cxt *rootfs; /* / path handler */
size_t ncputypes;
struct lscpu_cputype **cputypes;
"${TS_CMD_LSCPU}" -p -y -s "${dumpdir}/${name}" \
>> ${TS_OUTPUT} 2>> $TS_ERRLOG
- # LE/BE depends on binary
- sed -i -e '/Byte Order:.*/d' $TS_OUTPUT
+ if [[ ! -e "${dumpdir}/${name}/sys/kernel/cpu_byteorder" ]]; then
+ # LE/BE depends on binary if we can't read it from the dump
+ sed -i -e '/Byte Order:.*/d' $TS_OUTPUT
+ fi
ts_finalize_subtest
done
$CP /sys/devices/system/cpu/* $TS_DUMP
$CP /sys/devices/system/node/*/cpumap $TS_DUMP
+if [ -e "/sys/kernel/cpu_byteorder" ]; then
+ $CP /sys/kernel/cpu_byteorder $TS_DUMP
+fi
+
+
tar zcvf $TS_NAME.tar.gz $TS_DUMP
rm -rf $TS_DUMP