greatislander
Posts: 2
Joined: Thu Oct 01, 2015 4:28 am

/etc/inittab no longer present in Raspbian Jessie?

Mon Oct 12, 2015 1:07 pm

Just installed Jessie on my Raspberry Pi Model B, and I went to edit /etc/inittab to configure my serial interface—and it's not there. What's the story?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4690
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: /etc/inittab no longer present in Raspbian Jessie?

Mon Oct 12, 2015 1:43 pm

inittab was a part of sysvinit, which has been replaced with systemd.. Serial getty is now a service like any other. What would you like to do exactly?

engineer_m
Posts: 25
Joined: Tue Apr 28, 2015 6:37 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Tue Oct 13, 2015 5:18 pm

I also have this problem. Previously i used sudo wget https://raw.github.com/lurch/rpi-serial ... al-console -O /usr/bin/rpi-serial-console && sudo chmod +x /usr/bin/rpi-serial-console.With that script I enabled and disabled my serial console, and i also changed its baud rate. How can i do that now?

ultrademon666
Posts: 1
Joined: Tue Oct 13, 2015 10:12 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Tue Oct 13, 2015 10:15 pm

Hi, i also had the same problem:

You have to disable the serial getty service:

Code: Select all

sudo systemctl stop serial-getty@ttyAMA0.service
you can also disable it from start again:

Code: Select all

sudo systemctl disable serial-getty@ttyAMA0.service

engineer_m
Posts: 25
Joined: Tue Apr 28, 2015 6:37 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Wed Oct 14, 2015 6:56 am

can you please tell me how to change the baud rate?

tlc
Posts: 18
Joined: Mon Mar 04, 2013 10:49 am

Re: /etc/inittab no longer present in Raspbian Jessie?

Thu Dec 17, 2015 1:57 pm

Hello.
The same question - Can anyone tell how to change baudrate for serial-getty@ttyAMA0.service
I do not want to have kernel messages on ttyAMA0, but I want to have serial terminal connected via ttyAMA0 with 9600kbit speed.
Thanks
Tomas

diederik
Posts: 389
Joined: Wed Mar 26, 2014 11:17 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Sun Dec 20, 2015 2:50 pm

tlc wrote:I do not want to have kernel messages on ttyAMA0, but I want to have serial terminal connected via ttyAMA0 with 9600kbit speed.
Modify /boot/cmdline.txt so it has sth like this:

Code: Select all

console=ttyAMA0,9600 kgdboc=ttyAMA0,9600 console=tty1
By having tty1 as the last console it will receive the kernel messages and not ttyAMA0

tlc
Posts: 18
Joined: Mon Mar 04, 2013 10:49 am

Re: /etc/inittab no longer present in Raspbian Jessie?

Mon Dec 21, 2015 6:28 am

Thanks diederik.
But this does not work in Raspbian Jessie with systemd.
I have already tried some combinations like
console=ttyAMA0,9600 kgdboc=ttyAMA0,9600 console=tty1
console=ttyAMA0,9600 kgdboc=tty1 console=tty1

But kernel messages are still on both tty1 and ttyAMA0 :-(

Tomas

tlc
Posts: 18
Joined: Mon Mar 04, 2013 10:49 am

Re: /etc/inittab no longer present in Raspbian Jessie?

Mon Dec 21, 2015 6:53 am

I have made next set of searches...
Tried sugestion on http://archlinuxarm.org/forum/viewtopic.php?f=31&t=5640 - just to make link

Code: Select all

ln -s /lib/systemd/system/serial-getty@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyAMA0.service
and erase ttyAMA0 from cmdline.txt - and it works ok for me now.
It seems that agetty is started with capability to support three speeds by default:
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM

Tomas

diederik
Posts: 389
Joined: Wed Mar 26, 2014 11:17 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Tue Dec 22, 2015 2:46 pm

Thanks for reporting the solution back, much appreciated :)

vilo
Posts: 1
Joined: Thu Jun 16, 2016 9:17 am

Re: /etc/inittab no longer present in Raspbian Jessie?

Thu Jun 16, 2016 9:23 am

Under Raspbian Jessie, you can use:

Code: Select all

sudo raspbian-config
Then choose "Advanced Options", then "Serial" and answer "No" to the question "Would you like a login shell to be accessible over serial?" However, this also removes the /dev/ttyAMA0 device.

barthawk
Posts: 8
Joined: Sat Aug 10, 2013 1:12 am

Re: /etc/inittab no longer present in Raspbian Jessie?

Tue Jun 21, 2016 6:34 am

Is there a way to get /dev/ttyAMA0 back if we disable serial consoles in raspi-config?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4690
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: /etc/inittab no longer present in Raspbian Jessie?

Tue Jun 21, 2016 6:59 am

enable_uart=1 in config.txt ensures the hardware itself is registered by the kernel.

barthawk
Posts: 8
Joined: Sat Aug 10, 2013 1:12 am

Re: /etc/inittab no longer present in Raspbian Jessie?

Tue Jun 21, 2016 7:15 am

Thanks for the suggestion, I checked the config.txt file and enable_uart=1 was already in the file, but there is still no /dev/ttyAMA0 file when I boot.

I'm, trying to write from a python script to the serial port. On my Pi Zero, the cmdline.txt doesn't refer to ttyAMA0, but serial0 which is linked to ttyAMA0. I remove that bit from cmdline.txt, but then when I reboot //dev/ttyAMA0 don't exist. If I tried the linking as described above, then I get a single message on the serial port saying "Uncompressing Linux... done, booting the kernel" but no logon prompt. Then /dev/ttyAMA0 exists.

However, when I try to open the port using python I get the message saying "Port is already open".

EDIT *User Error*
I didn't realize that defining the serial port in python opened the port automatically and I tried to open the port again, resulting in the error. It does appear that just removing the references to ttyAMA0 or ttySerial0 in the /boot/cmdline.txt while enabling the use of the serial port using raspi-config will enable the use of the serial port from user land programs. I did also change the permissions on ttyAMA0 to +0666 to allow regular users to write to it.

Thanks

netdudeuk
Posts: 10
Joined: Sun Jul 03, 2016 4:30 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Mon Jul 04, 2016 8:05 am

Hi

I have the same issue.

My cmdline.txt looks like this -

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

It used to look like this -

dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

I can access the serial port from Python but I still get the same "Uncompressing Linux... done, booting the kernel" message in the terminal window. What is needed to disable this message ?

Thanks

nadeto9696
Posts: 6
Joined: Thu Jul 14, 2016 2:02 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Thu Jul 14, 2016 2:06 pm

Hello,

I am trying to connect a Pi-Lite to a Pi 2B. I followed the instructions available and found out that the inittab file has been replaced with another one. However I couldn't find instructions anywhere about how to procede with the new os.

Can anyone help?
Cheers.

User avatar
DougieLawson
Posts: 30142
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: /etc/inittab no longer present in Raspbian Jessie?

Fri Jul 15, 2016 5:37 pm

nadeto9696 wrote:Hello,

I am trying to connect a Pi-Lite to a Pi 2B. I followed the instructions available and found out that the inittab file has been replaced with another one. However I couldn't find instructions anywhere about how to procede with the new os.

Can anyone help?
Cheers.
Can you post a link to the historic instructions you're following? What is it doing to inittab? If it is just to disable the serial console then there's an option in sudo raspi-config to do that for you on Jessie.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
danpeirce
Posts: 90
Joined: Thu May 10, 2012 8:32 am
Location: Richmond & Surrey BC Canada
Contact: Website

Re: /etc/inittab no longer present in Raspbian Jessie?

Sun Jul 17, 2016 7:32 am

barthawk wrote:Thanks for the suggestion, I checked the config.txt file and enable_uart=1 was already in the file, but there is still no /dev/ttyAMA0 file when I boot.

I'm, trying to write from a python script to the serial port. On my Pi Zero, the cmdline.txt doesn't refer to ttyAMA0, but serial0 which is linked to ttyAMA0. I remove that bit from cmdline.txt, but then when I reboot //dev/ttyAMA0 don't exist. If I tried the linking as described above, then I get a single message on the serial port saying "Uncompressing Linux... done, booting the kernel" but no logon prompt. Then /dev/ttyAMA0 exists.

However, when I try to open the port using python I get the message saying "Port is already open".

EDIT *User Error*
I didn't realize that defining the serial port in python opened the port automatically and I tried to open the port again, resulting in the error. It does appear that just removing the references to ttyAMA0 or ttySerial0 in the /boot/cmdline.txt while enabling the use of the serial port using raspi-config will enable the use of the serial port from user land programs. I did also change the permissions on ttyAMA0 to +0666 to allow regular users to write to it.

Thanks
Yes that (bold) seems to have worked for me using the Raspberry Pi Zero. In this case it was a reference to ttySerial0 that I removed.
As someone pointed out I am getting a message on ttyAMA0 on a reboot:

"Uncompressing Linux... done, booting the kernel. "

But since I will be writing custom firmware for the device I'll be connecting to the RPi zero that message could be handy. My PIC32 will boot faster and will need to wait for the RPi zero to come up.

nadeto9696
Posts: 6
Joined: Thu Jul 14, 2016 2:02 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Thu Jul 21, 2016 9:57 am

DougieLawson wrote:
nadeto9696 wrote:Hello,

I am trying to connect a Pi-Lite to a Pi 2B. I followed the instructions available and found out that the inittab file has been replaced with another one. However I couldn't find instructions anywhere about how to procede with the new os.

Can anyone help?
Cheers.
Can you post a link to the historic instructions you're following? What is it doing to inittab? If it is just to disable the serial console then there's an option in sudo raspi-config to do that for you on Jessie.
Hello again and thanks for your reply!

I managed to disable the serial port through the raspi-config menu but now I am struggling with disabling the bootup info on the serial port and using the minicom. I am following this guide: http://www.raspberrypi-spy.co.uk/2013/0 ... rix-board/ . When I execute the command sudo nano /boot/cmdline.txt I get something really similar to the expected sentence: dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline rootwait. Should I change it to the expected sentence or is it just changed for this version of the Pi/OS? The next step - the minicom is also not working, supposedly because I am not sure if the disable of the bootup step is fine. The line minicom -b 9600 -o -D /dev/ttyAMA0 is not doing anything for me. (''pressing keys on your keyboard should result in them appearing on the Pi-Lite!'')
Basically I am very confused and have little to no idea about what is going on. Any help is appreciated.

User avatar
DougieLawson
Posts: 30142
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: /etc/inittab no longer present in Raspbian Jessie?

Fri Jul 22, 2016 9:10 pm

Stop using an OUT OF DATE article from 2013. Find something that's current.

Also it's against the forum rules to post multiple topics on the same subject. Keep everything in one thread.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

charlzmon
Posts: 1
Joined: Thu Sep 07, 2017 12:49 pm

Re: /etc/inittab no longer present in Raspbian Jessie?

Thu Sep 07, 2017 12:52 pm

This should sort you out
https://spellfoundry.com/2016/05/29/con ... ding-pi-3/

I was struggling with the same thing: using outdated tutorials.

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 29 guests