Commit 0e730c14 authored by Alessandro Rubini's avatar Alessandro Rubini

build: prepare archives for upcoming V4 installation

This moves wr to usr/wr and copies etc to usr/etc.
Also, it creates the .tar.gz for /usr and an initramfs
that excludes usr.

The current installation still works (it ignores new files,
and can live with wr pointing to usr/wr).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 807f5672
......@@ -27,6 +27,8 @@ rootfs_override="$WRS_BASE_DIR/../userspace/rootfs_override"
TMPSCRIPT=$(mktemp /tmp/rootfs-script.XXXXXX)
ROOTFS_IMAGE_TGZ="$WRS_OUTPUT_DIR/images/wrs-image.tar.gz"
ROOTFS_USR_TGZ="$WRS_OUTPUT_DIR/images/wrs-usr.tar.gz"
ROOTFS_INITRAMFS="$WRS_OUTPUT_DIR/images/wrs-initramfs.gz"
cat > $TMPSCRIPT << EOF
. $WRS_BASE_DIR/../.config
......@@ -91,8 +93,22 @@ chown -R root:root $TMPFS/root
chown -R root:root $TMPFS/etc/dropbear
chmod a+rx $TMPFS
##Test Anchor
(cd "$TMPFS" && tar cz .> $ROOTFS_IMAGE_TGZ)
##### now move stuff to usr (we need usr to be in flash, / remains initramfs)
# remove needless stuff
rm -rf $TMPFS/home $TMPFS/opt
sed -i '/^default/ d' $TMPFS/etc/passwd
# move /wr and /var to /usr/wr and /usr/var
mv $TMPFS/wr $TMPFS/usr; ln -s usr/wr $TMPFS
mv $TMPFS/var $TMPFS/usr; ln -s usr/var $TMPFS
# copy /etc to /usr/etc, where it can be edited (boot sequence copies back)
cp -a $TMPFS/etc $TMPFS/usr/etc
(cd "$TMPFS" && tar cz . > $ROOTFS_IMAGE_TGZ)
(cd "$TMPFS/usr" && tar cz . > $ROOTFS_USR_TGZ)
# include /usr but nothing within usr
(cd "$TMPFS" && find . | grep -v '^./usr.' | \
cpio -o -H newc | gzip > $ROOTFS_INITRAMFS)
EOF
fakeroot bash $WRS_SH_OPTIONS $TMPSCRIPT
......
Markdown is supported
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