@@ -2447,11 +2447,14 @@ bootstrap_stage3() {
2447
2447
fi
2448
2448
2449
2449
# Avoid installing git or encryption just for fun while completing @system
2450
- # e.g. bug #901101
2451
- export USE=" ${DISABLE_USE[*]} "
2450
+ # e.g. bug #901101, this is a reduced (e.g. as minimal as possible)
2451
+ # set of DISABLE_USE, to set the stage for solving circular
2452
+ # dependencies, such as:
2453
+ # - nghttp2 -> cmake -> curl -> nghttp2
2454
+ export USE=" -git -crypt -http2"
2452
2455
2453
2456
# Portage should figure out itself what it needs to do, if anything.
2454
- local eflags=( " @system" )
2457
+ local eflags=( " --deep " " --update " " --changed-use " " @system" )
2455
2458
einfo " running emerge ${eflags[*]} "
2456
2459
estatus " stage3: emerge ${eflags[*]} "
2457
2460
emerge --color n -v " ${eflags[@]} " || return 1
@@ -2461,12 +2464,57 @@ bootstrap_stage3() {
2461
2464
# from happening, add to the worldfile #936629#c5
2462
2465
emerge --color n --noreplace sys-devel/binutils
2463
2466
2467
+ # Remove the stage2 hack from above. A future emerge run will
2468
+ # get env-update to happen.
2469
+ rm " ${ROOT} " /etc/env.d/98stage2
2470
+
2464
2471
# now try and get things in the way they should be according to the
2465
2472
# default USE-flags
2466
2473
unset USE
2467
2474
2468
- # Portage should figure out itself what it needs to do, if anything.
2469
- eflags=( " --deep" " --update" " --changed-use" " @world" )
2475
+ # do some sanity USE-flag enabling based on CPU, use cpuid2cpuflags
2476
+ # if keyworded for this arg, else see if there's fallbacks to be
2477
+ # made
2478
+ mkdir -p " ${ROOT} /etc/portage/package.use"
2479
+ if emerge --color n --oneshot -v cpuid2cpuflags ; then
2480
+ hash -r
2481
+ echo " */* $( cpuid2cpuflags) " \
2482
+ > " ${ROOT} /etc/portage/package.use/00cpu-flags"
2483
+ else
2484
+ case " ${CHOST} " in
2485
+ arm64-* darwin* )
2486
+ # https://github.com/RustCrypto/utils/issues/378
2487
+ local flags=( " aes" " sha1" " sha2" )
2488
+ local line
2489
+ sysctl hw.optional | while read -r line ; do
2490
+ line=${line# hw.optional.}
2491
+ [[ ${line%%*: } == " 1" ]] || continue
2492
+ line=${line%: * }
2493
+ case " ${line} " in
2494
+ " neon" )
2495
+ flags+=( " ${line} " )
2496
+ ;;
2497
+ " armv8_" * )
2498
+ line=${line# armv8_}
2499
+ case " ${line} " in
2500
+ " crc32" )
2501
+ flags+=( " ${line} " )
2502
+ ;;
2503
+ " 2_sha" * )
2504
+ flags+=( " ${line# 2_} " )
2505
+ ;;
2506
+ esac
2507
+ ;;
2508
+ esac
2509
+ done
2510
+ echo " */* CPU_FLAGS_ARM: ${flags} " \
2511
+ > " ${ROOT} /etc/portage/package.use/00cpu-flags"
2512
+ ;;
2513
+ esac
2514
+ fi
2515
+
2516
+ # re-emerge anything hopefully not running into circular deps
2517
+ eflags=( " --deep" " --changed-use" " @world" )
2470
2518
einfo " running emerge ${eflags[*]} "
2471
2519
estatus " stage3: emerge ${eflags[*]} "
2472
2520
emerge --color n -v " ${eflags[@]} " || return 1
@@ -2480,10 +2528,6 @@ bootstrap_stage3() {
2480
2528
# (--depclean may fail, which is ok)
2481
2529
sed -i -e ' s/resume/cleared/' " ${ROOT} " /var/cache/edb/mtimedb
2482
2530
2483
- # Remove the stage2 hack from above. A future emerge run will
2484
- # get env-update to happen.
2485
- rm " ${ROOT} " /etc/env.d/98stage2
2486
-
2487
2531
estatus " stage3 finished"
2488
2532
einfo " stage3 successfully finished"
2489
2533
}
@@ -3145,7 +3189,7 @@ OK! I'm going to give it a try, this is what I have collected sofar:
3145
3189
I'm now going to make an awful lot of noise going through a sequence of
3146
3190
stages to make your box as groovy as I am myself, setting up your
3147
3191
Prefix. In short, I'm going to run stage1, stage2, stage3, followed by
3148
- an emerge to do a final update to your system . If any of these stages
3192
+ installing a package to enter your Prefix . If any of these stages
3149
3193
fail, both you and me are in deep trouble. So let's hope that doesn't
3150
3194
happen.
3151
3195
EOF
@@ -3304,87 +3348,13 @@ EOF
3304
3348
3305
3349
[[ ${STOP_BOOTSTRAP_AFTER} == stage3 ]] && exit 0
3306
3350
3307
- # do some sanity USE-flag enabling based on CPU, use cpuid2cpuflags
3308
- # if keyworded for this arg, else see if there's fallbacks to be
3309
- # made
3310
- mkdir -p " ${EPREFIX} /etc/portage/package.use"
3311
- if emerge -1v cpuid2cpuflags ; then
3312
- hash -r
3313
- echo " */* $( cpuid2cpuflags) " \
3314
- > " ${EPREFIX} /etc/portage/package.use/00cpu-flags"
3315
- else
3316
- case " ${CHOST} " in
3317
- arm64-* darwin* )
3318
- # https://github.com/RustCrypto/utils/issues/378
3319
- local flags=( " aes" " sha1" " sha2" )
3320
- local line
3321
- sysctl hw.optional | while read -r line ; do
3322
- line=${line# hw.optional.}
3323
- [[ ${line%%*: } == " 1" ]] || continue
3324
- line=${line%: * }
3325
- case " ${line} " in
3326
- " neon" )
3327
- flags+=( " ${line} " )
3328
- ;;
3329
- " armv8_" * )
3330
- line=${line# armv8_}
3331
- case " ${line} " in
3332
- " crc32" )
3333
- flags+=( " ${line} " )
3334
- ;;
3335
- " 2_sha" * )
3336
- flags+=( " ${line# 2_} " )
3337
- ;;
3338
- esac
3339
- ;;
3340
- esac
3341
- done
3342
- echo " */* CPU_FLAGS_ARM: ${flags} " \
3343
- > " ${EPREFIX} /etc/portage/package.use/00cpu-flags"
3344
- ;;
3345
- esac
3351
+ # Now, we've got everything in $ROOT, we can get rid of /tmp
3352
+ if [[ -d ${EPREFIX} /tmp/var/tmp ]] ; then
3353
+ rm -Rf " ${EPREFIX} " /tmp || return 1
3354
+ mkdir -p " ${EPREFIX} " /tmp || return 1
3346
3355
fi
3347
3356
3348
- local cmd=" emerge -v --deep --update --changed-use @world"
3349
- if [[ -e ${EPREFIX} /var/cache/edb/mtimedb ]] && \
3350
- grep -q resume " ${EPREFIX} " /var/cache/edb/mtimedb ;
3351
- then
3352
- cmd=" emerge -v --resume"
3353
- fi
3354
- einfo " running ${cmd} "
3355
- if ${cmd} ; then
3356
- # Now, we've got everything in $ROOT, we can get rid of /tmp
3357
- if [[ -d ${EPREFIX} /tmp/var/tmp ]] ; then
3358
- rm -Rf " ${EPREFIX} " /tmp || return 1
3359
- mkdir -p " ${EPREFIX} " /tmp || return 1
3360
- fi
3361
-
3362
- hash -r # tmp/* stuff is removed in stage3
3363
- else
3364
- # emerge @world fail
3365
- cat << EOF
3366
-
3367
- Oh yeah, I thought I was almost there, and then this! I did
3368
- ${cmd}
3369
- and it failed at some point :( Details might be found in the build log:
3370
- EOF
3371
- for log in " ${EPREFIX} " /var/tmp/portage/* /* /temp/build.log ; do
3372
- [[ -e ${log} ]] || continue
3373
- echo " ${log} "
3374
- done
3375
- [[ -e ${log} ]] || echo " (no build logs found?!?)"
3376
- cat << EOF
3377
- I have no clue, really. Please find friendly folks in #gentoo-prefix on
3378
- irc.gentoo.org, [email protected] mailing list, or file a bug
3379
- at bugs.gentoo.org under Gentoo/Alt, Prefix Support.
3380
- You know, I got the feeling you just started to like me, but I guess
3381
- that's all gone now. I'll bother you no longer.
3382
-
3383
- CHOST: ${CHOST}
3384
- IDENT: ${CHOST_IDENTIFY}
3385
- EOF
3386
- exit 1
3387
- fi
3357
+ hash -r # tmp/* stuff is removed in stage3
3388
3358
3389
3359
if ! bash " ${BASH_SOURCE[0]} " " ${EPREFIX} " startscript ; then
3390
3360
# startscript fail?
0 commit comments