If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Announcement
Collapse
No announcement yet.
Announcement
Collapse
No announcement yet.
Running Linux From SD Card or USB Flash Drive - Using Balbes150 Method And Files.
I played a 1080p Divx file, the video was jerky (audio was fine) and all four CPU core's were >50% used.
I tried playing 4k Video using mpv player I think. as expected it played really slow like 1 frame per second.
Then I rebooted and launched Kodi, Kodi couldn't detect my USB drive. I tried closing Kodi and it hung, I couldn't close it or do anything else. So I ended up powering it down.
CPU: 1 PID:3598 Comm: system Tainted: P 3.14.29-amlogics905x-gl504d63-dirty #14
It looks like I've downloaded and installed the image that was meant for S905X and not S905.
No, it's not that - the images have been universally suitable for S905(x)-S912 for quite a while now. Just make sure you're using the correct dtb.img. (but only after automatic detection fails, it's always worth a try on the first run)
1. No HW will not be full screen video. Therefore, all the images which you have tried and which have full-screen video playback, have a HW (if you do not find - does not mean that it is not ).
2. Use for your model gxbb_p200. To accurately determine which dtb file you need, start Armbian and in the terminal run the command "sudo fw_printenv". The result of the command copy here. All the images, the title of which is specified S9xxx - versatile and can work on all processors s905 s905x s905d s912 .
Pay attention - you need to use the right dtb file. Now you are not using the correct file p201. To check you can try to run Armbian without "dtb.img". The system will try to use the built-in data from the TV box. If the system file is not run, then you have an outdated kernel and dtb data in the current firmware and need to use the dtb files from the image (from dir /dtb).
Thanks Shimon. I did the first run and in consecutive runs it was not able to find dtb file. As balbes pointed out the correct DTB for my board, it helped with Ethernet being detected correctly.
Balbes - Thank you for clarifying S9xxx, I thought so too, but when I saw the tainted message, I didn't know why I saw it this time and not with Arch Linux.
The reason I wanted to take control of the DTB file is that this particular box has Buildroot written on its eMMC. so it does not have a working android image/uboot etc to retrieve the correct DTB from. (Maybe that does not matter)
You were correct about my board being gxbb_p200. The seller said that this was board P201, I guess he is wrong in this case.
The Video's on MPV player were not played full screen but in window about 50% size of screen, it still caused CPU to spike pretty high (>50% on all 4 cores).
I tried Kodi and tried to play 4K file and other video files - I did not get any audio and Video was as if it was not playing,just saw one frame as if it was stuck. ( I verified it was not paused by doing pause/unpause multiple times)
Here is the output of sudo fw_printenv:
Code:
EnableSelinux=enforcing
baudrate=115200
bootargs=root=/dev/system rootfstype=ext4 rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 init=/sbin/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 androidboot.selinux=enforcing logo=osd1,loaded,0x3d800000,1080p60hz vout=1080p60hz,enable hdmimode=1080p60hz cvbsmode=576cvbs hdmitx=1080p60hz cvbsdrv=0 androidboot.firstboot=0 jtag=apao androidboot.hardware=amlogic
bootcmd=run start_autoscript; run storeboot;
bootdelay=1
bootsdcard=run sdcardargs; mmcinfo; ext2load mmc 0 ${loadaddr} boot.img; bootm ${loadaddr};
bootup_offset=0x10ac330
bootup_size=0x3f4c8
bootupdate=run bootupdateargs; mmcinfo; fatload mmc 0 ${loadaddr} boot.img; bootm ${loadaddr};
bootupdateargs=setenv bootargs root=/dev/mmcblk0p1 rootfstype=vfat ${initargs} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${hdmimode} cvbsdrv=${cvbs_drv} androidboot.firstboot=${firstboot} jtag=${jtag} firmware=rootfs.tar.gz;setenv bootargs ${bootargs} androidboot.hardware=amlogic;run cmdline_keys;
cmdline_keys=if keyman init 0x1234; then if keyman read usid ${loadaddr} str; then setenv bootargs ${bootargs} androidboot.serialno=${usid};fi;if keyman read mac ${loadaddr} str; then setenv bootargs ${bootargs} mac=${mac} androidboot.mac=${mac};fi;if keyman read deviceid ${loadaddr} str; then setenv bootargs ${bootargs} androidboot.deviceid=${deviceid};fi;fi;
cvbs_drv=0
cvbsmode=576cvbs
display_bpp=16
display_color_bg=0
display_color_fg=0xffff
display_color_index=16
display_height=1080
display_layer=osd1
display_width=1920
dtb_mem_addr=0x1000000
ethact=dwmac.c9410000
ethaddr=00:15:18:01:81:31
factory_reset_poweroff_protect=echo wipe_data=${wipe_data}; echo wipe_cache=${wipe_cache};if test ${wipe_data} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi; if test ${wipe_cache} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi;
fb_addr=0x3d800000
fb_height=1080
fb_width=1920
fdt_high=0x20000000
firstboot=0
gatewayip=10.18.9.1
hdmimode=1080p60hz
hostname=arm_gxbb
identifyWaitTime=750
init_display=osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale
initargs=rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 init=/sbin/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000
ipaddr=10.18.9.97
irremote_update=if irkey 0xe31cfb04 0xb748fb04 2500000; then echo read irkey ok!; if itest ${irkey_value} == 0xe31cfb04; then run update;else if itest ${irkey_value} == 0xb748fb04; then run update;
fi;fi;fi;
jtag=apao
loadaddr=1080000
netmask=255.255.255.0
outputmode=1080p60hz
preboot=run factory_reset_poweroff_protect;run upgrade_check;run init_display;run storeargs;run upgrade_key;run switch_bootmode;
reboot_mode=cold_boot
recovery_from_flash=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if imgread kernel ${recovery_part} ${loadaddr} ${recovery_offset}; then wipeisb; bootm ${loadaddr}; fi
recovery_from_sdcard=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload mmc 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload mmc 0 ${loadaddr} recovery.img; then if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo sd dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;
recovery_from_udisk=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload usb 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload usb 0 ${loadaddr} recovery.img; then if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo udisk dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;
recovery_offset=0
recovery_part=recovery
sdc_burning=sdc_burn ${sdcburncfg}
sdcardargs=setenv bootargs root=/dev/mmcblk0p1 rootfstype=ext2 ${initargs} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${hdmimode} cvbsdrv=${cvbs_drv} androidboot.firstboot=${firstboot} jtag=${jtag}; setenv bootargs ${bootargs} androidboot.hardware=amlogic;run cmdline_keys;
sdcburncfg=aml_sdc_burn.ini
serverip=10.18.9.113
start_autoscript=if usb start ; then run start_usb_autoscript;fi;if mmcinfo; then run start_mmc_autoscript;fi;
start_mmc_autoscript=if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi
start_usb_autoscript=if fatload usb 0 1020000 s905_autoscript; then autoscr 1020000; fi
stderr=serial
stdin=serial
stdout=serial
storeargs=setenv bootargs root=/dev/system rootfstype=ext4 ${initargs} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${hdmimode} cvbsdrv=${cvbs_drv} androidboot.firstboot=${firstboot} jtag=${jtag}; setenv bootargs ${bootargs} androidboot.hardware=amlogic;run cmdline_keys;
storeboot=if imgread kernel boot ${loadaddr}; then bootm ${loadaddr}; fi;run update;
switch_bootmode=get_rebootmode;if test ${reboot_mode} = factory_reset; then run recovery_from_flash;else if test ${reboot_mode} = update; then run update;else if test ${reboot_mode} = cold_boot; then run try_auto_burn; fi;fi;fi;
try_auto_burn=update 700 750;
update=run usb_burning; run sdc_burning; if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;
upgrade_check=echo upgrade_step=${upgrade_step}; if itest ${upgrade_step} == 3; then run init_display; run storeargs; run update;else fi;
upgrade_key=if gpio input GPIOAO_3; then echo detect upgrade key; run update;fi;
upgrade_step=2
usb_burning=update 1000
wipe_cache=successful
wipe_data=successful
Balbes - I tried one of your builds - Arch Linux with Kodi. I was blown away by how easily Kodi handled 1080p and 4k video. Awesome job !!! getting GPU acceleration with Kodi.
Thank you for putting this together. This has made me want GPU acceleration for all my projects.
The only issue I've had with this one so far is when I close Kodi, I do not get a prompt back. I think the system stays in some graphical mode and is just not displaying the text and cursor on console. Any suggestions ?
Can you advice on how to write this image to eMMC of p200 instead of having to boot using SD card ?
I'll continue playing around with other images and update back.
In Armbian to copy the system into the internal memory, there is a special script /root/install.sh. You can change it under the directory structure in ArchLinux and used to install ArchLinux on the internal memory. Before installing to the internal memory, I recommend you to check the system backup (utility ddbr and scripts ddbr_*) and create a full backup (for quick recovery). I advise you to study more topics about the Linux TV boxes on the forum Armbian, there are answers to all your questions.
Yes, I have been reading up a lot on these forums, sometimes there is too much information to go through to find one simple script like the one you've provided.
I've been trying to do a backup using ddbr (booted into Armbian image that you'd created) and I'm not able to find the option where I can specify destination folder for the backup to be created. I can't find any help in command or on the forums. I cannot let the command save it to default location because I do not have enough free space there.
Code:
cd /mnt/usb/media
sudo ddbr
ARGUMENT MODE DETECTED. YOU HAVE BEEN WARNED!!!
NO IN/OUT SIZE CHECKS WILL BE PERFORMED IN THIS MODE.
YOU ARE USING THIS MODE AT YOUR OWN RISK!!!
DO YOU WANT TO BACKUP OR RESTORE ?
BACKUP=(b) RESTORE=(r) b
NOT ENOUGH FREE SPACE!
FORCING COMPRESSION MODE
AVAILABLE DEVICES: mmcblk0 mmcblk1 sda1
YOU ARE RUNNING sid FROM mmcblk1
INTERNAL EMMC IS: mmcblk0 SIZE: 7634944
ROOT (mmcblk1) FREE SPACE IS: 3576980
YOU ARE IN FORCED COMPRESSION MODE!!!
THIS MODE CAN BE FROM DANGEROUS TO DESTRUCTIVE FOR YOUR mmcblk1 DRIVE
IF THE COMPRESSED BACKUP GROW BIGGER THAN THE FREE SPACE ON THE DRIVE
BAD THINGS MAY HAPPEN TO YOUR CURRENTLY RUNNING DRIVE mmcblk1
IT IS BETTER TO USE A DRIVE WITH PLENTY OF SPACE FOR BACKING UP EMMC
BY PRESSING ENTER YOU ARE CONTINUING AT YOUR OWN RISK!!!
CTRL+C to QUIT | ENTER TO CONTINUE ^C
Please advice on how to specify a destination folder for this backup.
I've spent most of the day today trying to find a way to install Arch linux on eMMC of the GXBB_P200 board but have not been able to do so. Google led me to options like
dd if=archlinux.img of=/dev/mmcblk0
but I don't think this will work. For one reason that the img file has only two partitions - boot and rootfs. But the eMMC is expected to have many more. Here is the output of fdisk -l on the p200:
Clearly, this is a little more than my current Linux skills, I dont' expect someone to write this for me but I do need some help. Is there any discussion on this topic (Arch linux and eMMC) that may have advice on how to do this ?
1. No options to choose another location for placement of copy no. If your media does not have the required free space, it makes no sense to choose other places. Use media larger. I recommend to create a copy of USB stick (they are slower, but are significantly more stable than SD card). For model TV boxes with 8Gb of memory you can use the 8GB flash drive in compression mode for a backup, or 16GB in any mode (with compression or without compression).
2. In any case, do NOT use this command to set the system to internal memory. You kill the boot loader (u-boot) and turn TV box into a brick.
3. To install ArchLinux in eMMC you need to edit script "install.sh". Maybe soon I'll pack a new version of the ArchLinux images with the enable of the installation.
1. I meant that I mount a USB drive with enough space while I booted Armbian from SD card. I tried to use ddbr to backup the internal MMC to the mounted USB drive, but it didn't work. It still tried to back it to the SD card itself. I'll create an image on a larger SD card and will need to modify the rootfs because by default when I create a bootable SD card with Armbian, it makes the rootfs of the size that is smaller than 8GB, so I need to expand that partition and then boot and backup using ddbr.
2. I thought so too, that's why I refrained from it.
3. I tried editing the script "install.sh" but this script handles a lot of items in Armbian that do not exist in Arch linux, so it isn't an easy modification. If I figure out installing Arch linux on internal MMC then I'll definitely update it here. If not, I'll look for your updated Arch linux image.
I've made a lot of progress on the script. I needed to make abootimg first and then was able to run the script to transfer the Arch OS onto eMMC. But even though the script completed successfully for the most part, something went wrong and now the box won't boot off eMMC. I am close to figuring this out and will share the update script or any questions I may have.
Last edited by ajiratech; 08-29-2017, 06:56.
Reason: the error I reported earlier was due to missing dependencies on my system, once I updated mine that went away. This is the current update I have so edited text.
#archlinux/install.sh
#!/bin/sh
echo "Start copy system for DATA partition."
mkdir -p /ddbr
chmod 777 /ddbr
VER=`uname -r`
IMAGE_KERNEL="/boot/Image"
IMAGE_INITRD="/boot/uInitrd"
PART_ROOT="/dev/data"
DIR_INSTALL="/ddbr/install"
IMAGE_DTB="/boot/dtb.img"
if [ ! -f $IMAGE_KERNEL ] ; then
echo "Not KERNEL. STOP install !!!"
return
fi
if [ ! -f $IMAGE_INITRD ] ; then
echo "Not INITRD. STOP install !!!"
return
fi
echo "Formatting DATA partition..."
umount -f $PART_ROOT
mke2fs -F -q -t ext4 -m 0 $PART_ROOT
e2fsck -n $PART_ROOT
echo "done."
echo "Copying ROOTFS."
if [ -d $DIR_INSTALL ] ; then
rm -rf $DIR_INSTALL
fi
mkdir -p $DIR_INSTALL
mount -o rw $PART_ROOT $DIR_INSTALL
cd /
echo "Copy BIN"
tar -cf - bin | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy BOOT"
#mkdir -p $DIR_INSTALL/boot
tar -cf - boot | (cd $DIR_INSTALL; tar -xpf -)
echo "Create DEV"
mkdir -p $DIR_INSTALL/dev
#tar -cf - dev | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy ETC"
tar -cf - etc | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy HOME"
tar -cf - home | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy LIB"
tar -cf - lib | (cd $DIR_INSTALL; tar -xpf -)
#commenting creation of media folder because it doesn't exist in Arch linux
#echo "Create MEDIA"
#mkdir -p $DIR_INSTALL/media
# next line was already commented
#tar -cf - media | (cd $DIR_INSTALL; tar -xpf -)
echo "Create MNT"
mkdir -p $DIR_INSTALL/mnt
#tar -cf - mnt | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy OPT"
tar -cf - opt | (cd $DIR_INSTALL; tar -xpf -)
echo "Create PROC"
mkdir -p $DIR_INSTALL/proc
echo "Copy ROOT"
tar -cf - root | (cd $DIR_INSTALL; tar -xpf -)
echo "Create RUN"
mkdir -p $DIR_INSTALL/run
echo "Copy SBIN"
tar -cf - sbin | (cd $DIR_INSTALL; tar -xpf -)
# commenting creation of SELINUX because it doesn't exist in Arch linux.
#echo "Copy SELINUX"
#tar -cf - selinux | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy SRV"
tar -cf - srv | (cd $DIR_INSTALL; tar -xpf -)
echo "Create SYS"
mkdir -p $DIR_INSTALL/sys
echo "Create TMP"
mkdir -p $DIR_INSTALL/tmp
echo "Copy USR"
tar -cf - usr | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy VAR"
tar -cf - var | (cd $DIR_INSTALL; tar -xpf -)
echo "Copy fstab"
rm $DIR_INSTALL/etc/fstab
cp -a /root/fstab $DIR_INSTALL/etc
#cp -a /boot/hdmi.sh $DIR_INSTALL/boot
rm $DIR_INSTALL/root/install.sh
rm $DIR_INSTALL/root/fstab
rm $DIR_INSTALL/usr/bin/ddbr
rm $DIR_INSTALL/usr/bin/ddbr_backup_nand
rm $DIR_INSTALL/usr/bin/ddbr_restore_nand
cd /
sync
umount $DIR_INSTALL
echo "*******************************************"
echo "Done copy ROOTFS"
echo "*******************************************"
echo "Writing new kernel image..."
mkdir -p $DIR_INSTALL/aboot
cd $DIR_INSTALL/aboot
dd if=/dev/boot of=boot.backup.img
abootimg -i /dev/boot > aboot.txt
abootimg -x /dev/boot
abootimg -u /dev/boot -k $IMAGE_KERNEL
abootimg -u /dev/boot -r $IMAGE_INITRD
if [ -f $IMAGE_DTB ] ; then
abootimg -u /dev/boot -s $IMAGE_DTB
fi
echo "done."
echo "Write env bootargs"
/usr/sbin/fw_setenv initargs "root=/dev/data rootflags=data=writeback rw console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.repair=yes net.ifnames=0 mac=\${mac}"
echo "*******************************************"
echo "Complete copy OS to eMMC parted DATA"
echo "*******************************************"
Here is the output when I execute this script:
Code:
---------- logs from attempt to install arch linux to eMMC ------------------
[root@alarm ~]# ./install.sh
Start copy system for DATA partition.
Formatting DATA partition...
umount: /dev/data: not mounted
/dev/data contains a ext4 file system
last mounted on /ddbr/install on Tue Aug 29 06:00:20 2017
e2fsck 1.43.4 (31-Jan-2017)
/dev/data: clean, 11/321920 files, 41630/1287168 blocks
done.
Copying ROOTFS.
[ 1052.404973@2] EXT4-fs (mmcblk0p14): mounted filesystem with ordered data mode. Opts: (null)
Copy BIN
Copy BOOT
Create DEV
Copy ETC
Copy HOME
Copy LIB
Create MNT
Copy OPT
Create PROC
Copy ROOT
Create RUN
Copy SBIN
Copy SRV
Create SYS
Create TMP
Copy USR
Copy VAR
Copy fstab
cp: cannot stat '/root/fstab': No such file or directory
rm: cannot remove '/ddbr/install/root/fstab': No such file or directory
rm: cannot remove '/ddbr/install/usr/bin/ddbr': No such file or directory
rm: cannot remove '/ddbr/install/usr/bin/ddbr_backup_nand': No such file or directory
rm: cannot remove '/ddbr/install/usr/bin/ddbr_restore_nand': No such file or directory
*******************************************
Done copy ROOTFS
*******************************************
Writing new kernel image...
65536+0 records in
65536+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 0.625496 s, 53.6 MB/s
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
extracting second stage image in stage2.img
reading kernel from /boot/Image
Writing Boot Image /dev/boot
reading ramdisk from /boot/uInitrd
Writing Boot Image /dev/boot
reading second stage from /boot/dtb.img
Writing Boot Image /dev/boot
done.
Write env bootargs
*******************************************
Complete copy OS to eMMC parted DATA
*******************************************
Now when I boot from internal memory (eMMC) I get kernel panic because it is not able to find and mount the root file system:
I've tried changing /dev/data to /dev/mmcblk0p2 and also mmcblk0p14 but it hasn't helped. I'll continue working on this tomorrow (it is 3:15 AM my time - US EST).
If I am missing something obvious then please advice.
Rerun the installation script from the external media (always with the same dtb file that you used when you first start). This is a common mistake. You change the dtb data in eMMC and with it , changing the placement and size of the partitions in the eMMC. The first time you run the script on the old accommodation sections. When you first run setup, the dtb to the external storage differs from dtb which is in eMMC. After the first run setup, the dtb on an external drive and the eMMC will be the same and the installation process will take place correctly.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment