Page 1 of 2

Help with pi-gen

Posted: Sat Jul 08, 2017 4:28 am
by l0calH0st
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()

Re: Help whit pi-gen

Posted: Sun Jul 09, 2017 5:33 am
by l0calH0st
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

Re: Help whit pi-gen

Posted: Sun Jul 09, 2017 6:27 pm
by l0calH0st
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

Re: Help whit pi-gen

Posted: Sun Jul 09, 2017 6:44 pm
by DirkS
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

Re: Help whit pi-gen

Posted: Sun Jul 09, 2017 8:31 pm
by l0calH0st
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.

Re: Help whit pi-gen

Posted: Sun Jul 09, 2017 9:16 pm
by l0calH0st
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

Re: Help whit pi-gen

Posted: Tue Jul 11, 2017 2:53 am
by l0calH0st
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 ?

Re: Help whit pi-gen

Posted: Tue Jul 11, 2017 9:55 am
by ShiftPlusOne
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?

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 3:21 pm
by l0calH0st
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

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 8:23 pm
by ShiftPlusOne
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.

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 8:44 pm
by l0calH0st
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

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 9:06 pm
by ShiftPlusOne
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.

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 10:06 pm
by l0calH0st
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.

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 10:10 pm
by ShiftPlusOne
Without having the problem in front of me, I think I am out of ideas.

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 10:28 pm
by rpdom
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.

Re: Help whit pi-gen

Posted: Wed Jul 12, 2017 11:22 pm
by l0calH0st
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

Re: Help whit pi-gen

Posted: Fri Jul 14, 2017 4:12 pm
by ShiftPlusOne
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.

Re: Help whit pi-gen

Posted: Fri Jul 14, 2017 6:25 pm
by l0calH0st
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.

Re: Help whit pi-gen

Posted: Fri Jul 14, 2017 8:46 pm
by ShiftPlusOne
It looks like you had a different error at the end there:
"git: command not found"

Re: Help whit pi-gen

Posted: Fri Jul 14, 2017 9:21 pm
by l0calH0st
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"

Re: Help whit pi-gen

Posted: Fri Jul 14, 2017 10:08 pm
by ShiftPlusOne
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.

Re: Help whit pi-gen

Posted: Fri Jul 14, 2017 10:30 pm
by l0calH0st
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 ?

Re: Help whit pi-gen

Posted: Sat Jul 15, 2017 8:10 am
by ShiftPlusOne
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

Re: Help whit pi-gen

Posted: Sat Jul 15, 2017 5:47 pm
by l0calH0st
Thanks !

Re: Help whit pi-gen

Posted: Sat Mar 24, 2018 8:20 am
by amulla
Any chance there is a simple guide on this with steps?