[opensuse-arm] Strange kiwi GPT partition update (for chromebook ARM)
Hi Marcus, I am trying to get my Chromebook ARM working with openSUSE 13.1. I managed to get the JeOS image booting the first time but once SD card is repartitoned, I cannot boot anymore. Parted gives some infos on my SD card: * For working image: ******************************************************************************** Model: Generic- SD/MMC (scsi) Disk /dev/sdb: 4013MB Sector size (logical/physical): 512B/512B Partition Table: gpt_sync_mbr Number Start End Size File system Name Flags 1 1049kB 34,6MB 33,6MB U-BOOT 2 35,7MB 245MB 210MB ext3 lxboot 3 247MB 1007MB 759MB ext4 lxroot ******************************************************************************** * For broken image (after repartitioning): ******************************************************************************** Model: Generic- SD/MMC (scsi) Disk /dev/sdb: 4013MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 34,6MB 33,6MB U-BOOT 2 35,7MB 245MB 210MB ext3 lxboot 3 247MB 3488MB 3240MB ext4 lxroot 4 3488MB 4013MB 525MB linux-swap(v1) lxswap ******************************************************************************** The strange thing is we have a "gpt_sync_mbr" partition table for the OBS image and after a first boot, we have a "gpt" partition table. Any idea why? Any idea how to fix that? Guillaume -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Le 20/03/2014 11:35, Guillaume Gardet a écrit :
Hi Marcus,
I am trying to get my Chromebook ARM working with openSUSE 13.1. I managed to get the JeOS image booting the first time but once SD card is repartitoned, I cannot boot anymore.
(...)
The strange thing is we have a "gpt_sync_mbr" partition table for the OBS image and after a first boot, we have a "gpt" partition table. Any idea why?
It seems it is not a problem. I can recover my SD card booting with the following command: cgpt add -t kernel -i 1 -S 1 -T 5 -P 10 -l U-BOOT $DEVICE Would it be possible to run this command in the initrd? Guillaume -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi,
The strange thing is we have a "gpt_sync_mbr" partition table for the OBS image and after a first boot, we have a "gpt" partition table. Any idea why?
It seems it is not a problem.
I can recover my SD card booting with the following command: cgpt add -t kernel -i 1 -S 1 -T 5 -P 10 -l U-BOOT $DEVICE
Would it be possible to run this command in the initrd?
I remember with the Chromebook Alex added some posprocessing steps using cgpt which initially changed the table for the needs of the Chrombook. It's true that on repartitioning this information gets lost again because parted can't handle it The problem I see here is that we can't do the call you need in a generic way, can we ? Thus I don't like to add this as part of the generic arm initrd code. But you can add and maintain this part as a hook script: 1. make sure cgpt is part of your image, guess adding the following to your kiwi XML description <package name="cgpt"/> 2. Use the preCallInit hook to call custom code - cd /tmp - mkdir kiwi-hooks - create a script called: preCallInit.sh and put in the cgpt call - tar -czf cgpt-table-update.tgz kiwi-hooks/ The tarball has to contain 'kiwi-hooks/preCallInit.sh' otherwise the hook will not be called 3. Copy cgpt-table-update.tgz over to your image description at the same place where your kiwi XML description resides 4. Make the hook code available in the initrd by adding it as a bootincluded archive to your kiwi XML description <archive name="cgpt-table-update.tgz" bootinclude="true"/> done, you have extended the initrd now by some additional code which runs right before systemd/init is called. The preCallInit hook is called when the system already has changed its root path (/) to the real root path but before systemd/init is called. For your purpose you can also choose the 'postpartition' hook but it would require that you bootinclude the cgpt so that it is part of the initrd which you don't need with 'preCallInit' within the hook script you have full access to all variables and functions because it's called in the main initrd shell scope. A common mistake is calling 'exit' in the hook script because this will exit the initrd at a stage where it has most probably not finished its job :) More about hooks and where they are called can be found here http://doc.opensuse.org/projects/kiwi/doc/#sec.hooks If there is a generic not Chromebook specific way to solve this problem I'm of course open to add the code to the native initrd process Thanks Regards, Marcus -- Public Key available gpg --keyserver pgp.mit.edu --recv-keys 0xCCE3C6A2 ------------------------------------------------------- Marcus Schäfer (Res. & Dev.) SUSE LINUX Products GmbH Tel: 0911-740 53 0 Maxfeldstrasse 5 FAX: 0911-740 53 479 D-90409 Nürnberg GF: Jeff Hawn,Jennifer Guild, Felix Imendörffer HRB: 21284 (AG Nürnberg) Germany http://www.suse.de ------------------------------------------------------- -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Le 21/03/2014 08:56, Marcus Schäfer a écrit :
Hi,
The strange thing is we have a "gpt_sync_mbr" partition table for the OBS image and after a first boot, we have a "gpt" partition table. Any idea why? It seems it is not a problem.
I can recover my SD card booting with the following command: cgpt add -t kernel -i 1 -S 1 -T 5 -P 10 -l U-BOOT $DEVICE
Would it be possible to run this command in the initrd? I remember with the Chromebook Alex added some posprocessing steps using cgpt which initially changed the table for the needs of the Chrombook. It's true that on repartitioning this information gets lost again because parted can't handle it
For 12.3, it was working fine. Maybe the repartionning was different?
The problem I see here is that we can't do the call you need in a generic way, can we ?
We could test if some vboot utils are there. If so, then we could do our stuff. This is the way it is done in "uboot-image-chromebook-install" script in JeOS images. Would it be possible to add something in "uboot-image-chromebook-setup" script (when $target is equal to firstboot or boot) ? Not sure when this script is called.
Thus I don't like to add this as part of the generic arm initrd code. But you can add and maintain this part as a hook script:
I will give it a try.
1. make sure cgpt is part of your image, guess adding the following to your kiwi XML description
<package name="cgpt"/>
2. Use the preCallInit hook to call custom code
- cd /tmp - mkdir kiwi-hooks - create a script called: preCallInit.sh and put in the cgpt call - tar -czf cgpt-table-update.tgz kiwi-hooks/
The tarball has to contain 'kiwi-hooks/preCallInit.sh' otherwise the hook will not be called
3. Copy cgpt-table-update.tgz over to your image description at the same place where your kiwi XML description resides
4. Make the hook code available in the initrd by adding it as a bootincluded archive to your kiwi XML description
<archive name="cgpt-table-update.tgz" bootinclude="true"/>
done, you have extended the initrd now by some additional code which runs right before systemd/init is called. The preCallInit hook is called when the system already has changed its root path (/) to the real root path but before systemd/init is called. For your purpose you can also choose the 'postpartition' hook but it would require that you bootinclude the cgpt so that it is part of the initrd which you don't need with 'preCallInit'
within the hook script you have full access to all variables and functions because it's called in the main initrd shell scope. A common mistake is calling 'exit' in the hook script because this will exit the initrd at a stage where it has most probably not finished its job :)
More about hooks and where they are called can be found here http://doc.opensuse.org/projects/kiwi/doc/#sec.hooks
If there is a generic not Chromebook specific way to solve this problem I'm of course open to add the code to the native initrd process
AFAIK, chromebook is the only system requiring that. Thanks for your help. Guillaume -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (2)
-
Guillaume Gardet
-
Marcus Schäfer