Le 11/05/2014 23:08, William Harrington a écrit :
>
> On May 11, 2014, at 3:24 PM, Pierre Labastie wrote:
>
>>> However, they are still ran as the clfs user and will fail at the creation
>>> of
>>> devices when using mknod.
>> Did you try ?
>> The Makefile has:
>> mk_SUDO: mk_CROSS
>> @sudo make BREAKPOINT=$(BREAKPOINT) SUDO
>> @touch $@
>> ----------------------
>> so all SUDO targets are run as root.
>>
>> Pierre
>
> Hi Pierre,
>
> That is in the Makefile.
>
> I can run make mk_SUDO and still get the same problem.
>
> Starting at creatingdirs, all the targets are ran as the clfs user.
>
> whoami in the 090-devices, for example, still outputs clfs and bombs out when
> attempting to use mknod
> and 095-changingowner doesn't use the root user so can't change ownership of
> anything to 0:0
>
> The rest work fine as the clfs user as jHALFS will set ${CLS} (/mnt/clfs) to
> 777 with the sticky bit. But creating devices and changing ownership to 0:0 in
> ${CLFS} (/mnt/clfs) isn't working properly like it should.
>
> In the Makefile:
>
> mk_SUDO: mk_CROSS
> @sudo make BREAKPOINT=$(BREAKPOINT) SUDO
> @touch $@
>
>
>
> SUDO: 090-devices 095-changingowner
>
>
> 090-devices: 089-createfiles
> @$(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)
>
> 095-changingowner: 094-flags
> @$(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)
>
> Sincerely,
>
> William Harrington
I think we misunderstood each other. Of course all the scripts which should be
run as root should be added to the SUDO variable. I attach a patch, which
should achieve that, for the systemd branch. What I do not have is a way to be
compatible with older versions of the book...
Pierre
Index: jhalfs/CLFS/master.sh
===================================================================
--- jhalfs.orig/CLFS/master.sh
+++ jhalfs/CLFS/master.sh
@@ -337,6 +337,7 @@ boot_Makefiles() { #
# A little housekeeping on the scripts
case $this_script in
*grub | *aboot | *colo | *silo | *arcload | *lilo | *introduction ) continue ;;
+ *how-to-view*) continue ;;
*whatnext*) continue ;;
*fstab) [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
*kernel) # if there is no kernel config file do not build the kernel
@@ -349,24 +350,29 @@ boot_Makefiles() { #
# First append each name of the script files to a list (this will become
# the names of the targets in the Makefile
case "${this_script}" in
- *changingowner) orphan_scripts="${orphan_scripts} ${this_script}" ;;
- *devices) orphan_scripts="${orphan_scripts} ${this_script}" ;;
- *) boottools="$boottools $this_script" ;;
+ *changingowner) orphan_scripts="${orphan_scripts} ${this_script}" ;;
+ *creatingdirs) orphan_scripts="${orphan_scripts} ${this_script}" ;;
+ *createfiles) orphan_scripts="${orphan_scripts} ${this_script}" ;;
+ *devices) orphan_scripts="${orphan_scripts} ${this_script}" ;;
+ *fstab) orphan_scripts="${orphan_scripts} ${this_script}" ;;
+ *pwdgroup) orphan_scripts="${orphan_scripts} ${this_script}" ;;
+ *settingenvironment) orphan_scripts="${orphan_scripts} ${this_script}" ;;
+ *) boottools="$boottools $this_script" ;;
esac
#
# Grab the name of the target, strip id number and misc words.
case $this_script in
- *kernel) name=linux ;;
- *bootscripts) name="bootscripts-cross-lfs" ;;
- *boot-scripts) name="boot-scripts-cross-lfs" ;;
- *udev-rules) name="udev-cross-lfs" ;;
- *grub-build) name=grub ;;
- *-aboot-build) name=aboot ;;
- *yaboot-build) name=yaboot ;;
- *colo-build) name=colo ;;
- *silo-build) name=silo ;;
- *arcload-build) name=arcload ;;
- *lilo-build) name=lilo ;;
+ *kernel) name=linux ;;
+ *bootscripts) name="bootscripts-cross-lfs" ;;
+ *boot-scripts) name="boot-scripts-cross-lfs" ;;
+ *udev-rules) name="udev-cross-lfs" ;;
+ *grub-build) name=grub ;;
+ *-aboot-build) name=aboot ;;
+ *yaboot-build) name=yaboot ;;
+ *colo-build) name=colo ;;
+ *silo-build) name=silo ;;
+ *arcload-build) name=arcload ;;
+ *lilo-build) name=lilo ;;
*) name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' ` ;;
esac
# Identify the unique version naming scheme for the clfs bootscripts..(bad boys)
@@ -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
#
--
http://lists.linuxfromscratch.org/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page