Changed how build time and disk usage is dumped to the logs.
This commit is contained in:
parent
0bdf6edc91
commit
3a321ea6ef
1 changed files with 18 additions and 22 deletions
|
@ -192,7 +192,7 @@ HEADER="# This file is automatically generated by jhalfs
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
wrt_target() { #
|
wrt_target() { # Create target and initialize log file
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
local i=$1
|
local i=$1
|
||||||
local PREV=$2
|
local PREV=$2
|
||||||
|
@ -201,7 +201,7 @@ cat << EOF
|
||||||
|
|
||||||
$i: $PREV
|
$i: $PREV
|
||||||
@\$(call echo_message, Building)
|
@\$(call echo_message, Building)
|
||||||
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=jhalfs/* \$(MOUNT_PT)\`\n" >logs/$this_script
|
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >logs/$this_script
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
@ -265,42 +265,42 @@ EOF
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
wrt_run_as_su() { # header to log file, execute script, footer to log file
|
wrt_run_as_su() { # Execute script inside time { }, footer to log file
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
local this_script=$1
|
local this_script=$1
|
||||||
local file=$2
|
local file=$2
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@su - lfs -c "source /home/lfs/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 && \\
|
@( time { su - lfs -c "source /home/lfs/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
||||||
echo -e "\nKB: \`du -skx --exclude=jhalfs/* \$(MOUNT_PT)\`\n" >>logs/$this_script
|
echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/$this_script
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
wrt_run_as_root() { #
|
wrt_run_as_root() { # Some scripts must be run as root..
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
local this_script=$1
|
local this_script=$1
|
||||||
local file=$2
|
local file=$2
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@export LFS=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 && \\
|
@( time { export LFS=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
||||||
echo -e "\nKB: \`du -skx --exclude=jhalfs/* \$(MOUNT_PT)\`\n" >>logs/$this_script
|
echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/$this_script
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#=============================#
|
#=============================#
|
||||||
wrt_run_as_root2() { # Some scripts must be run as root..
|
wrt_run_as_root2() { #
|
||||||
#=============================#
|
#=============================#
|
||||||
local this_script=$1
|
local this_script=$1
|
||||||
local file=$2
|
local file=$2
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@source envars && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 && \\
|
@( time { source envars && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
|
||||||
echo -e "\nKB: \`du -skx --exclude=jhalfs/* \`\n" >>logs/$this_script
|
echo -e "\nKB: \`du -skx --exclude=jhalfs \`\n" >>logs/$this_script
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
@ -314,8 +314,8 @@ wrt_run_as_chroot1() { #
|
||||||
local file=$2
|
local file=$2
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@\$(CHROOT1) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' && \\
|
@( time { \$(CHROOT1) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
|
||||||
echo -e "\nKB: \`du -skx --exclude=jhalfs/* \$(MOUNT_PT)\`\n" >>logs/${this_script}
|
echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/${this_script}
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
@ -328,8 +328,8 @@ wrt_run_as_chroot2() { #
|
||||||
local file=$2
|
local file=$2
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@\$(CHROOT2) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' && \\
|
@( time { \$(CHROOT2) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
|
||||||
echo -e "\nKB: \`du -skx --exclude=jhalfs/* \$(MOUNT_PT)\`\n" >>logs/${this_script}
|
echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/${this_script}
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
@ -341,22 +341,18 @@ wrt_copy_fstab() { #
|
||||||
local i=$1
|
local i=$1
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >logs/$i && \\
|
@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
|
||||||
cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1 && \\
|
|
||||||
echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >>logs/$i
|
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
wrt_copy_fstab2() { #
|
wrt_copy_fstab2() { #
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
local i=$1
|
local i=$1
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \`\n" >logs/$i && \\
|
@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
|
||||||
cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1 && \\
|
|
||||||
echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \`\n" >>logs/$i
|
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue