Win7x64 : Golden Image : partitions problems ... again
-
You totally right âŠ
I will try the download with the modified name partition.
If itâs works, we can realize new tests with the âsedâ command hack to permanently fix this issue for all french people. -
@Sebastian-Roth Just wondering, but would it be possible to use unicode here for the accented characters?
edit: Just tested and noâŠ
Though I wonder, can we just use the characters directly? My small test seems to think so. Which means:
if [[ $label =~ [Rr][Ee][Ss][Ee][Rr][Vv][Ee][Dd] || $label =~ [Rr][ïżœ~IĂ©][Ss][ïżœ~IĂ©][Rr][Vv][ïżœ~IĂ©] ]]; then
Can be rewritten and simplified to:
if [[ $label =~ [Rr][EeĂĂ©][Ss][EeĂĂ©][Rr][Vv][EeĂĂ©][Dd]? ]]; then
Iâm guessing the encoding gets messed up somewhere along the road ïżœ~IĂ© likely simply means Ă©. Donât know how or when this happens/happened, but thatâs my guess (Iâve seen this before trying to sort out data in different languages)
-
Hm, we are close to find the issue ⊠I can confirmed ⊠when i renamed the system partition in my Golden Image, the reserved partition has the good size after a deploy on a o7010 âŠ
So, the intuition was good ⊠!Screenshot on o7010 : https://drive.google.com/file/d/1btji1AQSUx7SmOQU5JsplMbENy6DFl1u/view?usp=sharing
-
@Quazz said:
Iâm guessing the encoding gets messed up somewhere along the road
Exactly what is happening. I donât fancy trying to get the encodings right because this will break sooner than later again.
@Jonathan-Cool said:
I tried your patch on the VM, upload the new image and tried a new download ⊠itâs didnât work.
Can you please do another test, same way but do a debug upload and when you get to the shell run
grep label /usr/share/fog/lib/funcs.sh
, take a picture of the screen and post here. Just so we get an idea if the patching really works. -
Hi !
@Sebastian-Roth I ran an upload debug task on VM and did the command : https://drive.google.com/file/d/1s1CVoUuPlNNCEK7bcn6TBpclbK4hc2bK/view?usp=sharing
What do you think about the result ?
-
I wanna smack myself in the head.
I think the problem is simply that the second e is accented in the test whereas it shouldnât be.
-
@Quazz said in Win7x64 : Golden Image : partitions problems ... again:
I think the problem is simply that the second e is accented in the test whereas it shouldnât be.
Why do you think it shouldnât be?? Reading what Jonathan posted a while ago I see two encoded eâsâŠ
@Jonathan-Cool Looks good but⊠hmm?? Sorry for the forth and back here but can you please do another debug capture and run the following three commands:
grep label /usr/share/fog/lib/funcs.sh grep label /bin/fog.upload blkid -po udev | grep sda1
Again take a picture and post here. Just so we have it all on one screen.
-
@Sebastian-Roth Yes, the first and third e should be Ă© but, the second e should just be a plain e!
Observe
if [[ $label =~ [Rr][Ee][Ss][Ee][Rr][Vv][Ee][Dd] || $label =~ [Rr][ïżœ~IĂ©][Ss][ïżœ~IĂ©][Rr][Vv][ïżœ~IĂ©] ]];
The word it should look for is Réservé
It will never match under these conditions and explains why the problem remains unsolved, imo.
-
Hi !
You right @Quazz ⊠the good word is âRĂ©servĂ©â and not âRĂ©sĂ©rvĂ©â.
Iâm back with the results of commands (on VM Golden Img) :
https://drive.google.com/file/d/13gj87dVq2SThjy5IYdbmtiyOCZuXXtDu/view?usp=sharingmy fog.postint :
#!/bin/bash ## This file serves as a starting point to call your custom pre-imaging/post init loading scripts. ## <SCRIPTNAME> should be changed to the script you're planning to use. ## Syntax of post init scripts are #. ${postinitpath}<SCRIPTNAME> sed -i -e "s#\[Rr\]\[Ee\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[Ee\]\[Dd\]#RM-CM-\\\)servM-CM-\\\)#gi" /bin/fog.upload sed -i -e "s#\[Rr\]\[Ee\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[Ee\]\[Dd\]#RM-CM-\\\)servM-CM-\\\)#gi" /usr/share/fog/lib/funcs.sh```
-
I think, this fix is not good : https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/funcs.sh#L493
Maybe the good fix is : line 493 :
if [[ $label =~ [Rr][Ee][Ss][Ee][Rr][Vv][Ee][Dd] || $label =~ [Rr][ĂĂ©][Ss][Ee][Rr][Vv][ĂĂ©] ]]; then
-
@Jonathan-Cool I created a pull request for this, but in the mean time you can of course edit those files on your own install already. Should do the trick, I reckon.
edit: Although, looking back, part of the problem is how blkid spits out the label when using Ă©
blkid | grep /dev/sda1
Should spit it out.
Iâve tested a bit myself and the same thing happens on my French installs.
Will need further looking into.
I also noticed I canât type in certain characters in FOS such as Ă©, perhaps related, will look into it later.
-
@Jonathan-Cool Arghhhh, I got it wrong again. My bad!
grep Vv /usr/share/fog/lib/funcs.sh grep Vv /bin/fog.upload blkid -po udev /dev/sda1 | grep LABEL
Keeping my fingers crossed I get it right this timeâŠ
@Quazz Thanks for finding the tripple Ă©âs. Didnât notice that. My guess is that it wonât help much because the label printed is not in the same character encoding as you noticed already. Thanks for the pull request. Shall I merge? I still hope we can come up with a way to pinpoint those partitions without labels. See my detailed comment here: https://github.com/FOGProject/fogproject/issues/195 (looking for files on the partitions might be way more reliable I hope)
-
Hi,
Thank you both for you precious help âŠ
Back with the results : https://drive.google.com/file/d/1hJXQ-H7C4gZPvAUlPlVz9CzmFmBeVLK2/view?usp=sharing
@Quazz : How i can fix my funcs.sh ? i can hack it with my fog.postinit i think ? With sed tool âŠ
-
@Jonathan-Cool Holy crap (sorry)! Thanks heaps for testing both
blkid
commands, the one Quazz posted and the one I did. I would have never expected those to return such different results!! As we use theblkid -po udev
syntax in the scripts (ref) we are back in the race. Mind trying this script:#!/bin/bash ## This file serves as a starting point to call your custom pre-imaging/post init loading scripts. ## <SCRIPTNAME> should be changed to the script you're planning to use. ## Syntax of post init scripts are #. ${postinitpath}<SCRIPTNAME> sed -i -e "s#\[Rr\]\[Ee\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[Ee\]\[Dd\]#\[Rr\]\[ĂĂ©\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[ĂĂ©\]#gi" /bin/fog.upload sed -i -e "s#\[Rr\]\[Ee\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[Ee\]\[Dd\]#\[Rr\]\[ĂĂ©\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[ĂĂ©\]#gi" /usr/share/fog/lib/funcs.sh
Again, boot up the client in debug mode and run:
grep Vv /usr/share/fog/lib/funcs.sh grep Vv /bin/fog.upload blkid -po udev /dev/sda1 | grep LABEL
If those match you can go ahead and capture the image (issue command
fog
on the console and step through). -
@Sebastian-Roth Yes, your pull request seems much better, although I do wonder if there wonât be any problems with a file based approach, what if someone creates a similar structure on their other partitions for some reason?
Btw, the whole label thing is very strange with the encoding because even when you search for the exact label as blkid prints it out, it still doesnât match.
The ID_FS_LABEL as Jonathan has already provided seems to have the correct encoding, though.
Very strange indeed, but for the time being this could be what we are looking for.
-
@Sebastian-Roth Perhaps we could use something like
parted -l /dev/sda | grep boot | awk '{print $1}'
(making use of the partition flags to find the correct partition, since flags should always be in English in FOS, this should work across the board)
Which will return the partition number for the boot partition (for both linux and windows even)
All these tools are already present in the inits.
Can also use similar commands to find other special cases
Microsoft reserved partition (Windows 10 UEFI installations, typically third partition)
parted -l /dev/sda | grep msftres | awk '{print $1}'
Hidden âBasic data partitionâ (Windows 10 UEFI installations, typically first partition)
parted -l /dev/sda | grep hidden | awk '{print $1}'
Linux swap
parted -l /dev/sda | grep swap | awk '{print $1}'
Linux LVM
parted -l /dev/sda | grep lvm | awk '{print $1}'
The only edge cases coming to mind are Windows XP and such maybe. They might set the boot flag on the only partition.
But it shouldnât be hard to detect if thereâs only one partition in which case skip the remaining logic because it would be pointless to check.
-
@Sebastian-Roth said in Win7x64 : Golden Image : partitions problems ... again:
@Jonathan-Cool Holy crap (sorry)! Thanks heaps for testing both
blkid
commands, the one Quazz posted and the one I did. I would have never expected those to return such different results!! As we use theblkid -po udev
syntax in the scripts (ref) we are back in the race. Mind trying this script:#!/bin/bash ## This file serves as a starting point to call your custom pre-imaging/post init loading scripts. ## <SCRIPTNAME> should be changed to the script you're planning to use. ## Syntax of post init scripts are #. ${postinitpath}<SCRIPTNAME> sed -i -e "s#\[Rr\]\[Ee\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[Ee\]\[Dd\]#\[Rr\]\[ĂĂ©\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[ĂĂ©\]#gi" /bin/fog.upload sed -i -e "s#\[Rr\]\[Ee\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[Ee\]\[Dd\]#\[Rr\]\[ĂĂ©\]\[Ss\]\[Ee\]\[Rr\]\[Vv\]\[ĂĂ©\]#gi" /usr/share/fog/lib/funcs.sh
Again, boot up the client in debug mode and run:
grep Vv /usr/share/fog/lib/funcs.sh grep Vv /bin/fog.upload blkid -po udev /dev/sda1 | grep LABEL
If those match you can go ahead and capture the image (issue command
fog
on the console and step through).Hm, itâs seem not match âŠ
my fog.postinit :
#!/bin/bash ## This file serves as a starting point to call your custom pre-imaging/post init loading scripts. ## <SCRIPTNAME> should be changed to the script you're planning to use. ## Syntax of post init scripts are #. ${postinitpath}<SCRIPTNAME> sed -i -e "s#[Rr][Ee][Ss][Ee][Rr][Vv][Ee][Dd]#[Rr][ĂĂ©][Ss][Ee][Rr][Vv][ĂĂ©]#gi" /bin/fog.upload sed -i -e "s#[Rr][Ee][Ss][Ee][Rr][Vv][Ee][Dd]#[Rr][ĂĂ©][Ss][Ee][Rr][Vv][ĂĂ©]#gi" /usr/share/fog/lib/funcs.sh
The results on my VM - Debug Upload Task : https://drive.google.com/file/d/1vAlGXD-PKZgv_Kwve9NIsSkWqobHyOR2/view?usp=sharing
-
Holy shit, i forgot to run âfogâ and ctrl+c ⊠i will be back soon with the real results âŠ
-
Back with the results ⊠: https://drive.google.com/file/d/1Kf9DscMwdhU7VCRf5Y-L7rL86qXQc1wP/view?usp=sharing
-
@Jonathan-Cool Looks like the sed didnât quite work as intended.
Try this:
sed -i -e "s#\\[Rr\\]\\[Ee\\]\\[Ss\\]\\[Ee\\]\\[Rr\\]\\[Vv\\]\\[Ee\\]\\[Dd\\]#[Rr][ĂĂ©][Ss][Ee][Rr][Vv][ĂĂ©]#gi" /bin/fog.upload sed -i -e "s#\\[Rr\\]\\[Ee\\]\\[Ss\\]\\[Ee\\]\\[Rr\\]\\[Vv\\]\\[Ee\\]\\[Dd\\]#[Rr][ĂĂ©][Ss][Ee][Rr][Vv][ĂĂ©]#gi" /usr/share/fog/lib/funcs.sh
edit: hold up, I see whatâs going on here. The forum is removing the backslashes that are supposed to escape the brackets
edit2: there we go, this one should work, I think