Re: [Gta04-owner] Antwort: Re: QtMoko reloaded

2018-03-01 Thread Andreas Kemnade
Hi,

On Thu, 1 Mar 2018 19:16:43 +0100
"H. Nikolaus Schaller"  wrote:
 
> > Maybe makesd also should display a list what it wants to do
> > asking for final confirmation  
> 
> No, that is a barrier for easy useage.
> 
Depends on the amount of information you display.
Not every detail like which kernel, etc.
If you quickly see wrong things, like an unusual size,
it can be helpful. If your qtmoko partition will
be of 1000GB size, you would probably abort.

Or you can print model name of the device.

So just enough information to ring alarm bells but
not too much that you do not see critical things

Maybe that confirmation will be only enabled if
.makesd.conf is not available. So it does not break
you mass-production of production-test sdcards.

Regards,
Andreas


pgpAC2UnwougW.pgp
Description: OpenPGP digital signature
___
Gta04-owner mailing list
Gta04-owner@goldelico.com
http://lists.goldelico.com/mailman/listinfo.cgi/gta04-owner


Re: [Gta04-owner] Antwort: Re: QtMoko reloaded

2018-03-01 Thread Andreas Kemnade
On Thu, 1 Mar 2018 18:48:30 +0100
"H. Nikolaus Schaller"  wrote:

> > 
> > Accessing "/dev/sdc" is completely wrong and luckily I had no "/dev/sdc" 
> > that could be erased! The same is true for "/media/P"!   
> 
> Well, it is impossible to perfectly prevent erasing the wrong device, because 
> only the user can know what the SD card reader with an SD really is.
> So it is equally risky as calling fdisk directly.
> 
No,
if you call fdisk you see what disk you use.
Here Sven thought, makesd would access /dev/sdg
but did access /dev/sdc!

That is a different thing.
fdisk does not do any writes when it is called without a device name to
work on!
makesd does.

Sven's sudo construction is just equal to calling
makesd *without* DEV set!!!

In that case makesd should not take a predefined device.

Maybe makesd also should display a list what it wants to do
asking for final confirmation

The best thing would be to call makesd from NAND with a graphical
interface.

> There is at least one protection: you can't overwrite /dev/sda.
> 
> What you could do is to just sudo chmod o+rw /dev/your-sd-reader
> but I am not sure what happens with newly created partitions.
> 
No, that would not work, because you want to mount the device and
create device nodes on it, which would require root privileges again.

Regards,
Andreas


pgpp_pifJLwea.pgp
Description: OpenPGP digital signature
___
Gta04-owner mailing list
Gta04-owner@goldelico.com
http://lists.goldelico.com/mailman/listinfo.cgi/gta04-owner


Re: [Gta04-owner] Antwort: Re: QtMoko reloaded

2018-03-01 Thread H. Nikolaus Schaller
Hi,

> Am 01.03.2018 um 17:31 schrieb Sven Dyroff :
> 
> Hello Nikolaus, 
> 
> > Hm. Do you have a non-whitespace white space? Happens sometimes when 
> > copying UTF charactersto a terminal. 
> 
> Ok, after typing the command by hand I got the error that I have no rights to 
> do that. So modified the command once again: 
> 
> DEV=/dev/sdg sudo ./makesd qtmoko -r 
> http://download.goldelico.com/letux-debian-rootfs/20180224-wheezy-7.11-armhf-qtmoko.tbz
>  
> 
>  

Ah, ok. Well, it seems to protect the user :)

I usually use an SD card reader of some SBC where I did ssh root access to so I 
never thought
about needing sudo.

Maybe we should add a check that you really have write access to the specified 
device.

> 
> Now it worked and created the SD card. 

Fine!

> 
> But please note that in the end I got: 
> 
> -%<-- 
> 
> rmdir: konnte '/media/P2' nicht entfernen: Datei oder Verzeichnis nicht 
> gefunden 
> rmdir: konnte '/media/P3' nicht entfernen: Datei oder Verzeichnis nicht 
> gefunden 
> rmdir: konnte '/media/P4' nicht entfernen: Datei oder Verzeichnis nicht 
> gefunden 
> fsck von util-linux 2.27.1 
> rootfs: 26693/7331840 Dateien (7.1% nicht zusammenhängend), 650288/29305190 
> Blöcke 
> fsck von util-linux 2.27.1 
> fsck.ext2: Datei oder Verzeichnis nicht gefunden beim Versuch, /dev/sdc2 zu 
> öffnen 
> Ist das Gerät möglicherweise nicht vorhanden? 
> fsck von util-linux 2.27.1 
> fsck.ext2: Datei oder Verzeichnis nicht gefunden beim Versuch, /dev/sdc3 zu 
> öffnen 
> Ist das Gerät möglicherweise nicht vorhanden? 
> fsck von util-linux 2.27.1 
> fsck.ext2: Datei oder Verzeichnis nicht gefunden beim Versuch, /dev/sdc4 zu 
> öffnen 
> Ist das Gerät möglicherweise nicht vorhanden? 
> 
> ->%-- 

That is a harmless and known bug. The script is not completely checking 
everything. So these warnings are not prevented.

> 
> Accessing "/dev/sdc" is completely wrong and luckily I had no "/dev/sdc" 
> that could be erased! The same is true for "/media/P"! 

Well, it is impossible to perfectly prevent erasing the wrong device, because 
only the user can know what the SD card reader with an SD really is.
So it is equally risky as calling fdisk directly.

There is at least one protection: you can't overwrite /dev/sda.

What you could do is to just sudo chmod o+rw /dev/your-sd-reader
but I am not sure what happens with newly created partitions.

> 
> Furthermore: Why "fsck.ext2"? My QtMoko v55 and v57 SD cards had already been 
> formatted with "fsck.ext4". So even "fsck.ext3" would have been outdated. 

No idea. The script only calls fsck.ext3. Seems to be a bug in util-linux 
2.27.1 when printing the error message.
On my system, there are symlinks:

root@letux:~# ls -l /sbin/fsck.ext*
lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext2 -> e2fsck
lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext3 -> e2fsck
lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext4 -> e2fsck
lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext4dev -> e2fsck
root@letux:~# 

which means they are all the same independently of the ext2/3/4 suffix... One 
size fits all :)

Anyways, this is just a safety check for a freshly created partition. So it 
should normally pass and
does not need to be perfect. It fails only if you have a broken SD card or SD 
card reader which
pretends to have written data...

So I will prepare patches for both issues reported above. They will be 
available in some
days (after I have tested them).

Thanks for feedback about makesd. It can only become better :)

BR,
Nikolaus

___
Gta04-owner mailing list
Gta04-owner@goldelico.com
http://lists.goldelico.com/mailman/listinfo.cgi/gta04-owner