Mageia Bugzilla – Attachment 3939 Details for
Bug 2808
Sectool not configured for Mageia
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Modified bootloader script to support either or both grub and grub2 on same machine
bootloader.sh (text/plain), 2.27 KB, created by
George Mitchell
on 2013-05-11 03:24:34 CEST
(
hide
)
Description:
Modified bootloader script to support either or both grub and grub2 on same machine
Filename:
MIME Type:
Creator:
George Mitchell
Created:
2013-05-11 03:24:34 CEST
Size:
2.27 KB
patch
obsolete
>#!/usr/bin/env bash > ># ----------------------------------------------------------- # ># Copyright (C) 2008 Red Hat, Inc. # ># Written by Michel Samia <msamia@redhat.com> # ># bootloader.sh # ># more info in bootloader.dsc # ># ----------------------------------------------------------- # > ># Modified by George Mitchell <george@chinilu.com> to add support for both grub and grub2 on Mageia Linux 05-10-2013 > >if (( ${DEBUG} == 1 )); then >. "${TESTS_DIRS}/bash_defs_debug.sh" >else >. "${TESTS_DIRS}/bash_defs.sh" >fi > >if [[ -f "${GRUB2CONF}" ]] >then > > const E_BAD_PERMISSIONS=1 > const E_NO_PASSWORD=2 > const E_NO_PASSWORD_TXT="\${GRUB2CONF} does not contain a password" > const H_NO_PASSWORD_TXT="Please add the line 'password --md5 hash' to ${GRUB2CONF}, where hash is output of grub-md5-crypt" > > if (( ${REFRESH} == 1 )); then > test_exit ${E_OK} > fi > > check_file_perm ${GRUB2CONF} 600 root:root 1 $E_BAD_PERMISSIONS "Bootloader configuration file" > > if [[ "`egrep '^password' ${GRUB2CONF} | wc -l`" == "0" ]] > then > if [[ "${ERROR_PASS}" == "1" ]] > then > report 'ERROR' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" > report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" > elif [[ "${WARNING_PASS}" == "1" ]] > then > report 'WARNING' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" > report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" > fi > fi >fi > >if [[ -f "${GRUBCONF}" ]] >then > > const E_BAD_PERMISSIONS=1 > const E_NO_PASSWORD=2 > const E_NO_PASSWORD_TXT="\${GRUBCONF} does not contain a password" > const H_NO_PASSWORD_TXT="Please add the line 'password --md5 hash' to ${GRUBCONF}, where hash is output of grub-md5-crypt" > > if (( ${REFRESH} == 1 )); then > test_exit ${E_OK} > fi > > check_file_perm ${GRUBCONF} 600 root:root 1 $E_BAD_PERMISSIONS "Bootloader configuration file" > > if [[ "`egrep '^password' ${GRUBCONF} | wc -l`" == "0" ]] > then > if [[ "${ERROR_PASS}" == "1" ]] > then > report 'ERROR' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" > report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" > elif [[ "${WARNING_PASS}" == "1" ]] > then > report 'WARNING' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" > report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" > fi > fi > >fi
#!/usr/bin/env bash # ----------------------------------------------------------- # # Copyright (C) 2008 Red Hat, Inc. # # Written by Michel Samia <msamia@redhat.com> # # bootloader.sh # # more info in bootloader.dsc # # ----------------------------------------------------------- # # Modified by George Mitchell <george@chinilu.com> to add support for both grub and grub2 on Mageia Linux 05-10-2013 if (( ${DEBUG} == 1 )); then . "${TESTS_DIRS}/bash_defs_debug.sh" else . "${TESTS_DIRS}/bash_defs.sh" fi if [[ -f "${GRUB2CONF}" ]] then const E_BAD_PERMISSIONS=1 const E_NO_PASSWORD=2 const E_NO_PASSWORD_TXT="\${GRUB2CONF} does not contain a password" const H_NO_PASSWORD_TXT="Please add the line 'password --md5 hash' to ${GRUB2CONF}, where hash is output of grub-md5-crypt" if (( ${REFRESH} == 1 )); then test_exit ${E_OK} fi check_file_perm ${GRUB2CONF} 600 root:root 1 $E_BAD_PERMISSIONS "Bootloader configuration file" if [[ "`egrep '^password' ${GRUB2CONF} | wc -l`" == "0" ]] then if [[ "${ERROR_PASS}" == "1" ]] then report 'ERROR' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" elif [[ "${WARNING_PASS}" == "1" ]] then report 'WARNING' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" fi fi fi if [[ -f "${GRUBCONF}" ]] then const E_BAD_PERMISSIONS=1 const E_NO_PASSWORD=2 const E_NO_PASSWORD_TXT="\${GRUBCONF} does not contain a password" const H_NO_PASSWORD_TXT="Please add the line 'password --md5 hash' to ${GRUBCONF}, where hash is output of grub-md5-crypt" if (( ${REFRESH} == 1 )); then test_exit ${E_OK} fi check_file_perm ${GRUBCONF} 600 root:root 1 $E_BAD_PERMISSIONS "Bootloader configuration file" if [[ "`egrep '^password' ${GRUBCONF} | wc -l`" == "0" ]] then if [[ "${ERROR_PASS}" == "1" ]] then report 'ERROR' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" elif [[ "${WARNING_PASS}" == "1" ]] then report 'WARNING' $E_NO_PASSWORD "$E_NO_PASSWORD_TXT" report 'HINT' $E_NO_PASSWORD "$H_NO_PASSWORD_TXT" fi fi fi
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2808
:
3920
|
3926
|
3927
|
3936
|
3937
|
3938
| 3939 |
3940
|
3941
|
3942
|
3943
|
3944
|
3946
|
3947
|
3948
|
3952
|
3953
|
3954
|
3963
|
3964