Full disk encryption Titanium PowerBook G4

"Scott C. MacCallum" <[email protected]> Wed, 29 Jan 2020 15:03:47 +0000
Newsgroups gmane.os.openbsd.ppc
Message-ID <semrqsbB8qOzCo91rFAlhbGVVGT9kkHu9ioui-YT1J_dik5TEnLD4pivZ7X1P0kw-bzRPV3Hm6gpdsudv2o5xM9bfDvQytypMfKaKROHQfY=@protonmail.com>
Marcus,

"Since your $HOME is now on softraid(4) CRYPTO, you need a way do unlock your encrypted device before log in. What's you plan for that?"

That's a good question!

Scott

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, January 29, 2020 6:20 AM, <[email protected]> wrote:

> The pre-dawn daily digest
> Volume 1 : Issue 1155 : "text" Format
>
> Messages in this Issue:
> Full disk encryption Titanium PowerBook G4
> Re: Full disk encryption Titanium PowerBook G4
> Re: Full disk encryption Titanium PowerBook G4
> Re: Full disk encryption Titanium PowerBook G4
> Re: clang build kernel traps
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Date: Tue, 28 Jan 2020 14:57:21 +0000
> From: "Scott C. MacCallum" [email protected]
> To: "[email protected]" [email protected]
> Subject: Full disk encryption Titanium PowerBook G4
> Message-ID: B4NGALWloS_NdA33UCsAU9b42-5ZfUhKw4SP0lA72OA3ZGaCT1a1w1c5RaMZCRKKrkxwP64FQKtuWoyxfw-lP26UuSK9DKN8XfJhQakkzkw=@protonmail.com
>
> Good morning,
>
> I have a Titanium PowerBook G4 and I'd like to do full disk encryption before the installation of 6.6. I've referenced: https://www.openbsd.org/faq/faq14.html#softraidFDE and https://ftp.openbsd.org/pub/OpenBSD/6.6/macppc/INSTALL.macppc, making device changes where I think it's appropriate, but after installation I got the infamous blinking Mac folder.
>
> I've since successfully installed 6.6 without full disk encryption, so I suspect my failure is a result of picking a correct Open Firmware device-specifier.
>
> Has anyone had success with this?
>
> Scott
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Date: Tue, 28 Jan 2020 10:38:05 -0500
> From: Gao-Mi Baohao [email protected]
> To: "Scott C. MacCallum" [email protected]
> Cc: [email protected]
> Subject: Re: Full disk encryption Titanium PowerBook G4
> Message-ID: CACotH1k7t2CWuYafCaPvb4jzGq_qv01FHwFrT5JOu7dPLuwj3A@mail.gmail.com
>
> Scott:
>
> The last time I messed with it, booting from crypto softraid was not
> supported on macppc (only i386, amd64, and sparc64). The man page for
> softraid ( https://man.openbsd.org/softraid.4 ) seems to confirm that this
> is still the case.
>
> It looks like the openbsd macppc loader simply does not support softraid
> volumes at this time.
>
> Most recently, when I was looking for something similar on an aluminum g4
> powerbook, I ended up just doing an encrypted home slice, unlocked at boot
> from rc.local (for example, see http://astro-gr.org/openbsd-encrypt-home/ ).
>
> On Tue, Jan 28, 2020, 9:57 AM Scott C. MacCallum [email protected]
> wrote:
>
> > Good morning,
> > I have a Titanium PowerBook G4 and I'd like to do full disk encryption
> > before the installation of 6.6. I've referenced:
> > https://www.openbsd.org/faq/faq14.html#softraidFDE and
> > https://ftp.openbsd.org/pub/OpenBSD/6.6/macppc/INSTALL.macppc, making
> > device changes where I think it's appropriate, but after installation I got
> > the infamous blinking Mac folder.
> > I've since successfully installed 6.6 without full disk encryption, so I
> > suspect my failure is a result of picking a correct Open Firmware
> > device-specifier.
> > Has anyone had success with this?
> > Scott
>
> --
>
> Date: Tue, 28 Jan 2020 17:52:10 +0000
> From: "Scott C. MacCallum" [email protected]
> To: Gao-Mi Baohao [email protected]
> Cc: "[email protected]" [email protected]
> Subject: Re: Full disk encryption Titanium PowerBook G4
> Message-ID: Z6FnlR0WYd6Btkubuscj0SCkBw-WaLZBgUZ7GG_ZEB1Ki0jJVXLsfQ9lGAAAs36Fkw1rqKOkhBIaLWEaIUcID5C6i34zN0X_nqWEj84U-6A=@protonmail.com
>
> Gao-Mi:
>
> Thanks for your response. It makes me feel better to know that the failure wasn't my doing. Thank you for sharing the encrypted home slice resource. I'm looking forward to giving that a shot.
>
> Scott
>
> Sent with ProtonMail Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Tuesday, January 28, 2020 10:38 AM, Gao-Mi Baohao [email protected] wrote:
>
> > Scott:
> > The last time I messed with it, booting from crypto softraid was not supported on macppc (only i386, amd64, and sparc64). The man page for softraid ( https://man.openbsd.org/softraid.4 ) seems to confirm that this is still the case.
> > It looks like the openbsd macppc loader simply does not support softraid volumes at this time.
> > Most recently, when I was looking for something similar on an aluminum g4 powerbook, I ended up just doing an encrypted home slice, unlocked at boot from rc.local (for example, see http://astro-gr.org/openbsd-encrypt-home/ ).
> > On Tue, Jan 28, 2020, 9:57 AM Scott C. MacCallum [email protected] wrote:
> >
> > > Good morning,
> > > I have a Titanium PowerBook G4 and I'd like to do full disk encryption before the installation of 6.6. I've referenced: https://www.openbsd.org/faq/faq14.html#softraidFDE and https://ftp.openbsd.org/pub/OpenBSD/6.6/macppc/INSTALL.macppc, making device changes where I think it's appropriate, but after installation I got the infamous blinking Mac folder.
> > > I've since successfully installed 6.6 without full disk encryption, so I suspect my failure is a result of picking a correct Open Firmware device-specifier.
> > > Has anyone had success with this?
> > > Scott
>
> Date: Wed, 29 Jan 2020 11:18:17 +0100
> From: Marcus MERIGHI [email protected]
> To: "Scott C. MacCallum" [email protected]
> Cc: [email protected]
> Subject: Re: Full disk encryption Titanium PowerBook G4
> Message-ID: [email protected]
>
> Hello,
>
> [email protected] (Scott C. MacCallum), 2020.01.28 (Tue) 18:52 (CET):
>
> > Thank you for sharing the encrypted home slice resource. I'm looking
> > forward to giving that a shot.
>
> I'd recommend two slices on the encrypted device. One small one (5GB)
> and a large one (in my case 850GB). Make the small one the "a" slice and
> the large one the "d" slice. Mount the small one as $HOME, the large one
> as $HOME/data (or whatever you like).
>
> This way, if you crash your system and fsck(8) needs to be run, you get
> to access your $HOME fast and not only after fsck has finished on the
> large slice.
>
> Since your $HOME is now on softraid(4) CRYPTO, you need a way do unlock
> your encrypted device before log in. What's you plan for that?
>
> Marcus
>
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> > On Tuesday, January 28, 2020 10:38 AM, Gao-Mi Baohao [email protected] wrote:
> >
> > > Scott:
> > > The last time I messed with it, booting from crypto softraid was not
> > > supported on macppc (only i386, amd64, and sparc64). The man page
> > > for softraid ( https://man.openbsd.org/softraid.4 ) seems to confirm
> > > that this is still the case.
> > > It looks like the openbsd macppc loader simply does not support
> > > softraid volumes at this time.
> > > Most recently, when I was looking for something similar on an
> > > aluminum g4 powerbook, I ended up just doing an encrypted home
> > > slice, unlocked at boot from rc.local (for example, see
> > > http://astro-gr.org/openbsd-encrypt-home/ ).
> > > On Tue, Jan 28, 2020, 9:57 AM Scott C. MacCallum [email protected] wrote:
> > >
> > > > Good morning,
> > > > I have a Titanium PowerBook G4 and I'd like to do full disk
> > > > encryption before the installation of 6.6. I've referenced:
> > > > https://www.openbsd.org/faq/faq14.html#softraidFDE and
> > > > https://ftp.openbsd.org/pub/OpenBSD/6.6/macppc/INSTALL.macppc,
> > > > making device changes where I think it's appropriate, but after
> > > > installation I got the infamous blinking Mac folder.
> > > > I've since successfully installed 6.6 without full disk encryption,
> > > > so I suspect my failure is a result of picking a correct Open
> > > > Firmware device-specifier.
> > > > Has anyone had success with this?
> > > > Scott
>
> --
>
> Date: Wed, 29 Jan 2020 00:11:40 -0500
> From: George Koehler [email protected]
> To: rgc [email protected]
> Cc: [email protected]
> Subject: Re: clang build kernel traps
> Message-ID: [email protected]
>
> On Wed, 22 Jan 2020 06:36:17 +0900
> rgc [email protected] wrote:
>
> > --- gcc4-obj/locore.s Wed Jan 22 04:29:10 2020
> > +++ clang-obj/locore.s Wed Jan 22 04:29:05 2020
> > ...
>
> You might have found a problem with mftb (move from time base) in
> clang's assembler. Some of the other differences in your disassembly
> might not cause problems.
>
> This is a sample of the differences:
>
> $ cat sample.s
> lwz %r31,battable+4@l(%r31)
> mftb %r28
> bla s_dsitrap
> bc 4,17,s_trap
> addi %r30,%r30,idledone@l
> nop
> s_dsitrap:
> nop
> cpu_switchto_asm:
> nop
> idledone:
> nop
> $ gcc -c sample.s
> $ clang -c -o sample-clang.o sample.s
> $ objdump -d sample.o > sample.ds
> $ objdump -d sample-clang.o > sample-clang.ds
> fishport$ diff -u sample.ds sample-clang.ds
> ...
> 00000000 <s_dsitrap-0x18>:
>
> -   0: 83 ff 00 04 lwz r31,4(r31)
> -   4: 7f 8c 42 e6 mftb r28
> -   8: 48 00 00 1b bla 18 <s_dsitrap>
>
> -   0: 83 ff 00 00 lwz r31,0(r31)
>
> -   4: 7f 8c 42 a6 mfspr r28,268
>
> -   8: 48 00 00 03 bla 0 <s_dsitrap-0x18>
>     c: 40 91 00 10 ble- cr4,1c <s_trap>
>
>
> -   10: 3b de 00 20 addi r30,r30,32
>
> -   10: 3b de 00 00 addi r30,r30,0
>     14: 60 00 00 00 nop
>     ...
>
>     The change from 4 to 0 in 'lwz r31,4(r31)' is not significant if the
>     relocation for 'battable+4@l' overwrites the 4 or 0 with a different
>     value. I see that gcc and clang use the same relocations:
>
>     =begin
>     $ readelf -r sample.o sample-clang.o
>
>     File: sample.o
>
>     Relocation section '.rela.text' at offset 0x270 contains 3 entries:
>     Offset Info Type Sym.Value Sym. Name + Addend
>     00000002 00000704 R_PPC_ADDR16_LO 00000000 battable + 4
>     00000008 00000102 R_PPC_ADDR24 00000000 .text + 18
>     00000012 00000104 R_PPC_ADDR16_LO 00000000 .text + 20
>
>     File: sample-clang.o
>
>     Relocation section '.rela.text' at offset 0xc8 contains 3 entries:
>     Offset Info Type Sym.Value Sym. Name + Addend
>     00000002 00000604 R_PPC_ADDR16_LO 00000000 battable + 4
>     00000008 00000502 R_PPC_ADDR24 00000000 .text + 18
>     00000012 00000504 R_PPC_ADDR16_LO 00000000 .text + 20
>     =end
>
>     Both gcc and clang use 'battable + 4' as the relocation for the
>     'battable+4@l' in the source code, so the 4 is not lost. Each
>     relocation has a different symbol index (Info >> 8, see ELF32_R_SYM in
>
>
> <sys/exec_elf.h>) because gcc and clang wrote the symbols in a
>
> different order (readelf -s *.o), but the symbols 'battable' and
> '.text' are the same.
>
> Branches with predictions like bge- beq+ bne- might differ, because
> newer versions of the Power ISA changed how to set the branch
> prediction bits (but tried to be backward-compatible).
>
> I recall that mftb (move from time base) is different between 32-bit
> and 64-bit PowerPC, and suspect that clang might be using the wrong
> mftb for our 32-bit target, but I won't know until I check the ISA
> manual.
>
> --George
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> End of [ppc] Daily digest, Issue 1155 (5 messages)