About a remaining shell hack.

M.Canales.es macana at macana-es.com
Fri Feb 16 15:02:26 PST 2007


Hi, 

Now in the Makefile we have this hack to bring to make a working shell when 
entering to the chroot:


#
# The convoluted piece of code below is necessary to provide 'make' with a 
valid shell in the
# chroot environment. (Unless someone knows a different way)
# Manually create the /bin directory and provide link to the /tools dir.
# Also change the original symlink creation to include (f)orce to prevent 
failure due to
#  pre-existing links.
#
mk_CHROOT: mk_SUDO
 @if [ ! -e $(MOUNT_PT)/bin ]; then \
   mkdir $(MOUNT_PT)/bin; \
   cd $(MOUNT_PT)/bin && \
   ln -sf /tools/bin/bash bash; ln -sf bash sh; \
   sudo chown -R 0:0 $(MOUNT_PT)/bin; \
 fi;
 @sudo sed -e 's|^ln -sv |ln -svf |' -i $(CMDSDIR)/chapter06/*-createfiles
 @$(call echo_CHROOT_request)
 @( sudo $(CHROOT1) "cd $(SCRIPT_ROOT) && make CHROOT")
 @touch $@



After the current SHELL change, I think that that hack maybe could be replaced 
by:

ifeq ($(shell ls /bin/bash),/bin/bash)
  SHELL = /bin/bash
else
  SHELL = /tools/bin/bash
endif

or something more simple, if someone can find a better way.

What do you think?


-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfromscratch.org
LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:                           http://es.tldp.org



More information about the alfs-discuss mailing list