runit-fstab-generator
Publicado por Perfil removido (última atualização em 20/06/2017)
[ Hits: 1.766 ]
Download runit-fstab-generator
Faz parsing do /etc/fstab e produz scripts pra montar as partições encontradas.
- ignora a partição root.
- ignora partições que tem noauto nas opções.
- cria os arquivos em /run/runit/rc.d/mount-$local_onde_e_montado.rc
- faz uso do lodewijk para garantir paralelização da montagem das partições.
- cria arquivo mounts.target em /run/runit/rc.d , que pode ser usado para rodar todos os scripts gerados
#!/bin/sh # # Convert fstab entries into run files for mount # depends on lodewijk and can't define dependencies # it requires the dir /run/rc.d to be created and writable # # files created: # /run/runit/rc.d/mounts.target --> this is a script that keeps a list # of mounts and executes them with lodewijk # /run/runit/rc.d/$mount.rc --> this is a run file for a mount, the # name is mount-[basename of path on fstab].rc # mount.rc files that are not on tmpfs automatically depend on # mount-rw.rc [ "$(id -u)" != "0" ] && exit 128 set -eu create_run() { ( printf "%s\\n%s\\n\\n" "#!/bin/sh" "set -eu" if [ "$1" != "tmpfs" ]; then printf "%s\\n\\n" "lodewijk mount-rw.rc" fi printf "%s\\n" "echo \"mounting $2 ...\"" printf "%s" "exec mount " if [ "$1" = "tmpfs" ]; then printf "%s" "-t $1 " fi if [ ! -z "$4" ]; then printf "%s" "-o $4 " fi if [ "$1" != "tmpfs" ]; then printf "%s" "$1 " fi printf "%s\\n" "$2" ) > /run/runit/rc.d/mount-"$(echo $2 | grep -o '[^/]*$').rc" chmod +x /run/runit/rc.d/mount-"$(echo $2 | grep -o '[^/]*$').rc" } printf "%s\\n%s\\n\\n" "#!/bin/sh" "set -eu" > /run/runit/rc.d/mounts.target chmod +x /run/runit/rc.d/mounts.target grep -v '^#' < /etc/fstab | while IFS= read -r mount; do # Separate each arg into it's own disk="$(echo $mount|cut -d' ' -f1)" location="$(echo $mount|cut -d' ' -f2)" filesystem="$(echo $mount|cut -d' ' -f3)" # If the fstab mentions no auto, then we don't generate a run unit to mount opts="$(echo $mount|cut -d' ' -f4)" if (echo $opts | grep -q noauto); then continue fi # We don't want to remount the root partition [ "$location" = "/" ] && continue # We now call a function to create a run file create_run "$disk" "$location" "$filesystem" "$opts" # We add it to mounts.target printf "%s\\n" "lodewijk mount-$(echo $location | grep -o '[^/]*$').rc" >> /run/runit/rc.d/mounts.target done
Configurar usuarios samba na boa sem dor de cabeça em modo texto
4net.sh - Calcula velocidade de transmissão na rede
BackUp Mensal de Relatórios Diários
NetProfiler - Um solução para quem passeia por várias redes.
Script para renomear vários arquivos ao mesmo tempo.
Nenhum comentário foi encontrado.
Instalação e configuração do Chrony
Programa IRPF - Guia de Instalação e Resolução de alguns Problemas
Criando uma Infraestrutura para uma micro Empresa
O Que Fazer Após Instalar Ubuntu 25.04
O Que Fazer Após Instalar Fedora 42
Debian 12 -- Errata - Correções de segurança
Instalando o Pi-Hole versão v5.18.4 depois do lançamento da versão v6.0
Instalação de Drivers da Placa de Vídeo [RESOLVIDO] (4)
NAT LoopBack - Hairpin NAT (0)
Música que eu compus, será que ficou boa? (4)
Alguém poderia me ajudar a escolher peças pra montar um desktop? (3)