Skip to content

Commit

Permalink
Fix the symbol links not support in onie unzip issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xumia committed May 26, 2022
1 parent 271e0d9 commit 0f89c54
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -647,5 +647,5 @@ fi
pushd $FILESYSTEM_ROOT && sudo tar czf $OLDPWD/$FILESYSTEM_DOCKERFS -C ${DOCKERFS_PATH}var/lib/docker .; popd

## Compress together with /boot, /var/lib/docker and $PLATFORM_DIR as an installer payload zip file
pushd $FILESYSTEM_ROOT && sudo zip --symlinks $OLDPWD/$ONIE_INSTALLER_PAYLOAD -r boot/ $PLATFORM_DIR/; popd
sudo zip -g -n .squashfs:.gz $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS
pushd $FILESYSTEM_ROOT && sudo tar cf $OLDPWD/$ONIE_INSTALLER_PAYLOAD boot/ $PLATFORM_DIR/; popd
sudo tar uf $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS
5 changes: 4 additions & 1 deletion build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ elif [ "$IMAGE_TYPE" = "aboot" ]; then
sudo rm -f $OUTPUT_ABOOT_IMAGE
sudo rm -f $ABOOT_BOOT_IMAGE
## Add main payload
cp $ONIE_INSTALLER_PAYLOAD $OUTPUT_ABOOT_IMAGE
tmpdir=$(mktemp -d)
jar -xf $ONIE_INSTALLER_PAYLOAD -C $tmpdir
pushd $tmpdir && zip -n .squashfs:.gz $OUTPUT_ABOOT_IMAGE -r .; popd
rm $tmpdir -rf
## Add Aboot boot0 file
j2 -f env files/Aboot/boot0.j2 ./onie-image.conf > files/Aboot/boot0
sed -i -e "s/%%IMAGE_VERSION%%/$IMAGE_VERSION/g" files/Aboot/boot0
Expand Down
6 changes: 3 additions & 3 deletions installer/arm64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ fi
# Decompress the file for the file system directly to the partition
if [ x"$docker_inram" = x"on" ]; then
# when disk is small, keep dockerfs.tar.gz in disk, expand it into ramfs during initrd
unzip -o $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir
tar -xf $ONIE_INSTALLER_PAYLOAD -C $demo_mnt/$image_dir
else
unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" -d $demo_mnt/$image_dir
tar -xf $ONIE_INSTALLER_PAYLOAD --exclude="$FILESYSTEM_DOCKERFS" -C $demo_mnt/$image_dir

if [ "$install_env" = "onie" ]; then
TAR_EXTRA_OPTION="--numeric-owner"
else
TAR_EXTRA_OPTION="--numeric-owner --warning=no-timestamp"
fi
mkdir -p $demo_mnt/$image_dir/$DOCKERFS_DIR
unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR
tar -xf $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" -O | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR
fi


Expand Down
6 changes: 3 additions & 3 deletions installer/armhf/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ fi
# Decompress the file for the file system directly to the partition
if [ x"$docker_inram" = x"on" ]; then
# when disk is small, keep dockerfs.tar.gz in disk, expand it into ramfs during initrd
unzip -o $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir
tar -xf $ONIE_INSTALLER_PAYLOAD -C $demo_mnt/$image_dir
else
unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" -d $demo_mnt/$image_dir
tar -xf $ONIE_INSTALLER_PAYLOAD --exclude="$FILESYSTEM_DOCKERFS" -C $demo_mnt/$image_dir

if [ "$install_env" = "onie" ]; then
TAR_EXTRA_OPTION="--numeric-owner"
else
TAR_EXTRA_OPTION="--numeric-owner --warning=no-timestamp"
fi
mkdir -p $demo_mnt/$image_dir/$DOCKERFS_DIR
unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR
tar -xf $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" -O | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR
fi


Expand Down
6 changes: 3 additions & 3 deletions installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -536,17 +536,17 @@ fi
# Decompress the file for the file system directly to the partition
if [ x"$docker_inram" = x"on" ]; then
# when disk is small, keep dockerfs.tar.gz in disk, expand it into ramfs during initrd
unzip -o $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir
tar xvf $ONIE_INSTALLER_PAYLOAD -C $demo_mnt/$image_dir
else
unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" -d $demo_mnt/$image_dir
tar xvf $ONIE_INSTALLER_PAYLOAD --exclude="$FILESYSTEM_DOCKERFS" -C $demo_mnt/$image_dir
if [ "$install_env" = "onie" ]; then
TAR_EXTRA_OPTION="--numeric-owner"
else
TAR_EXTRA_OPTION="--numeric-owner --warning=no-timestamp"
fi
mkdir -p $demo_mnt/$image_dir/$DOCKERFS_DIR
unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR
tar -xf $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" -O | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR
fi
if [ "$install_env" = "onie" ]; then
Expand Down
2 changes: 1 addition & 1 deletion onie-image-arm64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FILESYSTEM_ROOT=./fsroot-${TARGET_MACHINE}
FILESYSTEM_SQUASHFS=fs.squashfs

## Filename for onie installer payload, will be the main part of onie installer
ONIE_INSTALLER_PAYLOAD=fs.zip
ONIE_INSTALLER_PAYLOAD=fs.tar

## Filename for docker file system
FILESYSTEM_DOCKERFS=dockerfs.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion onie-image-armhf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FILESYSTEM_ROOT=./fsroot-${TARGET_MACHINE}
FILESYSTEM_SQUASHFS=fs.squashfs

## Filename for onie installer payload, will be the main part of onie installer
ONIE_INSTALLER_PAYLOAD=fs.zip
ONIE_INSTALLER_PAYLOAD=fs.tar

## Filename for docker file system
FILESYSTEM_DOCKERFS=dockerfs.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion onie-image.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FILESYSTEM_ROOT=./fsroot-${TARGET_MACHINE}
FILESYSTEM_SQUASHFS=fs.squashfs

## Filename for onie installer payload, will be the main part of onie installer
ONIE_INSTALLER_PAYLOAD=fs.zip
ONIE_INSTALLER_PAYLOAD=fs.tar

## Filename for docker file system
FILESYSTEM_DOCKERFS=dockerfs.tar.gz
Expand Down

0 comments on commit 0f89c54

Please sign in to comment.