lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQ4ar1gM1+08EXUZYHvt38Bt_D+NZdhRyH8hfjecw2vEg@mail.gmail.com>
Date:   Wed, 7 Apr 2021 20:03:18 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Michal Marek <michal.lkml@...kovi.net>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        linux-arch <linux-arch@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 04/20] kbuild: scripts/install.sh: call sync before
 calling the bootloader installer

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> It's good to ensure that the files are written out before calling the
> bootloader installer, as other architectures do, so call sync after
> doing the copying of the kernel and system map files.


I see 3 architectures that call 'sync' from install.sh

masahiro@...ver:~/ref/linux$ find . -name install.sh  | xargs grep sync
./arch/nios2/boot/install.sh:sync
./arch/x86/boot/install.sh:       sync
./arch/m68k/install.sh:sync


As for nios2 and m68k, they do not call
any bootloader-specific setups.



> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
>  scripts/install.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index af36c0a82f01..92d0d2ade414 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -52,12 +52,12 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>  # Default install - same as make zlilo
>  install "$2" "$4"/vmlinuz
>  install "$3" "$4"/System.map
> +sync
>
>  if [ -x /sbin/lilo ]; then
>         /sbin/lilo
>  elif [ -x /etc/lilo/install ]; then
>         /etc/lilo/install
>  else
> -       sync
>         echo "Cannot find LILO."
>  fi
> --
> 2.31.1
>

Why do we need 'sync' before lilo invocation?



If you want to ensure everything is flushed
to a disk before this scripts exits,
adding 'sync' at the end of the script
makes more sense, in my opinion.



   if [ -x /sbin/lilo ]; then
          /sbin/lilo
   elif [ -x /etc/lilo/install ]; then
          /etc/lilo/install
   else
         echo "Cannot find LILO."
   fi

   sync




This goes aligned with nios2 and m68k.



--
Best Regards

Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ