User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Help with pi-gen

Sat Jul 08, 2017 4:28 am

Hello
I'm trying to build official raspbian updated images using pi-gen
I managed to start build.sh but once the job is done i only get the light image ???
I'm missing something, the readme is a bit cryptyk for me.

Someone could explain what i should do to build both images please ?

To make the script starting i edited build.sh like this

Code: Select all

#!/bin/bash -e
IMG_NAME=Raspbian
run_sub_stage()

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Sun Jul 09, 2017 5:33 am

Setting the img name that way wasn't really ok, now i have done as described in "Stage specification" :
echo "IMG_NAME='Raspbian'" > config
sudo ./build.sh

Started and working :geek: hope is the good one :roll:

Next thing on the list, understand how to remove/add stuff i want for a custom build

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Sun Jul 09, 2017 6:27 pm

And i got again a nice raspbian lite image, no full image :( like the first time i have 2 mounted partitons on my desktop (no idea if they are from the full or lite image but the script never unmount them)
ps
if it matters i'm using xubuntu amd64 inside virtualbox

DirkS
Posts: 9943
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Help whit pi-gen

Sun Jul 09, 2017 6:44 pm

No (error) messages in the console window?
Have you checked the build log to see at which stage the script ends?
Could it be that you're running out of disk space in your Virtualbox instance?

If you don't want to generate the Lite image you can delete stage2/EXPORT_IMAGE and stage2/EXPORT_NOOBS

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Sun Jul 09, 2017 8:31 pm

DirkS wrote:No (error) messages in the console window?
Have you checked the build log to see at which stage the script ends?
Could it be that you're running out of disk space in your Virtualbox instance?

If you don't want to generate the Lite image you can delete stage2/EXPORT_IMAGE and stage2/EXPORT_NOOBS
Thanks for the reply, didn't noticed the exports files in the stages folders !! yeah.....
I think the -4gb image and the regular stage5 image wasn't created becouse xubuntu hangs when unmounting disks.
I'm trying again on the same vm, removed all the exports but the last one on stage5, i will also test this on another distro to check if the problem was unmounting the 2 disk images used by the script.
vhdd have 200gb limit, real hdd have over 500gb free space.

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Sun Jul 09, 2017 9:16 pm

Yes, the problem was unmounting the boot/rootfs disks used to create the img, deleting the other 2 img-export fixed this, but i still have to unmount the disks manually when the script end, no errors in build.log

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Tue Jul 11, 2017 2:53 am

Tested xubuntu lts, xubuntu 17.04, debian 9, all have the unmount problem, once the first *.img is created all later exports don't work, why ? someone that managed to run pi-gen whitout issues can tell me how you did and distro used please ?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Tue Jul 11, 2017 9:55 am

I've been running it on mint, debian jessie, and recently stretch without any problems.

Could you explain what you mean by "xubuntu hangs when unmounting disks". Hangs how? On what command? For what reason?

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Wed Jul 12, 2017 3:21 pm

ShiftPlusOne wrote:I've been running it on mint, debian jessie, and recently stretch without any problems.

Could you explain what you mean by "xubuntu hangs when unmounting disks". Hangs how? On what command? For what reason?
Hello
I'll try to explain better because english is not my first language, if i launch the script whit all default settings (echo "IMG_NAME='Raspbian'" > config and then sudo ./build.sh) i should get 3x *.img right ? lite, -4g and full image
I get only the first one, the lite img in this example, the 2nd and 3rd EXPORT_IMAGE fail
I can leave only one EXPORT_IMAGE at the stage i need to fix this but if i need to customize the image and need to export from multiple stages i can't :\
No idea if the script mount/unmount the 2 virtual disks (/boot and rootfs?) at every EXPORT_IMAGE, in my case i have them mounted from the first export till the script end, they never get unmounted, even when the script end, when i manually unmount them /boot always unmount at the first try, i have to force unmount the other one sometimes it just don't unmount and i have to reboot.
I'm starting to think this is caused by virtualbox.....

Edit
Xubuntu lts on vmware player 12.5.7 whit 100gb vhdd just fail and don't create any image
once it's done whit all enabled stages and start the images export pop this error and stop

/boot: offset 4194304, length 43743232
/: offset 48234496, length 1611866112
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mke2fs 1.42.13 (17-May-2015)
Invalid filesystem option set: ^metadata_csum,^huge_file

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Wed Jul 12, 2017 8:23 pm

Ah, that's a fairly recent change and would require a recent e2fsprogs package. I may have the name of it wrong.

Currently I build in debian stretch.

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Wed Jul 12, 2017 8:44 pm

ShiftPlusOne wrote:Ah, that's a fairly recent change and would require a recent e2fsprogs package. I may have the name of it wrong.

Currently I build in debian stretch.
I always did an apt-get update/apt-get dist-upgrade on all tested distros, it report 1.42.13-1ubuntu1 for e2fsprogs whit xubuntu lts
Will try again whit debian9 on vmware and see what happen

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Wed Jul 12, 2017 9:06 pm

My mint install doesn't have a recent enough e2fsprogs package yet and I am guessing it comes from ubuntu's repo. Might make sense to make pi-gen check the version and only use that parameter if it's relevant.

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Wed Jul 12, 2017 10:06 pm

Testing on vmware/debian9 now, it have a newer version of e2fsprogs (1.43.4-2), it was failing on virtualbox, same problem as xubuntu lts/17.04 (whitout telling me "Invalid filesystem option set: ^metadata_csum,^huge_file")

Edit
Same problem :( whit more then one EXPORT_IMAGE it create only the first one.
Last edited by l0calH0st on Wed Jul 12, 2017 11:21 pm, edited 1 time in total.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Wed Jul 12, 2017 10:10 pm

Without having the problem in front of me, I think I am out of ideas.

User avatar
rpdom
Posts: 15219
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Help whit pi-gen

Wed Jul 12, 2017 10:28 pm

l0calH0st wrote:I always did an apt-get update/apt-get dist-upgrade on all tested distros, it report 1.42.13-1ubuntu1 for e2fsprogs whit xubuntu lts
Will try again whit debian9 on vmware and see what happen
I'm running Ubuntu 16.04 on the laptop I use to create my SD cards. The latest e2fsprogs and e2fslibs available in that distro is 1.42.13-1ubuntu1. So I added the Debian Stretch repos and pinned it down. Then I told it to install the e2fsprogs from stretch and it now works. This procedure will probably work on any distro based on Debian Jessie.

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Wed Jul 12, 2017 11:22 pm

ShiftPlusOne wrote:Without having the problem in front of me, I think I am out of ideas.
If can help here is the build.log https://pastebin.com/VnCPk4r1
and the console output https://pastebin.com/1hprUEAF

All noobs exports was removed and stage5 skipped in that logs

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Fri Jul 14, 2017 4:12 pm

Are you using the docker build script?
https://github.com/RPi-Distro/pi-gen/is ... -315398671

If so, then that will use a jessie base to build from, which won't work regardless of what you run it on.

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Fri Jul 14, 2017 6:25 pm

ShiftPlusOne wrote:Are you using the docker build script?
https://github.com/RPi-Distro/pi-gen/is ... -315398671

If so, then that will use a jessie base to build from, which won't work regardless of what you run it on.
I'm using "build.sh" to start the build process.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Fri Jul 14, 2017 8:46 pm

It looks like you had a different error at the end there:
"git: command not found"

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Fri Jul 14, 2017 9:21 pm

ShiftPlusOne wrote:It looks like you had a different error at the end there:
"git: command not found"
Already tryed whit git installed, it give another kind of error and i still have 1 img instead of 3 :(

Edit
This is the last msg whit git installed "fatal: Not a git repository (or any of the parent directories): .git"

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Fri Jul 14, 2017 10:08 pm

Yeah, it's expected that you clone the pi-gen repo rather than download the archive. It uses the git commit id to fingerprint itself in /etc/rpi-issue.

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Fri Jul 14, 2017 10:30 pm

ShiftPlusOne wrote:Yeah, it's expected that you clone the pi-gen repo rather than download the archive. It uses the git commit id to fingerprint itself in /etc/rpi-issue.
I guess you found my mistake then, trying again.

Edit
Yes now works fine thanks for the help.
Some questions about adding/removing packages, what's the difference between "XX-packages" and "XX-packages-nr" ?
I will always skip stage5 since i don't need Mathematica, i can create a new packages list whit my packages named "02-packages" in stage4/00-install-packages ? or i have to put them in one pre-existing packages list ?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5968
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Help whit pi-gen

Sat Jul 15, 2017 8:10 am

l0calH0st wrote:
ShiftPlusOne wrote:Yeah, it's expected that you clone the pi-gen repo rather than download the archive. It uses the git commit id to fingerprint itself in /etc/rpi-issue.
I guess you found my mistake then, trying again.

Edit
Yes now works fine thanks for the help.
Some questions about adding/removing packages, what's the difference between "XX-packages" and "XX-packages-nr" ?
I will always skip stage5 since i don't need Mathematica, i can create a new packages list whit my packages named "02-packages" in stage4/00-install-packages ? or i have to put them in one pre-existing packages list ?
nr installs with the --no-install-recommends option.

You can add a 02-packages

User avatar
l0calH0st
Posts: 19
Joined: Sun Sep 11, 2016 2:32 am
Location: 127.0.0.1

Re: Help whit pi-gen

Sat Jul 15, 2017 5:47 pm

Thanks !

amulla
Posts: 3
Joined: Mon Jan 02, 2017 2:05 pm
Contact: Website

Re: Help whit pi-gen

Sat Mar 24, 2018 8:20 am

Any chance there is a simple guide on this with steps?

Return to “Raspbian”