<commit_before>#!/bin/bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
  echo "Usage: ./makephysical.sh /path/to/physical_sysroot [port]"
  exit 1
fi

OSTREE_SYSROOT="$(realpath "$1")"  # replaces `--sysroot=...`
export OSTREE_SYSROOT
OSNAME="dummy-os"
BRANCHNAME="generated"
HARDWARE="dummy-hw"

echo "Creating OSTreee physical sysroot in $OSTREE_SYSROOT"
rm -rf "$OSTREE_SYSROOT"

mkdir -p "$OSTREE_SYSROOT"
ostree admin init-fs "$OSTREE_SYSROOT"
ostree admin os-init $OSNAME
ostree config --repo=${OSTREE_SYSROOT}/ostree/repo set core.mode bare-user

mkdir -p "$OSTREE_SYSROOT/boot/loader.0"
ln -s loader.0 "$OSTREE_SYSROOT/boot/loader"

touch "$OSTREE_SYSROOT/boot/loader/uEnv.txt"

SCRIPT_DIR="$(dirname "$0")"
OSTREE_DIR=$(mktemp -d /tmp/ostreephys-XXXXX)
"$SCRIPT_DIR/makedeployed.sh" "$OSTREE_DIR/repo" $BRANCHNAME $HARDWARE

if [ "$#" -eq 2 ]; then
  echo "port: $2"
  PORT=$2
else
  PORT=56042
fi

(
    cd "$OSTREE_DIR/repo"
<commit_msg>Use `bare-user-only` for ostree tests<commit_after>#!/bin/bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
  echo "Usage: ./makephysical.sh /path/to/physical_sysroot [port]"
  exit 1
fi

OSTREE_SYSROOT="$(realpath "$1")"  # replaces `--sysroot=...`
export OSTREE_SYSROOT
OSNAME="dummy-os"
BRANCHNAME="generated"
HARDWARE="dummy-hw"

echo "Creating OSTreee physical sysroot in $OSTREE_SYSROOT"
rm -rf "$OSTREE_SYSROOT"

mkdir -p "$OSTREE_SYSROOT"
ostree admin init-fs "$OSTREE_SYSROOT"
ostree admin os-init $OSNAME
ostree config --repo=${OSTREE_SYSROOT}/ostree/repo set core.mode bare-user-only

mkdir -p "$OSTREE_SYSROOT/boot/loader.0"
ln -s loader.0 "$OSTREE_SYSROOT/boot/loader"

touch "$OSTREE_SYSROOT/boot/loader/uEnv.txt"

SCRIPT_DIR="$(dirname "$0")"
OSTREE_DIR=$(mktemp -d /tmp/ostreephys-XXXXX)
"$SCRIPT_DIR/makedeployed.sh" "$OSTREE_DIR/repo" $BRANCHNAME $HARDWARE

if [ "$#" -eq 2 ]; then
  echo "port: $2"
  PORT=$2
else
  PORT=56042
fi

(
    cd "$OSTREE_DIR/repo"

{'fraction_non_alphanumeric': 0.1606864274570983, 'fraction_numerical': 0.014560582423296931, 'mean_word_length': 4.7604790419161676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '349951', 'n_tokens_mistral': 815, 'n_tokens_neox': 773, 'n_words': 170}