medium change set

This commit is contained in:
Danieliskot
2023-12-26 00:38:18 +01:00
parent 51ad55627c
commit 09218bf9b4
7 changed files with 60 additions and 49 deletions
+7 -9
View File
@@ -1,16 +1,14 @@
#!/usr/bin/env bash
#set -eET -o pipefail
export setCompatFlags top
grep -q -- -x <<<"${setCompatFlags}"&&set -x
grep -q -- -n <<<"${setCompatFlags}"&&set -n
grep -q -- -v <<<"${V}"&&set -v
#trap 'echo $(basename ${BASH_SOURCE[0]}):${LINENO}: "${BASH_COMMAND}"' DEBUG
export setCompatFlags top LMK setCompatFlags
trap 'rm -rf ${TOP}/${INITRAMFS}{,.img};exit ${?}' INT TERM
cd "$(dirname $(readlink -f ${0}))"||false
. ../.config||false
trap 'rm -rf ${TOP}/${INITRAMFS}{,.img};exit ${?}' HUP INT QUIT ILL TRAP ABRT TERM
#add more ELFs, if need ;)
list=(bash tar e2fsck fsck.fat f2fs mdadm mount.ntfs-3g blkid)
list=(bash blkid tar e2fsck fsck.fat fsck.f2fs mdadm mount.ntfs-3g)
# copy file to initramfs tree, including
# all library dependencies (as shown by ldd)
@@ -53,10 +51,10 @@ incDynElf()
return ${?}
}
mkdir -p $([ ${V} ]&&echo ${V}) ${INITRAMFS}/{bin,dev,etc,lib{32,64,x32,},mnt,proc,root,run,sys,tmp,usr{,/local}/{sbin,bin,lib{32,64,x32,}},var/log}
mkdir -p ${INITRAMFS}/{bin,dev,etc,lib{32,64,x32,},mnt,proc,root,run,sys,tmp,usr{,/local}/{sbin,bin,lib{32,64,x32,}},var/log}
# If bb is not found use all static prebuilt
incDynElf busybox || { cp -f $([ ${V} ]&&echo ${V}) static/busybox ${INITRAMFS}/bin;static=true; }
incDynElf busybox || { cp -f static/busybox ${INITRAMFS}/bin;static=true; }
for i in $(${INITRAMFS}/bin/busybox --list|egrep -v "tar|init|blkid"); do ln -sf $([ ${V} ]&&echo ${V}) busybox ${INITRAMFS}/bin/$i; done
mknod ${INITRAMFS}/dev/console c 5 1
@@ -92,7 +90,7 @@ echo "root::0:0::/root:/bin/bash" >${INITRAMFS}/etc/passwd
cp -f $([ ${V} ]&&echo ${V}) functions ${INITRAMFS}/lib
cp -f $([ ${V} ]&&echo ${V}) init shutdown ${INITRAMFS}
ln -sf -$([ ${V} ]&&echo ${V}) ../init ${INITRAMFS}/bin/init
ln -sf $([ ${V} ]&&echo ${V}) ../init ${INITRAMFS}/bin/init
cp -f $([ ${V} ]&&echo ${V}) ../.config ${INITRAMFS}/lib
chmod a+x -R $([ ${V} ]&&echo ${V}) ${INITRAMFS}
+7 -8
View File
@@ -25,14 +25,13 @@ d()
m()
{
case "${1}" in
q) printf '%s' "[Question]: ${2}";;
a) printf '%s' "[Answer]: ${2}";;
A) printf '%s' "[Action]: ${2}";;
i) printf '%s' "[Info]: ${2}";;
w) printf '%s' "[Warning]: ${2}";;
e) printf '%s' "[Error]: ${2}";;
f) printf '%s' "[Fatal]: ${2}";;
*) printf '%s' "${1}";;
q) echo -e "[Question]: ${2}";;
A) echo -e "[Action]: ${2}";;
i) echo -e "[Info]: ${2}";;
w) echo -e "[Warning]: ${2}";;
e) echo -e "[Error]: ${2}";;
f) echo -e "[Fatal]: ${2}";;
*) echo -e "${1}";;
esac
}
rp()
+1 -1
View File
@@ -21,7 +21,7 @@ exec >/dev/console >&1 2>&1 <&1
[[ "${DEBUG_IS_ENABLED}" = "true" ]]&&set -x
debugShell
echo "Linux Live Framework - Shutdown Magic!"
echo "Entering to clean-up things before final step."
echo "Entering to clean-up things before ${action}..."
(
mdev -s
sleep 1.5