Commit 54c8c1e2 authored by aTc's avatar aTc
Browse files

Update everything

parent c566a9c5
makeimg_data/cache/
makeimg_data/bind/
......@@ -3,15 +3,17 @@
makeimg.sh : build bootable pyra image
spawnimg.sh : mount and nspawn .img for tests/edits
sd-installer.sh : create bootable sd card image that will write rootfs.img to pyra emmc
make_all.sh : runs makeimg.sh, followed by sd-installer.sh
makeimg.sh <rootfs.img> <list of packages to install...>
makeimg.sh <rootfs.img> <size of image> <list of packages to install...>
makeing.sh will also create rootfs.img.installer.tar, which has the initramfs/uboot files needed by sd-installer.sh
(this way sd-installer.sh doesn't need to run on an arm cpu, and can take advantage of faster cpus for compression)
(this way sd-installer.sh doesn't need to run on an arm cpu, and can take advantage of faster cpus for compression.
With the proper qemu-arm-static and binfmt setup all tools do work on non arm platforms as well )
spawnimg.sh <rootfs.img>
Launches a systemd-nspawn into the image.
sd-installer.sh <rootfs.img>
......@@ -21,12 +23,14 @@ the installer will write the first .img.tar.zst file it finds on the card
example:
create image with pyra-meta-mate package and all its dependencies
sudo ./makeimg.sh pyra-mate.img pyra-meta-mate
create 4GB image with pyra-meta-mate package and all its dependencies
sudo ./makeimg.sh pyra-mate.img 4G pyra-meta-mate
create emmc installer sd card image
sudo ./sd-installer.sh pyra-mate.img
create all
sudo ./make_all pyra-mate.img 4G pyra-meta-mate
write resulting .img to sd card directly, put in first sd card slot on pyra, and power on.
warning: the -install.img will immediately start overwriting anything on the emmc when booted.
#!/bin/sh
if [ "$#" -lt 3 ] ; then echo "Usage: $0 output.img imagesize packages ( $0 output.img 4G pyra-meta-mate )" ; exit 1; fi
if [ $(id -u) -ne 0 ] ; then echo "Must be run as root"; exit 1; fi
IMAGENAME=$1
./makeimg.sh $@
./sd-installer.sh ${IMAGENAME}
......@@ -12,10 +12,12 @@ check_exists mke2fs
check_exists mkfs.f2fs
check_exists debootstrap
if [ "$#" -lt 2 ] ; then echo "Usage: $0 output.img packages" ; exit 1; fi
if [ "$#" -lt 3 ] ; then echo "Usage: $0 output.img imagesize packages ( $0 output.img 4G pyra-meta-mate )" ; exit 1; fi
IMAGENAME=$1
IMAGESIZE=$2
shift
shift
PACKAGES=$@
DATA=${PWD}/makeimg_data
......@@ -25,7 +27,7 @@ if [ -f ${IMAGENAME} ] ; then
exit 1
fi
dd if=/dev/zero bs=1 count=0 seek=4G of=${IMAGENAME}
dd if=/dev/zero bs=1 count=0 seek=${IMAGESIZE} of=${IMAGENAME}
sfdisk ${IMAGENAME} <<-__EOF__
1M,256M,0x83,*
......@@ -52,7 +54,7 @@ mount ${PART_BOOT} ${ROOTFS}/boot
mkdir -p "${DATA}/cache/debootstrap"
mkdir -p "${DATA}/cache/apt"
debootstrap --cache-dir="${DATA}/cache/debootstrap" --arch=armhf --keyring="${DATA}/keyrings/debian-archive-keyring.gpg" --include=eatmydata,ca-certificates buster ${ROOTFS} http://httpredir.debian.org/debian
debootstrap --cache-dir="${DATA}/cache/debootstrap" --arch=armhf --keyring="${DATA}/keyrings/debian-archive-keyring.gpg" --include=eatmydata,ca-certificates buster ${ROOTFS} http://deb.debian.org/debian
cp ${DATA}/keyrings/* ${ROOTFS}/etc/apt/trusted.gpg.d
cp ${DATA}/sources.list ${ROOTFS}/etc/apt/sources.list
......@@ -90,7 +92,7 @@ rm ${DATA}/installer/out -rf
rm ${ROOTFS}/installer -rf
sync
#sync
#echo Creating ${IMAGENAME}.tar
#SIZE=$(du -sb ${ROOTFS} | awk '{print $1}')
......
......@@ -31,6 +31,11 @@ $ROOT_PASS
$ROOT_PASS
EOF
echo pyra > /etc/hostname
rm /etc/resolv.conf
echo 'FONT="Lat15-Terminus24x12.psf.gz"' >> /etc/default/console-setup
cd /installer
./make-installer-initrd.sh
......
......@@ -24,6 +24,7 @@ copy_exec /bin/bash
copy_exec /usr/sbin/parted
copy_exec /usr/sbin/resize.f2fs
copy_exec /usr/bin/zstd
copy_exec /usr/bin/tar /usr/bin/real-tar
copy_file script /usr/share/pyra/scripts/pyra-install.sh
copy_file binary /usr/share/pyra/u-boot/pyra-u-boot-4g/MLO
copy_file binary /usr/share/pyra/u-boot/pyra-u-boot-4g/u-boot.img
......
......@@ -63,7 +63,9 @@ ${UBOOT}
Writing ${IMAGE} to eMMC"
pv -w 106 $IMAGE | zstd -d - | tar --numeric-owner -xf - -C ${ROOTFS}
# busybox seems to overwrite tar, copied it as real-tar in the hook script
pv -w 106 $IMAGE | zstd -d - | /usr/bin/real-tar --warning=no-timestamp --numeric-owner -xf - -C ${ROOTFS}
sync
. ${ROOTFS}/etc/default/pyra-extlinux
......
......@@ -7,10 +7,13 @@ LINUXVERSION=$(linux-version list | sort -r -V | head -1)
echo $LINUXVERSION
OUTIMG=initrd.img-${LINUXVERSION}-install
OUTRESIMG=initrd.img-${LINUXVERSION}-resize
echo $OUTIMG
mkinitramfs -v -d install-config -o ${OUTDIR}/${OUTIMG} ${LINUXVERSION}
#mkinitramfs -v -d resize-config -o ${OUTDIR}/${OUTRESIMG} ${LINUXVERSION}
mkdir -p ${OUTDIR}/extlinux
cat > ${OUTDIR}/extlinux/extlinux.conf << EOF
......
......@@ -29,6 +29,7 @@ PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")"
mount $ROOT_PART $ROOTFS
if test -f ${ROOTFS}/pyra-resize; then
echo -------------- RESIZE ------------
rm ${ROOTFS}/pyra-resize
umount $ROOTFS
echo ", +" | sfdisk -N $PART_NUM $ROOT_DEV
partprobe $ROOT_DEV
......
deb http://httpredir.debian.org/debian/ buster main contrib non-free
deb-src http://httpredir.debian.org/debian/ buster main contrib non-free
deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free
deb http://security.debian.org/ buster/updates main contrib non-free
deb-src http://security.debian.org/ buster/updates main
deb http://httpredir.debian.org/debian/ buster-updates main contrib non-free
deb-src http://httpredir.debian.org/debian/ buster-updates main contrib non-free
deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free
deb [arch=armhf] http://packages.pyra-handheld.com/ unstable/
uboot-versions/uboot-dave
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment