User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

Force Raspi-config to run at next boot

Sun Sep 23, 2012 8:56 am

I am working on making a distro spin for Raspi and I would like to be able to distribute the image so that raspi-config is set to run at the first boot, like in Rasbian.

So, uhh, how would on go about doing so?
echo "Something Useful" > /dev/null

User avatar
RaTTuS
Posts: 10558
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Force Raspi-config to run at next boot

Sun Sep 23, 2012 9:17 am

put something in the /ect/rc?.d locations that do the stuff then remove the script [or change the runlrevel values on teh script]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

Re: Force Raspi-config to run at next boot

Tue Oct 09, 2012 2:54 am

The secrets are this code which is a more documented version of the original. The original can be found at http://github.com/asb/raspi-config

Code: Select all

#!/bin/sh
# Part of raspi-config http://github.com/super-nathan/raspi-config
#
# See LICENSE file for copyright and license details

# Should be installed to /etc/profile.d/raspi-config.sh to force raspi-config 
# to run at initial login

# You may also want to set automatic login in /etc/inittab on tty1 by adding a 
# line such as:
# 1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1 # RPICFG_TO_DISABLE

# If you are trying to make this run on boot for a machine that has already been configured,
# then if you follow all the above instructions you will still be booted into an X session.
# If you <ctlr>+<alt>+<f1> you will find the raspi-config there ready to run. 
# In order to boot straight into Raspi-config you must disable lightdm with 
# $ sudo update-rc.d lightdm disable
# Then when you reboot the machine, you will be sent straight into the config.


if [ $(id -u) -ne 0 ]; then
  printf "\nNOTICE: the software on this Raspberry Pi has not been fully configured. Please run 'sudo raspi-config'\n\n"
else
  raspi-config
  exec login -f pi
fi
echo "Something Useful" > /dev/null

Return to “Beginners”