[rhel5-branch] [PATCH] Create /dev/* symlinks after we mount tmpfs on /dev

Radek Vykydal rvykydal at redhat.com
Thu Sep 13 13:57:41 UTC 2012


I tried a scratch build as I did one for a 5.9 bz recently
and it fails with:

cc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=generic -fasynchronous-unwind-tables -Wall -Werror -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DUSESELINUX=1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/libdhcp -I/usr/include/dhcp4client -I/usr/include/dhcp6client     -DUSE_LOGDEV -DVERSION='"11.1.2.254"' -c -o init.o init.c
cc1: warnings being treated as errors
init.c: In function 'createDevices':
init.c:487: warning: ignoring return value of 'symlink', declared with attribute warn_unused_result
init.c:488: warning: ignoring return value of 'symlink', declared with attribute warn_unused_result
init.c:489: warning: ignoring return value of 'symlink', declared with attribute warn_unused_result
init.c:490: warning: ignoring return value of 'symlink', declared with attribute warn_unused_result
make[1]: *** [init.o] Error 1


On 09/13/2012 01:33 PM, Vratislav Podzimek wrote:
> Creating them in mk-images results in these files missing after
> we mount tmpfs on /dev in our init.
>
> Resolves: rhbz#784159
>
> Signed-off-by: Vratislav Podzimek<vpodzime at redhat.com>
> ---
>   loader2/init.c    | 7 +++++++
>   scripts/mk-images | 7 -------
>   2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/loader2/init.c b/loader2/init.c
> index 782526b..1717fcf 100644
> --- a/loader2/init.c
> +++ b/loader2/init.c
> @@ -482,6 +482,13 @@ static void createDevices(void) {
>                       strerror(errno));
>       }
>
> +    /* some of these may fail if the links already exist, but that means
> +    we don't need to create them */
> +    symlink("/proc/self/fd/0", "/dev/stdin");
> +    symlink("/proc/self/fd/1", "/dev/stdout");
> +    symlink("/proc/self/fd/2", "/dev/stderr");
> +    symlink("/proc/self/fd", "/dev/fd");
> +
>       /* Restore umask for minimal side affects */
>       umask(previous_umask);
>   }
> diff --git a/scripts/mk-images b/scripts/mk-images
> index 4823ad0..ce3beb6 100755
> --- a/scripts/mk-images
> +++ b/scripts/mk-images
> @@ -606,13 +606,6 @@ makeinitrd() {
>       mkdir -p $MBD_DIR/var/run/rhsm
>       mkdir -p $MBD_DIR/var/lock/rpm
>
> -    ( cd $MBD_DIR/dev
> -      ln -sf /proc/self/fd/0 stdin
> -      ln -sf /proc/self/fd/1 stdout
> -      ln -sf /proc/self/fd/2 stderr
> -      ln -sf /proc/self/fd fd
> -    )
> -
>       if [ "$BUILDARCH" = "ppc" -o "$BUILDARCH" = "ppc64" ]; then
>   	mkdir -p $MBD_DIR/dev/iseries
>       fi



More information about the anaconda-patches mailing list