Let me know if you like this! :)

Wow nice, thank you!
75%
12
Uhm, why would anyone use that?!
25%
4
 
Total votes: 16
c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Tue Apr 14, 2015 4:46 pm

Ok, first you have to use "/dev/sda". That's why it says "/dev/sdX" - Don't use sda5...
The second problem is, that the tool "fuser" isn't found. You should have been warned that it's missing. Please download the latest version of the installer and try again. There were some changes yesterday.
Be sure to install the debian package "psmisc" first which includes "fuser".

I really have no clue why it doesn't find raspi-config... in my latest test installation this worked fine.
Maybe you just retry it like I said above :-)

Please let me know if there are any further problems. Thanks!

mshannon
Posts: 8
Joined: Thu Oct 17, 2013 4:14 pm

Re: rpi2strap - Debian armhf

Tue May 05, 2015 6:40 pm

Thanks, I eventually got this to work but my SD card got corrupted. I tried again but could not get it to work. I've had another go after your recent update but I get:

sudo python rpi2strap.py /dev/sdb
Traceback (most recent call last):
File "rpi2strap.py", line 111, in <module>
main()
File "rpi2strap.py", line 42, in main
from armdebootstrap import ArmDeboostrap
File "/home/pi/armdebootstrap.py", line 1
SyntaxError: Non-ASCII character '\xc3' in file /home/pi/armdebootstrap.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

I got a similar error ' File "rpi2strap.py", line 1 ' when I ran rpi2strap.py and removed the Non-ASCII characters in your surname which let it move on to armdebootstrap.py, but I cannot remove them as this file re-downloads the new one. I changed my locale to include all languages (this took some time) but I still get the same error.

I then tried to run armdebootstrap.py but get the error:
sudo python armdebootstrap.py
File "armdebootstrap.py", line 177
print(content, file=f)
^
SyntaxError: invalid syntax

So I cannot move on .

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Tue May 05, 2015 7:17 pm

Please try again using python3 ;)
sudo python3 rpi2strap.py /dev/sdb

linux34
Posts: 46
Joined: Sat Jul 21, 2012 9:00 am

Re: rpi2strap - Debian armhf

Tue May 19, 2015 9:49 am

Can we make Debian 8 image?
How mb is the image?

Can any give link to download this image ?

Thanks...

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Tue May 19, 2015 9:55 am

I created the script because I don't like images.
If you need an image you could create an empty image with dd and remove the check for "/dev/sd*" in the script.

brightidea
Posts: 7
Joined: Wed Aug 31, 2011 7:45 am

Re: rpi2strap - Debian armhf

Wed May 20, 2015 9:12 am

Thank you for this script.

for ubuntu 14.04 users:

libdebian-installer-extra4_0.99ubuntu1_amd64.deb
libdebian-installer4_0.99ubuntu1_amd64.deb
cdebootstrap_0.6.4ubuntu1_amd64.deb

get these from http://packages.ubuntu.com/ out of the vivid repo and install with "sudo dpkg -i PACKAGENAME"
Do it in the order above to prevent dependancy errors.


One suggestion, can you update the script to use local mirrors, as uk would be better than germany for me personally. Maybe a command line option for the local mirror region code to use, defaulting to germany if not given?

brightidea
Posts: 7
Joined: Wed Aug 31, 2011 7:45 am

Re: rpi2strap - Debian armhf

Wed May 20, 2015 11:21 am

another suggestion, use python getpass so the end user can choose their own root password.

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Wed May 20, 2015 12:51 pm

@brightidea good idea, I'll add this :-)

User avatar
gigpi
Posts: 17
Joined: Thu May 14, 2015 12:23 pm

Re: rpi2strap - Debian armhf

Thu May 21, 2015 7:30 pm

@c0d3z3r0
Hello and thanks for the script, my microSD get mounted as "mmcblk0" so i get "Wrong sdcard format! Should be /dev/sdX" error.
I commented the if check in armdebootstrap.py but the error won't go away, soon as i give the python3 rpi2strap.py /dev/mmcblk0 command magically my comments get deleted o.0

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Thu May 21, 2015 7:39 pm

Indeed, there is some magic in my script :P armdebootstrap get's downloaded everytime you execute rpi2strap, maybe that's not the best way ti be sure to have the latest version. I'll comment this out and add an update option or so later.
I am going to add "mmcblk" devices to the check.

Give me some minutes ;-)

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Thu May 21, 2015 7:58 pm

@gigpi Fixed now

hexed6
Posts: 1
Joined: Tue May 26, 2015 3:19 am

Re: rpi2strap - Debian armhf

Tue May 26, 2015 3:34 am

c0d3z3r0,

I registered to say thank you. Initially, I was worried because there was no installation candidate for fdisk on my Debian Jessie host, which is listed as a prerequisite. The script ran without a single error or warning, and the system booted fine. Currently installing X, wish me luck. ;)

On a side note, do you have a recommended method for getting Kodi installed on Jessie? I've seen some notes about getting it compiled, but no real guide.

Thanks again for the script.

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Tue May 26, 2015 3:17 pm

Hi hexed6,

I'm glad to hear that it worked for you :-)

I'm not using Kodi so I have no hints for you. Sorry :(

skgucek
Posts: 4
Joined: Fri Jun 05, 2015 11:52 am

Re: rpi2strap - Debian armhf

Fri Jun 05, 2015 4:46 pm

Thanks for your script, sadly it fails on the last step for me:

Code: Select all

[email protected]:~/rpi2strap$ sudo python3 rpi2strap.py /dev/sdb
[sudo] password for stasko: 
Welcome to RPi2strap!
This is your last chance to abort!
Your sdcard is /dev/sdb. Is that right? [yN] 
y
Delete MBR and partition table and create a new one.
Create filesystems.
Mount filesystems.
Install debian. First stage. This will take some minutes.
Second stage. Again, please wait some minutes.
You can safely ignore the perl and locale warnings.
Configure the system.
Update the system.
Install rpi-update and raspi-config package.
Traceback (most recent call last):
  File "./rpi2strap.py", line 112, in <module>
    main()
  File "./rpi2strap.py", line 55, in main
    % adb.tmp.name)
AttributeError: 'str' object has no attribute 'name'
System information:

Code: Select all

[email protected]:~$ uname -a
Linux ornis 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) x86_64 GNU/Linux
[email protected]:~$ cat /etc/debian_version
8.0
[email protected]:~$ python3 -V
Python 3.4.2
Even through I am not a python expert, I will try to decipher your script and finish the rest of the installation by hand... but it would be great if you told me what I was doing wrong, since the script apparently works for others.

EDIT: Finished by running the rest of the commands in the script by hand, it boots. However, I have a few questions:
a) What is the VideoCore linking step about? Doesn't rpi-update take care of all that? I didn't do it, since I'm running headless.
b) Your proposed step of installing of rpi-update and raspi-config is from unofficial Wheezy repositories on archive.raspberrypi.org. Mixing repositories from different Debian versions is really bad practice, especially with different versions from unofficial sources. When I tried running that step by hand, I noticed that it doesn't just innocently install two packages, but a bunch of them, a lot of them Wheezy. Why do this, when you can keep a clean Jessie/Testing/Sid sources.list by installing these tools by hand, as I did:

Code: Select all

# required curl which is not installed by default with your tool, but I guess it could be "pyhtonized"
curl -L --output /usr/bin/rpi-update https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update 
chmod +x /usr/bin/rpi-update
curl -L --output /usr/bin/raspi-config https://raw.githubusercontent.com/asb/raspi-config/master/raspi-config 
chmod +x /usr/bin/raspi-config
The tools can update themselves, I think it is an appropriate option for keeping the sources.list clean until someone at Debian packages these tools and starts making official RPi2 images.
c) In the script, you forgot to add the hostname from /etc/hostname to /etc/hosts, when the finished installation is run, it constlanty complains about "unknown host: raspberrypi".
d) 32 MB is really small for the boot partition, some of us plan to compile our own kernels and would like to keep the official one on that partition as backup. Why not the standard 100 MB or maybe ask the user for the size, add arg options?
e) Otherwise thanks for your tool! Qemu is sadly quite slow for me on a netbook, I think it would be nice if a minimal image creating script was written for running directly on RPi using debootstrap and regular chroot, one that would produce a .tar in the style of archlinux-arm. I really liked their method of distribution, but Arch is sadly too unstable for me.

Cheers and good luck with your script!

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Sat Jun 06, 2015 12:19 pm

Thank you very much for your contribution! :-)
skgucek wrote:Thanks for your script, sadly it fails on the last step for me:
Fixed. I forgot to change rpi2strap after modifying armdebootstrap.

a) I have had the problem that I couldn't access the vc binaries without specifying the full path. The paths are now added to PATH instead of symlinking the binaries.
b) rpi-update and raspi-config are now installed as you suggested
c) Fixed
d) There is now an parameter -b / --boot-size for changing the partition size. The default is 100M
e) I didn't need that so there was no need to add an option for creating a tar archive. Sorry for that. Maybe this will be added at some time later.

skgucek
Posts: 4
Joined: Fri Jun 05, 2015 11:52 am

Re: rpi2strap - Debian armhf

Sat Jun 06, 2015 2:38 pm

Very nice!

First of all, archive.raspberrypi.org now actually has a jessie dist, so that makes your old method a bit better since you would not be mixing packages from different dist versions. But it is still bad for people who want to use testing or sid.

Also, I figured this later, but forgot to write:
rpi-update checks for its dependencies, which in the raspberrypi.org package are listed as such: curl, binutils (which contains readelf)
raspi-config does not check for its dependencies (bah), which in the raspberrypi.org package are listed as such: whiptail, parted, lua5.1, triggerhappy

I'm not sure what happens if you run raspi-config without those, it opens okay, but maybe fails later on configuring. Generally I think that script is less important than the first one. I only installed rpi-update on my Pi, as it is the easiest way of getting the full firmware, but so far I haven't had the need for the other script and did minor customizations manually.

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Sat Jun 06, 2015 6:36 pm

Oh... you're right. That's really bad. I'll add the dependency checking to raspi-config and offer a pull request to the developer(s).

zyxmon
Posts: 2
Joined: Mon Jun 15, 2015 11:17 am

Re: rpi2strap - Debian armhf

Mon Jun 15, 2015 11:24 am

Thanks for the script.
A couple of tiny remarks.
1)
>> The raspberrypi.org repository is included in the sources.list.

I cannot find it in /etc/apt
2) The way rpi-update is run - it does not create symlinks to /opt/vc/bin utilities
No config.txt file is present in /boot

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Mon Jun 15, 2015 1:39 pm

zyxmon wrote: >> The raspberrypi.org repository is included in the sources.list.

I cannot find it in /etc/apt
raspberrypi.org repo is no longer included in the apt sources because the installation process of rpi-update and raspi-config changed. They are now installed directly. So you will get a "really" clean debian armhf.
zyxmon wrote: 2) The way rpi-update is run - it does not create symlinks to /opt/vc/bin utilities
Correct. /opt/vc/bin and /opt/vc/sbin are now added to the PATH instead of symlinking the binaries.
zyxmon wrote: No config.txt file is present in /boot
Fixed :)

zyxmon
Posts: 2
Joined: Mon Jun 15, 2015 11:17 am

Re: rpi2strap - Debian armhf

Mon Jun 15, 2015 1:52 pm

One more remark on Readme.md (installation). In Debian one needs to install qemu-user-static, not qemu-arm-static.
BTW I have written a small post in my blog (Russian) on RPI2, Rasbian and Jessie - http://www.zyxmon.org/2015/06/14/raspbe ... an-jessie/

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Mon Jul 06, 2015 4:44 pm

skgucek wrote: rpi-update checks for its dependencies, which in the raspberrypi.org package are listed as such: curl, binutils (which contains readelf)
raspi-config does not check for its dependencies (bah), which in the raspberrypi.org package are listed as such: whiptail, parted, lua5.1, triggerhappy
This is now fixed. Dependencies will be installed and raspi-config checks them. I submitted a pull request.

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Tue Jul 21, 2015 7:16 pm

New Features:
- You'll be asked for a root password
- Overclocking can now be done with rpi2strap oc setting in raspi-config

User avatar
gigpi
Posts: 17
Joined: Thu May 14, 2015 12:23 pm

Re: rpi2strap - Debian armhf

Fri Aug 07, 2015 12:49 pm

c0d3z3r0 wrote:New Features:
- You'll be asked for a root password
- Overclocking can now be done with rpi2strap oc setting in raspi-config
Hello!
Using this line to install:

Code: Select all

./rpi2strap.py --packages screen --boot-size 100 /dev/mmcblk0
I have trouble with root password step:

Code: Select all

Configure the system.
Enter rpi root password: 
Repeat: 
Traceback (most recent call last):
  File "./rpi2strap.py", line 95, in <module>
    main()
  File "./rpi2strap.py", line 51, in main
    adb.install()
  File "/home/user/bin/rpi2strap/armdebootstrap.py", line 285, in install
    self.configure()
  File "/home/user/bin/rpi2strap/armdebootstrap.py", line 252, in configure
    (self.rootpass, self.tmp))
AttributeError: 'ArmDeboostrap' object has no attribute 'rootpass'
I have done 3 test, with different passwords, but got the same result as above.
Hope this help fixing :)

c0d3z3r0
Posts: 23
Joined: Fri Jun 14, 2013 1:27 pm

Re: rpi2strap - Debian armhf

Fri Aug 07, 2015 1:34 pm

Thanks, fixed now

User avatar
gigpi
Posts: 17
Joined: Thu May 14, 2015 12:23 pm

Re: rpi2strap - Debian armhf

Fri Aug 07, 2015 6:44 pm

c0d3z3r0 wrote:Thanks, fixed now
Now is working perfectly.
Thank you for your work!

Return to “Debian”

Who is online

Users browsing this forum: No registered users and 3 guests