add roles/toxcore

This commit is contained in:
emdee 2024-01-08 12:51:06 +00:00
parent c8610f9ded
commit 7e491f4b8c
51 changed files with 1665 additions and 770 deletions

View file

@ -32,21 +32,24 @@ AGI_install_syslog_daemon: syslog-ng # sysklogd
AGI_install_cron_daemon: cronie #
AGI_install_bootloader: syslinux # grub:2
AGI_install_syslinux_kernel_line:
# this is required I think
- console=tty1
# this is required I think
- text
# adjust these to suit
- lang=en
- keymap=us
AGI_syslinux_date: 2023_09_30
AGI_syslinux_vmlinuz: vmlinuz-6.1.52-pentoo
AGI_syslinux_initramfs: initramfs-pentoo-x86_64-6.1.52-pentoo
AGI_syslinux_vga: "0x037f" # 0x37f?
AGI_syslinux_ipv6disable: 1
AGI_syslinux_cmdline:
- rootfstype=ext2
# remove this if you want IPV6
- ipv6.disable=1
# fsck should NOT be done by the bootloader
- rd.skipfsck=1
# =0x37f works too
- vga=789
# remove this if you want IPV6
- ipv6.disable=1
# this is required I think
- console=ttyS0
- lang=en
- keymap=us
- vga={{AGI_syslinux_vga}}
# this is required I think
- text
# these may not all be needed or useful in a container
# - pti=on
# - iommu=pt

View file

@ -20,39 +20,6 @@
- name: setup syslinux
shell: |
[ -d /boot/syslinux ] || mkdir /boot/syslinux
[ -f /boot/syslinux/syslinux.cfg ] || \
cat > /boot/syslinux/syslinux.cfg << EOF
# -*-mode: sh; tab-width: 8; coding: utf-8-dos -*-
default vesamenu.c32
prompt 0
# timeout 150
menu title nbd2
menu background splash.png
menu color title 1;36;44 #c0ffffff #00000000 std
menu color sel 7;37;40 #e0000000 #20ECEAC7 all
menu rows 15
menu tabmsgrow 21
menu timeoutrow 23
menu helpmsgrow 23
# drm.debug=0xe
# rd.shell rd.debug
label pentoo2019-Pen19-6.1.52-pentoo_2023_09_30_0x037f
menu label pentoo2019_Pen19_6.1.52-pentoo_2023_09_30_0x037f
menu default
kernel /vmlinuz-6.1.52-pentoo_2023_09_30
INITRD /initramfs-pentoo-x86_64-6.1.52-pentoo_2023_09_30.img
# was vga=0x315
APPEND root=LABEL=root {{''.join(AGI_install_syslinux_kernel_commands)}}
label MAIN hd0 MBR
menu label MAIN hd0 0
com32 chain.c32
APPEND hd0
EOF
[ ! -d /usr/share/syslinux/ ] || \
for elt in {{' '.join(AGI_install_syslinux_c32)}}; do
[ -f /boot/syslinux/$elt ] && continue
@ -60,6 +27,15 @@
done
exit 0
- name: setup syslinux.cfg
template: |
dest: /boot/syslinux/syslinux.cfg
src: boot/syslinux/syslinux.cfg
force: no
newline_sequence: '\r\n'
owner: root
mode: '0644'
- name: do syslinux install manually
shell: |
df | grep {{AGI_install_disk}} && \
@ -122,6 +98,8 @@
dest: /etc/default/grub
line: '{{item.from}}="{{item.to}}"'
regexp: '^#*{{item.from}}=.*'
owner: root
mode: '0644'
with_items:
# Append parameters to the linux kernel command line for non-recovery entries
- from: GRUB_CMDLINE_LINUX_DEFAULT
@ -138,6 +116,18 @@
- from: GRUB_DISABLE_LINUX_UUID
to: true
- name: grub.cfg from roles/ansible-gentoo_install/tasks/
shell: |
LINE="{{' '.join(AGI_install_syslinux_kernel_line)}}"
# LINE="$LINE pti=on doscsi iommu=pt amd_iommu=on debugfs=off efi=disable_early_pci_dma extra_latent_entropy init_on_free=1 kvm.nx_huge_pages=force l1tf=full,force mce=0 mds=full,nosmt nosmt=force page_alloc.shuffle=1 pti=on random.trust_cpu=off slab_nomerge slub_debug=FZ spec_store_bypass_disable=on spectre_v2=on tsx_async_abort=full,nosmt vsyscall=none "
grep /boot /etc/fstab || exit 1
df | grep /boot || mount /boot || exit 2
[ -d /boot/grub ] || exit 3
[ -f /boot/grub/grub.cfg ] || exit 4
[ -f /boot/grub/grub.cfg.dst ] || cp -p /boot/grub/grub.cfg /boot/grub/grub.cfg.dst
sed -e 's@ ro *$@ '"$LINE"' ro@' -i /boot/grub/grub.cfg
ignore_errors: true
when: AGI_install_bootloader == 'grub:2'
- name: fstab root
@ -145,24 +135,32 @@
dest: /etc/fstab
line: '{{AGI_container_disk}}3 / ext4 defaults,noatime 0 1'
regexp: '^{{AGI_container_disk}}3'
owner: root
mode: '0644'
- name: fstab boot
lineinfile:
dest: /etc/fstab
line: '{{AGI_container_disk}}1 /boot ext3 defaults,noatime 0 1'
regexp: '^{{AGI_container_disk}}3'
owner: root
mode: '0644'
- name: fstab swap
lineinfile:
dest: /etc/fstab
line: '{{AGI_container_disk}}2 none swap nofail,sw 0 0'
regexp: '^{{AGI_container_disk}}2'
owner: root
mode: '0644'
- name: fstab shm
lineinfile:
dest: /etc/fstab
line: 'tmpfs /run/shm tmpfs defaults,noexec,size=5% 0 0'
regexp: '^tmpfs */run/shm'
owner: root
mode: '0644'
# linuxPen19 /mnt/linuxPen19 virtiofs defaults,dirsync 0 0
@ -171,18 +169,24 @@
dest: /etc/security/passwdqc.conf
line: 'enforce=none'
regexp: '^enforce=.*'
owner: root
mode: '0644'
- name: /etc/security/passwdqc.conf
lineinfile:
dest: /etc/security/passwdqc.conf
line: 'enforce=none'
regexp: '^enforce=.*'
owner: root
mode: '0644'
- name: /etc/conf.d/consolefont
lineinfile:
dest: /etc/conf.d/consolefont
line: 'consolefont="ter-v{{AGI_consolefont_font_size}}b"'
regexp: '^consolefont=.*'
owner: root
mode: '0644'
- name: consolefont
shell: |
@ -193,7 +197,7 @@
/etc/init.d consolefont start
# these are right for ter-v28b consolefont
if tty|grep -q /dev/ttyS0 ; then
stty cols 80 rows 35
stty cols 80 rows 34
elif tty|grep -q /dev/tty[1-6] ; then
stty cols 80 rows 22
fi

View file

@ -17,7 +17,8 @@
done
# 700 files from ansible umask
find /usr/local/*bin/ /usr/local/etc/ -name '*sh' -exec chmod 755 {} \;
find /usr/local/ -type f -exec chown ${BOX_USER_NAME}:${BOX_USER_GROUP} {} \;
find /usr/local/{src,bin,share,etc} -type f \
-exec chown ${BOX_USER_NAME}:${BOX_USER_GROUP} {} \;
exit 0
when: AGI_bootstrap_mountpoints|default([])|length > 0

View file

@ -0,0 +1,30 @@
# -*-mode: sh; tab-width: 8; coding: utf-8-dos -*-
default vesamenu.c32
##? SERIAL 0 115200
##? CONSOLE 0
prompt 0
timeout 150
menu title {{BOX_NBD_DEV}} TAB to edit RETURN to boot
menu color title 1;36;44 #c0ffffff #00000000 std
menu color sel 7;37;40 #e0000000 #20ECEAC7 all
menu rows 15
menu tabmsgrow 21
menu timeoutrow 23
menu helpmsgrow 23
# rd.shell rd.debug
label {{AGI_syslinux_vmlinuz}}_{{AGI_syslinux_date}}_{{AGI_syslinux_vga}}
menu label {{AGI_syslinux_vmlinuz}}_{{AGI_syslinux_date}}_{{AGI_syslinux_vga}}
menu default
kernel /{{AGI_syslinux_vmlinuz}}
INITRD /{{AGI_syslinux_initramfs}}
# was vga=0x315
APPEND root=LABEL=root rootfstype=ext2 console=ttyS0 pti=on rd.skipfsck=1 ipv6.disable={{AGI_syslinux_disable}} lang=en keymap=us vga={{AGI_syslinux_vga}} text
label MAIN hd0 MBR
menu label MAIN hd0 0
com32 chain.c32
APPEND hd0