Skip to content

Commit 7867549

Browse files
committed
Draft.
1 parent fd929d6 commit 7867549

File tree

5 files changed

+125
-15
lines changed

5 files changed

+125
-15
lines changed

_lib/ubiquitous_bash

_prog/build-special.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,22 @@ _build_ubDistBuild-fetch() {
8686
cd "$functionEntryPWD"
8787

8888

89+
cd "$currentAccessoriesDir"/parts
90+
if [[ "$objectName" == "ubDistBuild" ]]
91+
then
92+
_gitBest clone --recursive [email protected]:soaringDistributions/"$objectName".git
93+
else
94+
_gitBest clone --recursive [email protected]:mirage335/"$objectName".git
95+
fi
96+
97+
mkdir -p "$currentAccessoriesDir"/parts/"$objectName"
98+
cd "$currentAccessoriesDir"/parts/"$objectName"
99+
if [[ ! -e ./.git ]]
100+
then
101+
cp -a "$scriptAbsoluteFolder"/.git ./
102+
fi
103+
89104

90-
mkdir -p "$currentAccessoriesDir"/parts/ubDistBuild
91-
cd "$currentAccessoriesDir"/parts/ubDistBuild
92-
cp -a "$scriptAbsoluteFolder"/.git ./
93105
#git config gc.pruneExpire now
94106
#git config gc.reflogExpire now
95107
#git config gc.reflogExpireUnreachable now

_prog/features.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,49 @@ _setup_vm-wsl2_sequence() {
319319
_userMSW _messagePlain_probe wsl --import ubdist '/cygdrive/c/core/infrastructure/ubdist_wsl' "$scriptLocal"/package_rootfs.tar --version 2
320320
_userMSW wsl --import ubdist '/cygdrive/c/core/infrastructure/ubdist_wsl' "$scriptLocal"/package_rootfs.tar --version 2
321321

322+
323+
# Preserve fallback and rootfs if automatic test is successful. Expected to suffice for rebuilding 'ubdist' or other dist/OS from an MSW host if necessary.
324+
if wsl -d "ubdist" /bin/true > /dev/null 2>&1 && ! wsl -d "ubdist" /bin/false > /dev/null 2>&1 && wsl -d ubdist /home/user/ubiquitous_bash.sh _true && ! wsl -d ubdist /home/user/ubiquitous_bash.sh _false
325+
then
326+
_messagePlain_good 'good: wsl: ubdist: true/false'
327+
328+
mkdir -p '/cygdrive/c/core/infrastructure/ubdist_wsl_recovery/autotest_success'
329+
cp "$scriptLocal"/package_rootfs.tar '/cygdrive/c/core/infrastructure/ubdist_wsl_recovery/autotest_success/package_rootfs.tar'
330+
331+
mkdir -p '/cygdrive/c/core/infrastructure/ubdist_wsl_fallback'
332+
_userMSW _messagePlain_probe wsl --import ubdist_fallback '/cygdrive/c/core/infrastructure/ubdist_wsl_fallback' "$scriptLocal"/package_rootfs.tar --version 2
333+
_userMSW wsl --import ubdist_fallback '/cygdrive/c/core/infrastructure/ubdist_wsl_fallback' "$scriptLocal"/package_rootfs.tar --version 2
334+
335+
if wsl -d "ubdist" /bin/true > /dev/null 2>&1 && ! wsl -d "ubdist" /bin/false > /dev/null 2>&1 && wsl -d ubdist /home/user/ubiquitous_bash.sh _true && ! wsl -d ubdist /home/user/ubiquitous_bash.sh _false
336+
then
337+
_messagePlain_good 'good: wsl: ubdist_fallback: true/false'
338+
else
339+
_messagePlain_bad 'fail: wsl: ubdist_fallback: true/false'
340+
sleep 15
341+
_messageFAIL
342+
_stop 1
343+
return 1
344+
fi
345+
346+
if [[ -e '/cygdrive/c/core/infrastructure/ubdist_wsl_recovery/autotest_success/package_rootfs.tar' ]]
347+
then
348+
_messagePlain_good 'good: autotest_success: package_rootfs.tar'
349+
else
350+
_messagePlain_bad 'fail: autotest_success: package_rootfs.tar'
351+
sleep 15
352+
_messageFAIL
353+
_stop 1
354+
return 1
355+
fi
356+
else
357+
_messagePlain_bad 'fail: wsl: ubdist: true/false'
358+
sleep 15
359+
_messageFAIL
360+
_stop 1
361+
return 1
362+
fi
363+
364+
322365
_messagePlain_probe wsl --set-default ubdist
323366
wsl --set-default ubdist
324367

compile.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _ub_cksum_special_derivativeScripts_contents() {
3636
#export ub_setScriptChecksum_disable='true'
3737
( [[ -e "$0".nck ]] || [[ "${BASH_SOURCE[0]}" != "${0}" ]] || [[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]] || [[ "$1" == '--compressed' ]] || [[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]] ) && export ub_setScriptChecksum_disable='true'
3838
export ub_setScriptChecksum_header='2591634041'
39-
export ub_setScriptChecksum_contents='1928957248'
39+
export ub_setScriptChecksum_contents='3498338440'
4040

4141
# CAUTION: Symlinks may cause problems. Disable this test for such cases if necessary.
4242
# WARNING: Performance may be crucial here.
@@ -277,8 +277,8 @@ fi
277277

278278

279279
# ATTENTION: Highly irregular. Workaround due to gsch2pcb installed by nix package manager not searching for installed footprints.
280-
if [[ "$NIX_PROFILES" != "" ]]
281-
then
280+
#if [[ "$NIX_PROFILES" != "" ]]
281+
#then
282282
if [[ -e "$HOME"/.nix-profile/bin/gsch2pcb ]] && [[ -e /usr/local/share/pcb/newlib ]] && [[ -e /usr/local/lib/pcb_lib ]]
283283
then
284284
gsch2pcb() {
@@ -290,7 +290,7 @@ then
290290
"$HOME"/.nix-profile/bin/gsch2pcb --elements-dir /usr/share/pcb/pcblib-newlib "$@"
291291
}
292292
fi
293-
fi
293+
#fi
294294

295295

296296
# Only production use is Inter-Process Communication (IPC) loops which may be theoretically impossible to make fully deterministic under Operating Systems which do not have hard-real-time kernels and/or may serve an unlimited number of processes.

ubiquitous_bash.sh

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _ub_cksum_special_derivativeScripts_contents() {
3636
#export ub_setScriptChecksum_disable='true'
3737
( [[ -e "$0".nck ]] || [[ "${BASH_SOURCE[0]}" != "${0}" ]] || [[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]] || [[ "$1" == '--compressed' ]] || [[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]] ) && export ub_setScriptChecksum_disable='true'
3838
export ub_setScriptChecksum_header='2591634041'
39-
export ub_setScriptChecksum_contents='1900127426'
39+
export ub_setScriptChecksum_contents='2814606825'
4040

4141
# CAUTION: Symlinks may cause problems. Disable this test for such cases if necessary.
4242
# WARNING: Performance may be crucial here.
@@ -277,8 +277,8 @@ fi
277277

278278

279279
# ATTENTION: Highly irregular. Workaround due to gsch2pcb installed by nix package manager not searching for installed footprints.
280-
if [[ "$NIX_PROFILES" != "" ]]
281-
then
280+
#if [[ "$NIX_PROFILES" != "" ]]
281+
#then
282282
if [[ -e "$HOME"/.nix-profile/bin/gsch2pcb ]] && [[ -e /usr/local/share/pcb/newlib ]] && [[ -e /usr/local/lib/pcb_lib ]]
283283
then
284284
gsch2pcb() {
@@ -290,7 +290,7 @@ then
290290
"$HOME"/.nix-profile/bin/gsch2pcb --elements-dir /usr/share/pcb/pcblib-newlib "$@"
291291
}
292292
fi
293-
fi
293+
#fi
294294

295295

296296
# Only production use is Inter-Process Communication (IPC) loops which may be theoretically impossible to make fully deterministic under Operating Systems which do not have hard-real-time kernels and/or may serve an unlimited number of processes.
@@ -43099,10 +43099,22 @@ _build_ubDistBuild-fetch() {
4309943099
cd "$functionEntryPWD"
4310043100

4310143101

43102+
cd "$currentAccessoriesDir"/parts
43103+
if [[ "$objectName" == "ubDistBuild" ]]
43104+
then
43105+
_gitBest clone --recursive [email protected]:soaringDistributions/"$objectName".git
43106+
else
43107+
_gitBest clone --recursive [email protected]:mirage335/"$objectName".git
43108+
fi
43109+
43110+
mkdir -p "$currentAccessoriesDir"/parts/"$objectName"
43111+
cd "$currentAccessoriesDir"/parts/"$objectName"
43112+
if [[ ! -e ./.git ]]
43113+
then
43114+
cp -a "$scriptAbsoluteFolder"/.git ./
43115+
fi
43116+
4310243117

43103-
mkdir -p "$currentAccessoriesDir"/parts/ubDistBuild
43104-
cd "$currentAccessoriesDir"/parts/ubDistBuild
43105-
cp -a "$scriptAbsoluteFolder"/.git ./
4310643118
#git config gc.pruneExpire now
4310743119
#git config gc.reflogExpire now
4310843120
#git config gc.reflogExpireUnreachable now
@@ -43673,6 +43685,49 @@ _setup_vm-wsl2_sequence() {
4367343685
_userMSW _messagePlain_probe wsl --import ubdist '/cygdrive/c/core/infrastructure/ubdist_wsl' "$scriptLocal"/package_rootfs.tar --version 2
4367443686
_userMSW wsl --import ubdist '/cygdrive/c/core/infrastructure/ubdist_wsl' "$scriptLocal"/package_rootfs.tar --version 2
4367543687

43688+
43689+
# Preserve fallback and rootfs if automatic test is successful. Expected to suffice for rebuilding 'ubdist' or other dist/OS from an MSW host if necessary.
43690+
if wsl -d "ubdist" /bin/true > /dev/null 2>&1 && ! wsl -d "ubdist" /bin/false > /dev/null 2>&1 && wsl -d ubdist /home/user/ubiquitous_bash.sh _true && ! wsl -d ubdist /home/user/ubiquitous_bash.sh _false
43691+
then
43692+
_messagePlain_good 'good: wsl: ubdist: true/false'
43693+
43694+
mkdir -p '/cygdrive/c/core/infrastructure/ubdist_wsl_recovery/autotest_success'
43695+
cp "$scriptLocal"/package_rootfs.tar '/cygdrive/c/core/infrastructure/ubdist_wsl_recovery/autotest_success/package_rootfs.tar'
43696+
43697+
mkdir -p '/cygdrive/c/core/infrastructure/ubdist_wsl_fallback'
43698+
_userMSW _messagePlain_probe wsl --import ubdist_fallback '/cygdrive/c/core/infrastructure/ubdist_wsl_fallback' "$scriptLocal"/package_rootfs.tar --version 2
43699+
_userMSW wsl --import ubdist_fallback '/cygdrive/c/core/infrastructure/ubdist_wsl_fallback' "$scriptLocal"/package_rootfs.tar --version 2
43700+
43701+
if wsl -d "ubdist" /bin/true > /dev/null 2>&1 && ! wsl -d "ubdist" /bin/false > /dev/null 2>&1 && wsl -d ubdist /home/user/ubiquitous_bash.sh _true && ! wsl -d ubdist /home/user/ubiquitous_bash.sh _false
43702+
then
43703+
_messagePlain_good 'good: wsl: ubdist_fallback: true/false'
43704+
else
43705+
_messagePlain_bad 'fail: wsl: ubdist_fallback: true/false'
43706+
sleep 15
43707+
_messageFAIL
43708+
_stop 1
43709+
return 1
43710+
fi
43711+
43712+
if [[ -e '/cygdrive/c/core/infrastructure/ubdist_wsl_recovery/autotest_success/package_rootfs.tar' ]]
43713+
then
43714+
_messagePlain_good 'good: autotest_success: package_rootfs.tar'
43715+
else
43716+
_messagePlain_bad 'fail: autotest_success: package_rootfs.tar'
43717+
sleep 15
43718+
_messageFAIL
43719+
_stop 1
43720+
return 1
43721+
fi
43722+
else
43723+
_messagePlain_bad 'fail: wsl: ubdist: true/false'
43724+
sleep 15
43725+
_messageFAIL
43726+
_stop 1
43727+
return 1
43728+
fi
43729+
43730+
4367643731
_messagePlain_probe wsl --set-default ubdist
4367743732
wsl --set-default ubdist
4367843733

0 commit comments

Comments
 (0)