#!/usr/bin/ash

run_latehook() {
    local composefs

    # composefs.digest= is the V1 EROFS karg; composefs= is the legacy V2 karg.
    composefs="$(getarg composefs.digest)"
    if [ -z "$composefs" ]; then
        composefs="$(getarg composefs)"
    fi
    if [ -z "$composefs" ]; then
        return 0
    fi

    /usr/bin/composefs-setup-root --sysroot /new_root
}
