New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archlinux template fails to build #2565

Closed
hThoreau opened this Issue Jan 9, 2017 · 10 comments

Comments

Projects
None yet
4 participants
@hThoreau

hThoreau commented Jan 9, 2017

Qubes OS version R3.2

Fedora-23 Standalone appVM, building Archlinux


Expected behavior:

Running make template succeeds.

Actual behavior:

[user@archlinux qubes-builder]$ make template
mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/vmm-xen/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/vmm-xen/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/core-vchan-xen/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/core-vchan-xen/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/core-qubesdb/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/core-qubesdb/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/linux-utils/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/linux-utils/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/core-agent-linux/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/core-agent-linux/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/gui-common/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/gui-common/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/gui-agent-linux/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/gui-agent-linux/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

mkdir -p /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs
for arch_build_dir in archlinux; do\
	pkgnames=`cat qubes-src/app-linux-split-gpg/$arch_build_dir/PKGBUILD | grep pkgname | cut -d "=" -f 2 | tr -d '()"'`;\
	for pkgname in $pkgnames; do\
		ln -f qubes-src/app-linux-split-gpg/pkgs/$pkgname-*.pkg.tar.xz /home/user/qubes-builder/qubes-src/linux-template-builder/pkgs-for-template/archlinux/pkgs/;\
	done;\
done;\

-> Building template archlinux (logfile: build-logs/template-archlinux.log)...
Makefile:297: recipe for target 'template-local-archlinux' failed
make: *** [template-local-archlinux] Error 1

Steps to reproduce the behavior:

  1. Follow instructions provided in the documentation (https://www.qubes-os.org/doc/templates/archlinux/);
  2. Execute fix described here (#2557) when make qubes-vm fails;
  3. Retry make qubes-vm
  4. make template

General notes:

I've also attached the log that was returned to me bellow.
template-archlinux.txt

I'm a Graphic Designer by trade, I'm as familiar to CLI as my grandma is to GUI, meaning, I couldn't code even if my life depended on it. XD I'm more than grateful for any aid provided, but please, try to didatic with me.

Thanks in advance.

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

unman Jan 9, 2017

Member
Member

unman commented Jan 9, 2017

@hThoreau

This comment has been minimized.

Show comment
Hide comment
@hThoreau

hThoreau Jan 9, 2017

I've edited the original post after reading the comment from Marek Marczykowski-Górecki recommending to run make qubes-qv again instead of building the dependencies separately, as they weren't all listed in the OP.

After doing that the error message I've gotten, referenced in the log, was slightly different from the one you've quoted, even though I've stopped at the same step of the procedure.

Still, I've tried your recommendation. The return I've had was the following:

[user@archlinux qubes-builder]$ make app-linux-split-gpg-vm
Currently installed dependencies:
git-2.5.5-1.fc23.x86_64
rpmdevtools-8.9-1.fc23.noarch
rpm-build-4.13.0-0.rc1.13.fc23.x86_64
createrepo-0.10.3-3.fc21.noarch
debootstrap-1.0.87-1.fc23.noarch
dpkg-dev-1.17.27-1.fc23.noarch
python-sh-1.11-1.fc23.noarch
dialog-1.3-4.20160424.fc23.x86_64
--> Archlinux dist-prepare-chroot (makefile):
  --> Checking mounting of dev/proc/sys on build chroot...
    --> sudo mount --bind /dev/pts /home/user/qubes-builder/chroot-archlinux/dev/pts;
  --> Synchronize resolv.conf, in case it changed since last run...
cp: cannot stat ‘/etc/resolv.conf’: No such file or directory
/home/user/qubes-builder/qubes-src/builder-archlinux/Makefile.archlinux:65: recipe for target 'dist-prepare-chroot' failed
make[1]: *** [dist-prepare-chroot] Error 1
Makefile:209: recipe for target 'app-linux-split-gpg-vm' failed
make: *** [app-linux-split-gpg-vm] Error 1

hThoreau commented Jan 9, 2017

I've edited the original post after reading the comment from Marek Marczykowski-Górecki recommending to run make qubes-qv again instead of building the dependencies separately, as they weren't all listed in the OP.

After doing that the error message I've gotten, referenced in the log, was slightly different from the one you've quoted, even though I've stopped at the same step of the procedure.

Still, I've tried your recommendation. The return I've had was the following:

[user@archlinux qubes-builder]$ make app-linux-split-gpg-vm
Currently installed dependencies:
git-2.5.5-1.fc23.x86_64
rpmdevtools-8.9-1.fc23.noarch
rpm-build-4.13.0-0.rc1.13.fc23.x86_64
createrepo-0.10.3-3.fc21.noarch
debootstrap-1.0.87-1.fc23.noarch
dpkg-dev-1.17.27-1.fc23.noarch
python-sh-1.11-1.fc23.noarch
dialog-1.3-4.20160424.fc23.x86_64
--> Archlinux dist-prepare-chroot (makefile):
  --> Checking mounting of dev/proc/sys on build chroot...
    --> sudo mount --bind /dev/pts /home/user/qubes-builder/chroot-archlinux/dev/pts;
  --> Synchronize resolv.conf, in case it changed since last run...
cp: cannot stat ‘/etc/resolv.conf’: No such file or directory
/home/user/qubes-builder/qubes-src/builder-archlinux/Makefile.archlinux:65: recipe for target 'dist-prepare-chroot' failed
make[1]: *** [dist-prepare-chroot] Error 1
Makefile:209: recipe for target 'app-linux-split-gpg-vm' failed
make: *** [app-linux-split-gpg-vm] Error 1
@cryptix

This comment has been minimized.

Show comment
Hide comment
@cryptix

cryptix Jan 9, 2017

Hey @hThoreau!

I just completed the steps in the documentation and got a working rpm-file to install the template, create one and boot it.

I first hit step 2 (the missing init) myself. Did you use rdhammond workaround or the one marmarek linked to?

cryptix commented Jan 9, 2017

Hey @hThoreau!

I just completed the steps in the documentation and got a working rpm-file to install the template, create one and boot it.

I first hit step 2 (the missing init) myself. Did you use rdhammond workaround or the one marmarek linked to?

@hThoreau

This comment has been minimized.

Show comment
Hide comment
@hThoreau

hThoreau Jan 9, 2017

Hello @cryptix,

By "rdhammond workaround" you refer to this post, am I correct? In that case, yes, I've used it. By "the one marmarek linked to", you refer to this piece of code? I've found that the files in the qubes-builder were already rectified for that error.

hThoreau commented Jan 9, 2017

Hello @cryptix,

By "rdhammond workaround" you refer to this post, am I correct? In that case, yes, I've used it. By "the one marmarek linked to", you refer to this piece of code? I've found that the files in the qubes-builder were already rectified for that error.

@cryptix

This comment has been minimized.

Show comment
Hide comment
@cryptix

cryptix Jan 9, 2017

uhm.. both no, actually. The problem I ran into and fix I used are documented here.

I suggest you clean up and start over fresh with a new clone of the qubes-builder (step 4), if you haven't already, to make sure you don't have strange side-effects of (potential partial) fixes that don't work well together. I only had to add the init from

I looked into the template-archlinux.txt you attached in the initial post. The failed umount on line 1485 makes me think some process blocked the packaging of the rpm. (This could be a terminal window, where you did manual investigation in the builder chroot. A running terminal shell (like bash or zsh) always has a working directory. If it is located inside a directory that you want to un-mount, the umount will fail with target is busy.)

cryptix commented Jan 9, 2017

uhm.. both no, actually. The problem I ran into and fix I used are documented here.

I suggest you clean up and start over fresh with a new clone of the qubes-builder (step 4), if you haven't already, to make sure you don't have strange side-effects of (potential partial) fixes that don't work well together. I only had to add the init from

I looked into the template-archlinux.txt you attached in the initial post. The failed umount on line 1485 makes me think some process blocked the packaging of the rpm. (This could be a terminal window, where you did manual investigation in the builder chroot. A running terminal shell (like bash or zsh) always has a working directory. If it is located inside a directory that you want to un-mount, the umount will fail with target is busy.)

@hThoreau

This comment has been minimized.

Show comment
Hide comment
@hThoreau

hThoreau Jan 9, 2017

@cryptix
Where did you get the "init" from? As for the umount, you think an open text editor might have caused that?

hThoreau commented Jan 9, 2017

@cryptix
Where did you get the "init" from? As for the umount, you think an open text editor might have caused that?

@cryptix

This comment has been minimized.

Show comment
Hide comment
@cryptix

cryptix Jan 9, 2017

Okay, just make sure make qubes-vm works without many modifications. I only had to add the init to the PKGBUILD, nothing else.

As for the umount, you think an open text editor might have caused that?

Text editor: unlikely, they usually only hold files open while they save or read files.

What I meant in general is this :

  • open your terminal (like gnome-terminal)
  • insert a usb key and mount it or network share.
  • go into that location cd /media/usbkey/...
  • try to unmount the usb drive (it will result in a target is busy error)

This is pretty arcane phenomena and can be hard to catch.

In this special case the build system should know how to cleanly unmount, I think.

cryptix commented Jan 9, 2017

Okay, just make sure make qubes-vm works without many modifications. I only had to add the init to the PKGBUILD, nothing else.

As for the umount, you think an open text editor might have caused that?

Text editor: unlikely, they usually only hold files open while they save or read files.

What I meant in general is this :

  • open your terminal (like gnome-terminal)
  • insert a usb key and mount it or network share.
  • go into that location cd /media/usbkey/...
  • try to unmount the usb drive (it will result in a target is busy error)

This is pretty arcane phenomena and can be hard to catch.

In this special case the build system should know how to cleanly unmount, I think.

@hThoreau

This comment has been minimized.

Show comment
Hide comment
@hThoreau

hThoreau Jan 10, 2017

Thank you @cryptix,
I manage to build the template! I performed the following substitutions in order to do so:

Changed

> # FIXME: do a source code move vm-systemd/*.sh to init/
> # since those scripts are shared between sysvinit and systemd.
> install -m 0755 init/*.sh vm-systemd/*.sh $(DESTDIR)$(LIBDIR)/qubes/init/
> install -m 0644 init/functions $(DESTDIR)$(LIBDIR)/qubes/init/

for

# FIXME: do a source code move vm-systemd/*.sh to init/
# since those scripts are shared between sysvinit and systemd.
install -m 0755 /home/user/qubes-src/core-agent-linux/init/*.sh vm-systemd/*.sh $(DESTDIR)$(LIBDIR)/qubes/init/
install -m 0644 /home/user/qubes-src/core-agent-linux/init/functions $(DESTDIR)$(LIBDIR)/qubes/init/

in the document
/qubes-builder/qubes-src/core-agent-linux/Makefile

Also, I've changed the first line of the document
/qubes-builder/qubes-src/app-linux-split-gpg/doc/Makefile
to
PANDOC=/bin/true

Finally, I've did what you suggested, so maybe those first two modifications where just overkill. XD


Now I'm stuck in the next step (yay!) getting denied permission to transfer the template to the dom0. I've to figure that one now... is there something wrong with the following line of command?
sudo qvm-run --pass-io archlinux 'cat /home/user/qubes-builder/qubes-src/linux-template-builder/rpm/install-templates.sh' > install-templates.sh
it returns
bash: install-templates.sh: Permission denied

hThoreau commented Jan 10, 2017

Thank you @cryptix,
I manage to build the template! I performed the following substitutions in order to do so:

Changed

> # FIXME: do a source code move vm-systemd/*.sh to init/
> # since those scripts are shared between sysvinit and systemd.
> install -m 0755 init/*.sh vm-systemd/*.sh $(DESTDIR)$(LIBDIR)/qubes/init/
> install -m 0644 init/functions $(DESTDIR)$(LIBDIR)/qubes/init/

for

# FIXME: do a source code move vm-systemd/*.sh to init/
# since those scripts are shared between sysvinit and systemd.
install -m 0755 /home/user/qubes-src/core-agent-linux/init/*.sh vm-systemd/*.sh $(DESTDIR)$(LIBDIR)/qubes/init/
install -m 0644 /home/user/qubes-src/core-agent-linux/init/functions $(DESTDIR)$(LIBDIR)/qubes/init/

in the document
/qubes-builder/qubes-src/core-agent-linux/Makefile

Also, I've changed the first line of the document
/qubes-builder/qubes-src/app-linux-split-gpg/doc/Makefile
to
PANDOC=/bin/true

Finally, I've did what you suggested, so maybe those first two modifications where just overkill. XD


Now I'm stuck in the next step (yay!) getting denied permission to transfer the template to the dom0. I've to figure that one now... is there something wrong with the following line of command?
sudo qvm-run --pass-io archlinux 'cat /home/user/qubes-builder/qubes-src/linux-template-builder/rpm/install-templates.sh' > install-templates.sh
it returns
bash: install-templates.sh: Permission denied

@cryptix

This comment has been minimized.

Show comment
Hide comment
@cryptix

cryptix Jan 10, 2017

Nice that you got the template!!

bash: install-templates.sh Permission denied

Hm.. yea. that script seemed unnecessary to me.

Try to fetch the .rpm from the noarch directory (like explained in copy to dom0) and then run sudo dnf install xxx.rpm and delete it afterwards. That's everything the script does, notice that only the dnf install needs sudo.

hope that helps.

cryptix commented Jan 10, 2017

Nice that you got the template!!

bash: install-templates.sh Permission denied

Hm.. yea. that script seemed unnecessary to me.

Try to fetch the .rpm from the noarch directory (like explained in copy to dom0) and then run sudo dnf install xxx.rpm and delete it afterwards. That's everything the script does, notice that only the dnf install needs sudo.

hope that helps.

@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong Jan 10, 2017

Member

I'm glad you've able to help each other and make progress on this on your own. :)

For issue tracking purposes, this is obviously a duplicate of #2557 (as I'm sure you know, having cited that issue yourself), so I'm marking and closing it as a duplicate for organizational purposes. But please feel free, of course, to finish your discussion here, if it's helping. (In the future, you may find the MLs more appropriate as a medium for this type of exchange.)

Member

andrewdavidwong commented Jan 10, 2017

I'm glad you've able to help each other and make progress on this on your own. :)

For issue tracking purposes, this is obviously a duplicate of #2557 (as I'm sure you know, having cited that issue yourself), so I'm marking and closing it as a duplicate for organizational purposes. But please feel free, of course, to finish your discussion here, if it's helping. (In the future, you may find the MLs more appropriate as a medium for this type of exchange.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment