All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: workaround for MS Windows' insanity (ignores partition types / hidden flag since 2018)
@ 2019-11-20 15:39 Marcel Partap
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Partap @ 2019-11-20 15:39 UTC (permalink / raw)
  To: nvinson234; +Cc: grub-devel

Thanks Nicholas,
that's actually a great idea. However, in the current set up, we use an ISO image as a loop device and boot from that.. as in:

> menuentry "Live-System (FSFW Uni Stick Xfce 1213m buster amd64 mit Persistenz)" {
>     echo -e " \n \n \n Bitte einen kleinen Moment Geduld.."
>     echo -e "(je nach USB-Stick braucht das System bis zu 5min zum Starten)"
>     set isofile=/boot/FSFW-Uni-Stick-Xfce_1213m_buster-amd64.hybrid.iso
>     loopback loop $isofile
>     linux (loop)/live/vmlinuz boot=live findiso=$isofile components locales=de_DE.UTF-8 keyboard-layouts=de timezone=Europe/Berlin utc=auto net.ifnames=0 persistence-label=linux-
> userdata,linux-systemconfig,linux-systemdata,linux-system persistence-encryption=none,luks persistence-storage=directory,file,filesystem mitigations=off rootpw=Risiko quiet loglevel=3 splash persistence
>     initrd (loop)/live/initrd.img
> }

It requires a bit of rework on our install script.. I'll try and report back. If it doesn't work (i.e. successfully boot without windumb asking to format), my previously proposed workaround wouldn't work either I guess.
Best regards,
#marcel

P.S.: (please cc, not on list)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: workaround for MS Windows' insanity (ignores partition types / hidden flag since 2018)
  2019-11-13 23:13 Marcel Partap
  2019-11-14  1:49 ` Vladimir 'phcoder' Serbinenko
@ 2019-11-18 12:01 ` Nicholas Vinson
  1 sibling, 0 replies; 5+ messages in thread
From: Nicholas Vinson @ 2019-11-18 12:01 UTC (permalink / raw)
  To: grub-devel

On 11/13/19 18:13, Marcel Partap wrote:
> Dear grub devs,
> as we have just last week released a hundred of our debian-based https://github.com/fsfw-dresden/usb-live-linux/ sticks .. and at the moment are rolling out a version for primary schools, I have stumbled over the pure stupidity that is Windows 10's handling of partitioned usb drives. As seems abundantly documented, windows changed its behaviour sometime last year and now blatantly ignores the hidden flag, displaying partitions regardless of type and prominently offering to format non-windows filesystems. I was somewhat shocked at this ridiculous demeanour.. After an hour of investigating this I found the very sole workaround was to set the partition type to 0 - empty/none. This was the only way to windows not show and offer to format partitions beyond the exchange FAT partition. Rejoicing, on restart I found out that grub would not proceed booting from a partition of type "empty". Now semantically, that is totally correct. However, in order to provide us with a coping mechanism for such live linux use scenarios, I propose to add a flag that overrides this code:
Why wouldn't the following work?

Partition 1: type: FAT32	Linux mount point:	/boot
Partition 2: type: 0		Linux mount point:	/

The kernel image, initramfs, and all the files GRUB needs to boot are 
placed in partition 1, the rest of Linux in partition 2.  At that point 
you won't be relying on GRUB to mount partition 2 as your initramfs 
would be handling it.

Regards,
Nicholas Vinson

>>    static inline int
>>    grub_msdos_partition_is_empty (int type)
>>    {
>>      return (type == GRUB_PC_PARTITION_TYPE_NONE);
>>    }
> to allow booting from partitions of type 0 empty/none.
> This should cause less confusion to the hundreds of young students atm wondering about "what the hell is formatting" ..
> 
> Best Regards,
> #marcel
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: workaround for MS Windows' insanity (ignores partition types / hidden flag since 2018)
@ 2019-11-18  7:44 Marcel Partap
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Partap @ 2019-11-18  7:44 UTC (permalink / raw)
  To: phcoder; +Cc: grub-devel

>> On Wed, 13 Nov 2019, 17:12 Marcel Partap, <address@hidden> wrote:
>> […] I propose to add a flag that overrides this code:
>>     >   static inline int
>>     >   grub_msdos_partition_is_empty (int type)
>>     >   {
>>     >     return (type == GRUB_PC_PARTITION_TYPE_NONE);
>>     >   }
>>     to allow booting from partitions of type 0 empty/none.
>>
From my limited impact analysis (rg -pzLuuC50 partition_is_empty), the only change in behaviour would be grub not failing to boot from such a partition.
Other opinions on this?

> Type 0 means that entry is empty and changing this is to expose bunch of garbage partition
Where would these come from? I never encountered a partition of type 0 in the wild.. No software seems to put partitions into the part table, then flag them as empty.. which is why this should be a no-impact fix, especially when it is a grub config flag.

> and this is behavior followed by other consumers like Linux and BSD.
Yes of course the current behaviour is default because it is sane. But in a world where insane software still plays a dominating rule, sometimes conscious non-sane workarounds can be an apt kludge.

> However we can assist you in finding a better solution. Did you already consider alternative partition maps? I'd try msdos+gpt or msdos+BSD or msdos+sunpc.

Yes I tried with hybrid DOS/GPT partition scheme, no dice.

> Another workaround is to put some fake FAT structures that will end up as showing as a FS. You can even put some explanation files there

That might be a way, but I would have no idea how to do that and it is somewhat more complex to apply..


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: workaround for MS Windows' insanity (ignores partition types / hidden flag since 2018)
  2019-11-13 23:13 Marcel Partap
@ 2019-11-14  1:49 ` Vladimir 'phcoder' Serbinenko
  2019-11-18 12:01 ` Nicholas Vinson
  1 sibling, 0 replies; 5+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2019-11-14  1:49 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

On Wed, 13 Nov 2019, 17:12 Marcel Partap, <mpartap@gmx.net> wrote:

> Dear grub devs,
> as we have just last week released a hundred of our debian-based
> https://github.com/fsfw-dresden/usb-live-linux/ sticks .. and at the
> moment are rolling out a version for primary schools, I have stumbled over
> the pure stupidity that is Windows 10's handling of partitioned usb drives.
> As seems abundantly documented, windows changed its behaviour sometime last
> year and now blatantly ignores the hidden flag, displaying partitions
> regardless of type and prominently offering to format non-windows
> filesystems. I was somewhat shocked at this ridiculous demeanour.. After an
> hour of investigating this I found the very sole workaround was to set the
> partition type to 0 - empty/none. This was the only way to windows not show
> and offer to format partitions beyond the exchange FAT partition.
> Rejoicing, on restart I found out that grub would not proceed booting from
> a partition of type "empty". Now semantically, that is totally correct.
> However, in order to provide us with a coping mechanism for such live linux
> use scenarios, I propose to add a flag that overrides this code:
> >   static inline int
> >   grub_msdos_partition_is_empty (int type)
> >   {
> >     return (type == GRUB_PC_PARTITION_TYPE_NONE);
> >   }
> to allow booting from partitions of type 0 empty/none.
>
Type 0 means that entry is empty and changing this is to expose bunch of
garbage partition and this is behavior followed by other consumers like
Linux and BSD.
However we can assist you in finding a better solution. Did you already
consider alternative partition maps? I'd try msdos+gpt or msdos+BSD or
msdos+sunpc. Dinner other schemes might also work. Another workaround is to
put some fake FAT structures that will end up as showing as a FS. You can
even put some explanation files there

> This should cause less confusion to the hundreds of young students atm
> wondering about "what the hell is formatting" ..
>
> Best Regards,
> #marcel
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #2: Type: text/html, Size: 3030 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* workaround for MS Windows' insanity (ignores partition types / hidden flag since 2018)
@ 2019-11-13 23:13 Marcel Partap
  2019-11-14  1:49 ` Vladimir 'phcoder' Serbinenko
  2019-11-18 12:01 ` Nicholas Vinson
  0 siblings, 2 replies; 5+ messages in thread
From: Marcel Partap @ 2019-11-13 23:13 UTC (permalink / raw)
  To: grub-devel

Dear grub devs,
as we have just last week released a hundred of our debian-based https://github.com/fsfw-dresden/usb-live-linux/ sticks .. and at the moment are rolling out a version for primary schools, I have stumbled over the pure stupidity that is Windows 10's handling of partitioned usb drives. As seems abundantly documented, windows changed its behaviour sometime last year and now blatantly ignores the hidden flag, displaying partitions regardless of type and prominently offering to format non-windows filesystems. I was somewhat shocked at this ridiculous demeanour.. After an hour of investigating this I found the very sole workaround was to set the partition type to 0 - empty/none. This was the only way to windows not show and offer to format partitions beyond the exchange FAT partition. Rejoicing, on restart I found out that grub would not proceed booting from a partition of type "empty". Now semantically, that is totally correct. However, in order to provide us with a coping mechanism for such live linux use scenarios, I propose to add a flag that overrides this code:
>   static inline int
>   grub_msdos_partition_is_empty (int type)
>   {
>     return (type == GRUB_PC_PARTITION_TYPE_NONE);
>   }
to allow booting from partitions of type 0 empty/none.
This should cause less confusion to the hundreds of young students atm wondering about "what the hell is formatting" ..

Best Regards,
#marcel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-20 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 15:39 workaround for MS Windows' insanity (ignores partition types / hidden flag since 2018) Marcel Partap
  -- strict thread matches above, loose matches on Subject: below --
2019-11-18  7:44 Marcel Partap
2019-11-13 23:13 Marcel Partap
2019-11-14  1:49 ` Vladimir 'phcoder' Serbinenko
2019-11-18 12:01 ` Nicholas Vinson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.