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: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to