Re: [qubes-users] ubuntu template

2017-06-27 Thread Ken J
Hi Unman,

That might be the case more times than not (working on my search
skills) :) I want to start by thanking you for your work. Amazing

I was a bit confused throughout this process because had the ./setup
telling me to make install-deps, make get-sources, make qubes-vm, make
template. I've got https://www.qubes-os.org/doc/qubes-builder/ telling me
something different. Then there's
https://www.qubes-os.org/doc/templates/ubuntu/ telling don't worry it's
easy with no instruction. Then there is this thread telling me if I have an
issue please bump to master and try something else. My build fails and like
the poor sap that I am I have no idea if it's me, my setup, qubes, or
trump.

Maybe I'm using all of the wrong search terms, qubes + ubuntu + debootstrap
+ mount, no clue what the answer is all I got that looked remotely close to
my search was this thread.

On Tue, Jun 27, 2017 at 5:54 PM, Unman  wrote:

> On Wed, Jun 28, 2017 at 01:44:03AM +0100, Unman wrote:
> > On Tue, Jun 27, 2017 at 08:29:24AM -0700, kennethjohns...@gmail.com
> wrote:
> > > On Friday, March 3, 2017 at 7:07:07 AM UTC-8, Unman wrote:
> > > > > As soon as the PRs are merged I'll post to the list, and you can
> try it
> > > > > then. (Or you could merge them yourself of course, and try the
> build.)
> > > > > Testing and feedback would be much appreciated.
> > > > >
> > > > > I've been using Xenial for a while and it seems fine.
> > > >
> > > > PRs are merged, to master if nor 3.2
> > > >
> > > > This means that both Xenial and Trusty should build straight.
> > > >
> > > > Set up a build environment as per docs.
> > > >
> > > > git clone  https://github.com/QubesOS/qubes-builder
> > > > cd qubes-builder
> > > > ./setup (select builder-debian and trsut/xenial variants, deselect
> > > > fed23)
> > > > edit builder.conf, changing RELEASE:=3.2 to RELEASE:=master
> > > > make switch-branch (to get latest and greatest versions of
> components)
> > > > make qubes-vm
> > > > make template
> > > >
> > > > cheers
> > > >
> > > > unman
> > >
> > > Is this still usable today? I switched the branch to master and I went
> from having a failure in debootstrap at the make template stage to a
> failure at the make qubes-vm stage.
> > >
> > > To be clear the debootstrap.log was showing an entry "chroot: failed
> to run command 'mount': No such file or directory" where I could see mount
> was in the /bin dir when I mounted and checked.
> > >
> > > This issue in make qubes-vm appears to happen because core-agent-linux
> cannot find files.
> > > ...
> > > make[1]: Entering directory `/home/user/qubes-src/core-agent-linux'
> > > dh_install --fail-missing
> > > cp: cannot stat 
> > > 'debian/tmp/lib/systemd/system/avahi-daemon.service.d/30_qubes.conf':
> No such file or directory
> > > dh_install: cp -a debian/tmp/lib/systemd/system/
> avahi-daemon.service.d/30_qubes.conf debian/qubes-core-agent//lib/
> systemd/system/avahi-daemon.service.d/ returned exit code 1
> > > make[1]: *** [override_dh_install] Error 2
> > > make[1]: Leaving directory `/home/user/qubes-src/core-agent-linux'
> > > ...
> > >
> > > One thing I tried doing in an prior run was git checkout v3.2.18 as
> per https://github.com/QubesOS/qubes-core-agent-linux/releases/tag/v3.2.18
> running on a hunch that the 4.0 code is messing with something which did
> indeed work and it continued on. v3.2.18 is the last v3 release you guys
> have. But shortly after it failed in another module. I followed the same
> steps, checked out a v3 version and it continued on. did that I think one
> more time and make qubes-vm finishes.
> > >
> > > Now I run make template and fails in debootstrap same as initially.
> > >
> > > Is there an Ubuntu guide out there that is relevant and works? I have
> been scouring the web for 3 days now trying to get a trusty and xenial
> template built.
> >
> > I think you need to work on your search skills :-)
> > The same question was asked on this list 3 days ago.
> > The mount error arises because 'mount' isn't on the path - copy the
> > export PATH statement from template_debian/vars.sh to
> > template_qubuntu/vars.sh, and you should be good to go.
> >
> > The build on master is crocked for the moment.
> > Note that the PRs are all merged to 3.2, and you can therefore build on
> > 3.2 without any problem.
> > The simplest way to do this is to set RELEASE := 3.2 , and then 'make
> > switch-branch'.
> >
> > There's really no need for a special Ubuntu guide - the standard
> > instructions for using qubes-builder in
> > www.qubes-os.org/doc/qubes-builder explain the basics.
> > Obviously if you just want to build a template, then 'make qubes-vm' and
> > 'make template' suffice.
> > Otherwise, there's the illustrated guide to building an Arch Template in
> > the docs.
> >
> > unman
> >
>
> And an update shows me you'd worked this out for yourself - good stuff.
>



-- 
Regards,
Ken B. Johnson

-- 
You received this message because you are 

Re: [qubes-users] ubuntu template

2017-06-27 Thread Ken J
Sorry to keep bombarding. But I figured the issue out. /proc wasn't being
mounted because debootstrap wasn't looking in /bin for it. It was looking
everywhere else (for some reason). /bin is not in the PATH.

This:
https://github.com/QubesOS/qubes-builder-debian/blob/master/template_debian/vars.sh#L11

Needs to be added here:
https://github.com/QubesOS/qubes-builder-debian/blob/master/template_qubuntu/vars.sh
as well.

This happens because I was using Fedora24 qube to build the template. I'm
assuming if I used a debian-8 vm this wouldn't have happened.

Just wanted to update for anyone having an issue with building ubuntu
templates. And also for anyone using Fedora to build a template.

P.S while writing this I was prepping a pull request. Found that unman is
too badass and fast. Already was on it!

On Tue, Jun 27, 2017 at 1:00 PM, Ken J <kennethjohns...@gmail.com> wrote:

> Some other notes to add. After doing some more debugging:
>
> #!/bin/bash
> sudo mount /home/user/qubes-builder/qubes-src/linux-template-
> builder/prepared_images/xenial.img /mnt/
>
>
> # mknod on each file and they already exist so they need to be deleted.
> Also possible that the
> # mount failure possible below causes everything to exit without properly
> cleaning up.
> # Files to delete
> sudo rm /mnt/dev/null
> sudo rm /mnt/dev/zero
> sudo rm /mnt/dev/full
> sudo rm /mnt/dev/random
> sudo rm /mnt/dev/urandom
> sudo rm /mnt/dev/tty
> sudo rm -rf /mnt/dev/pts/
> sudo rm -rf /mnt/dev/shm/
> sudo rm /mnt/dev/ptmx
>
> # [pid 17064] [7fac5cb258e7] symlink("/proc/self/fd",
> "/home/user/qubes-builder/qubes-src/linux-template-builder/mnt/dev/fd/fd")
> = -1 ENOENT (No such file or directory)
> #[pid 17064] [7fac5cb241f0] write(2, "ln: ", 4) = 4
> #[pid 17064] [7fac5cb241f0] write(2, "failed to create symbolic link
> '"..., 104) = 104
> #[pid 17064] [7fac5cb241f0] write(2, ": No such file or directory",
> 27) = 27
> #[pid 17064] [7fac5cb241f0] write(2, "\n", 1) = 1
> #[pid 17064] [7fac5cb340f7] lseek(0, 0, SEEK_CUR) = -1 ESPIPE (Illegal
> seek)
> #[pid 17064] [7fac5caa733b] close(0) = 0
> #[pid 17064] [7fac5caa733b] close(1) = 0
> #[pid 17064] [7fac5caa733b] close(2) = 0
> #[pid 17064] [7fac5caf9da8] exit_group(1) = ?
> #[pid 17064] [] +++ exited with 1 +++
>
> # Possibly proc wasn't properly mounted
>
> sudo umount /mnt
>
>
> I edited the builder-debian/template_debian/01_install_core.sh to add an
> strace -f -i to the debootstrap command @ line 47:
>
> COMPONENTS="" $DEBOOTSTRAP_PREFIX strace -i -f debootstrap \
> --arch=amd64 \
> --include="ncurses-term,locales,tasksel,$eatmydata_maybe" \
> --components=main \
> 
> --keyring="${SCRIPTSDIR}/../keys/${DIST}-${DISTRIBUTION}-archive-keyring.gpg"
> \
> "${DIST}" "${INSTALLDIR}" 
> "file://${INSTALLDIR}/${TMPDIR}/dummy-repo"
> 2>/tmp/fuck.txt && \
> return 0
>
>
>
> On Tue, Jun 27, 2017 at 8:29 AM, <kennethjohns...@gmail.com> wrote:
>
>> On Friday, March 3, 2017 at 7:07:07 AM UTC-8, Unman wrote:
>> > On Fri, Feb 10, 2017 at 11:15:18PM +, Unman wrote:
>> > > On Fri, Feb 10, 2017 at 10:04:54AM -0800, damien.wa...@gmail.com
>> wrote:
>> > > > Le jeudi 9 février 2017 12:41:42 UTC+1, Unman a écrit :
>> > > > > On Thu, Feb 09, 2017 at 02:37:36AM -0800, wrote:
>> > > > > > Hi,
>> > > > > >
>> > > > > > I am new into qubes (few months) and find it great. But I need
>> a distro with newer packages (debian jessie was fine until I ran in issues
>> with encfs compatibility).
>> > > > > >
>> > > > > > So I wanted to build an ubuntu template but I did not found
>> clear instructions.
>> > > > > >
>> > > > > > using https://github.com/QubesOS/qubes-builder and the setup
>> script, I do not get ubuntu to choose in the menu.
>> > > > > >
>> > > > > > On this forum, there is few posts about it but using privaze
>> repo.
>> > > > > >
>> > > > > > I really need help on this :-)
>> > > > > >
>> > > > > > Best regards,
>> > > > > >
>> > > > > > Damien
>> > > > > >
>> > > > >
>> > > > > Hi Damien,
>> > > > >
>> > > > > The Ubuntu bu

Re: [qubes-users] ubuntu template

2017-06-27 Thread Ken J
Some other notes to add. After doing some more debugging:

#!/bin/bash
sudo mount
/home/user/qubes-builder/qubes-src/linux-template-builder/prepared_images/xenial.img
/mnt/


# mknod on each file and they already exist so they need to be deleted.
Also possible that the
# mount failure possible below causes everything to exit without properly
cleaning up.
# Files to delete
sudo rm /mnt/dev/null
sudo rm /mnt/dev/zero
sudo rm /mnt/dev/full
sudo rm /mnt/dev/random
sudo rm /mnt/dev/urandom
sudo rm /mnt/dev/tty
sudo rm -rf /mnt/dev/pts/
sudo rm -rf /mnt/dev/shm/
sudo rm /mnt/dev/ptmx

# [pid 17064] [7fac5cb258e7] symlink("/proc/self/fd",
"/home/user/qubes-builder/qubes-src/linux-template-builder/mnt/dev/fd/fd")
= -1 ENOENT (No such file or directory)
#[pid 17064] [7fac5cb241f0] write(2, "ln: ", 4) = 4
#[pid 17064] [7fac5cb241f0] write(2, "failed to create symbolic link
'"..., 104) = 104
#[pid 17064] [7fac5cb241f0] write(2, ": No such file or directory", 27)
= 27
#[pid 17064] [7fac5cb241f0] write(2, "\n", 1) = 1
#[pid 17064] [7fac5cb340f7] lseek(0, 0, SEEK_CUR) = -1 ESPIPE (Illegal
seek)
#[pid 17064] [7fac5caa733b] close(0) = 0
#[pid 17064] [7fac5caa733b] close(1) = 0
#[pid 17064] [7fac5caa733b] close(2) = 0
#[pid 17064] [7fac5caf9da8] exit_group(1) = ?
#[pid 17064] [] +++ exited with 1 +++

# Possibly proc wasn't properly mounted

sudo umount /mnt


I edited the builder-debian/template_debian/01_install_core.sh to add an
strace -f -i to the debootstrap command @ line 47:

COMPONENTS="" $DEBOOTSTRAP_PREFIX strace -i -f debootstrap \
--arch=amd64 \
--include="ncurses-term,locales,tasksel,$eatmydata_maybe" \
--components=main \

--keyring="${SCRIPTSDIR}/../keys/${DIST}-${DISTRIBUTION}-archive-keyring.gpg"
\
"${DIST}" "${INSTALLDIR}"
"file://${INSTALLDIR}/${TMPDIR}/dummy-repo" 2>/tmp/fuck.txt && \
return 0



On Tue, Jun 27, 2017 at 8:29 AM,  wrote:

> On Friday, March 3, 2017 at 7:07:07 AM UTC-8, Unman wrote:
> > On Fri, Feb 10, 2017 at 11:15:18PM +, Unman wrote:
> > > On Fri, Feb 10, 2017 at 10:04:54AM -0800, damien.wa...@gmail.com
> wrote:
> > > > Le jeudi 9 février 2017 12:41:42 UTC+1, Unman a écrit :
> > > > > On Thu, Feb 09, 2017 at 02:37:36AM -0800, wrote:
> > > > > > Hi,
> > > > > >
> > > > > > I am new into qubes (few months) and find it great. But I need a
> distro with newer packages (debian jessie was fine until I ran in issues
> with encfs compatibility).
> > > > > >
> > > > > > So I wanted to build an ubuntu template but I did not found
> clear instructions.
> > > > > >
> > > > > > using https://github.com/QubesOS/qubes-builder and the setup
> script, I do not get ubuntu to choose in the menu.
> > > > > >
> > > > > > On this forum, there is few posts about it but using privaze
> repo.
> > > > > >
> > > > > > I really need help on this :-)
> > > > > >
> > > > > > Best regards,
> > > > > >
> > > > > > Damien
> > > > > >
> > > > >
> > > > > Hi Damien,
> > > > >
> > > > > The Ubuntu builds are referenced in setup as Trusty and Xenial.
> > > > >
> > > > > I've just put in a series of Pull Requests that should allow
> > > > > straightforward builds of both.
> > > > > Wait a little while for them to be merged.
> > > > >
> > > > > It should then be a matter of:
> > > > > git clone  https://github.com/QubesOS/qubes-builder
> > > > > cd qubes-builder
> > > > > ./setup
> > > > > make qubes-vm
> > > > > make template
> > > > >
> > > > > Copy generated Template to dom0 and install - there's a handy
> script
> > > > > provided to do this for you.
> > > > >
> > > > > I'll let you know when the PRs are merged. Focus at the moment is
> on
> > > > > the GSOC applications.
> > > > >
> > > > > unman
> > > >
> > > > Hi, thank you !
> > > >
> > > > Is there a way I may support you? maybe I can test it?
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Damien
> > > >
> > >
> > > As soon as the PRs are merged I'll post to the list, and you can try it
> > > then. (Or you could merge them yourself of course, and try the build.)
> > > Testing and feedback would be much appreciated.
> > >
> > > I've been using Xenial for a while and it seems fine.
> >
> > PRs are merged, to master if nor 3.2
> >
> > This means that both Xenial and Trusty should build straight.
> >
> > Set up a build environment as per docs.
> >
> > git clone  https://github.com/QubesOS/qubes-builder
> > cd qubes-builder
> > ./setup (select builder-debian and trsut/xenial variants, deselect
> > fed23)
> > edit builder.conf, changing RELEASE:=3.2 to RELEASE:=master
> > make switch-branch (to get latest and greatest versions of components)
> > make qubes-vm
> > make template
> >
> > cheers
> >
> > unman
>
> Is this still usable today? I switched the branch to master and I went
> from having a failure in debootstrap at the make template stage to a
> failure at the make qubes-vm stage.
>
> To be clear the