View previous topic :: View next topic |
Author |
Message |
M3L6H n00b
Joined: 03 Apr 2016 Posts: 17
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Apr 04, 2016 6:59 pm Post subject: Re: Problems with setting up kernel with buildkernel |
|
|
M3L6H wrote: | I'm not quite sure what that's all about. Any help would be appreciated. Thanks! |
M3L6H ... ok, I now see where 'buildkernel' comes from ... again, please follow the handbook.
best ... khay |
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2573 Location: Here and Away Again
|
Posted: Mon Apr 04, 2016 7:05 pm Post subject: |
|
|
Moved from Installing Gentoo to Unsupported Software, as this seems to be about software that is not available via Portage at this time. _________________ Kindest of regardses. |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Mon Apr 04, 2016 9:14 pm Post subject: |
|
|
Where is the point in using a script from an overlay which you do not understand?
The gentoo handbook are the basics with researching the other parts to set up a box. I use gentoo for quite a while, i used linux for a much longer time, and i did needed to read about uefi and some special script commands to get my box running.
I also recommend, use the handbook please. Thank you.
@ mods, the guide refers to a script from an overlay |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Tue Apr 05, 2016 12:10 am Post subject: |
|
|
tw04l124 wrote: | Where is the point in using a script from an overlay which you do not understand? |
The wiki implies that Windows 8 & 10 require special handling to dual-boot. I've only dual booted with XP & below using the boot sector intended foe DOS/Win98.
Others boot grub and chainload Windows. I don't know if that works with UEFI. So be a little easier on him.
My sister has win 8. Ugh! And I wouldn't allow win 10 in the same HOUSE with my hardware. YMMV. |
|
Back to top |
|
|
M3L6H n00b
Joined: 03 Apr 2016 Posts: 17
|
Posted: Tue Apr 05, 2016 12:27 am Post subject: |
|
|
Glad to see someone understands. Anyway, I’ve gotten in touch with the maker of the overlay, so we'll see what comes of that. |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Tue Apr 05, 2016 8:03 am Post subject: |
|
|
Tony0945 wrote: | The wiki implies that Windows 8 & 10 require special handling to dual-boot. |
Could you please point us to the exact section where this is written? A windows 10 dual-boot with Gentoo is as easy as was with windows 7. At least with msdos partition table. |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Tue Apr 05, 2016 8:25 am Post subject: Re: Problems with setting up kernel with buildkernel |
|
|
Code: | if [[ "${ISUSBPART[${CANONPART}]-0}" == "1" ]]; then | is borked as the bracketing is fubared; one reason I do not favour excessive bracketing, is that it's harder to spot mistakes.
For an associative array, it should be: Code: | if [[ ${ISUSBPART["${CANONPART:-0}"]} = 1 ]]; then |
With just - and not :- the default selection would never happen, since the variable has been assigned a value (it may be empty, but it's been assigned.)
If that is a standard array (integer-based, not associative) it is unnecessary to supply a default value, since that is an arithmetic context:
Code: | if [[ ${ISUSBPART[CANONPART]} = 1 ]]; then |
The whole function would be cleaner as: Code: | partuuid_is_usb() {
local p=$(readlink --canonicalize "${PARTUUIDDEVDIR}/${1,,}")
[[ ${ISUSBPART[p]} = 1 ]]
} |
or: Code: | [[ ${ISUSBPART["${p:-0}"]} = 1 ]] | if that's an associative array (declare -A arr) |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Apr 05, 2016 8:26 am Post subject: |
|
|
charles17 wrote: | Tony0945 wrote: | The wiki implies that Windows 8 & 10 require special handling to dual-boot. |
Could you please point us to the exact section where this is written? A windows 10 dual-boot with Gentoo is as easy as was with windows 7. At least with msdos partition table. |
charles17 ... that would be 'legacy' MBR booting, and while that is one option efi booting is another. I didn't read the wiki in any depth but if anyone were taking this route then I'd suggest they read Roderick Smith's managing secure boot rather than follow that guide. The information is available, and besides configuring secure boot, there is no reason *not* to follow the handbook.
best ... khay |
|
Back to top |
|
|
M3L6H n00b
Joined: 03 Apr 2016 Posts: 17
|
Posted: Tue Apr 05, 2016 3:33 pm Post subject: |
|
|
Problem solved! Turns out (somehow this slipped my notice), my SSD was not GPT partitioned. So I had to modify the CRYPTPATHMAP parameter in the .conf file. I wasn't able to run buildkernel --easy-config this way, but I was able to run buildkernel --ask --verbose, and that worked out fine. |
|
Back to top |
|
|
Sakaki Guru
Joined: 21 May 2014 Posts: 409
|
Posted: Tue Apr 05, 2016 5:17 pm Post subject: Re: Problems with setting up kernel with buildkernel |
|
|
steveL wrote: | Code: | if [[ "${ISUSBPART[${CANONPART}]-0}" == "1" ]]; then | is borked as the bracketing is fubared) |
Actually it is as intended - the test is looking up a modified path in the ISUSBPART associative array and returning the value stored there (0 or 1) if previously seen, or a default value of 0 if not yet seen (unknown key); this returned value is then compared with 1 to decide what to do next. The default is needed because the script runs under set -u.
As M3L6H just noted, the underlying issue is that the buildkernel script is designed to work with GPT systems, not MBR. Nevertheless, it should fail gracefully in such a case (and notify the user to set CRYPTPATHMAP directly); I will add that to the next release. _________________ Regards,
sakaki |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Tue Apr 05, 2016 8:28 pm Post subject: |
|
|
afaik gpt is the way to go these days because of uefi / windows 10 constraints. i only remember from last september that i was forced to use gpt because of uefi or windows 10 or so... honestly forgot why |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Wed Apr 06, 2016 2:28 pm Post subject: Re: Problems with setting up kernel with buildkernel |
|
|
steveL wrote: | Code: | if [[ "${ISUSBPART[${CANONPART}]-0}" == "1" ]]; then | is borked as the bracketing is fubared) |
Sakaki wrote: | Actually it is as intended |
If it were "as intended" then you wouldn't get Code: | /usr/sbin/buildkernel: line 334: ISUSBPART: bad array subscript |
Quote: | the test is looking up a modified path in the ISUSBPART associative array and returning the value stored there (0 or 1) if previously seen, or a default value of 0 if not yet seen (unknown key); this returned value is then compared with 1 to decide what to do next. The default is needed because the script runs under set -u. |
OK, I see what you're saying; your intention is to use 0 when there is no matching value, and it is indeed an associative array.
Firstly, bash (as other ksh-derivatives) does not field-split inside [[.
However it does use fnmatch(3p) on the RHS of the = operator, which is a simple strcmp() in sh, or iow glob-matching; so the RHS of that is usually quoted when it's a parameter-expansion, to force simple strcmp() in effect.
For the specific, you don't even need the default value for your comparison (I should have spotted that before); you just need to quote the expansion of the array-index, as indicated for an associative array (which can have any string as index): Code: | [[ ${ISUSBPART["$p"]} = 1 ]] | You would not need to do this for an integer-based array, in the usual case, where indexing is equivalent to arithmetic context, so ${arr[i++]} works as expected.
The return value will be shell true (or 0) if the associative value is a 1, or false (1) if not, the same values you're returning currently.
(With no 'return' stmt the return value is the exit status of the last command run.)
You also would not need the default if you were using integer comparison, which is -eq in [[, but quicker with: Code: | ((${ISUSBPART["$p"]})) | as the last statement; an empty (or unset) value in arithmetic context is equivalent to 0.
I tend to use arithmetic context for that reason: it's quicker in bash.
Originally it was the ease of the C-style "uninitialised is 0" semantic, but greycat insists on initialisation. ;-) Still works for locals, though declare -i a b c works better.
#bash are your (sometimes grumpy;) friends.
HTH,
steveL |
|
Back to top |
|
|
|