runit-fstab-generator
Publicado por Perfil removido (última atualização em 20/06/2017)
[ Hits: 1.805 ]
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
Usando Shell para incluir múltiplos usuários no Windows
Backup, gerando no final uma imagem .iso dos arquivos !!
Usar o Google Translate para ler (speak) a seleção
Autenicação no Serviço ADSL da Brasil Telecom
tira_usb.sh - Remover dispositivo USB
Nenhum coment�rio foi encontrado.
Aprenda a Gerenciar Permissões de Arquivos no Linux
Como transformar um áudio em vídeo com efeito de forma de onda (wave form)
Como aprovar Pull Requests em seu repositório Github via linha de comando
Visualizar arquivos em formato markdown (ex.: README.md) pelo terminal
Dando - teoricamente - um gás no Gnome-Shell do Arch Linux
Como instalar o Google Cloud CLI no Ubuntu/Debian
Mantenha seu Sistema Leve e Rápido com a Limpeza do APT!
Procurando vídeos de YouTube pelo terminal e assistindo via mpv (2025)
Alguém já usou o framework Avalonia para desenvolver interfaces de usu... (4)
Ajuda Pra Melhoria do NFTABLES. (8)
Sinto uma leve lentidão ao arrastar, miniminizar e restauras as janela... (2)
Pastas da raiz foram para a área de trabalho [RESOLVIDO] (7)