lrrr

Members
  • Content Count

    20
  • Joined

  • Last visited

About lrrr

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. lrrr

    U-boot Orange Pi Zero

    Which patches are you using to enable sf command for SPI? The mainline Allwinner A10 SPI driver does not work with sun8i. The only driver I've found to work is this older fork. fork: https://github.com/StephanvanSchaik/u-boot/tree/sunxi-spi info: https://linux-sunxi.org/Bootable_SPI_flash#SPI_driver It's been awhile since I've used an official armbian image. IIRC besides kernel related files, it's just overlays, bootscripts, and dtbs. Also, a couple of armbian related files that need to be kept if you want the armbian OS scripts to work (armbian-config, etc).
  2. GPL guarantees the source code, which allows *you* to modify Armbian. If you want Synaptic as default, fork and modify source. Source code is available by clicking the downloads > source links on the menu. Have fun.
  3. lrrr

    Orange Pi R1

    Is there an "official" way to install openwrt to spiflash? About the only thing I've found for installing to spiflash, is this: https://github.com/hyphop/miZy.
  4. lrrr

    armbian systemd units?

    For brief info on the services: head -n3 /lib/systemd/system/armbian* I've found them not to be necessary but YMMV. Have a look at the commented scripts in '/usr/lib/armbian' to see which services you might want (or need).
  5. There is no official sdcard image but the attached script will create a image for the OrangePi Zero/R1. It uses daily generated files from Debian daily-images and considered testing/unstable. SDcard image creation: You will need basic Linux/Debian and dosfs utils. No su/root needed. Run the script to generate sdcard image for writing to sdcard. Optionally, if you want ssh network-console access, add preseed.cfg to same directory as script. See attached preseed.cfg and example-preseed.txt . Basic installation: Once the installer is started, it runs completely in RAM and no longer needs files from the sdcard. You can delete all partitions on the sdcard and install Debian. Guided partitioning is recommended. When using ssh network-console installer, allow time for the installer to download files before logging in using ssh installer@IPAddress. Basic SDcard image script guide: Two parts are needed, the device-specific firmware.img.gz and partition.img.gz. Concatenate both to get full sdcard image. There is no firmware for the Zero/R1 but can easily be created by using gen-hd-image and extracted u-boot binary from deb file. For more info, see attached opz-sd-gen.sh script and wiki.debian.org. Notice: Posted for anyone interested in testing and experimental purposes. opz-sd-gen.sh preseed.cfg Edit: To use buster u-boot version instead of stretch, edit script with: sed -i 's/^UBOOTDEB.*/UBOOTDEB="u-boot-sunxi_2018.05+dfsg-1_armhf.deb"/' opz-sd-gen.sh
  6. Does dpkg-divert not work for some reason? dpkg-divert --add /etc/default/cpufrequtils
  7. I usually use the cached rootfs in cache/rootfs. Extract, then mount pseudo-filesystems and copy over static qemu like you posted. Quick hacks are good if they get the job done. Another easy way to get chroot with customize-image.sh and do things manually: #!/bin/sh echo "Entering chroot for $1 $2 $3" bash Before you exit chroot, copy your debs/files with another shell, network, etc.
  8. lrrr

    Building Image: Omitting Software?

    Add your code to userpatches/customize-image.sh. Also of interest is userpatches/lib.config. Should be info in the documentation.
  9. lrrr

    Initial easy setup proposal

    Used ext2fsd for years when I used to dual boot with Windows. Never encountered any problems. Tried it the other day before posting. No problems accessing the sdcard and adding my custom configuration to armbian_first_run.txt.
  10. It would be nice if the SDK could easily build deb packages, similar to openwrt's SDK. I checked into chroot-buildpackages.sh but didn't mess with distcc setup. Larger projects will need distcc or much patience. This is sort of what I do to "cross-compile" deb packages. You still need to build an image but you don't have to use it. You can just copy your deb packages over to target os. To get make install results into deb package, you need to use some sort of debian package builder. Many options, guides, and tutorials are available online. The example below uses dpkg-deb. After you build initial image, you can speed up image building by setting clean level: ./compile CLEAN_LEVEL="" Needs a small patch to SDK, as we need a way to get out the debs (or use another method, like network). diff --git a/lib/image-helpers.sh b/lib/image-helpers.sh index a99163e..bea81fc 100644 --- a/lib/image-helpers.sh +++ b/lib/image-helpers.sh @@ -110,7 +110,7 @@ customize_image() chmod +x $SDCARD/tmp/customize-image.sh mkdir -p $SDCARD/tmp/overlay # util-linux >= 2.27 required - mount -o bind,ro $SRC/userpatches/overlay $SDCARD/tmp/overlay + mount -o bind $SRC/userpatches/overlay $SDCARD/tmp/overlay display_alert "Calling image customization script" "customize-image.sh" "info" chroot $SDCARD /bin/bash -c "/tmp/customize-image.sh $RELEASE $LINUXFAMILY $BOARD $BUILD_DESKTOP" umount $SDCARD/tmp/overlay In userpatches/customize-image.sh, drop your compile code. Or for multiple packages, do something like: for FN in /tmp/overlay/packages/*; do source $FN done Add your compile script. Here is a hello world example, copy to userpatches/overlay/packages/helloworld: #!/bin/sh -e # example based on https://ubuntuforums.org/showthread.php?t=910717 PACKAGE="helloworld" VERSION="1.0-1" BDIR="${PACKAGE}_${VERSION}" ARCH="armhf" MAINTAINER="lrrr <lrrr@armbian.com>" cat <<-EOF > /tmp/hw.c #include <stdio.h> int main(void){ printf("Hello world!\n"); return 0; } EOF mkdir -p ${BDIR}/usr/local/bin gcc -Wall /tmp/hw.c -o ${BDIR}/usr/local/bin/$PACKAGE mkdir -p ${BDIR}/DEBIAN cat <<-EOF > ${BDIR}/DEBIAN/control Package: $PACKAGE Version: $VERSION Section: base Priority: optional Architecture: $ARCH Maintainer: $MAINTAINER Description: Hello World When you need some sunshine, just run this small program! EOF dpkg-deb --build $BDIR # requires armbian SDK mod for /tmp/overlay (rw) mv -v ${BDIR}.deb /tmp/overlay rm -fr ${BDIR} hw.c
  11. lrrr

    Initial easy setup proposal

    @botfapIMO, users who cannot access ext4 fs need a GUI wizard but the tool should not be required for users who can access ext4 fs. It's feature creep, all because the average Armbian user cannot find a way to access the file system. There are ways to access ext4 from Windows (ext2fsd) and Mac (macfuse). Also, you have VM's and Linux Live USB/CD.
  12. lrrr

    Initial easy setup proposal

    @botfap A script generator would do most of the work, generate a config script, find offset in image and insert. Could be script based like yours or a statically linked binary, or dynamic linked with a GUI. One could do something similar with a static sized text file, such as armbian_first_run.txt, that is padded with whitespace instead of zeros. But armbian-firstrun-config doesn't do much. @tkaiser No filesystem required to mount, just rw access to the image file. I admit, it's hacky but doesn't require much changes to build. Just throwing some ideas out. I don't care if you make armbian fat, just add option to disable it in build so I don't have to fork code. Edit: armbian-firstrun-config does not do much but it does call (source) armbian_first_run.txt. Any code in the file will be exec on first boot. The txt file extension threw me off, thinking it was parsed.
  13. lrrr

    Initial easy setup proposal

    Here is a couple of more ways I was messing around with. 1) Create a static sized "binary" shell script on the image with a special header. Find the header and inject script. Simple working example. # Something like this would be added to official SDK. For testing add to userpatches/customize-image.sh # add 25k binary script ACI=/boot/customize-image.sh printf "#ARMBIAN_CUSTOMIZE_IMAGE_PLACEHOLDER" > $ACI OFFSET=$(du -b $ACI | awk {'print $1'}) dd if=/dev/zero of=$ACI bs=1 count=25k conv=notrunc seek=$OFFSET # modify armbian-firstrun-config and add txt file to exec $ACI sed -i 's/^do_firstrun_automated_user_configuration$/sh \/boot\/customize-image.sh\ndo_firstrun_automated_user_configuration\n/' /usr/lib/armbian/armbian-firstrun-config touch /boot/armbian_first_run.txt # Bash script run on users host. Depends on dd and grep. IMAGE=$1 # parse image and get offset grep -abq "#ARMBIAN_CUSTOMIZE_IMAGE_PLACEHOLDER" $IMAGE if [ $? -ne 0 ]; then echo "Unable to find placeholder in $IMAGE" && exit 1 fi OFFSET=$(grep -Uabo "#ARMBIAN_CUSTOMIZE_IMAGE_PLACEHOLDER" $IMAGE | awk -F : {'print $1'}) # myscript.sh > /boot/customize-image.sh cat <<-EOF > myscript.sh #!/bin/sh -e echo "Deleting /root/.not_logged_in_yet" >> /root/log.txt rm -f /root/.not_logged_in_yet echo "Resetting root password" >> /root/log.txt chage -d 17790 root exit 0 EOF # inject script into image printf "Injecting script into $IMAGE (offset=0x%x)\n" $OFFSET dd if=myscript.sh of=$IMAGE bs=1 count=16k seek=$OFFSET conv=notrunc 2) Another way is to append extra blocks before first partition (after u-boot). Have armiban-firstrun-config read the block range with dd, verify config, and process. No example. Edit: seems like this thread is going in different direction. Have fun... but FAT?!?
  14. lrrr

    Initial easy setup proposal

    I would do something similar to Armbian SDK and userpatches/customize-image.sh. Add script to setup chroot (mounts,qemu-static,etc) using pre-built image. For example, if userpatches/post-image-customize.sh exists, copy to chroot and exec or drop to chroot for manual configuration. Then, cleanup. It would be more versatile as you could exec binaries on the image, like dpkg-reconfigure, etc. You could even use armbian-config but hardware detection would be based on host hardware, not the target.
  15. Here is a slightly cleaner approach. Download lib.config, lib.sh, customize-image.sh to userpatches. Most options are already set in lib.config. The resulting image is close to a basic chroot install with the minimal armbian packages needed for booting. Options: REMOVE_SYSTEMD in customize-image.sh to use systemd or not. PACKAGE_LIST* in lib.config will determine which armbian based configs are added to the image. There are a few optimizations, that might be of interest, which are not included. Some are located in the SDK under packages/bsp/common/usr/lib/armbian/*. There is an example of one optimization in the customize-image.sh. Only tested debian, with Orange Pi Zero and R1 boards. Last git commit used: be0778b. customize-image.sh lib.config lib.sh