slackpkg, lilo+elilo+initrd

Se avete problemi con l'installazione e la configurazione di Slackware64 postate qui. Non usate questo forum per argomenti che trattano la Slackware32 o generali... per quelli usate rispettivamente il forum Slackware e Gnu/Linux in genere.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware64 usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Slackware64, se l'argomento è Slackware32 o generale usate rispettivamente il forum Slackware o Gnu/Linux in genere.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
Avatar utente
ZeroUno
Staff
Staff
Messaggi: 5441
Iscritto il: ven 2 giu 2006, 14:52
Nome Cognome: Matteo Rossini
Slackware: current
Kernel: slack-current
Desktop: ktown-latest
Distribuzione: 01000000-current
Località: Roma / Castelli
Contatta:

slackpkg, lilo+elilo+initrd

Messaggio da ZeroUno »

Sto pensando di aggiungere a slackpkg+ un plugin per far gestire - dopo l'upgrade del kernel - non solo lilo ma anche un initrd (purchè prefatto) ed elilo.

Una bozza dello script è quì: https://www.linuxquestions.org/question ... 175628620/

copia in /usr/libexec/slackpkg/functions.d/zlookkernel.sh
e dai chmod +x /usr/libexec/slackpkg/functions.d/zlookkernel.sh

riporta bug e suggerimenti.

Codice: Seleziona tutto

lookkernel() {
  NEWKERNELMD5=$(md5sum /boot/vmlinuz 2>/dev/null)
  if [ "$KERNELMD5" != "$NEWKERNELMD5" ]; then
    KERNEL=$(ls -l /boot/vmlinuz|rev|cut -f1 -d-|rev)
    echo -e "\nYour kernel image was updated (found $KERNEL). You have to rebuild the bootloader.\nDo you want slackpkg to do it? (Y/n)"
    answer
    if [ "$ANSWER" != "n" ] && [ "$ANSWER" != "N" ]; then
      INITRD=/boot/initrd.gz
      if [ -e /boot/initrd-tree/command_line ];then
        INITRD=$(cat /boot/initrd-tree/command_line|sed -r -e 's/^.* -o //' -e 's/ .*$//')
        if [ -z "$INITRD" ];then
          INITRD=/boot/initrd.gz
        fi
        if [ -e "$INITRD" ];then
          echo -en "Found $INITRD; do you want to rebuild it with:\n  "
          cat /boot/initrd-tree/command_line|sed -r "s/-k [0-9\.]+ /-k $KERNEL /"
          echo "Do you want continue? (Y/n)"
          answer
          if [ "$ANSWER" != "n" ] && [ "$ANSWER" != "N" ]; then
            cat /boot/initrd-tree/command_line|sed -r "s/-k [0-9\.]+ /-k $KERNEL /"|sh
          fi
        fi
      fi

      if [ -x /sbin/lilo ]&&[ -e /etc/lilo.conf ]; then
        echo -e "\nFound lilo. Do you want to run now: /sbin/lilo ? (Y/n)"
        answer
        if [ "$ANSWER" != "n" ] && [ "$ANSWER" != "N" ]; then
          if ! /sbin/lilo -t ;then
            echo "You need to fix your lilo configuration. Then press return to continue."
            read
          fi
          /sbin/lilo -v
        fi

      elif [ -e /boot/efi/EFI/Slackware/elilo.conf ];then
        echo -e "\nFound elilo. Copying files to EFI partition"
        COPYDONE=""
        for tocopy in vmlinuz vmlinuz-generic vmlinuz-huge `basename $INITRD`;do
          if [ -e /boot/$tocopy ]&&[ -e /boot/efi/EFI/Slackware/$tocopy ]&&grep -E -q "= *$tocopy *$" /boot/efi/EFI/Slackware/elilo.conf ;then
            echo "Do you want to copy $tocopy to EFI partition? (Y/n)"
            answer
            if [ "$ANSWER" != "n" ] && [ "$ANSWER" != "N" ]; then
              cp /boot/$tocopy /boot/efi/EFI/Slackware/$tocopy && COPYDONE="$COPYDONE $tocopy"
              touch -r /boot/$tocopy /boot/efi/EFI/Slackware/$tocopy
            fi
          fi
        done
        if [ -z "$COPYDONE" ];then
          echo -e "\nWARNING! no files to copy found. You have to fix bootloader yourself\n"
        fi
      elif [ -e /boot/grub ]&&[ -x /usr/sbin/grub-install ];then
        echo -e "\nWARNING! Grub found but not supported by slackpkg. You have to fix it yourself\n"
      else
        echo -e "\nWARNING! slackpkg can't found your bootloader configuration. You have to fix it yourself\n"
      fi
    fi
  fi
}
E' una bozza ovviamente, e c'è tanto da fare, ma non vuole essere un script che costruisce un initrd o modifica file di configurazione come fanno ubuntu e centos, ma solo il lancio del comando mkinitrd e - se in uso - la copia dei nuovi file nella partizione EFI.
Packages finder: slakfinder.org | Slackpkg+, per aggiungere repository a slackpkg

Codice: Seleziona tutto

1011010 1100101 1110010 1101111 - 0100000 - 1010101 1101110 1101111

Rispondi