Failed to run debootstrap for armhf stretch

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Failed to run debootstrap for armhf stretch

IAmANobody
Hi,

I tried following command:
sudo debootstrap --verbose --include=dpkg,sudo,apt --arch=armhf stretch /srv/chroot/armhf_stretch http://deb.debian.org/debian

but failed errors:
W: Failure trying to run: chroot /srv/chroot/armhf_stretch dpkg-deb -f /var/cache/apt/archives/dpkg_1.18.25_armhf.deb Version
W: See /srv/chroot/armhf_stretch/debootstrap/debootstrap.log for details
W: Failure trying to run: chroot /srv/chroot/armhf_stretch mount -t proc proc /proc
W: See /srv/chroot/armhf_stretch/debootstrap/debootstrap.log for details

Appreciate any tips what was wrong?

Thank you.

Kind regards,

hh

Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

Paul Wise via nm
On Sat, Nov 3, 2018 at 6:52 PM jupiter wrote:

> Appreciate any tips what was wrong?

You didn't mention which arch you are running these commands on but I
guess that you are running them on amd64, which usually cannot run ARM
programs. There are two options to solve this; running the package
postinst scripts on first boot on an ARM device (debootstrap --foreign
on amd64 and debootstrap --second-stage on armhf) or using emulating
the ARM instructions on amd64 (use qemu-debootstrap from
qemu-user-static).

--
bye,
pabs

https://wiki.debian.org/PaulWise

Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

IAmANobody
Thanks Paul, but I did have a command debootstrap --arch=armhf stretch posted on the previous message, or did you mean something else I could be missing? I was running debootstrap on Ubuntu 18 amd64 laptop which could be what you refer to. Anyway, the same command I was running for armhf jessie before on the same laptop and and same OS distribution, that was no problem at all, just wandering why I could create armhf jessie but could not create for armhf stretch without using --foreign and --second-stage? Also, I've already installed qemu-user-static on Ubuntu laptop as well.

Thank you.







On Sat, Nov 3, 2018 at 10:06 PM Paul Wise <[hidden email]> wrote:
On Sat, Nov 3, 2018 at 6:52 PM jupiter wrote:

> Appreciate any tips what was wrong?

You didn't mention which arch you are running these commands on but I
guess that you are running them on amd64, which usually cannot run ARM
programs. There are two options to solve this; running the package
postinst scripts on first boot on an ARM device (debootstrap --foreign
on amd64 and debootstrap --second-stage on armhf) or using emulating
the ARM instructions on amd64 (use qemu-debootstrap from
qemu-user-static).

--
bye,
pabs

https://wiki.debian.org/PaulWise

Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

Paul Wise via nm
On Sun, Nov 4, 2018 at 8:06 AM hh h wrote:

> I did have a command debootstrap --arch=armhf stretch posted on the previous message

That doesn't mention which architecture you are running the command on.

> running debootstrap on Ubuntu 18 amd64 laptop which could be what you refer to.

Yes, that is what I was referring to.

> why I could create armhf jessie but could not create for armhf stretch without using --foreign and --second-stage?

jessie and stretch should not be any different here. I suggest
comparing the debootstrap logs for jessie and stretch to figure out
what the problem is.

> Also, I've already installed qemu-user-static on Ubuntu laptop as well.

BTW, I'm not sure about the version combinations and if Ubuntu
supports it yet, but recent versions of the Linux kernel and
qemu-user-static from Debian buster support emulating ARM binaries
without using qemu-debootstrap and without copying qemu-arm-static
into the chroot.

--
bye,
pabs

https://wiki.debian.org/PaulWise

Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

IAmANobody
Does Extracting package means installing it?

I had no errors after running debootstrap , but it had some problems I
could not run apt installation despite I could use schroot to  mount
it:

(1) The apt package was not extracted in the extracted list despite it
was downloaded in /var/cache/apt/archives.

(2) The /var/lib/dpkg/status is empty despite so many packages were extracted.

(3) The libc6 is in the Extracting list, but it did not installed as
many other packages are in the Extracting list but not installed.

(4) The /etc/apt/sources.list contains one line invalid URL: deb
http://debootstrap.invalid/ stretch main, I fixed it by changing to
deb [arch=armhf] http://deb.debian.org/debian stretch main.

(5) I am able to use schroot to mount to he armhf stretch, but in the
schroot armhf stretch, I ran the command "mount" that shown the same
mount information in the host, is it normal?

(6) Without the apt installed, I could not download dependencies. I
tried dpkg installation, but it cannot install apt package, it had
dependency errors

# dpkg -i apt_1.4.8_armhf.deb
Selecting previously unselected package apt.
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack apt_1.4.8_armhf.deb ...
Unpacking apt (1.4.8) ...
dpkg: dependency problems prevent configuration of apt:
 apt depends on adduser; however:
  Package adduser is not installed.
 apt depends on gpgv | gpgv2 | gpgv1; however:
  Package gpgv is not installed.
  Package gpgv2 is not installed.
  Package gpgv1 is not installed.
 apt depends on debian-archive-keyring; however:
  Package debian-archive-keyring is not installed.
 apt depends on init-system-helpers (>= 1.18~); however:
  Package init-system-helpers is not installed.
 apt depends on libapt-pkg5.0 (>= 1.3~rc2); however:
  Package libapt-pkg5.0 is not installed.
 apt depends on libc6 (>= 2.15); however:
  Package libc6 is not installed.
 apt depends on libgcc1 (>= 1:3.5); however:
  Package libgcc1 is not installed.
 apt depends on libstdc++6 (>= 5.2); however:
  Package libstdc++6 is not installed.


I: Retrieving apt 1.4.8
I: Validating apt 1.4.8
..........
I: Chosen extractor for .deb packages: dpkg-deb
I: Extracting libacl1...
I: Extracting libattr1...
I: Extracting libaudit-common...
I: Extracting libaudit1...
I: Extracting base-files...
I: Extracting base-passwd...
I: Extracting bash...
I: Extracting libbz2-1.0...
I: Extracting libdebconfclient0...
I: Extracting coreutils...
I: Extracting dash...
I: Extracting libdb5.3...
I: Extracting debconf...
I: Extracting debianutils...
I: Extracting diffutils...
I: Extracting dpkg...
I: Extracting e2fslibs...
I: Extracting e2fsprogs...
I: Extracting libcomerr2...
I: Extracting libss2...
I: Extracting findutils...
I: Extracting gcc-6-base...
I: Extracting libgcc1...
I: Extracting libc-bin...
I: Extracting libc6...
I: Extracting multiarch-support...
I: Extracting grep...
I: Extracting gzip...
I: Extracting hostname...
I: Extracting init-system-helpers...
I: Extracting libcap-ng0...
I: Extracting libgcrypt20...
I: Extracting libgpg-error0...
I: Extracting libselinux1...
I: Extracting libsemanage-common...
I: Extracting libsemanage1...
I: Extracting libsepol1...
I: Extracting lsb-base...
I: Extracting liblz4-1...
I: Extracting mawk...
I: Extracting libncursesw5...
I: Extracting libtinfo5...
I: Extracting ncurses-base...
I: Extracting ncurses-bin...
I: Extracting libpam-modules...
I: Extracting libpam-modules-bin...
I: Extracting libpam-runtime...
I: Extracting libpam0g...
I: Extracting libpcre3...
I: Extracting perl-base...
I: Extracting sed...
I: Extracting sensible-utils...
I: Extracting login...
I: Extracting passwd...
I: Extracting libsystemd0...
I: Extracting libudev1...
I: Extracting sysvinit-utils...
I: Extracting tar...
I: Extracting tzdata...
I: Extracting libustr-1.0-1...
I: Extracting bsdutils...
I: Extracting libblkid1...
I: Extracting libfdisk1...
I: Extracting libmount1...
I: Extracting libsmartcols1...
I: Extracting libuuid1...
I: Extracting mount...
I: Extracting util-linux...
I: Extracting liblzma5...
I: Extracting zlib1g...


On 11/4/18, Paul Wise <[hidden email]> wrote:

> On Sun, Nov 4, 2018 at 8:06 AM hh h wrote:
>
>> I did have a command debootstrap --arch=armhf stretch posted on the
>> previous message
>
> That doesn't mention which architecture you are running the command on.
>
>> running debootstrap on Ubuntu 18 amd64 laptop which could be what you
>> refer to.
>
> Yes, that is what I was referring to.
>
>> why I could create armhf jessie but could not create for armhf stretch
>> without using --foreign and --second-stage?
>
> jessie and stretch should not be any different here. I suggest
> comparing the debootstrap logs for jessie and stretch to figure out
> what the problem is.
>
>> Also, I've already installed qemu-user-static on Ubuntu laptop as well.
>
> BTW, I'm not sure about the version combinations and if Ubuntu
> supports it yet, but recent versions of the Linux kernel and
> qemu-user-static from Debian buster support emulating ARM binaries
> without using qemu-debootstrap and without copying qemu-arm-static
> into the chroot.
>
> --
> bye,
> pabs
>
> https://wiki.debian.org/PaulWise
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

Paul Wise via nm
On Mon, 2018-11-05 at 20:38 +1100, hh h wrote:

> Does Extracting package means installing it?

No, it just means extracting the files to disk, but not running any
install tasks like maintainer scripts or triggers etc. The maintainer
scripts are needed to make the install work properly. It sounds to me
like you have used qemu-user-static but you only did the first stage
(debootstrap --foreign) of a two-stage debootstrap. I probably should
have explained it better before, but qemu-user-static is for when you
want to do a single-stage debootstrap solely on amd64. The two-stage
debootstrap (debootstrap --foreign, debootstrap --second-stage) is for
when you are not using qemu-user-static but want to do the second stage
on the ARM device itself. IIRC debootstrap will setup the install to do
the right thing on the first boot of the ARM device.

--
bye,
pabs

https://wiki.debian.org/PaulWise

Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

Andreas Jellinghaus-3
In reply to this post by IAmANobody
Are you tied to debootstrap or would multistrap also work for you?

I used multistrap to build the bootable sdcard image for odroid hc1. Also I used buster - so I'm not sure the same will work for you. But it might be worth a try?


For example this might be relevant:
...
-> apt install  qemu binfmt-support qemu-user-static
...
* Next we need to configure all debian packages. This requires the use of qemu as emulator, if this step is run on a normal computer:
-> cp /usr/bin/qemu-arm-static  /mnt/usr/bin/
-> mount --bind /dev /mnt/dev
-> mount --bind /proc /mnt/proc
-> chroot /mnt/ bash -c "DEBIAN_FRONTEND=noninteractive dpkg --configure -a"

* Likely this last step failed with a problen in the dash and bash packages. To work around it, run it once more with interactive dialoges:
-> chroot /mnt/ bash -c "dpkg --configure -a"

Above installs the qemu emulator so the desktop or laptop that you can use can run the arm binaries to perform a minimal configuration of the installation medium.

Good luck with your project!

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

IAmANobody
In reply to this post by Paul Wise via nm
Sorry, I should mention that I did start schroot in root mode and run
second stage, but it failed on permission denied

# /debootstrap/debootstrap --second-stage
/debootstrap/debootstrap: 1455: /debootstrap/debootstrap: cannot
create //test-dev-null: Permission denied
E: Cannot install into target '/' mounted with noexec or nodev

As I mentioned in previous message, that the host mount were shown in
the schroot environment, I was not clear that was the problem or not.

I used the same schroot mount for armhf jessie which does not show the
mount information in host environment.


On 11/5/18, Paul Wise <[hidden email]> wrote:

> On Mon, 2018-11-05 at 20:38 +1100, hh h wrote:
>
>> Does Extracting package means installing it?
>
> No, it just means extracting the files to disk, but not running any
> install tasks like maintainer scripts or triggers etc. The maintainer
> scripts are needed to make the install work properly. It sounds to me
> like you have used qemu-user-static but you only did the first stage
> (debootstrap --foreign) of a two-stage debootstrap. I probably should
> have explained it better before, but qemu-user-static is for when you
> want to do a single-stage debootstrap solely on amd64. The two-stage
> debootstrap (debootstrap --foreign, debootstrap --second-stage) is for
> when you are not using qemu-user-static but want to do the second stage
> on the ARM device itself. IIRC debootstrap will setup the install to do
> the right thing on the first boot of the ARM device.
>
> --
> bye,
> pabs
>
> https://wiki.debian.org/PaulWise
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

Paul Wise via nm
On Tue, 2018-11-06 at 10:19 +1100, hh h wrote:


> # /debootstrap/debootstrap --second-stage
> /debootstrap/debootstrap: 1455: /debootstrap/debootstrap: cannot
> create //test-dev-null: Permission denied
> E: Cannot install into target '/' mounted with noexec or nodev

Mounting the root directory with noexec or nodev is going to break any
installation, so I suggest you try to figure out where that came from.

--
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Failed to run debootstrap for armhf stretch

IAmANobody
Thanks Paul for the explanation, I figured out the storage was mounted
with user which automatically added nodev and nosquid. Added dev,squid
fixed it.

Appreciate your kind assistance.




On 11/6/18, Paul Wise <[hidden email]> wrote:

> On Tue, 2018-11-06 at 10:19 +1100, hh h wrote:
>
>
>> # /debootstrap/debootstrap --second-stage
>> /debootstrap/debootstrap: 1455: /debootstrap/debootstrap: cannot
>> create //test-dev-null: Permission denied
>> E: Cannot install into target '/' mounted with noexec or nodev
>
> Mounting the root directory with noexec or nodev is going to break any
> installation, so I suggest you try to figure out where that came from.
>
> --
> bye,
> pabs
>
> https://wiki.debian.org/PaulWise
>
>