Fastboot command to reboot in recovery mode? - command

Is there a fastboot command to reboot in factory mode?
I've tried fastboot reboot factory and got no success

I have always used
"fastboot reboot-recovery"

Related

How to apply SELinux file_contexts change on AOSP device without a full image flash?

I am modifying SELinux policies for a hardware device running Android 9.
Currently my process is like this:
Run the device as userdebug but with SELinux set to enforcing
Make changes to .te files and/or file_contexts
Build the policies using mmm system/sepolicy
Push the policies on the device using the following script:
adb root
adb wait-for-device
adb remount
adb wait-for-device
adb push out/target/product/<PRODUCT_NAME>/vendor/etc/selinux /vendor/etc/
adb push out/target/product/<PRODUCT_NAME>/system/etc/selinux /system/etc/
adb shell sync; sync; sync;
adb reboot
Test and go back to step 1 if needed.
This process seems to work fine when modifications involve .te files. But when I modify the file_contexts, this doesn't work, and labels I changed are not applied on the device.
For now, I have to do a full make and flash when I modify file_contexts, which is very time consuming...
So is there a way to apply file_contexts changes without a full make/flash ?
Check if there is product/etc/selinux or odm/etc/selinux in the ${ANDROID_PRODUCT_OUT}.
If they exist, you have to push them into the device too.
The file_contexts is only applied if the file or directory is created via init.rc or after running the restorecon command.
If the file or directory is created by adb shell or any other process runtime, the selinux context will inherit its parent.

Raspberry pi 4B doesnt boot after systemctl reboot

I rebooted my rpi 4b with the following command: sudo systemctl reboot, and it did turn off, but wasn't rebooting after about an hour and a half (i had rebooted it perfectly before) so I decided to cut the power off and on, and try to login via ssh, but the green LED it blinked quickly and stopped after a long blink. I tried looking up answers but didn't find anything, I also tried removing and re-creating the FAT32 partitions, but I got the same LED pattern. Thanks in advance.
If you are just trying to reboot the raspi then you simply need reboot or sudo reboot. systemctl is something else entirely and responsible for running services on your pi.

how can i reset service usb to serial driver that listed in lsmod without reboot system?

I have one usb_to_serial that connected my usb
and installed by this command
modprobe usbserial vendor=0x67b product=0x2303
and connect to other devices via console
and when use of the screen for connecting to console for example
screen /dev/ttyUSB0 9600
i can stop the session by the this command
fuser -k /dev/ttyUSB0
but when connect to other device console my console empty show
my question is when i reboot the system and connecting the first device via Console any thing is ok but when i need to connect to other device then must be reboot the os thus can to connect new device! there is any method that don`t required to reboot and only reset the usbserial service without reboot?
thanks for help
now me found a method to restart service usbconsole
if you have same problem then can to try kill process by
pkill -f /dev/ttyUSB0 ; screen /dev/ttyUSB0 9600
by this command you kill prior session on Serial Console and create new session for them

kernel module insertion issue

We are running the latest raspibian on the raspberry pi board and have a kernel driver for a USB peripheral which is added externally (sudo insmod driverx.ko) after boot-up by connecting to the hardware using ssh (its a headless system).
The problem is as follows:
If the device is already connected to the system upon power-up then running sudo insmod driverx.ko leads to the terminal getting stuck (no response, Ctrl+C doesn't work). Running lsmod by starting another ssh session shows that the module is in use even though there is no code running that will use it.
If I plug the USB device after the system boots up then sudo insmod driverx.ko works normally, (the terminal is still active). Running lsmod subsequently shows that that module is loaded but not in use by anyone. I can then run my user code and everything is fine. Upon running my user code lsmod shows the kernel module is in use and the number of users is 1.
In our system the USB device will always be plugged in. The kernel version and the driver version are the same.
I can fill in more details but do not wish to bias or make this query un-readble.
Please advise on what could the problem be.
Thank you for your time and help.
Possibility is that, the device is already attached into some other driver during startup. If it’s the case, the device credential of your specific device has to be removed from the startup driver.
Check the USB device list before to insert your driver.

Rasperry Pi won't boot any more after installing upstart

I'm running Jessie 8.0 on a raspberry pi 2 B and it doesn't boot completely anymore after installing upstart
sudo apt-get install upstart
FYI: Apache, PHP, MySQL, KODI were installed upfront
What can I do? Could I try to uninstall upstart?
Thanks in advance
Just ran into this headache this morning on my Raspberry Pi 3. You can use Recovery / Single User Mode to fix this.
Plug in a keyboard and HDMI connection to the Pi.
Repeatedly press shift while booting to get to the recovery console.
Press 'e' to edit config, use tab and arrow keys to navigate to cmdline.txt
Add "init=/bin/bash" to the end as the last argument
Press "OK", and then hit the escape key to continue booting
After the boot sequence looks like it has stopped (mine looked like it had frozen mid-boot, don't worry), try pressing enter to get a CLI prompt
Type /etc/init.d/mountall.sh
Type mount -n -o remount,rw / (This mounts the root of SD Card)
At this point most commands should be functional, now you can use Escounda's answer and type: sudo apt-get purge --auto-remove upstart
After a reboot everything should be back to normal with no OS reinstall required! Don't forget to remove "init=/bin/bash" from your cmdline.txt when you're finished.
I'm probably late to the party, but I had the same issue yesterday (Pi won't boot, no way to use apt to remove upstart)
So I installed Ubuntu in a VM and chrooted into my SD Card (See https://raspberrypi.stackexchange.com/a/24011/13597 for more informations about this)
Then removed upstart just like in Escounda's second post
I managed to boot again by removing upstart:
sudo apt-get purge --auto-remove upstart
This command will also automatically reinstall systemd-sysv