<commit_before>#!/bin/bash

function log() {
  echo "[CHROOT] $*"
}

function update_locales() {
  locale-gen en_US.UTF-8
  update-locale LANG=en_US.UTF-8 LC_MESSAGES=POSIX
}

function lvm_initramfs_hook() {
  LVM_INITRAMFS_HOOK=/etc/initramfs-tools/scripts/local-top/lvm2
  echo "#!/bin/bash"  >  LVM_INITRAMFS_HOOK
  echo "vgchange -ay" >> LVM_INITRAMFS_HOOK
  chmod a+x LVM_INITRAMFS_HOOK
  update-initramfs -u
}

function set_hostname() {
  echo "amnesiac" > /etc/hostname
}

#
# main
#

log "Setting up locale"
update_locales

log "Adding lvm2 hook for initramfs"
lvm_initramfs_hook

log "Changing hostname"
set_hostname
<commit_msg>Fix initramfs twiddling for LVM<commit_after>#!/bin/bash

function log() {
  echo "[CHROOT] $*"
}

function update_locales() {
  locale-gen en_US.UTF-8
  update-locale LANG=en_US.UTF-8 LC_MESSAGES=POSIX
}

function lvm_initramfs_hook() {
  LVM_INITRAMFS_HOOK=/usr/share/initramfs-tools/scripts/local-top/lvm2
  sed 's/lvchange_activate() {/vgchange -ay\nlvchange_activate() {/' $LVM_INITRAMFS_HOOK
  update-initramfs -u
}

function set_hostname() {
  echo "amnesiac" > /etc/hostname
}

#
# main
#

log "Setting up locale"
update_locales

log "Adding lvm2 hook for initramfs"
lvm_initramfs_hook

log "Changing hostname"
set_hostname

{'fraction_non_alphanumeric': 0.11811023622047244, 'fraction_numerical': 0.006299212598425197, 'mean_word_length': 4.674107142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '742772', 'n_tokens_mistral': 546, 'n_tokens_neox': 527, 'n_words': 97}