mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 15:11:19 +02:00
Some changes to be able to build an armel-based rootfs.
Review URL: http://codereview.chromium.org/554056
This commit is contained in:
parent
cb68f29229
commit
3700cd8c0c
@ -142,6 +142,7 @@ fi
|
|||||||
|
|
||||||
# -- Turn root file system into bootable image --
|
# -- Turn root file system into bootable image --
|
||||||
|
|
||||||
|
if [ "$FLAGS_arch" = "x86" ]; then
|
||||||
# Setup extlinux configuration.
|
# Setup extlinux configuration.
|
||||||
# TODO: For some reason the /dev/disk/by-uuid is not being generated by udev
|
# TODO: For some reason the /dev/disk/by-uuid is not being generated by udev
|
||||||
# in the initramfs. When we figure that out, switch to root=UUID=$UUID.
|
# in the initramfs. When we figure that out, switch to root=UUID=$UUID.
|
||||||
@ -164,8 +165,12 @@ EOF
|
|||||||
# Make partition bootable and label it.
|
# Make partition bootable and label it.
|
||||||
sudo "$SCRIPTS_DIR/extlinux.sh" -z --install "${ROOT_FS_DIR}/boot"
|
sudo "$SCRIPTS_DIR/extlinux.sh" -z --install "${ROOT_FS_DIR}/boot"
|
||||||
|
|
||||||
|
fi # --arch=x86
|
||||||
|
|
||||||
cleanup_rootfs_loop
|
cleanup_rootfs_loop
|
||||||
|
|
||||||
|
if [ "$FLAGS_arch" = "x86" ]; then
|
||||||
|
|
||||||
# Create a master boot record.
|
# Create a master boot record.
|
||||||
# Start with the syslinux master boot record. We need to zero-pad to
|
# Start with the syslinux master boot record. We need to zero-pad to
|
||||||
# fill out a 512-byte sector size.
|
# fill out a 512-byte sector size.
|
||||||
@ -180,6 +185,8 @@ sudo sfdisk -H64 -S32 -uS -f "$MBR_IMG" <<EOF
|
|||||||
;
|
;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
fi # --arch=x86
|
||||||
|
|
||||||
OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}"
|
OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}"
|
||||||
echo "Done. Image created in ${OUTPUT_DIR}"
|
echo "Done. Image created in ${OUTPUT_DIR}"
|
||||||
echo "To copy to USB keyfob, outside the chroot, do something like:"
|
echo "To copy to USB keyfob, outside the chroot, do something like:"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
assert_inside_chroot
|
assert_inside_chroot
|
||||||
|
|
||||||
# Flags
|
# Flags
|
||||||
DEFINE_string target "x86" \
|
DEFINE_string arch "x86" \
|
||||||
"The target architecture to build for. One of { x86, arm }."
|
"The target architecture to build for. One of { x86, arm }."
|
||||||
DEFINE_string root "" \
|
DEFINE_string root "" \
|
||||||
"The root file system to customize."
|
"The root file system to customize."
|
||||||
@ -144,7 +144,7 @@ sudo chmod 0755 "$ROOT_FS_DIR"/mnt/stateful_partition
|
|||||||
# installed all of the packages.
|
# installed all of the packages.
|
||||||
TMP_STATIC=$(mktemp -d)
|
TMP_STATIC=$(mktemp -d)
|
||||||
sudo cp -r "${SRC_ROOT}/rootfs_static_data/common/." "$TMP_STATIC"
|
sudo cp -r "${SRC_ROOT}/rootfs_static_data/common/." "$TMP_STATIC"
|
||||||
# TODO: Copy additional target-platform-specific subdirectories.
|
# TODO: Copy additional arch-platform-specific subdirectories.
|
||||||
sudo chmod -R a+rX "$TMP_STATIC/."
|
sudo chmod -R a+rX "$TMP_STATIC/."
|
||||||
sudo cp -r "$TMP_STATIC/." "$ROOT_FS_DIR"
|
sudo cp -r "$TMP_STATIC/." "$ROOT_FS_DIR"
|
||||||
sudo rm -rf "$TMP_STATIC"
|
sudo rm -rf "$TMP_STATIC"
|
||||||
|
@ -257,11 +257,17 @@ PACKAGE_LISTS=$(echo "$FLAGS_package_list" | sed -e 's/,/ /g')
|
|||||||
PKG_LIST_ARCH="$FLAGS_arch"
|
PKG_LIST_ARCH="$FLAGS_arch"
|
||||||
if [ "$PKG_LIST_ARCH" = "x86" ]; then
|
if [ "$PKG_LIST_ARCH" = "x86" ]; then
|
||||||
PKG_LIST_ARCH="i386"
|
PKG_LIST_ARCH="i386"
|
||||||
|
FORCE_NO_SCRIPTS=""
|
||||||
|
else
|
||||||
|
# For armel we forcefully disable all maintainer scripts.
|
||||||
|
# TODO: Remove this when everything is whitelisted for all build variants.
|
||||||
|
FORCE_NO_SCRIPTS="-o=DPkg::options::=--nodpkg_fallback"
|
||||||
fi
|
fi
|
||||||
for p in $PACKAGE_LISTS; do
|
for p in $PACKAGE_LISTS; do
|
||||||
COMPONENTS=$(filter_pkgs "$p" "$PKG_LIST_ARCH")
|
COMPONENTS=$(filter_pkgs "$p" "$PKG_LIST_ARCH")
|
||||||
sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \
|
sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \
|
||||||
ARCH="$FLAGS_arch" apt-get --force-yes install $COMPONENTS
|
ARCH="$FLAGS_arch" \
|
||||||
|
apt-get $FORCE_NO_SCRIPTS --force-yes install $COMPONENTS
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create kernel installation configuration to suppress warnings,
|
# Create kernel installation configuration to suppress warnings,
|
||||||
@ -278,8 +284,20 @@ warn_initrd = no
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Install the kernel.
|
# Install the kernel.
|
||||||
|
# TODO: Support for armel kernels.
|
||||||
|
if [ "$FLAGS_arch" = "x86" ]; then
|
||||||
sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive ARCH="$FLAGS_arch"\
|
sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive ARCH="$FLAGS_arch"\
|
||||||
apt-get --force-yes install "linux-image-${KERNEL_VERSION}"
|
apt-get --force-yes install "linux-image-${KERNEL_VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install optionally present rootfs static data. This can be used to blast
|
||||||
|
# custom firmware, kernel modules, etc. onto the image.
|
||||||
|
# TODO: Remove this hack at some point.
|
||||||
|
LOCAL_ASSETS="${FLAGS_build_root}/${FLAGS_arch}/local_assets"
|
||||||
|
OPTIONAL_ROOTFS_DATA="${LOCAL_ASSETS}/rootfs_data.tgz"
|
||||||
|
if [ -f "${OPTIONAL_ROOTFS_DATA}" ]; then
|
||||||
|
sudo tar -zxvf "${OPTIONAL_ROOTFS_DATA}" -C "${ROOT_FS_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
# List all packages installed so far, since these are what the local
|
# List all packages installed so far, since these are what the local
|
||||||
# repository needs to contain.
|
# repository needs to contain.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user