summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Stone <ahs3@redhat.com>2012-12-18 15:55:58 -0700
committerAl Stone <ahs3@redhat.com>2012-12-18 15:55:58 -0700
commitaf2eefb952f8b158d533b0fc5334fd6770ec9cf9 (patch)
treec24ee892ca6bcbc8c6e4e57c4ecfa55e245cf404
parentcf12ecee89931ce7c5cb14e820fa32ac87a96f97 (diff)
parent693215413af0cf64b55d5ad44690a5e3b2cbaf35 (diff)
downloadbootstrap.git.DONOTUSE-af2eefb952f8b158d533b0fc5334fd6770ec9cf9.tar.gz
bootstrap.git.DONOTUSE-af2eefb952f8b158d533b0fc5334fd6770ec9cf9.tar.xz
bootstrap.git.DONOTUSE-af2eefb952f8b158d533b0fc5334fd6770ec9cf9.zip
Merge branch 'aarch64-ahs3'
-rwxr-xr-xbuild-rootfs-img.sh46
-rwxr-xr-xstage13
2 files changed, 48 insertions, 1 deletions
diff --git a/build-rootfs-img.sh b/build-rootfs-img.sh
new file mode 100755
index 0000000..9862694
--- /dev/null
+++ b/build-rootfs-img.sh
@@ -0,0 +1,46 @@
+#!/bin/bash -x
+# script for creating a filesystem image for Fedora's Aarch64 port
+# Copyright 2012 John Dulaney jdulaney@fedoraproject.org
+# Licensed under the GPLv3+
+# Dependencies: qemu
+
+# Set image size
+ imgsize=8G
+
+# Create image
+ qemu-img create rootfs.img $imgsize
+
+# Add partitions to the image, a 50 MB DOS bootable partition for
+# uboot, and the rest will be for /
+ parted rootfs.img mklabel msdos
+ parted rootfs.img mkpart primary fat16 1 50
+ parted rootfs.img mkpart primary ext3 50 $imgsize
+ parted rootfs.img set 1 boot on
+
+# Mount the image in /tmp
+ mkdir /tmp/ext3
+ mkdir /tmp/vfat
+
+ sudo kpartx -a -v rootfs.img
+
+ sudo mkfs.vfat /dev/mapper/loop0p1
+ sudo mkfs.ext3 /dev/mapper/loop0p2
+
+ sudo mount /dev/mapper/loop0p1 /tmp/vfat
+ sudo mount /dev/mapper/loop0p2 /tmp/ext3
+
+# Put uboot into the vfat partition for booting
+ wget http://fedorapeople.org/groups/armv8/u-boot.bin
+ sudo cp u-boot.bin /tmp/vfat
+ sudo sync
+ sudo umount /tmp/vfat
+
+# Copy file system into image
+ cd rootfs
+ sudo sh -c "find . -print | cpio -pdumv /tmp/ext3"
+
+# Unmount the image.
+ sudo sync
+ sudo umount /tmp/ext3
+
+ echo 'Completed.'
diff --git a/stage1 b/stage1
index 87c6568..fb46db6 100755
--- a/stage1
+++ b/stage1
@@ -1137,9 +1137,10 @@ EOF
chmod a+x distccd.script
# add in the handy script to make sure the rootfs is usable
- # as an NFS root
+ # as an NFS root (and then execute it)
cp init-rootfs.sh $ROOTFS/
chmod a+x $ROOTFS/init-rootfs.sh
+ ( cd $ROOTFS; sudo ./init-rootfs.sh )
echo stage2 ready