debian-mini-odroid-c1 icon indicating copy to clipboard operation
debian-mini-odroid-c1 copied to clipboard

make /usr/sbin/debootstrap: 1290 Permission denied & Error: /dev/loop0: unrecognised disk label

Open grynas opened this issue 10 years ago • 11 comments

Building on xubuntu 64bits, and at the end this message appears: /usr/sbin/debootstrap: 1290: /usr/sbin/debootstrap: cannot create /media/user/debian/debian-mini-odroid-c1/trunk/rootfs.base.tmp/test-dev-null: Permission denied E: Cannot install into target '/media/user/debian/debian-mini-odroid-c1/trunk/rootfs.base.tmp' mounted with noexec or nodev make[1]: *** [rootfs.base] Error 1 make[1]: Leaving directory `/media/user/debian/debian-mini-odroid-c1/trunk' make: *** [build-rootfs] Error 2

I`ve tried both with "sudo make" and sudo su from root account, yet without any success... Anyone could help with this?

grynas avatar Feb 22 '15 11:02 grynas

Any chance you're doing this on an encrypted home directory? Looks like your file system is mounted with insufficient privileges. Maybe this helps: http://askubuntu.com/questions/522116/chroot-question

tomuta avatar Feb 22 '15 20:02 tomuta

Thank you, seems like that was the issue with encryption. But I`ve got another error, seems at the very end of process:

Error: /dev/loop0: unrecognised disk label make[1]: *** [sdcard.img] Error 1 make[1]: Leaving directory `/home/user/buildodroid/debian-mini-odroid-c1/trunk' make: *** [build-rootfs] Error 2

...

grynas avatar Feb 23 '15 07:02 grynas

I'm also getting the same issue. I tried it twice (Second time after a clean up). I was using Ubuntu 14.04 64-bit with the 32-bit toolchain (as mentioned in the doc). The same occurs for 32-bit Ubuntu also. Here's the console output from the end:

update-initramfs: Generating /boot/initrd.img-3.10.70
for i in patches/*.patch ; do patch -p0 -d rootfs < $i ; done
patching file etc/init.d/ssh
patching file etc/default/tmpfs
umount rootfs/proc
umount rootfs/sys
umount rootfs/dev
rm rootfs/postinstall
rm -rf rootfs/postinst/
rm rootfs/usr/bin/qemu-arm-static
touch rootfs
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d rootfs/boot/initrd.img-* uInitrd
Image Name:   uInitrd
Created:      Wed Mar 11 02:13:27 2015
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    15398455 Bytes = 15037.55 kB = 14.69 MB
Load Address: 00000000
Entry Point:  00000000
if test -f "sdcard.img.tmp"; then rm "sdcard.img.tmp" ; fi
./createimg sdcard.img.tmp 32 768 boot rootfs u-boot/sd_fuse uInitrd
787185+0 records in
787185+0 records out
806077440 bytes (806 MB) copied, 2.83805 s, 284 MB/s
2+0 records in
2+0 records out
2 bytes (2 B) copied, 0.0015117 s, 1.3 kB/s
442+0 records in
442+0 records out
442 bytes (442 B) copied, 0.00313326 s, 141 kB/s
63+0 records in
63+0 records out
32256 bytes (32 kB) copied, 0.00240075 s, 13.4 MB/s
460+1 records in
460+1 records out
235960 bytes (236 kB) copied, 0.00470477 s, 50.2 MB/s
Warning: sdcard.img.tmp is not a block device
Disk sdcard.img.tmp: cannot get geometry

Disk sdcard.img.tmp: 98 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
sdcard.img.tmp1             0         -          0   0  Empty
sdcard.img.tmp2             0         -          0   0  Empty
sdcard.img.tmp3             0         -          0   0  Empty
sdcard.img.tmp4             0         -          0   0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
sdcard.img.tmp1   *      2048     80324      78277   c  W95 FAT32 (LBA)
sdcard.img.tmp2         80325   1574369    1494045  83  Linux
sdcard.img.tmp3             0         -          0   0  Empty
sdcard.img.tmp4             0         -          0   0  Empty
Successfully wrote the new partition table

Re-reading the partition table ...
BLKRRPART: Inappropriate ioctl for device

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
Error: /dev/loop0: unrecognised disk label
make[1]: *** [sdcard.img] Error 1
make[1]: Leaving directory `/home/mislam/odroid'
make: *** [build-rootfs] Error 2

mislam avatar Mar 11 '15 05:03 mislam

Phew! Finally... I found the culprit. Ubuntu 14.04 has an older version of sfdisk v2.20.1 which was causing this issue. Now that I have tried with Ubuntu 14.10 where they upgraded sfdisk to v2.25.1 that resolved the issue.

mislam avatar Mar 12 '15 02:03 mislam

Interesting... I was going to install 14.04 in a VM this weekend as all my machines are on 14.10...

tomuta avatar Mar 13 '15 02:03 tomuta

I can confirm too - with ubuntu 14.10 everything went fine. Thanks everyone for sharing ideas and thanks tomuta for working on this project!

grynas avatar Mar 17 '15 14:03 grynas

By the way, I believe if you use fdisk instead of sfdisk, you can easily avoid this issue, since I've found another good make script for debian/ubuntu here: http://forum.odroid.com/viewtopic.php?f=112&t=8075

mislam avatar Mar 17 '15 14:03 mislam

Is it possible to make this run on Kubuntu 14.04? I have no option of upgrading, unfortunately.

dniku avatar Jun 05 '15 14:06 dniku

You could try to install a newer version of sfdisk from the backports repository.

tomuta avatar Jun 05 '15 15:06 tomuta

@tomuta, it seems that there is no newer version in the repository. According to this page, sfdisk is in util-linux package, however, running

$ sudo apt-get install util-linux/trusty-backports

on Kubuntu 14.04 LTS fails with the error saying that there is no trusty-backports release for util-linux. Am I missing something obvious, or is there indeed no new version?

UPD: all right, I've found out about the existence of packages.ubuntu.com, and there is indeed no new version. I guess I'll have to opt for some dirty hacking, use a "poorly tested" ppa, or just install Ubuntu 15.04 in VirtualBox.

dniku avatar Jun 15 '15 20:06 dniku

Are you sure it's sfdisk? I'm using 14.04 and the partitions get created properly, but partprobe is failing. Destroying and recreating the loopback device seems to solve the initial problem.

Try this: https://github.com/tomuta/debian-mini-odroid-c1/pull/28

inferiorhumanorgans avatar Jul 26 '15 23:07 inferiorhumanorgans