Le 11/05/2014 03:51, William Harrington a écrit :
> 
> On May 10, 2014, at 8:13 PM, William Harrington wrote:
> 
>> Ah okay I think I saw what I was missing, not AS_ROOT but as SUDO now in the
>> Makefilfe I have this:
>>
>> SUDO:          086-creatingdirs 087-createfiles 088-devices 089-pwdgroup
>> 090-fstab 091-settingenvironment 092-changingowner
> 
> Okay, the only problem I see now is this in the Makefile:
> 
> 086-creatingdirs:  085-grub-build
>         @$(call echo_message, Building)
>         @export BASHBIN=$(SHELL) && $(SHELL) progress_bar.sh $@ $$PPID &
>         @echo "$(nl_)`date`$(nl_)" >logs/$@
>         @$(PRT_DU) >>logs/$@
>         @source ~/.bashrc && \
>         $(CMDSDIR)/boot/$@ >> logs/$@ 2>&1 && \
>         $(PRT_DU) >>logs/$@
>         @$(call housekeeping)
> 
> We don't have a ~/.bashrc for root.
> 
> It looks like that is being pulled in from common/libs/func_wrt_Makefile in
> jhalfs.
> Should it be using clfs user's .bashrc at that time?
> 
> Sincerely,
> 
> William Harrington
I think we have two issues here:
- how to distinguish new versions of the book from older versions, since with
new versions, the "boot" chapter should be run as root, while in older ones,
part of the chapter is run as the clfs user.
- generate adequate instructions when running scripts as root, specially,
passing the CLFS and other variables to sudo.

The second one is the easier I think. Just add (well, the introducing comment
should be changed too):
@@ -390,14 +396,18 @@ boot_Makefiles() {                     #
     case $this_script in
        # The following 2 scripts are defined in the /boot directory but need
        # to be run as a root user. Set them up here but run them in another 
phase
-      *changingowner*)  wrt_RunAsRoot "${file}"    ;;
-      *devices*)        wrt_RunAsRoot "${file}"    ;;
-      *fstab*)   if [[ -n "$FSTAB" ]]; then
+      *changingowner)   wrt_RunAsRoot "${file}"    ;;
+      *creatingdirs)    wrt_RunAsRoot "${file}"    ;;
+      *createfiles)     wrt_RunAsRoot "${file}"    ;;
+      *devices)         wrt_RunAsRoot "${file}"    ;;
+      *fstab)    if [[ -n "$FSTAB" ]]; then
                    LUSER_wrt_CopyFstab
                  else
                    LUSER_wrt_RunAsUser  "${file}"
                  fi
          ;;
+      *pwdgroup)           wrt_RunAsRoot "${file}"    ;;
+      *settingenvironment) wrt_RunAsRoot "${file}"    ;;
       *)         LUSER_wrt_RunAsUser  "${file}"       ;;
     esac
     #
---------------------------
Now the Makefile has:
086-creatingdirs:  085-grub-build
        @$(call echo_message, Building)
        @export BASHBIN=$(SHELL) && $(SHELL) progress_bar.sh $@ $$PPID &
        @echo "$(nl_)`date`$(nl_)" >logs/$@
        @$(PRT_DU) >>logs/$@
        @export CLFS=$(MOUNT_PT) && \
        clfs-commands/boot/$@ >>logs/$@ 2>&1 && \
        $(PRT_DU) >>logs/$@
        @$(call housekeeping)
----------------------
which I think is OK.

For first item, now, I'd rely on your knowlege of your book...

Regards
Pierre
-- 
http://lists.linuxfromscratch.org/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to