7 Replies Latest reply on Oct 11, 2014 6:11 AM by mhahn

    Edison boot into single-user mode?

    raminf

      I re-flashed the Edison, added an 8GB SD card to the Arduino board, and created a symbolic link from /usr/local to /home/local after moving all the contents over. This allowed me to build and install a large amount of software on the device itself (including Postgres, Python3, Django, nginx, and a boatload of python packages).

       

      All was going well until I tried to set Postgres auto-start on boot. So I added an entry for systemd, made sure the individual commands ran properly on the command line, and then restarted.

       

      The system has gone into an endless reboot loop, stuck on:

       

      [ TIME ] Timed out waiting for device dev-mmcblk1p1.device.

      [DEPEND] Dependency failed for Mount for SDCard.

      [ TIME ] Timed out waiting for device dev-disk-by\x2dpartlabel-factory.device.

      [DEPEND] Dependency failed for Mount for factory.

      [ TIME ] Timed out waiting for device sys-subsystem-net-devices-wlan0.device.

      [DEPEND] Dependency failed for WPA supplicant service.

      [ TIME ] Timed out waiting for device dev-ttyMFD2.device.

      [DEPEND] Dependency failed for Serial Getty on ttyMFD2.

      [ TIME ] Timed out waiting for device dev-disk-by\x2dpartlabel-home.device.

      [DEPEND] Dependency failed for /home.

      [DEPEND] Dependency failed for File System Check on /dev/disk...partlabel/home.

       

      Followed by a series of messages like this that has been running for at least an hour:

       

      A start job is running for Create Static Device Node... 20s / no limit)

      A start job is running for Create Static Device Node... min / no limit)

      ...

       

      Is there anyway I can boot up in single-user mode?

       

      I'd like try to run fsck on the file system (if it's available) and see if this has anything to do with the startup script? I'd really rather not reflash the device and start from scratch if possible (getting it to that point was a couple days worth of work).

       

      TIA for any advice.

        • 1. Re: Edison boot into single-user mode?
          mhahn

          hmmm, rough guess: I'd assume the mountpoint might not be yet available when you start the script. And you should be able to tell grub to init=/bin/sh or something like this. Maybe you need to put something more due to systemd start

          • 2. Re: Edison boot into single-user mode?
            JPMontero_Intel

            Hi raminf,

             

            Single user mode is not accessible during the boot process, you can access single user mode if you are logged into Linux by typing "init 1"

             

            Regards,
              JPMontero_Intel

            • 3. Re: Edison boot into single-user mode?
              mhahn

              in my reply surely grub -> uboot. Aren't there boot options for uboot as well similar to what you'd have with grub?

              • 4. Re: Edison boot into single-user mode?
                raminf

                Thanks JPMonteiro.

                 

                That would be a very handy thing to have. Most Unix devices going back to early Sun workstations had boot into single user mode. It comes in handy if there's a regular startup problem so you can edit startup config files in root and bring things back up.

                 

                In my case I was stuck in a startup loop and couldn't get to Unix prompt. Ended up having to re-flash the whole thing and had to go back to zero.

                • 5. Re: Edison boot into single-user mode?
                  raminf

                  Thanks mhahn. Grub commands don't seem to match uboot. I tried lots of variations including 'single' as well as 'run bootcmd single' and various forms of -s, s, single, 1, and -1). None of them worked. Based on response from JPMonteiro there doesn't appear to be a way to go single-user. Ended up reflashing and  starting all over.

                   

                  Really wish they'd add that in. It's going to be a big barrier in the way of adding startup services to systemd.

                  • 6. Re: Edison boot into single-user mode?
                    AlexT_Intel

                    raminf

                    There's something called rescue mode, which is AFAICS pretty much "single", you can boot into by doing the below:

                     

                    1) At the very stage of the board's boot process, at the "Hit any key to stop autoboot" prompt, hit any key

                    2) Type "setenv bootargs_target rescue" and hit Enter

                    3) Type "boot" and hit Enter

                     

                    The system will boot into so called "rescue.target" mode which I haven't investigated much, but it looks very much like a single user mode. The command acts only for the current boot, if you reset the board, it will try to boot into standard multiuser mode again.

                     

                    I'm not sure if it's going to help you with this specific problem of mount not coming up on time, but you can defintiely try and see Please report back here, I'm sure your findings will be interesting for others.

                     

                    Below is the serial console log of an example boot into this mode with the things you need to type in bold green:

                    ******************************

                    PSH KERNEL VERSION: b0182727

                                    WR: 20104000

                    ******************************

                     

                    SCU IPC: 0x800000d0  0xfffce92c

                     

                    PSH miaHOB version: TNG.B0.VVBD.0000000c

                     

                    microkernel built 23:15:13 Apr 24 2014

                     

                    ******* PSH loader *******

                    PCM page cache size = 192 KB

                    Cache Constraint = 0 Pages

                    Arming IPC driver ..

                    Adding page store pool ..

                    PagestoreAddr(IMR Start Address) = 0x04899000

                    pageStoreSize(IMR Size)          = 0x00080000

                     

                    *** Ready to receive application ***

                     

                     

                    U-Boot 2014.04 (Oct 05 2014 - 16:32:58)

                     

                          Watchdog enabled

                    DRAM:  980.6 MiB

                    MMC:  tangier_sdhci: 0

                    In:    serial

                    Out:  serial

                    Err:  serial

                    Hit any key to stop autoboot:  0

                    boot > setenv bootargs_target rescue

                    boot > boot

                    Target:blank

                    Partitioning already done...

                    Flashing already done...

                    GADGET DRIVER: usb_dnl_dfu

                    reading vmlinuz

                    5129792 bytes read in 127 ms (38.5 MiB/s)

                    Valid Boot Flag

                    Setup Size = 0x00003c00

                    Magic signature found

                    Using boot protocol version 2.0c

                    Linux kernel version 3.10.17-poky-edison+ (ed@bl-ub1204) #1 SMP PREEMPT Sun Oct 5 15:36:14 CEST 2014

                    Building boot_params at 0x00090000

                    Loading bzImage at address 00100000 (5114432 bytes)

                    Magic signature found

                    Kernel command line: "root=PARTUUID=012b3303-34ac-284d-99b4-34e03a2335f4 rootfstype=ext4 console=ttyMFD2 earlyprintk=ttyMFD2,keep loglevel=4 systemd.unit=rescue.target hardware_id=00 g_multi.iSerialNumber=bb11d34bb98d8306630653ab88ac5d79"

                     

                    Starting kernel ...

                    <boot sequence cut>

                       Starting Rescue Shell...

                    [  OK  ] Started Rescue Shell.

                    [  OK  ] Reached target Rescue Mode.

                    Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.

                    Type "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.

                    Give root password for system maintenance

                    (or type Control-D for normal startup):

                    • 7. Re: Edison boot into single-user mode?
                      mhahn

                      for a permanent change you could directly modify systemd.

                       

                      By default the "default.target" maps to multi-user. You may change it to whatever seems fine for you. This could be e.g. the "rescue.target" mentioned by AlexT_Intel or the "basic.target" or something you define yourself.

                       

                      # ls -la /etc/systemd/system/default.target

                      lrwxrwxrwx    1 root     root            37 Oct  9 14:22 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target