drtyhlpr
Posts: 4
Joined: Sun Dec 13, 2015 10:16 am

debian "jessie" build script

Sun Dec 13, 2015 10:19 am

Hi forum,

I created a debian "jessie" bootstrapping script and I need your feedback. please use it and tell me what you think. thanks and have fun:

https://github.com/drtyhlpr/rpi2-gen-image

what feature do you think are missing? any other ideas?

thanks

Sanduk
Posts: 4
Joined: Sat Dec 19, 2015 5:14 pm

Re: debian "jessie" build script

Sat Dec 19, 2015 6:08 pm

Your script looks really useful :) . I didn't test it up to now but I'm going to do that the next days (maybe with some tweaking for my usecase).
The script relies on an additional repository with only a couple of packages. Do you know if each of these packages was customized for the debian-jessie-rpi2 purpose? It would be good to know in which way they were altered and how to create updated versions of them. In particular the kernel seems outdated (3.18 vs 4.1.7 for the current raspbian jessie). Are there other differences between the official raspbian kernel and the one from the repository? Afaik the official raspbian kernel does not support qemu (and other potentially useful stuff) but making a debian jessie rpi image which is capable of running in a vm would be really useful for many people!
Say I want to make an image for the other rpi versions (A, B, B+, Zero), can I take your script and just exchange the debian stuff with the raspbian stuff (like the repositories), omit the packages from the custom repository and I'm done? Or is there more to that? I'm not sure but iirc there is also raspbian specific stuff e.g. for the GPIO pins. Will those work with your image?

felGru
Posts: 1
Joined: Sun Dec 20, 2015 10:43 pm

Re: debian "jessie" build script

Sun Dec 20, 2015 10:55 pm

I have started looking at the changes to the packages in this additional repository. For now I have only looked at the flash-kernel package which is build on version 3.35 from Debian, with the following small changes:

Code: Select all

diff --git a/db/all.db b/db/all.db
index 611b769..6d92f80 100644
--- a/db/all.db
+++ b/db/all.db
@@ -594,6 +594,11 @@ Mtd-Kernel: kernel
 Mtd-Initrd: ramdisk
 Bootloader-Sets-Incorrect-Root: yes
 
+Machine: Raspberry pi 2 Model B
+Machine: BCM2709
+Kernel-Flavors: rpi2
+Boot-Kernel-Path: /boot/firmware/kernel7.img
+
 Machine: TI AM335x BeagleBone
 Machine: TI AM335x BeagleBone Black
 Kernel-Flavors: armmp
diff --git a/debian/.gitignore b/debian/.gitignore
deleted file mode 100644
index 6715dee..0000000
--- a/debian/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-*.debhelper*
-*.substvars
-files
-flash-kernel
-flash-kernel-installer
-
diff --git a/debian/changelog b/debian/changelog
index 9fdb66f..3d1d602 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+flash-kernel (3.35.co1) rpi2; urgency=medium
+
+  * Add support for Raspberry pi 2 Model B
+
+ -- Sjoerd Simons <[email protected]>  Sun, 26 Apr 2015 20:45:52 +0200
+
 flash-kernel (3.35) unstable; urgency=medium
 
   * Team upload.
Still have to see if there are any significant changes to the kernel package.

fangfufu
Posts: 27
Joined: Sun Jul 15, 2012 5:03 pm

Re: debian "jessie" build script

Tue Dec 29, 2015 9:55 pm

Thanks, it is really useful.

I don't understand the dbus part. What does it do? Do I actually need it, if I am running my Raspberry Pi headless?

fangfufu
Posts: 27
Joined: Sun Jul 15, 2012 5:03 pm

Re: debian "jessie" build script

Sat Jan 02, 2016 11:00 am

GNU Screen works in a weird way in the image generated using your script - detached screen terminals get terminated when you log out.

To test this, you need to connect to your Raspberry Pi 2 via SSH, and then do the following:

Code: Select all

$ ssh $IP_ADDRESS
$ screen
# type in ctrl +d to detach your screen session
$ screen -r
# re-attachment works correctly
# type in ctrl +d to detach your screen session
$ exit # we are logging out from 
#let's log back in via SSH
ssh $IP_ADDRESS
$ screen -r
There is no screen to be resumed.
I have no idea how to fix this, apologies if I haven't explained myself properly. I have never encountered this problem before, I have no idea what to type in to Google in order to search for solutions.

This is how I generated my image:

Code: Select all

APT_SERVER="http.debian.net" HOSTNAME="vanguard" PASSWORD="afvzsdcx" DEFLOCAL="en_GB.UTF-8" TIMEZONE="Europe/London" ENABLE_CONSOLE=true ENABLE_IPV6=true ENABLE_SSHD=true ENABLE_SOUND=false ENABLE_MINGPU=true ENABLE_DBUS=false ENABLE_XORG=false ENABLE_UBOOT=true ./rpi2-gen-image.sh
I had to install dbus after generating the image by running:

Code: Select all

sudo apt-get install dbus

User avatar
rpdom
Posts: 14984
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: debian "jessie" build script

Sat Jan 02, 2016 11:04 am

That's normal behaviour for screen. Pressing Ctrl-d is the same as typing "exit". You're ending the process that is running in the screen session.

Press Ctrl-a first, then press D to detach from the session.

fangfufu
Posts: 27
Joined: Sun Jul 15, 2012 5:03 pm

Re: debian "jessie" build script

Sat Jan 02, 2016 12:39 pm

rpdom wrote:That's normal behaviour for screen. Pressing Ctrl-d is the same as typing "exit". You're ending the process that is running in the screen session.

Press Ctrl-a first, then press D to detach from the session.
You don't need to press Ctrl - a... Have you read the manual? This is in the man page.

Code: Select all

       C-a d
       C-a C-d     (detach)      Detach screen from this terminal.

User avatar
rpdom
Posts: 14984
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: debian "jessie" build script

Sat Jan 02, 2016 1:14 pm

fangfufu wrote:
rpdom wrote:That's normal behaviour for screen. Pressing Ctrl-d is the same as typing "exit". You're ending the process that is running in the screen session.

Press Ctrl-a first, then press D to detach from the session.
You don't need to press Ctrl - a... Have you read the manual? This is in the man page.

Code: Select all

       C-a d
       C-a C-d     (detach)      Detach screen from this terminal.
Yes, I've read the manual. I use screen all the time.

What do you think "C-a d" or "C-a C-d" mean? Clue: Press Ctrl-a, then d or press Ctrl-a, then Ctrl-d.
man screen wrote: By default, each command begins with a control-a (abbreviated C-a from now on), and is followed by one other keystroke.

fangfufu
Posts: 27
Joined: Sun Jul 15, 2012 5:03 pm

Re: debian "jessie" build script

Sat Jan 02, 2016 1:20 pm

rpdom wrote:
fangfufu wrote:
rpdom wrote:That's normal behaviour for screen. Pressing Ctrl-d is the same as typing "exit". You're ending the process that is running in the screen session.

Press Ctrl-a first, then press D to detach from the session.
You don't need to press Ctrl - a... Have you read the manual? This is in the man page.

Code: Select all

       C-a d
       C-a C-d     (detach)      Detach screen from this terminal.
Yes, I've read the manual. I use screen all the time.

What do you think "C-a d" or "C-a C-d" mean? Clue: Press Ctrl-a, then d or press Ctrl-a, then Ctrl-d.
man screen wrote: By default, each command begins with a control-a (abbreviated C-a from now on), and is followed by one other keystroke.
Ahh yes, I have been pressing C-a d all the time... If I press C-d, it actually terminates screen. Apologies.

Anyway, the problem has got nothing to do with how I detached screen. I logged into two separate SSH sessions, and when one SSH session gets terminated, all the screen sockets associated with that session gets deleted from /var/run/screen/S-$USERNAME. I can see it from the other SSH session.

Return to “Debian”