diff options
author | adv <adv@uma.es> | 2019-12-08 19:06:07 +0100 |
---|---|---|
committer | adv <adv@uma.es> | 2019-12-09 21:09:55 +0100 |
commit | 0be201458ad4f35f8a1aedaea8d042bbeead9228 (patch) | |
tree | e96588df969d7c9bcf7a282edcea92bb5060fce7 /client | |
parent | ca8168983e397b4f1b88dc8daf716702cae72529 (diff) |
#938 ogBurgInstallMbr() : binary may be in the ogLive or OGLIB/burg/burg.tgz
Check the availability of the binary in the ogLive. If necessary use the sources from $ OGLIB / burg / burg.tgz
Live. If necessary use the sources from $ OGLIB / burg / burg.tgz
Diffstat (limited to 'client')
-rwxr-xr-x | client/engine/Boot.lib | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib index 0f044cc3..f0e5f7d0 100755 --- a/client/engine/Boot.lib +++ b/client/engine/Boot.lib @@ -1609,7 +1609,7 @@ function ogBurgInstallMbr () { # Variables locales. -local PART DISK FIRSTAGE SECONSTAGE PREFIXSECONDSTAGE CHECKOS KERNELPARAM BACKUPNAME FILECFG +local BINARYAVAILABLE PART DISK FIRSTAGE SECONSTAGE PREFIXSECONDSTAGE CHECKOS KERNELPARAM BACKUPNAME FILECFG # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then @@ -1622,6 +1622,15 @@ fi # Error si no se reciben 2 parametros. [ $# -ge 2 ] || return $(ogRaiseError $OG_ERR_FORMAT; echo $?) +#Error si no tenemos el binario burg +BINARYAVAILABLE=$(burg-install -v &>/dev/null && echo "YES" ||echo "NO") +if [ "$BINARYAVAILABLE" == NO ]; then + if [ -e $OGLIB/burg/burg.tgz ]; then + cd / ; tar xzvf $OGLIB/burg/burg.tgz --strip 1 &>/dev/null + else + return $(ogRaiseError $OG_ERR_NOTEXEC "Binary burg not found"; echo $?) + fi +fi DISK=$1; PART=$2; CHECKOS=${3:-"FALSE"} @@ -1639,7 +1648,7 @@ FIRSTSTAGE=$(ogDiskToDev 1) SECONDSTAGE=$(ogMount $DISK $PART) # prepara el directorio principal de la segunda etapa (y copia los binarios) -[ -d ${SECONDSTAGE}/boot/burg/ ] || mkdir -p ${SECONDSTAGE}/boot/burg/; cp -prv /boot/burg/* ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; cp -prv $OGLIB/burg/* ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; #*/ ## (comentario Dogygen) #*/ ## (comentario Dogygen) +[ -d ${SECONDSTAGE}/boot/burg/ ] || mkdir -p ${SECONDSTAGE}/boot/burg/; cp -prv /boot/burg/* ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; cp -prv $OGLIB/burg/themes ${SECONDSTAGE}/boot/burg/ 2>&1>/dev/null; #*/ ## (comentario Dogygen) #*/ ## (comentario Dogygen) #Copiamos el tema mkdir -p ${SECONDSTAGE}/boot/burg/themes/OpenGnsys @@ -1649,7 +1658,7 @@ cp -prv "$OGLIB/burg/themes" "${SECONDSTAGE}/boot/burg/" 2>&1>/dev/null #PREFIXSECONDSTAGE="/boot/burg/" # Si Reconfigurar segunda etapa (grub.cfg) == FALSE -if [ -f ${SECONDSTAGE}/boot/burg/burg.cfg -o -f ${SECONDSTAGE}/boot/burg/burg.cfg$BACKUPNAME ] +if [ -f ${SECONDSTAGE}/boot/burg/burg.cfg -o -f ${SECONDSTAGE}/boot/burg/burg.cfg$BACKUPNAME ]; then if [ "$CHECKOS" == "false" -o "$CHECKOS" == "FALSE" ] then |